Traditional laboratory techniques for examining the nutrient content of organic fertilizers, specifically nitrogen (N), phosphorus (P), and potassium (K), are expensive, time-intensive, and pose environmental hazards. To address these issues, this paper presents a novel, non-destructive, image-based classification algorithm to identify fertilizer nutrient content. The proposed technique integrates color space conversion, unsupervised clustering, texture extraction, and an adapted New Identification Weighting (NIW) method. The NIW is derived from prior probability-based distance measurements and optimized with a balancing weighting factor to improve analytical stability across heterogeneous agricultural images. First, RGB images of fertilizers are converted into the perceptually uniform CIE L*a*b color space, which enhances color distinction under varying lighting conditions. Next, the images are segmented using K-Means clustering, followed by Gray-Level Co-occurrence Matrix (GLCM) extraction to capture textural and structural features. A key innovation of this research is the NIW method, functioning as an adaptive feature prioritization tool that assesses each features contribution to nutrient classification, effectively overcoming the limitations of previous a priori approaches. The system was tested on a dataset of 500 organic fertilizer images, achieving an overall classification accuracy of 97%, demonstrating its effectiveness and robustness. This approach offers a highly accurate and interpretable alternative to conventional chemical testing, making it a feasible, scalable, and affordable field tool for smart farming. By enabling on-site nutrient analysis, it strongly supports sustainable agricultural practices. Future work will focus on enhancing the systems flexibility to varying environmental conditions and integrating this approach into mobile-based diagnostic devices to facilitate real-time decision-making in agriculture.
Copyrights © 2026