PS12-7. Nested Cross-validated Hyperparameter Optimization and Decision-boundary Analysis for Image-based Anemia Classification in Dairy Goats.
Priyanka Gurrapu, Phaneendra Batchu, Aftab Siddique, David Shapiro-Ilan, Cristina Pisani, Niki C C Whitley, Thomas H TerrillAbstract
This study introduces an optimized AI-based machine learning framework for classifying anemia in dairy goats using image-based blood biosensor data collected at the USDA facility in Byron, Georgia. Whole-blood dispersion images were obtained under standardized micro-chamber conditions, emphasizing hematocrit-dependent pigment gradients and clotting microstructures. To ensure robust performance despite limited sample size, nested cross-validation was employed to separate hyperparameter tuning from performance estimation, thereby preventing information leakage and bias. Images were rescaled from 32 × 32 to 512 × 512 pixels to assess the impact of spatial resolution on model complexity. The classifiers evaluated included Support Vector Machine (SVM) with RBF kernel, Backpropagation Neural Network (BPNN), Convolutional Neural Network (CNN), and K-Nearest Neighbors (KNN). Hyperparameters optimized encompassed regularization (C), kernel bandwidth (γ), network depth, and learning rate. Performance metrics comprised cross-validated accuracy, precision, recall, F1-score, and execution time. Bias–variance analysis indicated that resolutions of 128 × 128 pixels or higher increased variance due to high-frequency texture noise in caprine blood dispersion. Optimal generalization was achieved at 64 × 64 resolution using SVM (C = 20; tuned γ), attaining 89.3% accuracy with balanced precision and recall. Decision-boundary analysis in principal component space demonstrated that optimized SVM provided smooth, nonlinear separation between anemia classes while limiting overfitting compared to deeper neural networks. Although CNN and BPNN achieved competitive accuracy, they exhibited higher variance under small-sample conditions. Explainability analyses using SHAP-PCA and Grad-CAM revealed that classification decisions relied on distributed boundary gradients and density transitions rather than isolated features, reflecting heterogeneous caprine hematology. These results indicate that nested cross-validated kernel optimization produces a computationally efficient, bias-controlled framework suitable for real-time, field-deployable anemia screening in dairy goat production.