Open-access Prediction of carcass rib eye area by ultrasound images in sheep using computer vision

Predição da área de olho de lombo da carcaça por imagens ultrassonográficas em ovinos utilizando visão computacional

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.

Figure 1
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.

ScoreDice=2ABA+ B(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).

IoU=SegmentationPredictionSegmentationPrediction(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.

MSRy,y^=1nsamplesi=1nsamplesyi-y^i²(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.

MAEy,y^=1nsamplesi=1nsamplesyi-y^i(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.

R²y,y^=1-i=1nsamplesyi-y^i²i=1nsamplesyi-y¯²(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.

Figure 2
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 , 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.

Table 1
Comparative metrics obtained by fitting the AdaBooster and Random Forest regressors models on segmented images using the U-Net algorithm.

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.

Table 2
Descriptive statistics and Student's t-test for the average loin eye area (LEA) predicted by the proposed method and observed in meat sheep.

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

  • CR-2023-0576.R1

BIOETHICS AND BIOSECURITY COMMITTEE APPROVAL

  • The study carried out was approved by the Committee on Ethics in the Use of Animals (CEUA/UFPI) of the Universidade Federal do Piauí, under number 340/17.

Edited by

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
location_on
Universidade Federal de Santa Maria Universidade Federal de Santa Maria, Centro de Ciências Rurais , 97105-900 Santa Maria RS Brazil , Tel.: +55 55 3220-8698 , Fax: +55 55 3220-8695 - Santa Maria - RS - Brazil
E-mail: cienciarural@mail.ufsm.br
rss_feed Stay informed of issues for this journal through your RSS reader
Acessibilidade / Reportar erro