ABSTRACT:
The present research created a tool to measure ultrasound images of the rib eye area in sheep. One hundred twenty-one ultrasound images of sheep were captured, with regions of interest segmented using the U-Net algorithm. The metrics adopted to evaluate automatic segmentations were Dicescore and intersection over union. Finally, a regression analysis was performed using the AdaBoost Regressor and Random Forest Regressor algorithms and the fit of the models was evaluated using the Mean Square Residuals, mean absolute error and coefficient of determination. The values obtained for the Dice metric were 0.94, and for Intersection over Union it was 0.89, demonstrating a high similarity between the actual and predicted values, ranging from 0 to 1. The values of Mean Quadratic Residuals, mean absolute error and coefficient The determination of the regressor models indicated the best fit for the Random Forest Regressor. The U-Net algorithm efficiently segmented ultrasound images of the Longissimus Dorsi muscle, with greater precision than the measurements performed by the specialist. This efficient segmentation allowed the standardization of rib eye area measurements and, consequently, the phenotyping of beef sheep on a large scale.
Key words: carcass; sheep; meat production; ultrasound; u-net
RESUMO:
O objetivo do presente trabalho foi o de criar uma ferramenta para mensurar imagens ultrassonográficas da área do olho de lombo em ovinos. Foram capturadas 121 imagens ultrassonográficas de ovinos, a partir das quais foram segmentadas regiões de interesse utilizando o algoritmo u-net. As métricas adotadas para avaliar as segmentações automáticas foram Dicescore e Interseção sobre União. Por fim, foi realizada análise de regressão utilizando os algoritmos AdaBoost Regressor e Random Forest Regressor e o ajuste dos modelos foi avaliado por meio de quadrado médio dos resíduos, erro absoluto médio e coeficiente de determinação (R²). Os valores obtidos para a métrica Dice foram 0,94, e para Interseção sobre União foi 0,89, demonstrando uma alta similaridade entre os valores reais e previstos, variando de 0 a 1. Os valores de quadrado médio dos resíduos, erro absoluto médio e coeficiente de determinação do modelo de regressores indicaram o melhor ajuste para o Random Forest Regressor. O algoritmo U-Net segmentou com eficiência as imagens ultrassonográficas do músculo Longissimus Dorsi, com maior precisão que as medidas realizadas pelo especialista. Essa eficiente segmentação permitiu a padronização das medidas de área de olho de lombo e, consequentemente, a fenotipagem de ovinos de corte em larga escala.
Palavras-chave: carcaça; ovelhas; produção de carne; ultrassom; u-net
INTRODUCTION
Sheep production has been expanding over the years, all over the world. However, the productivity of sheep meat has not changed, not meeting market demands, due to internal factors such as deficiencies in sanitary, nutritional and reproductive management, in addition to the lack of zootechnical information on the herds (LIRA et al., 2017). Therefore, ultrasound has been widely used to evaluate carcass indicator traits, being non-invasive and efficient technique for in vivo evaluation of animal carcass composition, demonstrating high repeatability, low cost and easy operation. The inclusion of carcass data obtained by ultrasound is essential for a better evaluation of herds in genetic improvement programs (GRILL et al., 2015). It is worth highlighting that some discrepant results in relation to the characteristics measured were observed. This is mainly due to failures in the professional’s measurement, which emphasizes the importance of the specialist’s experience in the results (GERALDO et al., 2017).
This way, the loin eye area (LEA) obtained by ultrasonography of the Longissimus Dorsi muscle is one of the most used and studied to assess the amount of muscle, as this measurement has a high correlation with the overall muscularity of the carcass, in addition to providing valuable information to incorporate models of growth and animal selection and assist in choosing animals for slaughter (LIRA et al., 2017).
In this context, computer vision algorithms, such as convolutional neural networks (CNN), can measure this muscle, through ultrasound images, extracting the region of interest. This methodology can bring advantages given the high greater precision of measurements by the algorithm than those made by evaluators, in addition to accelerating the large-scale measurement process, showing promising results in image segmentation (RONNENBERGER et al., 2015).
Thus, the objective was to develop a system for measuring the ribeye area of the Longissimus Dorsi muscle. For this development, the system was implemented in two stages: 1) delimitation of the Longissimus Dorsi muscle in ultrasound images, by image segmentation algorithms based on convolutional neural networks; and 2) LEA prediction based on the region delimited in the previous step, using shape attributes and regression algorithms.
MATERIALS AND METHODS
First, an ultrasound image of the muscle, in question, was obtained from each female of approximately one year of age of the Santa Inês breed, totaling 121 females. The images were collected with a Sonoscape ultrasound device, model A5V, equipped with a linear multifrequency transducer, using a frequency between 5.0 and 7.5 MHz.
During data collection, the animal identification number, the ultrasound images with muscle delimitation and the loin eye area (LEA) in cm² were recorded with the aid of the ultrasound device’s specific software.
While recording the images, the animal was comfortably restrained to avoid stress and improve image quality. Subsequently, with a comb, the hairs in the lumbar region were separated and a water-based gel indicated for capturing ultrasound images was applied. After capturing the images, the LEA was measured by a trained technician with the aid of the measurement tool of the ultrasound device itself.
The muscle region was marked on each image, as the algorithm requires trained data and LEA was measured. They learn the desired pattern using known inputs and outputs, then perform the same process on unknown data. Thus, the input of the algorithm were the ultrasound images and the outputs were the delimited region and the LEA measurement. The markings were performed by a trained technician using the online tool LabelMe (RUSSELL et al., 2008).
Before sending the images to the segmentation algorithm for automatic muscle delimitation, it was necessary to perform some data pre-processing steps, such as recording the ultrasound output image, in order to remove all the tags, from the figure 1, to get an image with as little extraneous information as possible.
Original ultrasound images (1a, 1b, and 1c), LEA segmentation performed by the trained technician (2a, 2b, and 2c), and LEA segmentation performed by the U-Net algorithm (3a, 3b, and 3c).
In the second stage of pre-processing, a zero-padding operation was performed, aiming to standardize the size of all images in the database, resizing them by adding the value 0 to the created pixels so that the images had same in width and height. At the end of this process, all images were resized to 320x320 pixels. Finally, the image pixels were normalized in the range from 0 to 1.
For segmentation, 70% of the total images were used to train the algorithm, while 30% for testing and calculating the hit metrics. The model was compiled with the Adam optimizer, and binary cross-entropy was used as a loss function, as there were only two classes (region of interest and background). The U-Net, composed of 6 layers and a dropout of 0.3 in this step, was trained for 200 epochs, with the training set divided and complete cycles performed in this step.
For the evaluation of automatic segmentations, two metrics were applied. The data coefficient metric (Dice Score) was defined by twice the measurements common to both and the size of the automatically segmented regions (X) and manually marked regions (Y) (EELBODE et al., 2020; DICE, 1945), as expressed given by Equation 1.
(1)
Equation 2 refers to the IoU (Intersection over Union) metric or Jaccard index. The IoU measured the number of common pixels between the segmentation and prediction masks (intersection) divided by the total number of pixels present in both masks segmented by the algorithm (union) (ALBATINEH & NIEWIADOMSKA-BUGAJ, 2011).
(2)
Feature extraction was investigated using two image categories of scripting algorithms and two pre-trained artificial neural networks to find essential features for LEA prediction. Therefore, in segmenting the region of interest, the Python Region Props function was used to calculate the properties determined for measuring the loin eye area from each ultrasound image (ARDHIANTO & BUDIARSO, 2013). The properties used were: centroid, convex area, eccentricity, equivalent diameter, extent, filled area, inertia tensor, inertia tensor eigenvalues, label, local centroid, major axis length, minor axis length, moments, moments central, orientation, perimeter, solidity, weighted centroid, and area.
The regression analysis assumed the values of the attributes obtained with the descriptors of the segmented images as an independent variable and the LEA measurements calculated by a trained technician using ultrasound as the dependent variable to predict LEA from the ultrasound images.
The two regression algorithms used were AdaBoost Regressor and Random Forest Regressor, both avaliable in Python (CAO et al., 2013; BREIMAN, 1996). The set of traits was divided, with values already normalized between 0 and 1, into training (50%) and validation (50%).
The metrics used in the performance evaluation of regression models were calculated using Python packages and were Mean Squared Residuals (MSR), Mean Absolute Error (MAE), and the Coefficient of determination (R 2 ) (KRAMER, 2016).
Equation 3 averages the model errors squared, where y i is the actual value and ŷ i is the predicted value.
(3)
The MAE is calculated according to Equation 4, where y i is the real value and ŷ i is the predicted value, whose difference between the real and the predicted value was determined in module.
(4)
The R 2 calculated according to ZHANG (2017), is shown in Equation 5, where y i is the actual value, ŷ i is the predicted value, and ȳ is the average value for LEA.
(5)
The means of LEA determined by a trained ultrasound technician and those predicted were submitted to descriptive analysis and comparing their means using the paired Student’s t-test at the 5% probability level. These procedures were performed using the software SAS (SAS UNIVERSITY EDITION, EUA).
RESULTS AND DISCUSSION
The results obtained with the automatic segmentation method from the ultrasonographic images of sheep using the U-Net algorithm for Dice Score and IoU (Jaccard index) (Figure 1), widely used in the segmentation of medical images were, respectively, 0.94 and 0.89 and shows that there is a similarity between the images, consistent with the Score Dice and IoU metrics. The Dice score and the Jaccard index (IoU metric) are used to evaluate segmentation performance in many medical images and classic computer vision tasks (EELBODE et al., 2020). BERTELS et al. (2019) also highlighted that the Dice score and the IoU metric are metrics generally used to evaluate segmentation functions in medical images. FIDON et al. (2017) emphasized that the data coefficient metric (Dice) is widely used for binary segmentation due to its robustness to class imbalance. Thus, the U-Net algorithm demonstrated efficiency in the segmentation of ultrasound images, as observed by RONNENBERG et al. (2015) and ISENSEE et al. (2021).
In figure 2, it was observed that the LEA values predicted by the proposed methodology were close to the LEA values obtained by the evaluation of a trained technician, which suggests that the algorithm was efficient in predicting LEA in sheep. The coefficient of determination (R2) is another metric that confirms the Random Forest model as the best fit, given the values reported and the conditions for evaluating the equations (MCMANUS et al., 2013; SALES et al., 2019). The values observed (Figure 2) for the coefficient of determination of the Random Forest and AdaBoost regressors were similar to those reported by WYNER et al. (2017), indicating a good fit of the prediction equation to the data.
Actual values (x-axis), obtained by the evaluation of a trained technician, and predicted (y-axis), obtained both by the proposed method for rib eye area in beef sheep
The Random Forest regressor presented lower MSR and MAE and higher R², indicating better quality of fit to the data, compared to the results obtained with the Adabooster regressor (Table 1), results similar to those observed by CHOWDHURY et al. (2019), showing the best fit of Random Forest and; consequently, its promising potential.
It was also observed in table 2 that the observed and predicted LEA means did not present significant differences (P < 0.05) by the Student’s t-test applied to the two groups of means, indicating a reduction or absence of bias in the predictions, which emphasizes the efficiency of the tool. The CV for the predicted LEA was lower than that obtained for the observed LEA and was lower than the results obtained by SENA et al. (2020) and TAVEIRA et al. (2016). Therefore, the prediction by the U-Net algorithm will allow a reliable estimate and indicates less dispersion in the data generated by the proposed tool. Furthermore, with these LEA averages programmed, it will be possible to contribute to large-scale phenotyping of carcass measurements in beef sheep, since predictions based on U-Net can be considered as good as actual values, even in small amounts of information.
The amplitude (A), the confidence interval (CI) and the mean standard residuals (MSR) were smaller for the predicted LEA (Table 2), values similar to those observed by BORGES et al. (2023), due to the proposed standardization, thus showing greater precision in the collected data and greater reliability in the predicted than in the observed, highlighting the success of the technological tool. The smaller variance for the predicted LEA emphasizes that the predicted averages showed less dispersion than the observed ones. Thus, this measure is essential for decision-making in animal management and improvement programs for meat production.
According to SAKAMOTO et al. (2014), SILVA et al. (2018) and GERALDO et al. (2017) the rib eye area is directly related to the yield of carcass cuts, and this measure can infer the quantity and quality of the meat, which justifies the fact that the AOL is more tested and more accepted.
CONCLUSION
The U-Net algorithm efficiently segmented ultrasound images of the Longissimus Dorsi muscle without human intervention and accurately predicting the rib eye area in beef sheep quickly and efficiently, providing safety and optimization in the measurement of the rib eye area, with values similar to measurements carried out by a professional.
It is important to highlight that in addition to proving the precision obtained with the standardization of rib eye area measurements, this research also contributed to the phenotyping of beef sheep on a large scale, being fundamental for genetic improvement programs and other areas of animal production. It is important to mention that the inclusion of more automatically measured measurements on the carcass is necessary for a more detailed analysis.
ACKNOWLEDGMENTS
The authors would like to thank the Coordenação de Aperfeiçoamento de Pessoal de Nível Superior (CAPES) - Brasil for financial assistance - Finance Code 001, Finance Code 88887.730148/2022-00 and the Universidade Federal do Piauí (UFPI) for assisting in the development of research.
REFERENCES
-
ALBATINEH, A. N.; NIEWIADOMSKA-BUGAJ, M. Correcting Jaccard and other similarity indices for chance agreement in cluster analysis. Advances in Data Analysis and Classification, v.5, p.179-200, 2011. Available from: <Available from: https://doi.org/10.1007/s11634-011-0090-y >. Accessed: Oct. 18, 2023. doi: 10.1007/s11634-011-0090-y.
» https://doi.org/10.1007/s11634-011-0090-y.» https://doi.org/10.1007/s11634-011-0090-y -
ARDHIANTO, E.; BUDIARSO, W. H. Z. Implementasi metode image Subtracting dan Metode Regionprops untuk Mendeteksi Jumlah Objek Berwarna RGB pada File Video. Dinamik, v.18, p.91-100, 2013. Available from: <Available from: https://doi.org/10.35315/dinamik.v18i2.1697 >. Accessed: Oct. 18, 2023. doi: 10.35315/dinamik.v18i2.1697.
» https://doi.org/10.35315/dinamik.v18i2.1697.» https://doi.org/10.35315/dinamik.v18i2.1697 -
BERTELS, J. et al. Optimizing the Dice Score and Jaccard Index for Medical Image Segmentation: Theory and Practice. Springer, v.11765, p.92-100, 2019. Available from: <Available from: https://doi.org/10.1007/978-3-030-32245-8_11 >. Accessed: Jan. 03, 2024. doi: 10.1007/978-3-030-32245-8_11.
» https://doi.org/10.1007/978-3-030-32245-8_11.» https://doi.org/10.1007/978-3-030-32245-8_11 -
BREIMAN, L. Bagging predictors. Machine Learning, v.24, p.123-140, 1996. Available from: <Available from: https://doi.org/10.1007/BF00058655 >. Accessed from: Oct. 19, 2023. doi: 10.1007/BF00058655.
» https://doi.org/10.1007/BF00058655.» https://doi.org/10.1007/BF00058655 -
BORGES, M. C. R. et al. Use of non-linear models to evaluate the sheep growth curve. Caderno De Ciências Agrárias, v.15, p.1-6, 2023. Available from: <Available from: https://doi.org/10.35699/2447-6218.2023.45002 >. Accessed from: Jan. 03, 2024. doi: 10.35699/2447-6218.2023.45002.
» https://doi.org/10.35699/2447-6218.2023.45002.» https://doi.org/10.35699/2447-6218.2023.45002 -
CAO, Y. et al. Advance and prospects of AdaBoost Algorithm. Acta Automatica Sinica, v.39, n.6, p.745-758, 2013. Available from: <Available from: https://doi.org/10.1016/S1874-1029(13)60052-X >. Accessed: Oct. 19, 2023. doi: 10.1016/S1874-1029(13)60052-X.
» https://doi.org/10.1016/S1874-1029(13)60052-X.» https://doi.org/10.1016/S1874-1029(13)60052-X -
CHOWDHURY, A. R. et al. A random forest classifier-based approach in the detection of abnormalities in the retina. Medical & Biological Engineering & Computing, v.57, p.193-203, 2019. Available from: <Available from: https://doi.org/10.1007/s11517-018-1878-0 >. Accessed: Jan. 03, 2024. doi: 10.1007/s11517-018-1878-0.
» https://doi.org/10.1007/s11517-018-1878-0.» https://doi.org/10.1007/s11517-018-1878-0 -
DICE, L. R. Measures of the amount of ecologic Association Between Species. Ecology, v.26, p.297-302, 1945. Available from: <https://doi.org/10.2307/1932409>. Accessed: Oct. 19, 2023. doi: 10.2307/1932409.
» https://doi.org/10.2307/1932409 -
EELBODE, T. et al. Optimization for medical Image Segmentation: Theory and Practice When Evaluating With Dice Score or Jaccard Index. IEEE Transactions on Medical Imaging, v.39, p.3679-3690, 2020. Available from: <Available from: https://doi.org/10.1109/TMI.2020.3002417 >. Accessed: Oct. 21, 2023. doi: 10.1109/TMI.2020.3002417.
» https://doi.org/10.1109/TMI.2020.3002417.» https://doi.org/10.1109/TMI.2020.3002417 -
FIDON, L. et al. Generalised Wasserstein Dice Score for Imbalanced Multi-class Segmentation Using Holistic Convolutional Networks. Springer, v.10670, p.64-76, 2017. Available from: <Available from: https://doi.org/10.1007/978-3-319-75238-9_6 >. Accessed: Jan. 03, 2024. doi: 10.1007/978-3-319-75238-9_6.
» https://doi.org/10.1007/978-3-319-75238-9_6.» https://doi.org/10.1007/978-3-319-75238-9_6 -
GERALDO, A. T. Avaliação de carcaça ovina por tomografia computadorizada: estado da arte no brasil e no mundo. Pubvet, v.11, p.91-102. 2017. Available from: <Available from: http://dx.doi.org/10.22256/pubvet.v11n1.91-102 >. Accessed: Jan. 03, 2024. doi: 10.22256/pubvet.v11n1.91-102.
» https://doi.org/10.22256/pubvet.v11n1.91-102.» http://dx.doi.org/10.22256/pubvet.v11n1.91-102 -
GRILL, L. et al. Evaluation of ultrasound scanning to predict carcass composition of Austrian meat sheep. Small Ruminant Research, v.123, p.260-268, 2015. Available from: <Available from: https://doi.org/10.1016/j.smallrumres.2014.12.005 >. Accessed: Oct. 19, 2023. doi: 10.1016/j.smallrumres.2014.12.005.
» https://doi.org/10.1016/j.smallrumres.2014.12.005.» https://doi.org/10.1016/j.smallrumres.2014.12.005 -
ISENSEE, F. et al. nnU-Net: a self-configuring method for deep learning-based biomedical image segmentation. Nature Methods, v.18, p.203-211, 2021. Available from: <Available from: https://doi.org/10.1038/s41592-020-01008-z >. Accessed: Jan. 03, 2024. doi: 10.1038/s41592-020-01008-z.
» https://doi.org/10.1038/s41592-020-01008-z.» https://doi.org/10.1038/s41592-020-01008-z -
KRAMER, O. Scikit-Learn. In: Machine Learning for Evolution Strategies. Studies in big data, v.20, p.45-53, 2016. Available from: <Available from: https://doi.org/10.1007/978-3-319-33383-0_5 >. Accessed: Oct. 19, 2023. doi: 10.1007/978-3-319-33383-0_5.
» https://doi.org/10.1007/978-3-319-33383-0_5.» https://doi.org/10.1007/978-3-319-33383-0_5 -
LIRA, A. B. et al. Performance and carcass characteristics of two biotypes of pasture-finished Santa Inês sheep supplemented with multinutritional blocks. Revista Brasileira de Saúde e Produção Animal, v.18, p.313-326, 2017. Available from: <Available from: http://dx.doi.org/10.1590/s1519-99402017000200010 >. Accessed: Oct. 21, 2023. doi: 10.1590/s1519-99402017000200010.
» https://doi.org/10.1590/s1519-99402017000200010.» http://dx.doi.org/10.1590/s1519-99402017000200010 -
MCMANUS, C. et al. Ultrassonography evaluation of sheep carcass quality of Santa Inês. Ciência Animal Brasileira, v.14, p.8-16, 2013. Available from: <Available from: https://doi.org/10.5216/cab.v14i1.12336 >. Accessed: Oct. 19, 2023. doi: 10.5216/cab.v14i1.12336.
» https://doi.org/10.5216/cab.v14i1.12336.» https://doi.org/10.5216/cab.v14i1.12336 -
RONNEBERGER, O. et al. U-Net: Convolutional Networks for Biomedical Image Segmentation. Medical Image Computing and Computer-Assisted Intervention, v.9351, p.234-241, 2015. Available from: <Available from: https://doi.org/10.48550/arXiv.1505.04597 >. Accessed: Oct 20, 2023. doi: 10.48550/arXiv.1505.04597.
» https://doi.org/10.48550/arXiv.1505.04597.» https://doi.org/10.48550/arXiv.1505.04597 -
RUSSELL, B. C. et al. LabelMe: A database and Web-Based Tool for Image Annotation. International Journal of Computer Vision, v.77, p.157-173, 2008. Available from: <Available from: https://doi.org/10.1007/s11263-007-0090-8 >. Accessed: Oct. 20, 2023. doi: 10.1007/s11263-007-0090-8.
» https://doi.org/10.1007/s11263-007-0090-8.» https://doi.org/10.1007/s11263-007-0090-8 -
SAKAMOTO, L. S. et al. Prediction of retail beef yield and fat content from live animal and carcass measurements in Nellore cattle. Journal of Animal Science, v.92, p.5230-5238. 2014. Available from: <Available from: https://doi.org/10.2527/jas.2012-6065 >. Accessed: Jan. 03, 2024. doi: 10.2527/jas.2012-6065.
» https://doi.org/10.2527/jas.2012-6065.» https://doi.org/10.2527/jas.2012-6065 -
SALES, R. O. et al. A importância da ultrassonografia na Medicina Veterinária: Ensino. Revista Brasileira de Higiene e Sanidade Animal, v.13, p.156-178. 2019. Available from: <Available from: http://dx.doi.org/10.5935/1981-2965.20190012 >. Accessed: Jan. 03, 2024. doi: 10.5935/1981-2965.20190012.
» https://doi.org/10.5935/1981-2965.20190012.» http://dx.doi.org/10.5935/1981-2965.20190012 -
SENA, L. S. et al. Genetic evaluation of tropical climate-adapted sheep for carcass traits including genomic information. Small Ruminant Research, v.188, p.106120. 2020. Available from: <Available from: https://doi.org/10.1016/j.smallrumres.2020.106120 >. Accessed: Oct 20, 2023. doi: 10.1016/j.smallrumres.2020.106120.
» https://doi.org/10.1016/j.smallrumres.2020.106120.» https://doi.org/10.1016/j.smallrumres.2020.106120 -
SILVA, F. V. et al. Performance and carcass characteristics of lambs fed a solution of cheese whey during feedlot and pre-slaughter lairage. Revista Brasileira de Zootecnia, v.47, p.1-6. 2018. Available from: <Available from: https://doi.org/10.1590/rbz4720170026 >. Accessed: Jan. 03, 2024. doi: 10.1590/rbz4720170026.
» https://doi.org/10.1590/rbz4720170026.» https://doi.org/10.1590/rbz4720170026 -
TAVEIRA, R. Z. et al. Carcass evaluation of Tabapuã breed bovines using ultrasound. Pubvet, v.10, p.100-104. 2016. Available from: <Available from: http://dx.doi.org/10.22256/pubvet.v10n1.100-104 >. Accessed: Jan. 03, 2024. doi: 10.22256/pubvet.v10n1.100-104.
» https://doi.org/10.22256/pubvet.v10n1.100-104.» http://dx.doi.org/10.22256/pubvet.v10n1.100-104 -
ZHANG, D. A Coefficient of Determination for Generalized Linear Models. The American Statistician, v.71, p.310-316, 2017. Available from: <Available from: https://doi.org/10.1080/00031305.2016.1256839 >. Accessed: Oct. 20, 2023. doi: 10.1080/00031305.2016.1256839.
» https://doi.org/10.1080/00031305.2016.1256839.» https://doi.org/10.1080/00031305.2016.1256839
BIOETHICS AND BIOSECURITY COMMITTEE APPROVAL
Edited by
-
Editors: Rudi Weiblen (0000-0002-1737-9817) Rubén Domínguez-Valencia (0000-0002-2764-504X)
Publication Dates
-
Publication in this collection
10 June 2024 -
Date of issue
2024
History
-
Received
25 Oct 2023 -
Accepted
16 Feb 2024 -
Reviewed
17 Apr 2024