Abstract
Deterioration of raw milk quality during tropical ambient storage (25–30°C) poses critical food safety challenges for Indonesian smallholder dairy cooperatives. Conventional laboratory testing (24–48 hours) precludes real time quality gatekeeping at the point of collection. This study developed and validated a computer vision system integrating Gray Level Co-occurrence Matrix (GLCM) texture analysis with machine learning classifiers for rapid, cost-effective milk quality screening. Three hundred raw milk samples from smallholder cooperative farms in Malang District, East Java, Indonesia, were classified as Good (n = 135, 45.0%), Abnormal (n = 108, 36.0%), or Defective (n = 57, 19.0%) per SNI 3141.1:2011 standards using Total Plate Count (TPC), pH, and titratable acidity. Sixteen image features (4 GLCM texture + 6 RGB statistics + 6 HSV statistics) were extracted from standardised digital images and evaluated using K-Nearest Neighbors (K-NN), Support Vector Machine (SVM), and XGBoost classifiers with five-fold cross-validation. XGBoost achieved the highest classification accuracy (93.2%), significantly outperforming SVM (91.7%, P = 0.023) and K-NN (87.6%, P < 0.001) at 2.1 seconds per sample. GLCM features dominated classification importance (88.8%), led by red-channel Contrast (55.6%) and Homogeneity (33.2%), showing strong biological alignment with TPC (r = 0.892) and titratable acidity (r = 0.831), reflecting GLCM sensitivity to bacterial proliferation and protein degradation rather than serving as independent validation. In the test dataset, zero Defective samples were misclassified as Good; three were conservatively misclassified as Abnormal maintaining rejection status but representing classification level under severity rather than a food safety failure. Temporal analysis identified a 12-hour critical quality window before TPC crossed the SNI threshold (1 × 106 CFU/mL) under tropical ambient storage. The XGBoost–GLCM system provides a validated, real-time preliminary screening tool that reduces collection-point decision time by >99.9% relative to conventional laboratory testing, intended to complement and not for replace confirmatory methods, supporting Indonesia’s national dairy self-sufficiency and public health protection objectives.
| Original language | English |
|---|---|
| Pages (from-to) | 1190-1205 |
| Number of pages | 16 |
| Journal | Advances in Animal and Veterinary Sciences |
| Volume | 14 |
| Issue number | 6 |
| DOIs | |
| Publication status | Published - 2026 |
UN SDGs
This output contributes to the following UN Sustainable Development Goals (SDGs)
-
SDG 2 Zero Hunger
Keywords
- Computer vision
- GLCM texture analysis
- K-NN
- Machine learning
- SVM
- XGBoost
Fingerprint
Dive into the research topics of 'Computer Vision-Based Rapid Classification of Raw Milk Quality in Indonesian Smallholder Dairy Systems'. Together they form a unique fingerprint.Cite this
- APA
- Author
- BIBTEX
- Harvard
- Standard
- RIS
- Vancouver