SHAP-Optimized Ensemble Learning Framework for Cattle Retinal Disease Classification Using PCA-Transformed RGB Imaging
摘要
Accurate and early detection of retinal abnormalities in livestock, particularly cattle, is essential for safeguarding animal health, preventing disease progression, and ensuring productivity in the agricultural sector. This study introduces an optimized and explainable ensemble learning framework for the classification of cattle retinal images into healthy and unhealthy categories. The proposed approach involves preprocessing RGB retinal photographs, followed by dimensionality reduction using Principal Component Analysis (PCA) to convert high-dimensional visual data into compact, structured features. These features are processed by an ensemble of three classical machine learning classifiers—Random Forest, Gradient Boosting, and Extra Trees—aggregated through a soft voting strategy to enhance prediction reliability. To further refine performance, the Random Forest model is optimized using GridSearchCV, resulting in improved classification metrics including accuracy, AUC, and reduced misclassification rates. Importantly, the framework integrates SHAP (SHapley Additive exPlanations) to provide interpretability, highlighting the contribution of individual PCA-transformed features to each prediction and offering transparency in model decisions. Experimental results on a curated dataset of cattle retinal images demonstrate that the optimized ensemble outperforms the baseline model, achieving an accuracy of ~76.5% and an AUC of 0.73, with reduced false positives and false negatives. This work highlights the practical potential of interpretable, lightweight AI models for veterinary diagnostics. The proposed solution supports scalable and accessible deployment in field settings, providing a reliable tool for early detection of retinal disease in cattle and contributing to enhanced animal welfare and improved farm management practices.