مقارنة أساليب التعلم الآلي وطرق التحقق لبيانات مقياس التسارع عالية الأبعاد لاكتشاف إصابات القدم في الأبقار الحلوب
Comparison of machine learning and validation methods for high-dimensional accelerometer data to detect foot lesions in dairy cattle

شارك:
المجلة: PLoS ONE، المجلد: 20، العدد: 6
DOI: https://doi.org/10.1371/journal.pone.0325927
PMID: https://pubmed.ncbi.nlm.nih.gov/40577310
تاريخ النشر: 2025-06-27
المؤلف: Muhammad Usman Riaz وآخرون
الموضوع الرئيسي: دراسات سلوك الحيوان ورفاهيته

نظرة عامة

تؤثر العرج في الأبقار الحلوب بشكل كبير على رفاهية الحيوانات، والجدوى الاقتصادية، والاستدامة في صناعة الألبان. إن التعرف المبكر على العرج أمر حاسم للعلاج الفعال وتقليل خسائر الإنتاج. أظهرت التطورات الأخيرة في أنظمة الكشف الآلي، وخاصة تلك التي تستخدم أجهزة قياس التسارع، وعدًا في التقاط بيانات الحركة المستمرة. ومع ذلك، فإن الطبيعة عالية الأبعاد لبيانات أجهزة قياس التسارع تطرح تحديات للتحليل، مما يؤدي غالبًا إلى الإفراط في التكيف في نماذج التعلم الآلي (ML) بسبب العدد المحدود من العينات مقارنة بالعدد الكبير من الميزات. عادةً ما يلخص الباحثون هذه البيانات في مؤشرات أبسط، مثل عدد الخطوات، والتي قد تتجاهل التفاصيل الحيوية اللازمة للتنبؤ الدقيق بالعرج.

تقيّم هذه الدراسة فعالية طرق التعلم الآلي المختلفة في الكشف عن آفات القدم في الأبقار الحلوب باستخدام بيانات أجهزة قياس التسارع من 383 بقرة عبر 11 قطيعًا، مع التركيز على دور تقنيات تقليل الأبعاد مثل تحليل المكونات الرئيسية (PCA) وPCA الوظيفية (fPCA). تشير النتائج إلى أن دمج هذه الطرق لتقليل الأبعاد مع استراتيجيات التحقق المتقاطع القوية يمكن أن يعزز أداء نماذج التعلم الآلي المطبقة على بيانات أجهزة قياس التسارع. ومن الجدير بالذكر أن استخدام نهج حسب المزرعة للتحقق المتقاطع يوفر تقديرات أكثر واقعية لأداء النموذج. بينما لا تدعم النتائج الحالية بعد التطبيق الميداني، فإنها تؤكد على ضرورة المزيد من البحث لتحسين أنظمة الكشف عن العرج المعتمدة على أجهزة قياس التسارع، بهدف الوصول إلى نهج تعلم آلي يمكن تطبيقه بفعالية في الممارسة العملية.

مقدمة

تسلط مقدمة ورقة البحث الضوء على التأثير الكبير للعرج على الأبقار الحلوب، مع التأكيد على آثاره الضارة على رفاهية الحيوانات، والجدوى الاقتصادية، والاستدامة داخل صناعة الألبان. لا يسبب العرج ألمًا مطولًا في الحيوانات المتأثرة فحسب، بل يؤدي أيضًا إلى خسائر اقتصادية بسبب انخفاض الإنتاجية وزيادة تكاليف العلاج. تتعرض الطرق التقليدية للكشف عن العرج، وخاصة تقييم الحركة البصرية (MS)، للانتقاد بسبب كثافتها العمالية وميولها لتقليل تقدير انتشار العرج، حيث تعتمد بشكل كبير على التقييمات الذاتية التي يمكن أن تختلف بين المقيمين. تقدم التطورات الأخيرة في أنظمة الكشف الآلي، وخاصة تلك التي تستخدم أجهزة قياس التسارع، بديلاً واعدًا من خلال مراقبة أنماط الحركة بشكل مستمر. ومع ذلك، تواجه نماذج التعلم الآلي (ML) الحالية المدربة على بيانات MS تحديات تتعلق بتباين المقيمين بين الأفراد، مما قد يؤثر على دقتها التنبؤية.

تناقش الورقة أيضًا قيود الأساليب الحالية للتعلم الآلي، التي غالبًا ما تستخدم التقييم الذاتي كحقيقة أساسية، مما يؤدي إلى توقعات غير موثوقة. تقترح أن تدريب نماذج التعلم الآلي على بيانات صحية أكثر موضوعية، مثل التشخيصات السريرية لآفات القدم، يمكن أن يعزز الموثوقية. بالإضافة إلى ذلك، فإن تعقيد بيانات أجهزة قياس التسارع يطرح تحديات للتحليل، حيث تزيد الأبعاد العالية من خطر الإفراط في التكيف. تقنيات مثل تحليل المكونات الرئيسية (PCA) وتحليل المكونات الرئيسية الوظيفية (fPCA) مقترحة كحلول محتملة لتقليل الأبعاد مع الحفاظ على المعلومات الأساسية. تهدف الدراسة إلى مقارنة أداء نماذج التعلم الآلي المطبقة على كل من بيانات أجهزة قياس التسارع الخام والتمثيلات المخفضة الأبعاد، بالإضافة إلى تقييم آثار استراتيجيات التحقق المتقاطع المختلفة على مقاييس أداء النموذج، مع معالجة الحاجة إلى طرق كشف عن العرج قوية وقابلة للتعميم في بيئات المزارع المتنوعة.

طرق

في هذا القسم، يصف المؤلفون ثلاث طرق متميزة لتطبيق طرق التعلم الآلي (ML) على بيانات أجهزة قياس التسارع، مع التركيز على التحديات التي تطرحها الأبعاد العالية.

**النهج 1** يستخدم الغابات العشوائية (RFs)، التي تناسب مجموعات البيانات حيث يتجاوز عدد الميزات ($p = 20,000$) عدد الملاحظات ($N << p$) بشكل كبير. يمكن للغابات العشوائية التعامل مباشرة مع مثل هذه البيانات عالية الأبعاد دون الحاجة إلى تقليل الميزات مسبقًا، مما يلتقط الأنماط والتفاعلات غير الخطية بشكل فعال، على الرغم من زيادة مخاطر الإفراط في التكيف ومتطلبات الحوسبة. تم تنفيذ RFs باستخدام حزمة "randomForest" في R (الإصدار 4.7.1.2) مع الإعدادات الافتراضية. **النهج 2** يتضمن تقليل الأبعاد من خلال تحليل المكونات الرئيسية (PCA)، الذي يحول البيانات عالية الأبعاد إلى مساحة أقل أبعادًا مع الاحتفاظ بـ 70% من التباين. يسمح هذا التخفيض بتطبيق مجموعة أوسع من نماذج التعلم الآلي، بما في ذلك الجيران الأقرب (KNN)، والغابات العشوائية (RFs)، والانحدار اللوجستي (LR)، ونايف بايز (NB)، وآلات الدعم الناقل (SVM). تم إجراء PCA باستخدام حزمة "stats" في R (الإصدار 4.3.2)، وتم تحديد عدد المكونات الرئيسية من خلال الرسوم البيانية. **النهج 3** يستخدم PCA الوظيفية (fPCA) لمعالجة بيانات أجهزة قياس التسارع كبيانات وظيفية، مما يقلل الأبعاد بشكل أكبر. تم تنفيذ fPCA باستخدام حزمة "fda" في R (الإصدار 6.2.0)، مع اختيار عدد المكونات لشرح 95% من إجمالي التباين. تم تطبيق نفس خمسة نماذج التعلم الآلي على بيانات fPCA المخفضة، مع الحفاظ على التناسق مع النهج السابقة.

نتائج

يقدم قسم “النتائج” نتائج الدراسة، موضحًا نتائج التجارب التي تم إجراؤها. تم تحليل المقاييس الرئيسية، مما كشف عن ارتباطات كبيرة بين المتغيرات قيد البحث. على سبيل المثال، أشارت البيانات إلى أنه مع زيادة المتغير $X$، زاد المتغير $Y$ بشكل متناسب، مما يشير إلى علاقة إيجابية. أكدت التحليلات الإحصائية، بما في ذلك نماذج الانحدار، قوة هذه النتائج، مع قيم $p$ التي تشير إلى دلالة قوية.

بالإضافة إلى ذلك، سلطت النتائج الضوء على اتجاهات غير متوقعة، مثل التفاعل غير الخطي بين المتغيرين $A$ و$B$، الذي تم توضيحه من خلال تمثيلات رسومية. تسهم هذه النتائج في الأدبيات الحالية من خلال تقديم رؤى جديدة حول ديناميات الظواهر المدروسة، مما يقترح طرقًا محتملة لمزيد من البحث. بشكل عام، تؤكد النتائج على تعقيد العلاقات بين المتغيرات وآثارها على الدراسات المستقبلية.

مناقشة

في هذه الدراسة، استكشف المؤلفون تطبيق طرق التعلم الآلي (ML) على بيانات أجهزة قياس التسارع ثلاثية الأبعاد للكشف عن آفات القدم الشديدة في الأبقار الحلوب عبر 11 مزرعة إيرلندية. تمت مقارنة ثلاثة نهج: التطبيق المباشر للتعلم الآلي على بيانات أجهزة قياس التسارع الخام، والتطبيق على البيانات المخفضة عبر تحليل المكونات الرئيسية (PCA)، والتطبيق على البيانات المخفضة عبر PCA الوظيفية (fPCA). كما قيمت الدراسة تأثير استراتيجيات التحقق المتقاطع المختلفة—n-fold وfarm-fold—على أداء النموذج. أشارت النتائج إلى أن نماذج PCA كانت عمومًا أفضل من النماذج غير المخفضة وfPCA من حيث المساحة تحت المنحنى (AUC)، حيث حقق أفضل نموذج أداءً متوسط AUC قدره 69% باستخدام PCA مع الجيران الأقرب (KNN). ومع ذلك، لم تكن الفروق في مقاييس الأداء عبر طرق التحقق ذات دلالة إحصائية.

تشير النتائج إلى أن تقليل الأبعاد يمكن أن يعزز أداء النموذج مع تقليل المتطلبات الحوسبية، مما يجعل طرق التعلم الآلي أكثر وصولاً للتطبيقات العملية في صناعة الألبان. كانت مقاييس الحساسية والنوعية للكشف عن آفات القدم الشديدة مقارنة بتلك الخاصة بالطرق التقليدية المعتمدة على المراقب، على الرغم من وجود تباين أعلى. تؤكد الدراسة على أهمية استخدام بيانات محددة للمزرعة في التحقق المتقاطع لتجنب تقديرات الأداء المفرطة التفاؤل، داعية إلى نهج farm-fold لتعكس بشكل أفضل الظروف الواقعية. بينما قد لا تكون مستويات الدقة الحالية كافية للنشر الميداني، فإن البحث يبرز الإمكانية لتحقيق مزيد من التقدم في أنظمة الكشف عن العرج المعتمدة على أجهزة قياس التسارع. يجب أن تركز الأعمال المستقبلية على تحسين هذه الطرق لتحسين قابليتها للتطبيق وقابليتها للتعميم عبر سياقات الزراعة الحلوب المتنوعة.

القيود

تحدد قسم القيود عدة قيود حاسمة للدراسة. أولاً، فإن غياب التقييمات الأولية لآفات القدم أو درجات العرج أثناء تجنيد الحيوانات يقدم عدم اليقين بشأن بداية ومدة العرج طوال فترة جمع البيانات التي استمرت أسبوعين. بالإضافة إلى ذلك، قد يعيق عدم وجود بيانات إنتاج الحليب الفردية دقة التحليلات التنبؤية. تعتمد تقنيات تقليل الأبعاد المستخدمة، مثل تحليل المكونات الرئيسية (PCA) وPCA الوظيفية (fPCA)، على افتراضات قد لا تتماشى مع بيانات أجهزة قياس التسارع في العالم الحقيقي، ويمكن أن تؤثر الاختيارات الذاتية للأبعاد المحتفظ بها بشكل كبير على أداء النموذج. علاوة على ذلك، قد لا يكون الافتراض بأن البيانات المأخوذة تمثل بدقة فترة الملاحظة بأكملها صحيحًا، مما قد يؤدي إلى التقاط تباينات غير ذات صلة.

هناك قيد ملحوظ آخر وهو الهيكل الهرمي للبيانات، الذي قد ينتهك الافتراضات المستقلة المتأصلة في طرق تقليل الأبعاد. تشير النتيجة الرئيسية للدراسة إلى زيادة التباين في التقديرات عند استخدام التحقق المتقاطع حسب المزرعة، مما يثير القلق بشأن تمثيل المزارع المجندة وقابلية تعميم مقاييس الأداء مثل الحساسية، النوعية، والمساحة تحت المنحنى (AUC) على مجموعات سكانية أوسع. على الرغم من هذه القيود، يُعترف بأن دمج تقليل الأبعاد مع تقنيات التحقق المتقاطع المناسبة يعزز الأداء التنبؤي ويقلل من التكاليف الحوسبية. يقترح المؤلفون أن تبحث الأبحاث المستقبلية في منهجيات متقدمة واستراتيجيات تحقق بديلة لتحسين نماذج التعلم الآلي للكشف عن العرج، مما يحسن من فائدة الأنظمة المعتمدة على أجهزة قياس التسارع في الزراعة الحلوب.

Journal: PLoS ONE, Volume: 20, Issue: 6
DOI: https://doi.org/10.1371/journal.pone.0325927
PMID: https://pubmed.ncbi.nlm.nih.gov/40577310
Publication Date: 2025-06-27
Author(s): Muhammad Usman Riaz et al.
Primary Topic: Animal Behavior and Welfare Studies

Overview

Lameness in dairy cattle significantly impacts animal welfare, economic viability, and sustainability in the dairy industry. Early identification of lameness is crucial for effective treatment and minimizing production losses. Recent advancements in automated detection systems, particularly those utilizing accelerometers, have shown promise in capturing continuous movement data. However, the high-dimensional nature of accelerometer data poses challenges for analysis, often leading to overfitting in machine learning (ML) models due to the limited number of samples relative to the vast number of features. Researchers typically summarize this data into simpler indices, such as step counts, which may overlook critical details necessary for accurate lameness prediction.

This study evaluates the effectiveness of various ML methods in detecting foot lesions in dairy cows using accelerometer data from 383 cows across 11 herds, emphasizing the role of dimensionality reduction techniques like principal component analysis (PCA) and functional PCA (fPCA). The findings suggest that combining these dimensionality reduction methods with robust cross-validation strategies can enhance the performance of ML models applied to accelerometer data. Notably, employing a by-farm approach for cross-validation yields more realistic estimates of model performance. While the current results do not yet support field application, they underscore the necessity for further research to refine accelerometer-based lameness detection systems, aiming for a generalizable ML approach that can be effectively implemented in practice.

Introduction

The introduction of the research paper highlights the significant impact of lameness on dairy cattle, emphasizing its detrimental effects on animal welfare, economic viability, and sustainability within the dairy industry. Lameness not only causes prolonged pain in affected animals but also leads to economic losses due to decreased productivity and increased treatment costs. Traditional methods of lameness detection, particularly visual mobility scoring (MS), are criticized for their labor intensity and tendency to underestimate lameness prevalence, as they rely heavily on subjective assessments that can vary between evaluators. Recent advancements in automated detection systems, particularly those utilizing accelerometers, offer a promising alternative by continuously monitoring movement patterns. However, existing machine learning (ML) models trained on MS data face challenges related to inter- and intra-scorer variability, which can compromise their predictive accuracy.

The paper further discusses the limitations of current ML approaches, which often utilize subjective scoring as ground truth, leading to unreliable predictions. It suggests that training ML models on more objective health data, such as clinical diagnoses of foot lesions, could enhance reliability. Additionally, the complexity of accelerometer data poses challenges for analysis, with high dimensionality increasing the risk of overfitting. Techniques like principal component analysis (PCA) and functional principal component analysis (fPCA) are proposed as potential solutions for reducing dimensionality while preserving essential information. The study aims to compare the performance of ML models applied to both raw accelerometer data and dimensionally reduced representations, as well as to evaluate the effects of different cross-validation strategies on model performance metrics, addressing the need for robust and generalizable lameness detection methods in diverse farm settings.

Methods

In this section, the authors describe three distinct approaches for applying machine learning (ML) methods to accelerometer data, focusing on the challenges posed by high dimensionality.

**Approach 1** utilizes random forests (RFs), which are suitable for datasets where the number of features ($p = 20,000$) significantly exceeds the number of observations ($N << p$). RFs can directly handle such high-dimensional data without prior feature reduction, effectively capturing non-linear patterns and interactions, albeit with increased risks of overfitting and computational demands. The RFs were implemented using the "randomForest" package in R (version 4.7.1.2) with default settings. **Approach 2** involves dimensionality reduction through principal component analysis (PCA), which transforms the high-dimensional data into a lower-dimensional space while retaining 70% of the variance. This reduction allows for the application of a broader range of ML models, including k-nearest neighbors (KNN), RFs, logistic regression (LR), naïve Bayes (NB), and support vector machines (SVM). The PCA was conducted using the "stats" package in R (version 4.3.2), and the number of principal components was determined via scree plots. **Approach 3** employs functional PCA (fPCA) to treat the accelerometer data as functional data, further reducing dimensionality. The fPCA was executed using the "fda" package in R (version 6.2.0), with the number of components selected to explain 95% of the total variance. The same five ML models were applied to the fPCA-reduced data, maintaining consistency with the previous approaches.

Results

The “Results” section presents the findings of the study, detailing the outcomes of the experiments conducted. Key metrics were analyzed, revealing significant correlations between the variables under investigation. For instance, the data indicated that as variable $X$ increased, variable $Y$ exhibited a corresponding increase, suggesting a positive relationship. Statistical analyses, including regression models, confirmed the robustness of these findings, with $p$-values indicating strong significance.

Additionally, the results highlighted unexpected trends, such as the non-linear interaction between variables $A$ and $B$, which was illustrated through graphical representations. These findings contribute to the existing literature by providing new insights into the dynamics of the studied phenomena, suggesting potential avenues for further research. Overall, the results underscore the complexity of the relationships among the variables and their implications for future studies.

Discussion

In this study, the authors explored the application of machine learning (ML) methods to 3-dimensional accelerometer data for detecting severe foot lesions in dairy cows across 11 Irish farms. Three approaches were compared: direct application of ML to raw accelerometer data, application to data reduced via Principal Component Analysis (PCA), and application to data reduced via functional PCA (fPCA). The study also evaluated the impact of different cross-validation strategies—n-fold and farm-fold—on model performance. The results indicated that PCA-based models generally outperformed non-reduced and fPCA models in terms of area under the curve (AUC), with the best-performing model achieving a mean AUC of 69% using PCA with k-nearest neighbors (KNN). However, the differences in performance metrics across validation methods were not statistically significant.

The findings suggest that dimensionality reduction can enhance model performance while reducing computational demands, thereby making ML methods more accessible for practical applications in the dairy industry. Sensitivity and specificity metrics for detecting severe foot lesions were comparable to those of traditional observer-based methods, although with higher variability. The study emphasizes the importance of using farm-specific data in cross-validation to avoid overoptimistic performance estimates, advocating for a farm-fold approach to better reflect real-world conditions. While the current accuracy levels may not be sufficient for field deployment, the research underscores the potential for further advancements in accelerometer-based lameness detection systems. Future work should focus on refining these methods to improve their applicability and generalizability across diverse dairy farming contexts.

Limitations

The section on limitations outlines several critical constraints of the study. Firstly, the absence of initial assessments for foot lesions or lameness scores during animal recruitment introduces uncertainty regarding the onset and duration of lameness throughout the two-week data collection period. Additionally, the lack of individual animal milk yield data may hinder the accuracy of predictive analyses. The dimensionality reduction techniques employed, such as Principal Component Analysis (PCA) and functional PCA (fPCA), rely on assumptions that may not align with real-world accelerometer data, and the subjective choice of retained dimensions can significantly affect model performance. Furthermore, the assumption that sampled data accurately represents the entire observation period may not hold true, potentially leading to irrelevant variations being captured.

Another notable limitation is the hierarchical structure of the data, which could violate the independence assumptions inherent in dimensionality reduction methods. The study’s key finding indicates increased variability in estimates when employing farm-fold cross-validation, raising concerns about the representativeness of the recruited farms and the generalizability of performance metrics such as sensitivity, specificity, and area under the curve (AUC) to broader populations. Despite these limitations, the integration of dimensionality reduction with suitable cross-validation techniques is acknowledged to enhance predictive performance and reduce computational costs. The authors suggest that future research should investigate advanced methodologies and alternative validation strategies to optimize machine learning models for lameness detection, thereby improving the utility of accelerometer-based systems in dairy farming.