This study presents a cost-effective and accurate method for assessing nitrogen concentration in vermicompost fertilizer using a low-cost TCS3200 color sensor and a K-Nearest Neighbors (KNN) machine learning model. The objective was to evaluate the performance of four different color spaces—RGB, Lab, LCh, and CMYK—identify the most effective feature representation for a multi-class classification task based on accuracy and theoretical robustness to ambient light variations. A total of 2400 data points were collected from a standard chemical test kit and processed. A rigorous 60-fold cross-validation approach was used to determine the optimal model hyperparameters and to ensure the robustness of the findings. The results demonstrate that the model trained on the LCh color space achieved the highest classification accuracy of 0.9708 with an optimal K-value of 6, significantly outperforming Lab (0.9688), RGB (0.9625), and CMYK (0.9583). A detailed analysis of the confusion matrix revealed that the model successfully classified the ‘High’ and ‘Medium’ nitrogen levels with near-perfect accuracy, while minor misclassifications occurred between the ‘Low’ and ‘Trace’ categories (5 Low ⟶ Trace, 6 Trace ⟶ Low). The proposed system offers a practical, robust, and accessible tool for precision agriculture, enabling farmers to make informed decisions regarding fertilization, and directly supporting sustainable agriculture and responsible resource management. The findings indicate that the LCh color space is highly effective for this application, providing a viable solution for the rapid and reliable assessment of vermicompost quality. Most importantly, this inexpensive, on-site system removes the need for costly, time-consuming laboratory analyses, giving farmers and compost users the instantaneous, accurate nitrogen data they need to maximize crop yield, optimize nutrient application, and significantly reduce input costs from overfertilization.
Background: In forensic ballistics, identifying ammunition types on physical evidence is critical, particularly when metallic residues are minimal. This study comparatively analyzes the elemental signatures deposited by two common projectiles—Full Metal Jacket (FMJ) (Cu/Zn jacket) and Lead Round Nose (LRN) (exposed Pb core)—on complex targets, including pig bone/tissue and mango wood. Methods: Using a semi-automatic handgun at an intermediate range of 5.0 m, residues were examined through high-resolution benchtop Micro-XRF (M4 Tornado) for micro-spatial analysis and Portable XRF (Elio) for rapid field characterization. Additionally, fresh pork leg samples were subjected to a 3-month environmental degradation period to assess trace persistence. Results: Observations indicated that LRN projectiles exhibit markedly elevated Lead (Pb) concentrations along the wound track in bone, hence confirming Pb as a reliable indicator for unjacketed ammunition; specifically, the median Pb concentrations at bullet wiping were 10.39 wt% for M4 and 7.34 wt% for Elio. Conversely, FMJ traces remain strictly confined to the surface bullet wipe area, with median concentrations of Pb, Cu, and Zn being 2.21 wt%, 0.24 wt%, and 0.59 wt% via M4, respectively. Statistical analysis showed a strong correlation for high-concentration elements on tissue, but significantly greater variance on wooden surfaces where FMJ traces exhibited a very weak negative correlation (r = −0.2774) due to minimal and irregular metal transfer. Taphonomic evaluation revealed that the Pb signature from LRN is exceptionally stable (r ≈ 0.9999) even after decomposition, while FMJ signatures are highly sensitive to environmental exposure. Conclusions: This research underscores the necessity of high-sensitivity Micro-XRF (M4) for definitive ammunition verification, providing a refined analytical framework for shooting incident reconstruction even involving degraded remains or complex environmental scenes.