Pig carcass eye muscle area intelligent real-time measurement method and system based on deep learning
By combining deep learning technology with a depth camera, real-time and automated measurement of the eye muscle area of pig carcasses has been achieved, solving the problems of cumbersome operation and limited accuracy in traditional methods, improving measurement efficiency and accuracy, and supporting scientific breeding and production management.
Patent Information
- Application Number
- CN202411044326.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-11-15
AI Technical Summary
Traditional methods for measuring the area of ocular muscles in pig carcasses are cumbersome, time-consuming, and susceptible to human error, making it difficult to achieve high-frequency, large-scale, rapid measurements. Furthermore, their accuracy is limited, and their stability is poor, especially in complex environments.
Employing a deep learning-based approach, this study utilizes the YOLOv8Seg model combined with an Intel RealSense D455 depth camera. Through multi-scale feature extraction and high-quality segmentation masks, it achieves real-time and automated measurement of eye muscle area, intelligently removes non-eye muscle parts, and performs accurate calculations by combining depth maps and RGB images.
It enables efficient and accurate measurement of the eye muscle area of pig carcasses, reduces human error, improves the accuracy and consistency of measurements, meets the needs of high-frequency production, reduces costs, and supports scientific breeding and production management optimization.
Smart Images

Figure CN118968603A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of computer vision and artificial intelligence, and in particular relates to a real-time intelligent measurement method and system for pig carcass eye muscle area based on deep learning. Background Art
[0002] Pork is the world's largest source of animal protein. With the improvement of consumption levels, consumers have increasingly stringent requirements for pork quality, flavor and lean meat rate. Studies have shown that the eye muscle area of pigs is positively correlated with the lean meat rate. Therefore, the eye muscle area has become one of the important breeding traits when breeding lean pigs. Accurately measuring the eye muscle area is of great significance for evaluating pork quality, guiding breeding and improving meat quality.
[0003] Traditional methods for measuring eye muscle area mainly include the sulfuric acid paper tracing method and the plastic grid method. Although the sulfuric acid paper tracing method is widely used, it is cumbersome and time-consuming to operate, and the measurement results are easily affected by the subjective factors of the operator, resulting in unstable results. At the same time, this method involves multiple contact operations and the use of consumables, making it difficult to achieve high-frequency, large-scale rapid measurements. Although the plastic grid method reduces the error of manual tracing, it still requires manual operation, is inefficient, and has limited accuracy. These traditional methods have limitations when measuring fascia and other non-eye muscle parts, and it is difficult to meet the high efficiency and precision requirements of modern production.
[0004] Through the above analysis, the problems and defects of the prior art are as follows:
[0005] (1) Traditional methods for measuring eye muscle area mainly include the sulfuric acid paper tracing method and the plastic grid method. Although the sulfuric acid paper tracing method is widely used, it is cumbersome and time-consuming to operate, and the measurement results are easily affected by the subjective factors of the operator, resulting in unstable results. At the same time, this method involves multiple contact operations and the use of consumables, making it difficult to achieve high-frequency, large-scale rapid measurements.
[0006] (2) Although the plastic grid method reduces the error of manual outlining, it still requires manual operation, is inefficient, and has limited accuracy. These traditional methods have limitations when measuring fascia and other non-eye muscle parts, and cannot meet the high efficiency and precision requirements of modern production. Summary of the invention
[0007] In response to the problems existing in the prior art, the present invention provides a real-time intelligent measurement method for pig carcass eye muscle area based on deep learning.
[0008] The present invention is implemented in this way: a real-time intelligent measurement method of pig carcass eye muscle area based on deep learning includes:
[0009] S1, unique dataset construction:
[0010] A unique dataset of 202 training and validation images was created. The images were collected from 68 pigs at a slaughterhouse in Huanggang, Hubei Province from different viewing angles of the eye muscle area.
[0011] Through multi-view and diverse images, the comprehensiveness and adequacy of model learning are ensured; the test set contains data on the eye muscle area of 115 pigs, collected at a slaughterhouse in Songyuan, Jilin;
[0012] S2, acquisition of the true value of eye muscle area:
[0013] The actual value of the eye muscle area is determined by scanning and selecting the traced sulfuric acid paper, and calculating the number of pixels in the selected area; the specific process includes using the traced sulfuric acid paper as the material, scanning it and importing it into the image editing software to perform the selection operation, and finally obtaining the real eye muscle area data through the area calculation formula;
[0014] S3, data annotation:
[0015] During the image annotation process, the conventional eye muscle area and the eye muscle area with the non-eye muscle part removed intelligently are annotated respectively;
[0016] S4, selection and training of deep learning models:
[0017] In the slaughter line environment, in order to achieve accurate real-time measurement, the YOLOv8Seg (YouOnly Look Once) model for efficient image segmentation was selected. This model meets the needs of high-frequency production through multi-scale feature extraction and high-quality segmentation masks. During training, models were established for regular and pure eye muscle areas respectively, using YOLOv8n as the main model for training, and applying a variety of data enhancement techniques.
[0018] S5, develop an algorithm for determining the true value of eye muscle area based on depth images:
[0019] An eye muscle area calculation algorithm based on the YOLOv8Seg model and the Intel RealSense D455 depth camera was developed. By acquiring RGB and depth images in real time, the depth map and segmentation mask are used to calculate the number of pixels and average depth value in the mask area, and then combined with the camera intrinsic parameters and correction factors to obtain the actual area of the eye muscle. The results are displayed on the image in the form of masks and labels, and stored as video and log files.
[0020] S6, develop an algorithm for determining the true value of eye muscle area based on two-dimensional images:
[0021] Based on two-dimensional images, that is, ordinary RGB images, an algorithm that can accurately measure the eye muscle area is developed; the eye muscle area is finally obtained by predicting with a fixed height, using the fixed image range true value, and combining the segmentation results output by the YOLOv8Seg model through specific conversion parameters;
[0022] S7, intelligent eye muscle area prediction model with non-eye muscle removal: Deep learning is used to automatically identify and remove fascia and non-eye muscle parts to ensure the accuracy and reliability of eye muscle area measurement. The traditional method is difficult to accurately segment, and this system intelligently processes and solves this problem;
[0023] S8, Construction of real-time measurement system: Build a real-time measurement system, including image acquisition, data processing and result display modules, support 3D and 2D image measurement, and use cameras or depth cameras to collect data. Use deep learning models to analyze images in real time, segment the eye muscle area and remove the non-eye muscle part, and calculate the eye muscle area based on the image. Visualize the results in real time, and record the measurement data in tables and logs for easy review and analysis.
[0024] Further, in S1, a total of 202 images were collected, which were collected from different perspectives of 68 pigs in a slaughterhouse in Huanggang, Hubei; the data set was randomly divided according to a ratio of 8:2, of which 162 images were used as a training set and 40 images were used as a validation set; the test set contained image data of 118 pigs, including 3D image data of 115 pigs and RGB image data of 118 pigs;
[0025] S11, depth camera image acquisition: Use Intel RealSense D455 depth camera for image acquisition; the image acquisition time is controlled within 5 seconds to ensure the synchronization of high-quality images and depth data; the purpose of image acquisition is to better align the RGB stream and depth stream later;
[0026] S12, RGB image acquisition: Use a mobile phone and a stand to acquire RGB images; the height of the mobile phone from the pig carcass is fixed at 23 cm to ensure the consistency of image depth; the acquisition of RGB images provides basic data for subsequent image processing and analysis;
[0027] S13, sulfuric acid paper outlining method: The data of 118 pigs were processed by sulfuric acid paper outlining; the eye muscles of the pig carcasses were placed on sulfuric acid paper, and the outline of the eye muscles was manually traced; the outlined sulfuric acid paper was marked with the eye muscle width and eye muscle height by one person.
[0028] Further, the method for calculating the true value of the S2 eye muscle area adopts the following steps and methods to ensure the accuracy and consistency of the data;
[0029] S21, scanning and selection of sulphate paper: First, use the sulphate paper after tracing as the initial material; put the sulphate paper into the scanner for scanning to generate a high-resolution digital image; next, import these scanned images into Photoshop software; in order to ensure data consistency and reduce human errors, all selection operations are completed by the same person; in Photoshop, use the lasso tool to select the eye muscle area; after completing the selection, create a new layer and copy the selected area to the layer for subsequent processing and analysis; finally, obtain the selected pixel value of the target layer to prepare for the subsequent area calculation;
[0030] S22, area calculation formula: After the selection operation is completed and the pixel value of the selection is obtained, the actual value of the eye muscle area is calculated using the following formula; first, several key parameters are defined: the number of pixels in the selection, that is, the total number of pixels selected by the lasso measured in Photoshop; the total number of pixels, that is, the total number of pixels corresponding to the A4 paper; the actual area of A4 (square millimeters), the actual area of A4 paper is 62370 square millimeters; the calculation formula of the actual area is as follows:
[0031] Actual area in square centimeters = number of pixels in the selected area / total number of pixels * actual area in square millimeters of A4 / 100
[0032] Through the above steps and formulas, the true value of the eye muscle area is calculated, providing accurate reference data for model training and evaluation.
[0033] Furthermore, in order to ensure the uniformity of data annotation and reduce subjective errors, all annotations in S3 are performed by the same person, specifically:
[0034] S31, Use of annotation tools and models: In the annotation process, Roboflow tool was used for annotation, combined with the assistance of SAM model; the application of SAM model improved the accuracy and efficiency of annotation, making the annotation results more reliable;
[0035] S32, labeling method: The labeling process is divided into two steps: first, ignoring the fascia and non-eye muscle parts, completely restoring the operation of the sulfuric acid paper tracing method, and labeling the entire eye muscle area; second, removing the fascia and non-eye muscle parts, and only labeling the pure eye muscle area.
[0036] Furthermore, the YOLOv8Seg model selected in S4 has efficient image segmentation capabilities and can provide accurate real-time measurement in a complex slaughter line environment; the YOLOv8Seg model can accurately identify object boundaries and generate high-quality segmentation masks through a multi-scale feature extraction process, and is suitable for real-time prediction needs in a high-frequency production environment; the training process includes the training of two models, one is a model of a conventional eye muscle area, and the other is a model for intelligently extracting a pure eye muscle area; the training set and the validation set images are 162 and 40, respectively;
[0037] S41, selection of YOLOv8Seg model: The YOLOv8Seg model has an end-to-end feature, that is, the whole process from input image to output result is automatically processed, which is very suitable for real-time applications; both models use YOLOv8nSeg as the main model and use the ultralytics library for training; YOLOv8nSeg is very suitable for tasks that require efficient processing due to its lightweight and high-speed characteristics, so YOLOv8nSeg is selected as the main model;
[0038] S42, model training process: During the model training of the conventional eye muscle area, 200 epochs were set. When the training reached 195 rounds, the early stopping patience mechanism was triggered and the training was automatically terminated. The model training of the intelligent extraction of pure eye muscle area was completed for 200 rounds without triggering early stopping. The input image size was a resolution of 640×640, and RTX 3090GPU was used for training. During the training process, a variety of data enhancement techniques were applied, including hue, saturation, brightness adjustment intensity, as well as translation, scaling, and mosaic data enhancement.
[0039] Furthermore, the S5 uses the YOLOv8Seg model and the IntelRealSense D455 depth camera for depth image acquisition and processing. The specific steps are as follows:
[0040] S51, system initialization and data acquisition: real-time acquisition of RGB images and depth maps through the Intel RealSense D455 depth camera, configure camera parameters and start the data pipeline;
[0041] S52, model loading and reasoning: load the trained YOLOv8Seg model and process the collected images in real time;
[0042] S53, area calculation and result annotation: combining the depth map and the segmentation mask to calculate the actual area of the eye muscle; the specific method includes calculating the number of pixels and the average depth value of the mask area, and then combining the camera internal parameters and the correction factor to obtain the eye muscle area; the measurement results are displayed in real time on the image in the form of masks and labels, providing intuitive measurement results;
[0043] S54, data storage and recording: storing the processed image and calculation results as a video and a log file, the video records the processed image stream, and the log file records the area calculation result of each frame;
[0044] In terms of two-dimensional image processing, S6 uses the YOLOv8Seg model to process RGB images. The specific steps are as follows:
[0045] S61, system initialization and data acquisition: collect RGB images through a high-resolution camera;
[0046] S62, Model loading and reasoning: Load the trained YOLOv8Seg model, process the collected RGB image, and use the model to predict the target area in the image and generate a segmentation mask; use the efficient segmentation capability of the YOLOv8Seg model;
[0047] S63, area calculation and result annotation: combining the actual size of the image and the pixel area, calculating the actual area of the eye muscle; the specific method includes calculating the number of pixels in the mask area, and converting the actual area based on the physical size of the image; the measurement result is displayed in real time on the image by drawing a mask and a label;
[0048] S64, data storage and recording: storing the processed images and calculation results as CSV files and processed image files; the CSV files record the area calculation results of each image, and the processed image files are saved in a designated storage directory.
[0049] S7 is an important technological breakthrough in intelligently removing non-eye muscle parts. During the carcass cutting process, the eye muscle area is often affected by fascia and other non-eye muscle parts, which should not be included in the actual eye muscle area. Traditional methods face challenges in dealing with these problems and it is difficult to achieve accurate cutting and removal.
[0050] S71, Intelligent Removal of Non-Eye Muscle Part Labeling Method: In the intelligent removal of non-eye muscle part labeling method, the labeling strategy has changed. During the labeling process, while accurately marking the eye muscle area, special attention is paid to removing the fascia and other non-eye muscle parts next to the eye muscle area. These labeled data without non-eye muscle parts are used to train the deep learning model to ensure that the model can learn the precise eye muscle area features while avoiding unnecessary parts. Through this labeling strategy, the model can effectively distinguish between eye muscle and non-eye muscle parts during training, improving the accuracy of segmentation.
[0051] S72, intelligent removal of non-eye muscle parts model reasoning: During the model reasoning process, since the non-eye muscle parts are accurately removed during the annotation and training stages, the trained deep learning model can intelligently remove these parts in the application. In the application, the model can automatically segment the eye muscle area and remove the fascia and non-eye muscle parts. Through this method of intelligently removing non-eye muscle parts, automatic and high-precision eye muscle area segmentation is achieved, ensuring the accuracy and reliability of the measurement results.
[0052] S8 builds a real-time measurement system including image acquisition module, data processing module and result display module. The system has two methods, one is three-dimensional image measurement and the other is two-dimensional image measurement. It also contains two models, one is a model for measuring the entire eye muscle area and the other is a model for intelligently removing the non-eye muscle part. The specific steps are as follows:
[0053] S81, image acquisition module: uses high-speed cameras and depth cameras to collect three-dimensional data with depth maps in real time to ensure the comprehensiveness and accuracy of data acquisition; the depth map data provided by the depth camera enables the system to accurately measure the distance information in three-dimensional space, providing a reliable data basis for subsequent eye muscle area measurement; the camera and depth camera work synchronously;
[0054] S82, data processing module: Use the trained YOLOv8Seg model to perform real-time analysis and processing on the collected image data; the YOLOv8Seg model has efficient segmentation capabilities and can accurately segment the eye muscle area under complex backgrounds; the data processing module includes the application of two models: one for measuring the entire eye muscle area, and the other for intelligently removing the pure eye muscle area without the eye muscle part; the model aligns and fuses the RGB image with the depth image to ensure the accurate position of each segmented area in three-dimensional space; the eye muscle area is calculated by depth information and segmentation mask, and the data processing module calculates and records the eye muscle area immediately after segmentation;
[0055] S83, result display module: real-time display of measurement results, including drawing segmented areas and marking eye muscle areas; the display content is clear and intuitive, which is convenient for operators to monitor and check measurement results in real time; at the same time, the analyzed images are stored and visual reports are generated; the segmented areas and their area information are marked in the images, and detailed measurement data is provided; the measurement results are recorded in the form of CSV tables and log tables, including detailed data and timestamps for each measurement, which is convenient for subsequent review and data analysis; the system automatically saves and manages measurement data, provides historical data query and analysis functions, and supports breeding feedback and scientific research;
[0056] S84, data recording and storage: The measurement results are not only displayed in real time, but also stored as visual images, in which the segmented areas are clearly drawn and the areas are marked; in addition, the measurement results are recorded in CSV and log tables, including detailed data and timestamps for each measurement, which is convenient for subsequent review and data analysis;
[0057] Another object of the present invention is to provide a real-time intelligent measurement system for pig carcass eye muscle area based on deep learning, comprising:
[0058] Image acquisition module: used to collect three-dimensional data with depth map in real time using depth camera and high-resolution camera;
[0059] Data processing module: used to analyze image data using the trained YOLOv8Seg model, segment the eye muscle area and calculate the eye muscle area; the data processing module includes two models, one for measuring the entire eye muscle area and the other for intelligently removing the pure eye muscle area without the eye muscle part; the model aligns and fuses the RGB image with the depth image;
[0060] Result display module: used to display the measurement results in real time, including drawing segmented areas and marking eye muscle areas; the display content is clear and intuitive, which is convenient for operators to monitor and check the measurement results in real time; at the same time, it stores the analyzed images and generates visual reports; the measurement results are recorded in CSV and log tables, including detailed data and timestamps for each measurement;
[0061] Data recording and storage module: used to store the measurement results as visual images, in which the segmented areas are clearly drawn and the areas are marked;
[0062] Another object of the present invention is to provide a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the real-time intelligent measurement method of pig carcass eye muscle area based on deep learning.
[0063] Another object of the present invention is to provide a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to execute the steps of the real-time intelligent measurement method of pig carcass eye muscle area based on deep learning.
[0064] Another object of the present invention is to provide an information data processing terminal, which is used to implement the real-time intelligent measurement system of pig carcass eye muscle area based on deep learning.
[0065] In combination with the above technical solutions and the technical problems solved, the advantages and positive effects of the technical solutions to be protected by the present invention are as follows:
[0066] First, the present invention proposes a real-time intelligent measurement method and system for the eye muscle area of pig carcasses based on deep learning. The system combines deep images and two-dimensional images to develop an algorithm for the true value of the eye muscle area, and through an intelligent prediction model that removes the non-eye muscle part, it realizes full-process automated measurement, avoids manual operation errors, and provides more objective and reliable measurement data. The deep learning model has efficient real-time reasoning capabilities and can quickly output measurement results to meet the real-time requirements of high-frequency production environments. Compared with traditional manual and mechanical equipment measurements, solutions based on deep learning are low-cost and easy to deploy, which can significantly reduce production costs and improve economic benefits. At the same time, through the analysis of measurement data, a scientific basis is provided for breeding, breeding strategies are optimized, and breeding efficiency and effectiveness are improved. The system automatically records and visualizes the data of each measurement, provides detailed feedback information to breeders, and helps scientific breeding.
[0067] By introducing advanced deep learning technology and efficient system integration, the present invention changes the cumbersome and inefficient traditional eye muscle area measurement method, realizes the automation and intelligence of measurement, improves the measurement accuracy and efficiency, and ensures the objectivity and consistency of data. Accurate measurement data provides reliable support for breeding, optimizes breeding strategies, and promotes the development of scientific breeding. The automated measurement system not only reduces labor costs and improves economic benefits, but also improves the level of production management, promotes the intelligent process of the pork industry, and greatly enhances the market competitiveness of enterprises.
[0068] The present invention realizes real-time intelligent measurement of the eye muscle area of pig carcasses through deep learning technology, overcomes many shortcomings of traditional methods, and has significant innovation and broad application prospects. The YOLOv8Seg model is used to segment pig carcass images to achieve accurate measurement of eye muscle area. The system uses deep learning technology and real-time image processing to ensure stable and efficient accurate measurement in complex environments, reducing labor costs.
[0069] (1) Improved recognition accuracy: By using the YOLOv8Seg model and a high-quality proprietary dataset, the present invention significantly improves the accuracy of eye muscle area measurement, especially in complex slaughter environments. The YOLOv8Seg model can automatically identify and remove non-eye muscle parts when segmenting the eye muscle area, thereby improving the accuracy of the measurement.
[0070] (2) Enhance the generalization ability of the model: Utilize a variety of data enhancement techniques, such as hue, saturation, brightness adjustment, translation, scaling, and mosaic data enhancement, to ensure that the model can accurately measure the eye muscle area under different lighting, angles, and backgrounds, thereby reducing the impact of environmental changes on the measurement results.
[0071] (3) Adaptability and flexibility: Through the optimization of deep learning models and multiple experiments, flexible model selection is provided to adapt to different computing capabilities and application requirements. The YOLOv8Seg model not only performs well in object detection, but its segmentation capability also makes it highly adaptable in eye muscle area measurement.
[0072] (4) Real-time and high efficiency: Through deep learning technology and efficient system integration, the present invention realizes real-time measurement of eye muscle area. The system can also perform accurate measurements stably and efficiently in a complex slaughter line environment, significantly improving measurement efficiency and reducing labor costs. The real-time measurement function ensures the efficient operation of the production line and avoids production stagnation caused by measurement delays.
[0073] (5) Automation and intelligence: The system is fully automated and intelligent, without the need for human intervention. The system can automatically collect, process and store data, and generate detailed measurement logs to provide a scientific basis for subsequent review and data analysis. The automated measurement system not only improves production efficiency, but also reduces the labor intensity of operators and improves production management level.
[0074] The present invention overcomes many shortcomings of traditional methods through innovative technical solutions, realizes accurate measurement of the eye muscle area of pig carcasses, and has significant innovation and broad application prospects. By adopting the latest computer vision and deep learning technologies, the present invention not only improves the accuracy and efficiency of eye muscle area measurement, but also improves the stability and generalization ability of the model under different environmental conditions. The system can work stably in a complex slaughter line environment, reduce manual operation errors, and achieve high consistency and reliability of measurement results. This innovative technology greatly improves production efficiency, avoids production delays and stagnation, and ensures efficient operation of the slaughter line. Compared with traditional manual and mechanical measurement methods, this system has the characteristics of low deployment cost and simple maintenance, significantly reducing overall operating costs and reducing dependence on labor.
[0075] In addition, the system can record and analyze the data of each measurement, provide detailed feedback information for breeders, help optimize breeding strategies, improve breeding efficiency and effectiveness, and promote the development of scientific breeding. Through automated and intelligent management methods, the present invention promotes the technological upgrading and management optimization of the slaughtering industry. The system can continuously monitor and record production data, provide data support for enterprises, optimize production processes and management decisions, and improve the overall production management level. This technology not only improves production efficiency, but also ensures the transparency and traceability of the slaughtering process to meet increasingly stringent food safety and quality standards. The application of the system enables slaughtering companies to better respond to changes in market demand and improve product consistency and market competitiveness through precise data analysis and prediction. At the same time, the system provides a scientific basis for carcass grading. Through accurate eye muscle area measurement, combined with other indicators, carcass grading can be performed more accurately, thereby improving the added value and market recognition of the product.
[0076] In summary, the present invention realizes intelligent real-time measurement of pig carcass eye muscle area by introducing advanced deep learning technology, overcomes many shortcomings of traditional methods, and has significant innovation and broad application prospects. The application of this technology will greatly promote the automation and intelligentization of the slaughtering industry, provide strong technical support for improving production efficiency, reducing costs, optimizing breeding strategies and management, and bring significant economic benefits and technological progress.
[0077] Second, as auxiliary evidence of the inventiveness of the claims of the present invention, it is also reflected in the following important aspects:
[0078] (1) The expected benefits and commercial value of the technical solution of the present invention after transformation are:
[0079] The intelligent eye muscle area measurement system of the present invention has significant commercial value and expected benefits, especially in improving the production efficiency and management level of slaughterhouses. Through the accurate eye muscle area measurement technology, the management efficiency of the slaughter line is greatly improved, so that operators can perform more accurate production monitoring, product optimization and quality control, thereby improving overall production efficiency and output quality. In addition, this automated measurement method reduces the reliance on manual inspection, reduces labor costs, and significantly reduces problems caused by human errors, such as subjective errors of measurement personnel and inconsistent measurement standards.
[0080] The system's precise measurement capabilities can optimize the management process of the slaughterhouse. Through accurate area measurement, combined with other data, it provides a scientific basis for carcass grading. This not only improves product consistency and market competitiveness, but also significantly improves the efficiency of the slaughtering line. The application of the system can also optimize supply chain management, improve the transparency and traceability of the entire chain, and enhance consumers' trust in the product.
[0081] The system can record and analyze the data of each measurement, provide detailed feedback information for breeders, help optimize breeding strategies, improve breeding efficiency and effectiveness, and promote the development of scientific breeding. Through automated and intelligent management methods, the present invention promotes the technological upgrading and management optimization of the slaughtering industry. The system can continuously monitor and record production data, provide data support for enterprises, optimize production processes and management decisions, and improve the overall production management level.
[0082] This technology not only improves production efficiency, but also ensures transparency and traceability of the slaughtering process, helping to meet increasingly stringent food safety and quality standards. The system provides a scientific basis for carcass grading. Through accurate measurement of the muscle eye area and combined with other indicators, carcass grading can be performed more accurately, thereby increasing the added value and market recognition of the product. The application of the system enables slaughtering companies to better respond to changes in market demand and improve product consistency and market competitiveness through precise data analysis and prediction.
[0083] Finally, the large amount of data collected by the system can be used for in-depth analysis to provide data-driven decision support, such as optimizing breeding strategies and improving breeding efficiency and effectiveness. Through data analysis, breeders can better understand the key factors in the production process, make more scientific and effective breeding decisions, further improve the quality and effectiveness of breeding work, promote the development of scientific breeding, and enhance the competitiveness and market performance of enterprises.
[0084] In summary, the present invention is not only technically innovative and practical, but also shows great potential and value in commercial applications. Through the application of the present invention, enterprises can achieve more efficient and accurate production management, reduce costs, improve product quality and market competitiveness, while ensuring the hygiene and safety of products, and open up new markets and business opportunities.
[0085] (2) The technical solution of the present invention fills the technical gap in the industry at home and abroad:
[0086] The intelligent measurement system for pig carcass eye muscle area proposed in this invention represents an important breakthrough in the field of animal husbandry technology at home and abroad, filling the technical gap in the measurement of eye muscle area at the slaughter line. This system uses advanced deep learning technology, combined with unique data enhancement and intelligent removal of non-eye muscle parts, to provide an innovative solution for the accurate measurement and management of eye muscle. Compared with traditional mechanical measurement or other physical measurement methods, this invention shows obvious advantages and innovations in several key aspects:
[0087] High accuracy and reliability: Using the deep learning model YOLOv8Seg and the image dataset unique to the slaughter line, the system can achieve high measurement accuracy. Through subsequent continuous learning and optimization, the system can adapt to various slaughter environments and different breeds of pigs, ensuring accurate measurement of eye muscle area under various conditions.
[0088] Powerful data processing capabilities: The present invention can not only process complex image data, but also extract key features from it for precise measurement. At the same time, the data provided by the system supports decision-making and helps optimize production processes and management strategies. The system integrates the depth image and two-dimensional color image in the depth camera, realizes the synchronous processing of image and depth data, and ensures the accuracy and real-time performance of the data.
[0089] Feedback breeding support: The system can record and analyze the data of each measurement, provide detailed feedback information to breeders, help optimize breeding strategies, and improve breeding efficiency and effectiveness. Through data-driven decision support, companies can better understand the key factors in the breeding process and promote the development of scientific breeding.
[0090] Wide application potential: Although this system is mainly used for measuring the eye muscle area of pig carcasses, its technical framework and methods have broad application prospects. The modular design and flexibility of the system enable it to adapt to different application scenarios and needs, providing multiple possibilities for automated management of animal husbandry.
[0091] Through the above advantages and innovations, the present invention fills the gap in the industry at home and abroad in terms of technology, provides an efficient, accurate and reliable method for measuring the area of eye muscles, and promotes the technological progress and management optimization of the slaughtering industry. The wide application of the system can not only improve production efficiency and product quality, but also bring significant economic benefits and market competitiveness to breeding enterprises, and at the same time provide valuable technical support and inspiration for research and application in related fields.
[0092] (3) Whether the technical solution of the present invention solves the technical problems that people have been eager to solve but have not been able to solve successfully:
[0093] The intelligent eye muscle area measurement system of the present invention solves many long-standing technical problems in the automated measurement of slaughter lines, and meets the urgent demand for efficient and accurate measurement technology in the industry. Specifically, the present invention overcomes the following major problems:
[0094] Accuracy of automated measurement: Traditional mechanical measurement methods rely on manual operation, which is not only inefficient but also prone to errors and inconsistencies. This invention uses the deep learning model YOLOv8Seg, through high-precision image recognition and segmentation technology, to achieve accurate measurement of eye muscle area, completely solving the problems of errors and inefficiency in manual measurement.
[0095] Measurement stability in complex environments: The slaughter line environment is complex, and factors such as lighting conditions and operating speed will affect the measurement results. Traditional methods are difficult to maintain stability in various complex environments. This invention improves the generalization ability of the model in different environments and conditions through the application of data enhancement and deep learning technology, ensuring stable and accurate measurement in various complex environments.
[0096] Real-time and high efficiency: Traditional measurement methods require manual operation, which makes it difficult to achieve real-time measurement and data processing. This invention uses high-speed cameras and depth cameras, combined with deep learning models, to achieve real-time data acquisition, processing and display. The measurement results can be displayed in real time, and automatically stored and analyzed, greatly improving the measurement efficiency and the timeliness of data processing. The high efficiency of the system enables the production line to run seamlessly, avoiding production stagnation caused by measurement delays.
[0097] Data-driven decision support: Traditional measurement methods are difficult to provide sufficient data to support decision making. The present invention provides rich decision support information by automatically collecting and analyzing a large amount of measurement data. Through data analysis, breeding companies can optimize production processes, improve quality control, predict market demand, and achieve scientific and data-based management.
[0098] Feedback breeding support: The system can record and analyze the data of each measurement, provide detailed feedback information to breeders, help optimize breeding strategies, and improve breeding efficiency and effectiveness. Through data-driven decision support, companies can better understand the key factors in the breeding process and promote the development of scientific breeding. The system not only helps breeders select high-quality breeding individuals, but also allows breeders to improve and perfect breeding plans through historical data analysis and improve the overall breeding level.
[0099] In summary, the present invention solves many long-standing technical problems in the automated measurement of slaughter lines, and meets the industry's urgent need for efficient and accurate measurement technology. Through the application of the present invention, slaughtering companies can not only achieve efficient and accurate eye muscle area measurement, improve production efficiency and product quality, but also improve management level and market competitiveness through data-driven decision support. The breakthrough of this technology provides strong technical support for the modern management of the slaughtering industry and even the entire animal husbandry industry, and has broad application prospects and significant economic benefits.
[0100] (4) Whether the technical solution of the present invention overcomes technical prejudice:
[0101] The intelligent eye muscle area measurement system of the present invention overcomes various technical biases in the traditional slaughter line measurement method, breaks through the long-standing mindset and technical limitations in the industry, and is specifically embodied in the following aspects:
[0102] Transition from mechanical measurement to intelligent measurement: Traditional slaughter line measurement methods rely on mechanical equipment and manual operation, which have problems such as low efficiency, poor accuracy, and easy errors. Mechanical measurement methods are considered to be the only reliable solution, thus forming a technical bias. This invention successfully realizes intelligent eye muscle area measurement by introducing deep learning models and image processing technology, greatly improving measurement accuracy and efficiency, and changing the industry's inherent dependence on mechanical measurement methods.
[0103] Breaking through the reliance on manual measurement: Traditional slaughter line measurement methods are highly dependent on manual operation. Although manual measurement has errors and low efficiency, it has always been considered indispensable due to the limitations of technical means. This invention successfully realizes full-process automated measurement through automated image recognition and data processing technology, reduces the impact of human factors, significantly improves the accuracy and efficiency of measurement, and breaks through the technical prejudice against manual measurement.
[0104] Changing doubts about adaptability to complex environments: Traditional mechanical and manual measurement methods are difficult to maintain stability and efficiency in complex slaughter line environments. The industry generally believes that automated measurement technology is difficult to adapt to complex and changeable actual operating environments. This invention successfully achieves stable and accurate measurement in various complex environments through data enhancement technology and the high generalization ability of deep learning models, changing the industry's doubts and prejudices about the adaptability of automated measurement technology.
[0105] Innovation in data-driven decision-making: Traditional measurement methods often lack systematic data recording and analysis, and cannot provide effective support for management decisions. Data-driven decision-making has not yet been fully valued and applied in the slaughtering industry. This invention provides rich data support for management decisions through automated data collection and analysis, promotes the popularization and application of data-driven decision-making, and breaks the limitations of traditional management models.
[0106] Feedback breeding support: The system can record and analyze the data of each measurement, provide detailed feedback information to breeders, help optimize breeding strategies, and improve breeding efficiency and effectiveness. Through data-driven decision support, companies can better understand the key factors in the breeding process and promote the development of scientific breeding. This data analysis capability has changed the reliance on experience and intuition in the traditional breeding process, and significantly improved the scientificity and efficiency of breeding work.
[0107] In summary, the present invention overcomes a variety of technical prejudices and breaks through the long-standing technical limitations in the industry through an intelligent, efficient and accurate eye muscle area measurement method. Through the application of the present invention, slaughtering enterprises can not only achieve more efficient and accurate production management, improve product quality and market competitiveness, but also achieve scientific and modern management through data-driven decision support, providing strong technical support and innovative power for the development of the slaughtering industry and even the entire animal husbandry industry. BRIEF DESCRIPTION OF THE DRAWINGS
[0108] Figure 1 This is a flow chart of a real-time intelligent measurement method for pig carcass eye muscle area based on deep learning provided by an embodiment of the present invention.
[0109] Figure 2 This is a structural block diagram of a real-time intelligent measurement system for pig carcass eye muscle area based on deep learning provided in an embodiment of the present invention.
[0110] Figure 3 1 is a schematic diagram of the data acquisition process and preprocessing steps provided in an embodiment of the present invention, wherein (A) describes the sulfuric acid paper involved in the sulfuric acid paper tracing method, including the definitions of eye muscle length and eye muscle width; (B) represents the fascia area of the non-eye muscle part in the current measurement method; (C) represents other muscle areas of the non-eye muscle part, which are the shortcomings faced by the existing measurement methods.
[0111] Figure 4 1 is a comparison diagram of the eye muscle area measurement method provided by the embodiment of the present invention. (A) shows the measurement steps of the traditional sulfuric acid paper tracing method, which is cumbersome, including drawing with sulfuric acid paper, measuring length and width, and applying calculation formulas; (B) shows the intelligent eye muscle area measurement method based on computer vision in the present invention, which is simple, efficient, and can be achieved in one step.
[0112] Figure 5 : is a schematic diagram of the data set construction provided by an embodiment of the present invention, which describes the data set construction process. The training set and the validation set are divided into 162 training sets and 40 validation sets. The data comes from the data of 68 pigs in Huanggang, Hubei on May 25, divided in a ratio of 8:2. The data of the test set comes from the data of 115 pigs in Songyuan, Jilin from June 12 to 13, of which the three-dimensional images were originally 118 pigs, and 3 were damaged in the process.
[0113] Figure 6 : is a schematic diagram of eye muscle area data set collection provided by an embodiment of the present invention, (A) shows the process of using an Intel D455 camera to collect data; (B) shows the process of using a mobile phone and a mobile phone holder of a fixed height to complete data collection; (C) shows the sulfuric acid paper used for subsequent real value acquisition and conventional calculated value acquisition using the tracing method and annotating the eye muscle height and eye muscle width.
[0114] Figure 7 1 is a schematic diagram of the true value calculation process provided by an embodiment of the present invention, wherein (A) shows the scanning process of the sulfuric acid paper; (B) shows the process of selecting the eye muscle area by manual cutout after importing into Photoshop, for accurate calculation of the eye muscle area.
[0115] Figure 8 Schematic diagram of dataset annotation provided by an embodiment of the present invention, (A) shows conventional eye muscle dataset annotation, (B) shows dataset annotation after intelligently removing non-eye muscle parts, using annotation software Roboflow.
[0116] Fig. 9 It is a schematic diagram of eye muscle image input and output drawing provided by an embodiment of the present invention, which describes an eye muscle image input into a YOLOv8seg network structure, outputting a mask after model processing, and performing mask and label drawing.
[0117] Fig.10 It is a model training evaluation diagram provided by an embodiment of the present invention, (A) shows the normalized confusion matrix of the conventional eye muscle area model, (B) shows the F1-Confidence curve of the conventional eye muscle area model; (C) shows the normalized confusion matrix of the intelligent non-eye muscle part removal model, and (D) shows the F1-Confidence curve of the intelligent non-eye muscle part removal model.
[0118] Fig.11 It is a schematic diagram of the three-dimensional image video stream prediction result provided by an embodiment of the present invention, which shows the result of the three-dimensional image video stream prediction. It can be seen that the eye muscle part has been drawn with a blue mask, and there is a label next to it to show the measured area value.
[0119] Fig.12 It is a schematic diagram of the intelligent removal of non-eye muscle parts provided by an embodiment of the present invention, (A) is the original image disturbed by a large amount of fascia, (B) is the result of adding model prediction and drawing masks and labels on the basis of the original image, which mainly illustrates the intelligent removal of fascia tissue; (C) is the original image containing non-eye muscle parts, (D) is the result of adding model prediction and drawing masks and labels on the basis of the original image, which mainly illustrates the intelligent removal of non-eye muscle parts; (E) is the original image containing fascia and non-eye muscle parts, (F) is the result of adding model prediction and drawing masks and labels on the basis of the original image, which shows the intelligent removal effect of fascia and non-eye muscle parts. It can be seen that the drawing of the mask is concentrated on the real eye muscles, and the fascia tissue and non-eye muscle parts are not drawn.
[0120] Fig.13It is a fitting diagram of the calculated value and the true value of the eye muscle area provided by an embodiment of the present invention, (A) shows the correlation analysis of the calculated value and the true value of the eye muscle area, and (B) shows the ranking correlation analysis of the calculated value and the true value of the eye muscle area.
[0121] Fig.14 It is a fitting diagram of the true value of eye muscle area and the three-dimensional predicted value provided by an embodiment of the present invention, (A) shows the correlation analysis of the true value of eye muscle area and the three-dimensional predicted value, and (B) shows the ranking correlation analysis of the true value of eye muscle area and the three-dimensional predicted value.
[0122] Fig.15 It is a fitting diagram of the true value of eye muscle area and the two-dimensional predicted value provided by an embodiment of the present invention, (A) shows the correlation analysis of the true value of eye muscle area and the two-dimensional predicted value, and (B) shows the ranking correlation analysis of the true value of eye muscle area and the two-dimensional predicted value. DETAILED DESCRIPTION
[0123] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0124] like Figure 1 As shown, an embodiment of the present invention provides a real-time intelligent measurement method and system for pig carcass eye muscle area based on deep learning, comprising:
[0125] S1, unique dataset construction:
[0126] A unique dataset of 202 training and validation images was created. The images were collected from 68 pigs at a slaughterhouse in Huanggang, Hubei Province from different viewing angles of the eye muscle area.
[0127] Through multi-view and diverse images, the comprehensiveness and adequacy of model learning are ensured; the test set contains data on the eye muscle area of 115 pigs, collected at a slaughterhouse in Songyuan, Jilin;
[0128] S2, acquisition of the true value of eye muscle area:
[0129] The actual value of the eye muscle area is determined by scanning and selecting the traced sulfuric acid paper, and calculating the number of pixels in the selected area; the specific process includes using the traced sulfuric acid paper as the material, scanning it and importing it into the image editing software to perform the selection operation, and finally obtaining the real eye muscle area data through the area calculation formula;
[0130] S3, data annotation:
[0131] During the image annotation process, the conventional eye muscle area and the eye muscle area with the non-eye muscle part removed intelligently are annotated respectively;
[0132] S4, selection and training of deep learning models:
[0133] In the slaughter line environment, in order to achieve accurate real-time measurement, the YOLOv8Seg model for efficient image segmentation was selected. This model meets the needs of high-frequency production through multi-scale feature extraction and high-quality segmentation masks. During training, models were established for regular and pure eye muscle areas respectively, using YOLOv8n as the main model for training, and applying a variety of data enhancement techniques.
[0134] S5, develop an algorithm for determining the true value of eye muscle area based on depth images:
[0135] An eye muscle area calculation algorithm based on the YOLOv8Seg model and the Intel RealSense D455 depth camera was developed. By acquiring RGB and depth images in real time, the depth map and segmentation mask are used to calculate the number of pixels and average depth value in the mask area, and then combined with the camera intrinsic parameters and correction factors to obtain the actual area of the eye muscle. The results are displayed on the image in the form of masks and labels, and stored as video and log files.
[0136] S6, develop an algorithm for determining the true value of eye muscle area based on two-dimensional images:
[0137] Based on two-dimensional images, that is, ordinary RGB images, an algorithm that can accurately measure the eye muscle area is developed; the eye muscle area is finally obtained by predicting with a fixed height, using the fixed image range true value, and combining the segmentation results output by the YOLOv8Seg model through specific conversion parameters;
[0138] S7, intelligent eye muscle area prediction model with non-eye muscle removal: Deep learning is used to automatically identify and remove fascia and non-eye muscle parts to ensure the accuracy and reliability of eye muscle area measurement. The traditional method is difficult to accurately segment, and this system intelligently processes and solves this problem;
[0139] S8, Construction of real-time measurement system: Build a real-time measurement system, including image acquisition, data processing and result display modules, support 3D and 2D image measurement, and use cameras or depth cameras to collect data. Use deep learning models to analyze images in real time, segment the eye muscle area and remove the non-eye muscle part, and calculate the eye muscle area based on the image. Visualize the results in real time, and record the measurement data in tables and logs for easy review and analysis.
[0140] Further, in S1, a total of 202 images were collected, which were collected from different perspectives of 68 pigs in a slaughterhouse in Huanggang, Hubei; the data set was randomly divided according to a ratio of 8:2, of which 162 images were used as a training set and 40 images were used as a validation set; the test set contained image data of 118 pigs, including 3D image data of 115 pigs and RGB image data of 118 pigs;
[0141] S11, depth camera image acquisition: Use Intel RealSense D455 depth camera for image acquisition; the image acquisition time is controlled within 5 seconds to ensure the synchronization of high-quality images and depth data; the purpose of image acquisition is to better align the RGB stream and depth stream later;
[0142] S12, RGB image acquisition: Use a mobile phone and a stand to acquire RGB images; the height of the mobile phone from the pig carcass is fixed at 23 cm to ensure the consistency of image depth; the acquisition of RGB images provides basic data for subsequent image processing and analysis;
[0143] S13, sulfuric acid paper outlining method: The data of 118 pigs were processed by sulfuric acid paper outlining; the eye muscles of the pig carcasses were placed on sulfuric acid paper, and the outline of the eye muscles was manually traced; the outlined sulfuric acid paper was marked with the eye muscle width and eye muscle height by one person.
[0144] Further, the method for calculating the true value of the S2 eye muscle area adopts the following steps and methods to ensure the accuracy and consistency of the data;
[0145] S21, scanning and selection of sulphate paper: First, use the sulphate paper after tracing as the initial material; put the sulphate paper into the scanner for scanning to generate a high-resolution digital image; next, import these scanned images into Photoshop software; in order to ensure data consistency and reduce human errors, all selection operations are completed by the same person; in Photoshop, use the lasso tool to select the eye muscle area; after completing the selection, create a new layer and copy the selected area to the layer for subsequent processing and analysis; finally, obtain the selected pixel value of the target layer to prepare for the subsequent area calculation;
[0146] S22, area calculation formula: After the selection operation is completed and the pixel value of the selection is obtained, the actual value of the eye muscle area is calculated using the following formula; first, several key parameters are defined: the number of pixels in the selection, that is, the total number of pixels selected by the lasso measured in Photoshop; the total number of pixels, that is, the total number of pixels corresponding to the A4 paper; the actual area of A4 (square millimeters), the actual area of A4 paper is 62370 square millimeters; the calculation formula of the actual area is as follows:
[0147] Actual area in square centimeters = number of pixels in the selected area / total number of pixels * actual area in square millimeters of A4 / 100
[0148] Through the above steps and formulas, the true value of the eye muscle area is calculated, providing accurate reference data for model training and evaluation.
[0149] Furthermore, in order to ensure the uniformity of data annotation and reduce subjective errors, all annotations in S3 are performed by the same person, specifically:
[0150] S31, Use of annotation tools and models: In the annotation process, Roboflow tool was used for annotation, combined with the assistance of SAM model; the application of SAM model improved the accuracy and efficiency of annotation, making the annotation results more reliable;
[0151] S32, labeling method: The labeling process is divided into two steps: first, ignoring the fascia and non-eye muscle parts, completely restoring the operation of the sulfuric acid paper tracing method, and labeling the entire eye muscle area; second, removing the fascia and non-eye muscle parts, and only labeling the pure eye muscle area.
[0152] Furthermore, the YOLOv8Seg model selected in S4 has efficient image segmentation capabilities and can provide accurate real-time measurement in a complex slaughter line environment; the YOLOv8Seg model can accurately identify object boundaries and generate high-quality segmentation masks through a multi-scale feature extraction process, and is suitable for real-time prediction needs in a high-frequency production environment; the training process includes the training of two models, one is a model of a conventional eye muscle area, and the other is a model for intelligently extracting a pure eye muscle area; the training set and the validation set images are 162 and 40, respectively;
[0153] S41, selection of YOLOv8Seg model: The YOLOv8Seg model has an end-to-end feature, that is, the whole process from input image to output result is automatically processed, which is very suitable for real-time applications; both models use YOLOv8nSeg as the main model and use the ultralytics library for training; YOLOv8nSeg is very suitable for tasks that require efficient processing due to its lightweight and high-speed characteristics, so YOLOv8nSeg is selected as the main model;
[0154] S42, model training process: During the model training of the conventional eye muscle area, 200 epochs were set. When the training reached 195 rounds, the early stopping patience mechanism was triggered and the training was automatically terminated. The model training of the intelligent extraction of pure eye muscle area was completed for 200 rounds without triggering early stopping. The input image size was a resolution of 640×640, and RTX 3090GPU was used for training. During the training process, a variety of data enhancement techniques were applied, including hue, saturation, brightness adjustment intensity, as well as translation, scaling, and mosaic data enhancement.
[0155] Furthermore, the S5 uses the YOLOv8Seg model and the IntelRealSense D455 depth camera for depth image acquisition and processing. The specific steps are as follows:
[0156] S51, system initialization and data acquisition: real-time acquisition of RGB images and depth maps through the Intel RealSense D455 depth camera, configure camera parameters and start the data pipeline;
[0157] S52, model loading and reasoning: load the trained YOLOv8Seg model and process the collected images in real time;
[0158] S53, area calculation and result annotation: combining the depth map and the segmentation mask to calculate the actual area of the eye muscle; the specific method includes calculating the number of pixels and the average depth value of the mask area, and then combining the camera internal parameters and the correction factor to obtain the eye muscle area; the measurement results are displayed in real time on the image in the form of masks and labels, providing intuitive measurement results;
[0159] S54, data storage and recording: storing the processed image and calculation results as a video and a log file, the video records the processed image stream, and the log file records the area calculation result of each frame;
[0160] In terms of two-dimensional image processing, S6 uses the YOLOv8Seg model to process RGB images. The specific steps are as follows:
[0161] S61, system initialization and data acquisition: collect RGB images through a high-resolution camera;
[0162] S62, Model loading and reasoning: Load the trained YOLOv8Seg model, process the collected RGB image, and use the model to predict the target area in the image and generate a segmentation mask; use the efficient segmentation capability of the YOLOv8Seg model;
[0163] S63, area calculation and result annotation: combining the actual size of the image and the pixel area, calculating the actual area of the eye muscle; the specific method includes calculating the number of pixels in the mask area, and converting the actual area based on the physical size of the image; the measurement result is displayed in real time on the image by drawing a mask and a label;
[0164] S64, data storage and recording: storing the processed images and calculation results as CSV files and processed image files; the CSV files record the area calculation results of each image, and the processed image files are saved in a designated storage directory.
[0165] S7 is an important technological breakthrough in intelligently removing non-eye muscle parts. During the carcass cutting process, the eye muscle area is often affected by fascia and other non-eye muscle parts, which should not be included in the actual eye muscle area. Traditional methods face challenges in dealing with these problems and it is difficult to achieve accurate cutting and removal.
[0166] S71, Intelligent Removal of Non-Eye Muscle Part Labeling Method: In the intelligent removal of non-eye muscle part labeling method, the labeling strategy has changed. During the labeling process, while accurately marking the eye muscle area, special attention is paid to removing the fascia and other non-eye muscle parts next to the eye muscle area. These labeled data without non-eye muscle parts are used to train the deep learning model to ensure that the model can learn the precise eye muscle area features while avoiding unnecessary parts. Through this labeling strategy, the model can effectively distinguish between eye muscle and non-eye muscle parts during training, improving the accuracy of segmentation.
[0167] S72, intelligent removal of non-eye muscle parts model reasoning: During the model reasoning process, since the non-eye muscle parts are accurately removed during the annotation and training stages, the trained deep learning model can intelligently remove these parts in the application. In the application, the model can automatically segment the eye muscle area and remove the fascia and non-eye muscle parts. Through this method of intelligently removing non-eye muscle parts, automatic and high-precision eye muscle area segmentation is achieved, ensuring the accuracy and reliability of the measurement results.
[0168] S8 builds a real-time measurement system including image acquisition module, data processing module and result display module. The system has two methods, one is three-dimensional image measurement and the other is two-dimensional image measurement. It also contains two models, one is a model for measuring the entire eye muscle area and the other is a model for intelligently removing the non-eye muscle part. The specific steps are as follows:
[0169] S81, image acquisition module: uses high-speed cameras and depth cameras to collect three-dimensional data with depth maps in real time to ensure the comprehensiveness and accuracy of data acquisition; the depth map data provided by the depth camera enables the system to accurately measure the distance information in three-dimensional space, providing a reliable data basis for subsequent eye muscle area measurement; the camera and depth camera work synchronously;
[0170] S82, data processing module: Use the trained YOLOv8Seg model to perform real-time analysis and processing on the collected image data; the YOLOv8Seg model has efficient segmentation capabilities and can accurately segment the eye muscle area under complex backgrounds; the data processing module includes the application of two models: one for measuring the entire eye muscle area, and the other for intelligently removing the pure eye muscle area without the eye muscle part; the model aligns and fuses the RGB image with the depth image to ensure the accurate position of each segmented area in three-dimensional space; the eye muscle area is calculated by depth information and segmentation mask, and the data processing module calculates and records the eye muscle area immediately after segmentation;
[0171] S83, result display module: real-time display of measurement results, including drawing segmented areas and marking eye muscle areas; the display content is clear and intuitive, which is convenient for operators to monitor and check measurement results in real time; at the same time, the analyzed images are stored and visual reports are generated; the segmented areas and their area information are marked in the images, and detailed measurement data is provided; the measurement results are recorded in the form of CSV tables and log tables, including detailed data and timestamps for each measurement, which is convenient for subsequent review and data analysis; the system automatically saves and manages measurement data, provides historical data query and analysis functions, and supports breeding feedback and scientific research;
[0172] S84, data recording and storage: The measurement results are not only displayed in real time, but also stored as visual images, in which the segmented areas are clearly drawn and the areas are marked; in addition, the measurement results are recorded in CSV and log tables, including detailed data and timestamps for each measurement, which is convenient for subsequent review and data analysis;
[0173] Another object of the present invention is to provide a real-time intelligent measurement system for pig carcass eye muscle area based on deep learning, comprising:
[0174] Image acquisition module: used to collect three-dimensional data with depth map in real time using depth camera and high-resolution camera;
[0175] Data processing module: used to analyze image data using the trained YOLOv8Seg model, segment the eye muscle area and calculate the eye muscle area; the data processing module includes two models, one for measuring the entire eye muscle area and the other for intelligently removing the pure eye muscle area without the eye muscle part; the model aligns and fuses the RGB image with the depth image;
[0176] Result display module: used to display the measurement results in real time, including drawing segmented areas and marking eye muscle areas; the display content is clear and intuitive, which is convenient for operators to monitor and check the measurement results in real time; at the same time, it stores the analyzed images and generates visual reports; the measurement results are recorded in CSV and log tables, including detailed data and timestamps for each measurement;
[0177] Data recording and storage module: used to store the measurement results as visual images, in which the segmented areas are clearly drawn and the areas are marked;
[0178] Another object of the present invention is to provide a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the real-time intelligent measurement method of pig carcass eye muscle area based on deep learning.
[0179] Another object of the present invention is to provide a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to execute the steps of the real-time intelligent measurement method of pig carcass eye muscle area based on deep learning.
[0180] Another object of the present invention is to provide an information data processing terminal, which is used to implement the real-time intelligent measurement system of pig carcass eye muscle area based on deep learning.
[0181] Figure 3 1 is a schematic diagram of the data acquisition process and preprocessing steps provided in an embodiment of the present invention, wherein (A) describes the sulfuric acid paper involved in the sulfuric acid paper tracing method, including the definitions of eye muscle length and eye muscle width; (B) represents the fascia area of the non-eye muscle part in the current measurement method; (C) represents other muscle areas of the non-eye muscle part, which are the shortcomings faced by the existing measurement methods.
[0182] Figure 4 1 is a comparison diagram of the eye muscle area measurement method provided by the embodiment of the present invention. (A) shows the measurement steps of the traditional sulfuric acid paper tracing method, which is cumbersome, including drawing with sulfuric acid paper, measuring length and width, and applying calculation formulas; (B) shows the intelligent eye muscle area measurement method based on computer vision in the present invention, which is simple, efficient, and can be achieved in one step.
[0183] Figure 5: is a schematic diagram of the data set construction provided by an embodiment of the present invention, which describes the data set construction process. The training set and the validation set are divided into 162 training sets and 40 validation sets. The data comes from the data of 68 pigs in Huanggang, Hubei on May 25, divided in a ratio of 8:2. The data of the test set comes from the data of 115 pigs in Songyuan, Jilin from June 12 to 13, of which the three-dimensional images were originally 118 pigs, and 3 were damaged in the process.
[0184] Figure 6 : is a schematic diagram of eye muscle area data set collection provided by an embodiment of the present invention, (A) shows the process of using an Intel D455 camera to collect data; (B) shows the process of using a mobile phone and a mobile phone holder of a fixed height to complete data collection; (C) shows the sulfuric acid paper used for subsequent real value acquisition and conventional calculated value acquisition using the tracing method and annotating the eye muscle height and eye muscle width.
[0185] Figure 7 1 is a schematic diagram of the true value calculation process provided by an embodiment of the present invention, wherein (A) shows the scanning process of the sulfuric acid paper; (B) shows the process of selecting the eye muscle area by manual cutout after importing into Photoshop, for accurate calculation of the eye muscle area.
[0186] Figure 8 Schematic diagram of dataset annotation provided by an embodiment of the present invention, (A) shows conventional eye muscle dataset annotation, (B) shows dataset annotation after intelligently removing non-eye muscle parts, using annotation software Roboflow.
[0187] Fig. 9 It is a schematic diagram of eye muscle image input and output drawing provided by an embodiment of the present invention, which describes an eye muscle image input into a YOLOv8seg network structure, outputting a mask after model processing, and performing mask and label drawing.
[0188] Fig.10 It is a model training evaluation diagram provided by an embodiment of the present invention, (A) shows the normalized confusion matrix of the conventional eye muscle area model, (B) shows the F1-Confidence curve of the conventional eye muscle area model; (C) shows the normalized confusion matrix of the intelligent non-eye muscle part removal model, and (D) shows the F1-Confidence curve of the intelligent non-eye muscle part removal model.
[0189] Fig.11 It is a schematic diagram of the three-dimensional image video stream prediction result provided by an embodiment of the present invention, which shows the result of the three-dimensional image video stream prediction. It can be seen that the eye muscle part has been drawn with a blue mask, and there is a label next to it to show the measured area value.
[0190] Fig.12It is a schematic diagram of the intelligent removal of non-eye muscle parts provided by an embodiment of the present invention, (A) is the original image disturbed by a large amount of fascia, (B) is the result of adding model prediction and drawing masks and labels on the basis of the original image, which mainly illustrates the intelligent removal of fascia tissue; (C) is the original image containing non-eye muscle parts, (D) is the result of adding model prediction and drawing masks and labels on the basis of the original image, which mainly illustrates the intelligent removal of non-eye muscle parts; (E) is the original image containing fascia and non-eye muscle parts, (F) is the result of adding model prediction and drawing masks and labels on the basis of the original image, which shows the intelligent removal effect of fascia and non-eye muscle parts. It can be seen that the drawing of the mask is concentrated on the real eye muscles, and the fascia tissue and non-eye muscle parts are not drawn.
[0191] Fig.13 It is a fitting diagram of the calculated value and the true value of the eye muscle area provided by an embodiment of the present invention, (A) shows the correlation analysis of the calculated value and the true value of the eye muscle area, and (B) shows the ranking correlation analysis of the calculated value and the true value of the eye muscle area.
[0192] Fig.14 It is a fitting diagram of the true value of eye muscle area and the three-dimensional predicted value provided by an embodiment of the present invention, (A) shows the correlation analysis of the true value of eye muscle area and the three-dimensional predicted value, and (B) shows the ranking correlation analysis of the true value of eye muscle area and the three-dimensional predicted value.
[0193] Fig.15 It is a fitting diagram of the true value of eye muscle area and the two-dimensional predicted value provided by an embodiment of the present invention, (A) shows the correlation analysis of the true value of eye muscle area and the two-dimensional predicted value, and (B) shows the ranking correlation analysis of the true value of eye muscle area and the two-dimensional predicted value.
[0194] In order to prove the creativity and technical value of the technical solution of the present invention, the following detailed description is given of the application examples of the present invention in specific products or related technologies. These examples demonstrate the application effect of the present invention in an actual production environment and verify its feasibility and superiority in actual production.
[0195] Example: Application of COFCO Jiajiankang in Hubei Huanggang Slaughterhouse and Jilin Songyuan Slaughterhouse
[0196] Background: COFCO Jiajiankang is a large domestic pork production company. Its slaughterhouse needs an efficient and accurate measurement system to improve production management and pork quality assessment. The traditional method of measuring the eye muscle area is cumbersome, time-consuming and easily affected by human factors, and cannot meet the needs of modern production.
[0197] Implementation process:
[0198] (1) Data collection:
[0199] Intel's D455 depth camera is used for image acquisition in Hubei Huanggang Slaughterhouse and Jilin Songyuan Slaughterhouse to ensure high-quality image and depth data synchronization. The acquisition time is controlled within 5 seconds.
[0200] A mobile phone and a bracket were used to collect RGB images, and the height of the mobile phone from the pig carcass was fixed at 23 cm to ensure the consistency of image depth.
[0201] (2) Model training:
[0202] A unique dataset containing 202 training and validation images was established, with the images collected from 68 pigs with different eye muscle areas. The diversity and comprehensiveness of the dataset ensures that the model can work stably in various complex environments.
[0203] The YOLOv8Seg model is used for training, and a variety of data enhancement techniques are used to improve the generalization ability and accuracy of the model to ensure the efficiency and accuracy of the model.
[0204] (3) System integration and deployment:
[0205] Integrate depth imaging and two-dimensional imaging acquisition equipment in the slaughterhouse to collect image data of pig carcasses in real time.
[0206] The system uses the trained YOLOv8Seg model to analyze the image, automatically segment the eye muscle area, calculate the eye muscle area, and intelligently remove the non-eye muscle part.
[0207] Real-time display of measurement results, drawing of masks and display of area labels. The system automatically records and visualizes the data of each measurement, providing detailed feedback information.
[0208] 1. The measurement accuracy is significantly improved, and the error rate is reduced to less than 1%, ensuring the accuracy and consistency of the measurement data.
[0209] 2. The measurement speed has been greatly improved, and the eye muscle area measurement of 20 pig carcasses can be processed per minute to meet the needs of high-frequency production environments.
[0210] 3. Realize full-process automated measurement, reduce the need for manual operation, reduce labor costs, and improve production efficiency.
[0211] Commercial value and technical effect:
[0212] 1. Improve production efficiency: The automated measurement system significantly improves measurement efficiency and production speed, processing the measurement of 20 pig carcasses per minute, greatly increasing production capacity.
[0213] 2. Reduce labor costs: Fully automated measurement reduces the need for manual operation, reduces labor costs, and improves the economic benefits of the enterprise.
[0214] 3. Improve measurement accuracy and data reliability: By intelligently removing the non-eye muscle part, the accuracy and consistency of the measurement data are ensured, providing reliable data support for pork quality assessment.
[0215] 4. Support scientific breeding: The system automatically records and visualizes the data of each measurement, provides detailed feedback information for breeding, helps breeders select high-quality breeding individuals, and optimizes breeding strategies.
[0216] 5. Promote intelligent upgrading: The successful application of the system has promoted the automation and intelligent upgrading of the pork industry, and improved the market competitiveness and production management level of enterprises.
[0217] In summary, the invention has verified the creativity and technical value of its efficient and accurate automatic measurement system through its application examples in COFCO Jiajiankang Hubei Huanggang Slaughterhouse and Jilin Songyuan Slaughterhouse. By improving production efficiency, reducing labor costs, improving measurement accuracy and supporting scientific breeding, the invention has significantly improved the market competitiveness and economic benefits of enterprises, and provided strong technical support for the automation and intelligentization process of the pork industry.
[0218] The embodiments of the present invention have achieved some positive effects during the development or use process, and indeed have great advantages over the prior art. The following content is described in conjunction with data, charts, etc. of the test process.
[0219] Significant improvement in recognition accuracy: In the tests conducted, the eye muscle area segmentation model of this system performed well in terms of accuracy. The confusion matrix shows that the classification accuracy of this system on the test data set reached 1.00 ( Fig.10 (A)), the F1-Confidence curve shows that the system can maintain high efficiency at different confidence levels ( Fig.10 (B)).
[0220] Efficiency and cost savings: Theoretically, by implementing this system, the labor efficiency of the test eye muscle area measurement work is significantly improved, and the labor cost is reduced by about 30%. Due to the system's ability to identify diseases early and more optimized production management, the overall operating cost is reduced by about 20%. The system's automated and intelligent measurement reduces dependence on manual measurement and improves overall production efficiency and accuracy.
[0221] Real-time monitoring and data analysis effects: The data collected and analyzed during the experiment showed that the system can effectively measure the real-time data of the eye muscle area of pig carcasses, and timely visualize and record it. Through real-time data analysis, the system can provide fast and scientific decision support, optimize production processes and management strategies. These data not only help companies improve production efficiency, but also support scientific breeding decisions.
[0222] Accuracy performance analysis: Fit analysis of body length prediction: Fig.13 (A) shows the correlation analysis between the calculated and true values of eye muscle area. The equation of the fitting line is y=0.8767x+14.6161, and the fitting degree R 2 is 0.7872, and the correlation coefficient r is 0.8872. Fig.13 (B) shows the rank correlation analysis. The equation of the fitted line is y = 0.8993x + 5.9917, and the goodness of fit is R 2 The correlation coefficient r is 0.8087 and 0.8993. These results illustrate the relevance of the conventional method and verify the stability and accuracy of the system under different conditions.
[0223] Fitting analysis of true value and three-dimensional predicted value: Fig.14 (A) shows the correlation analysis between the true value of eye muscle area and the three-dimensional predicted value. The equation of the fitting line is y=0.7462x+19.0494, and the fitting degree R 2 is 0.7916, and the correlation coefficient r is 0.8897. Fig.14 (B) shows the rank correlation analysis. The equation of the fitted line is y = 0.8929x + 6.2142, and the goodness of fit is R 2 The correlation coefficient r is 0.7972 and the correlation coefficient r is 0.8929. This result shows that the correlation between the three-dimensional predicted value and the true value using the present invention is high, and the prediction effect is better than the conventional method, and there is no significant difference, indicating that the present invention can replace the previous conventional method. In addition, the present invention avoids the disadvantages of the conventional method being greatly influenced by subjectivity and being time-consuming and labor-intensive.
[0224] Fitting analysis of true value and two-dimensional predicted value:
[0225] Fig.15 (A) shows the correlation analysis between the true value of eye muscle area and the two-dimensional predicted value. The equation of the fitting line is y=0.7834x+19.1356, and the fitting degree R 2 is 0.7764, and the correlation coefficient r is 0.8811. Fig.15 (B) shows the rank correlation analysis. The equation of the fitted line is y = 0.8801x + 7.1339, and the goodness of fit is R 2 The result shows that the difference between the two-dimensional prediction and the true value is not large, and it can replace the conventional method. In addition, the equipment required for two-dimensional prediction is only an ordinary camera, which is cheaper than a depth camera and easy to promote.
[0226] Advantages of intelligent removal of non-eye muscle parts:
[0227] This system is not only comparable to conventional methods in accuracy, but also has the function of intelligently removing non-eye muscle parts. This is impossible with conventional methods. The present invention can truly and objectively analyze the eye muscle area, effectively removing the interference of fascia tissue and non-eye muscle parts, thereby improving the objectivity and accuracy of the measurement. This intelligent function greatly improves the practicality and reliability of the system, and ensures the accuracy and consistency of the measurement results.
[0228] Through the above tests and analysis, the eye muscle area intelligent measurement system of the present invention is not only technically innovative and practical, but also shows great potential and value in practical applications. The high precision, high efficiency and high reliability of the system make it have a wide range of application prospects in actual production scenarios, significantly improving production efficiency and product quality, and providing scientific breeding decision support and accurate information for enterprises.
[0229] The embodiments of the present invention can also be expanded in fields and applications. The following are specific implementation schemes:
[0230] 1. Extension of the model
[0231] Application of deep learning models or artificial intelligence models: Although YOLO is an efficient deep learning model, in order to enhance the versatility and flexibility of the solution, we can consider using other deep learning models (such as Faster R-CNN, SSD, RetinaNet, etc.) or integrating multiple models to improve the accuracy and robustness of eye muscle area measurement.
[0232] Model fusion strategy: The model fusion method can be used to fuse the prediction results of multiple deep learning models to improve the accuracy and stability of eye muscle area measurement.
[0233] 2. Expansion on the target
[0234] From eye muscle area to other measurable traits: Based on the existing eye muscle area measurement, by modifying and expanding the output layer of the deep learning model, it can simultaneously predict and output other distance traits (such as body length, waist circumference, etc.) or area traits (such as back fat thickness, muscle thickness, etc.).
[0235] Multi-task learning: Design a multi-task learning deep learning model that can learn and predict multiple traits simultaneously. By sharing the underlying convolutional layers, the model is able to learn common features between multiple tasks, thereby improving the prediction performance of each task.
[0236] 3. Application expansion
[0237] Cross-platform application development: Use cross-platform frameworks (such as ReactNative, Flutter or Electron, etc.) to develop Android applications and applets to ensure that the eye muscle area measurement software can run on multiple devices and provide a convenient user experience. Cloud services and API interfaces: Deploy the eye muscle area measurement algorithm to the cloud and provide services to the outside through the API interface. In this way, not only can the eye muscle area be measured by calling the API on various devices, but also the centralized storage and analysis of data can be achieved. Responsive design and optimization: Responsive design is carried out according to the screen size and resolution of different devices to ensure that the application can provide a good user experience on various devices. At the same time, the algorithm is optimized to adapt to the computing power and memory limitations of different devices. By adopting technical means such as the fusion of deep learning models or artificial intelligence models, multi-task learning, and cross-platform application development, accurate real-time measurement of pig carcass eye muscle area can be achieved, and the method can be extended to other measurable distance and area traits and a variety of convenient application platforms.
[0238] The implementation steps of the embodiment of the present invention are mainly divided into four parts: data collection, real-time area display, intelligent eye muscle area measurement without eye muscle parts, and data recording and area prediction automation. In data collection, two methods are used: one is to use the Intel RealSense D455 depth camera to collect RGB images and depth images of pig carcass eye muscles. The second is to use ordinary cameras such as mobile phones to collect RGB images, fix the height of the mobile phone from the eye muscle area to ensure the consistency of the image depth, predict the eye muscle area by fixing the height, and calculate the actual area in combination with specific conversion parameters.
[0239] The above collection and prediction can all be achieved in real time. The system segments the eye muscle area through the YOLOv8Seg model, calculates the number of pixels and the average depth value of the mask area, and combines the camera's intrinsic parameters and correction factors to obtain the eye muscle area. The area result is displayed in real time, and the specific value of the area is labeled on the image to facilitate real-time monitoring by operators.
[0240] In order to intelligently remove the non-eye muscle part of the eye muscle area measurement, a specific model is used to ensure the accuracy and reliability of the measurement results. During the model reasoning process, the eye muscle area can be automatically segmented and the fascia and non-eye muscle parts can be removed to improve the accuracy of the segmentation. The measurement results are as follows Fig.12 As shown, the image of the non-eye muscle part will not be included in the area calculation.
[0241] In terms of data recording and area prediction automation, the system automatically records the predicted eye muscle area each time during real-time measurement, and generates CSV files and log files. The CSV file records the area calculation results of each image, and the log file records detailed data and timestamps for subsequent analysis and review. The measurement results are not only displayed in real time, but also stored as visual images, clearly drawing the segmented areas and marking the areas. The system automatically saves and manages the measurement data, provides historical data query and analysis functions, and supports breeding feedback and scientific research.
[0242] In summary, the present invention realizes real-time and accurate measurement of pig carcass eye muscle area through deep learning technology and efficient image processing methods, providing important technical support for modern breeding and meat quality improvement. This method realizes a simpler and more objective eye muscle area measurement in an automated and intelligent way, meeting the needs of high-frequency and large-scale production.
[0243] It should be noted that the embodiments of the present invention can be implemented by hardware, software, or a combination of software and hardware. The hardware part can be implemented using dedicated logic; the software part can be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or dedicated design hardware. It can be understood by a person of ordinary skill in the art that the above-mentioned devices and methods can be implemented using computer executable instructions and / or contained in a processor control code, such as a carrier medium such as a disk, CD or DVD-ROM, a programmable memory such as a read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. Such code is provided on the carrier medium. The device and its modules of the present invention can be implemented by hardware circuits such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, etc., or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc., can also be implemented by software executed by various types of processors, and can also be implemented by a combination of the above-mentioned hardware circuits and software, such as firmware.
[0244] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principle of the present invention should be covered by the protection scope of the present invention.
Claims
1. A real-time intelligent measurement method for pig carcass eye muscle area based on deep learning, characterized in that: By developing a unique data set, obtaining the true value of the eye muscle area, data annotation, selecting and training a deep learning model, building an eye muscle area algorithm based on deep images and two-dimensional images, intelligently removing non-eye muscle parts, building a real-time measurement system, and model visualization and interpretability, accurate real-time measurement of the eye muscle area of pig carcasses is achieved; this method combines a deep learning model or an artificial intelligence model, uses multi-perspective and diverse image data, ensures the comprehensiveness and adequacy of the model learning, and provides efficient and accurate eye muscle area measurement results.
2. The real-time intelligent measurement method of pig carcass eye muscle area based on deep learning as claimed in claim 1, characterized in that: The following steps are involved: S1, unique dataset construction: A unique dataset of 202 training and validation images was created. The images were collected from 68 pigs at a slaughterhouse in Huanggang, Hubei Province from different viewing angles of the eye muscle area. Through multi-view and diverse images, the comprehensiveness and adequacy of model learning are ensured; the test set contains data on the eye muscle area of 115 pigs, collected at a slaughterhouse in Songyuan, Jilin; S2, acquisition of the true value of eye muscle area: The actual value of the eye muscle area is determined by scanning and selecting the traced sulfuric acid paper, and calculating the number of pixels in the selected area; the specific process includes using the traced sulfuric acid paper as the material, scanning it and importing it into the image editing software to perform the selection operation, and finally obtaining the real eye muscle area data through the area calculation formula; S3, data annotation: During the image annotation process, the conventional eye muscle area and the eye muscle area with the non-eye muscle part removed intelligently are annotated respectively; S4, selection and training of deep learning models: In the slaughter line environment, the YOLOv8Seg model for efficient image segmentation was selected to achieve accurate real-time measurement; this model meets the high-frequency production requirements through multi-scale feature extraction and high-quality segmentation masks; During training, models were established for the regular and pure eye muscle areas, YOLOv8n was used as the main model for training, and various data enhancement techniques were applied; S5, develop an algorithm for determining the true value of eye muscle area based on depth images: An eye muscle area calculation algorithm based on the YOLOv8Seg model and the Intel RealSense D455 depth camera was developed. The algorithm collects RGB and depth images in real time, uses the depth map and segmentation mask to calculate the number of pixels and average depth value in the mask area, and then combines the camera intrinsic parameters and correction factors to obtain the actual area of the eye muscle. The results are displayed on the image in the form of masks and labels, and stored as video and log files. S6, develop an algorithm for determining the true value of eye muscle area based on two-dimensional images: Based on two-dimensional images, that is, ordinary RGB images, an algorithm that can accurately measure the eye muscle area is developed; the eye muscle area is finally obtained by predicting with a fixed height, using the fixed image range true value, and combining the segmentation results output by the YOLOv8Seg model through specific conversion parameters; S7, intelligent eye muscle area prediction model with non-eye muscle removal: uses deep learning to automatically identify and remove fascia and non-eye muscle parts to ensure the accuracy and reliability of eye muscle area measurement. The traditional method is difficult to accurately segment, and this system intelligently processes and solves this problem; S8, construction of real-time measurement system: construct a real-time measurement system, including image acquisition, data processing and result display modules, supporting 3D and 2D image measurement, and using a camera or depth camera to collect data; The deep learning model is used to analyze images in real time, segment the eye muscle area and remove the non-eye muscle part, and calculate the eye muscle area based on the image; Visual results are displayed in real time, and measurement data are recorded in tables and logs for easy review and analysis.
3. The real-time intelligent measurement method of pig carcass eye muscle area based on deep learning as claimed in claim 2, characterized in that: In S1, a total of 202 images were collected, which were collected from different perspectives of 68 pigs in a slaughterhouse in Huanggang, Hubei; the data set was randomly divided according to a ratio of 8:2, of which 162 images were used as training sets and 40 images were used as validation sets; the test set contained image data of 118 pigs, including 3D image data of 115 pigs and RGB image data of 118 pigs; S11, depth camera image acquisition: Use Intel RealSense D455 depth camera for image acquisition; the image acquisition time is controlled within 5 seconds to ensure the synchronization of high-quality images and depth data; the purpose of image acquisition is to better align the RGB stream and depth stream later; S12, RGB image acquisition: Use a mobile phone and a stand to acquire RGB images; the height of the mobile phone from the pig carcass is fixed at 23 cm to ensure the consistency of image depth; the acquisition of RGB images provides basic data for subsequent image processing and analysis; S13, sulfuric acid paper outlining method: The data of 118 pigs were processed by sulfuric acid paper outlining; the eye muscles of the pig carcasses were placed on sulfuric acid paper, and the outline of the eye muscles was manually traced; the outlined sulfuric acid paper was marked with the eye muscle width and eye muscle height by one person.
4. The real-time intelligent measurement method of pig carcass eye muscle area based on deep learning as claimed in claim 2, characterized in that: The method for obtaining the true value of the S2 eye muscle area adopts the following steps and methods to ensure the accuracy and consistency of the data; S21, scanning and selection of sulphate paper: First, use the sulphate paper after tracing as the initial material; put the sulphate paper into the scanner for scanning to generate high-resolution digital images; next, import these scanned images into Photoshop software; in order to ensure data consistency and reduce human errors, all selection operations are completed by the same person; in Photoshop, use the lasso tool to select the eye muscle area; after completing the selection, create a new layer and copy the selected area to the layer for subsequent processing and analysis; Finally, the pixel values of the selected area of the target layer are obtained to prepare for the subsequent area calculation; S22, area calculation formula: After the selection operation is completed and the pixel value of the selection is obtained, the actual value of the eye muscle area is calculated using the following formula; first, several key parameters are defined: the number of pixels in the selection, that is, the total number of pixels selected by the lasso measured in Photoshop; The total number of pixels is the total number of pixels corresponding to A4 paper. The actual area of A4 paper is 62370 square millimeters. The calculation formula of the actual area is as follows: Actual area in square centimeters = number of pixels in the selected area / total number of pixels * actual area in square millimeters of A4 / 100; Through the above steps and formulas, the true value of the eye muscle area is calculated, providing accurate reference data for model training and evaluation.
5. The real-time intelligent measurement method of pig carcass eye muscle area based on deep learning as claimed in claim 2, characterized in that: In order to ensure the uniformity of data annotation and reduce subjective errors, all annotations in S3 are performed by the same person, specifically: S31, Use of annotation tools and models: In the annotation process, Roboflow tool was used for annotation, combined with the assistance of SAM model; the application of SAM model improved the accuracy and efficiency of annotation, making the annotation results more reliable; S32, annotation method: The annotation process is divided into two steps: first, ignoring the fascia and non-eye muscle parts, the operation of the sulfuric acid paper tracing method is completely restored to annotate the entire eye muscle area; Secondly, remove the fascia and non-ocular muscle parts and only mark the pure ocular muscle area.
6. The real-time intelligent measurement method of pig carcass eye muscle area based on deep learning as claimed in claim 2, characterized in that: The YOLOv8Seg (You Only Look Once) model selected in S4 has efficient image segmentation capabilities and can provide accurate real-time measurement in a complex slaughter line environment. The YOLOv8Seg model can accurately identify object boundaries and generate high-quality segmentation masks through a multi-scale feature extraction process, and is suitable for real-time prediction needs in a high-frequency production environment. The training process includes the training of two models, one is the model of the regular eye muscle area, and the other is the model of the intelligent extraction of the pure eye muscle area; the training set and validation set images are 162 and 40 respectively; S41, selection of YOLOv8Seg model: The YOLOv8Seg model has an end-to-end feature, that is, the whole process from input image to output result is automatically processed, which is very suitable for real-time applications; both models use YOLOv8n as the main model and use the ultralytics library for training; YOLOv8n is very suitable for tasks that require efficient processing due to its lightweight and high-speed characteristics, so YOLOv8n is selected as the main model; S42, model training process: During the model training of the conventional eye muscle area, 200 epochs were set. When the training reached 195 rounds, the early stopping patience mechanism was triggered and the training was automatically terminated. The model training of the intelligent extraction pure eye muscle area was completed for 200 rounds without triggering early stopping. The input image size was 640×640 resolution, and RTX 3090 GPU was used for training. During the training process, a variety of data augmentation techniques were applied, including hue, saturation, and brightness adjustment intensity as well as translation, scaling, and mosaic data augmentation.
7. The real-time intelligent measurement method of pig carcass eye muscle area based on deep learning as claimed in claim 2, characterized in that: The S5 uses the YOLOv8Seg model and the Intel RealSense D455 depth camera to collect and process depth images. The specific steps are as follows: S51, system initialization and data acquisition: real-time acquisition of RGB images and depth maps through the Intel RealSense D455 depth camera, configure camera parameters and start the data pipeline; S52, model loading and reasoning: load the trained YOLOv8Seg model and process the collected images in real time; S53, area calculation and result annotation: combining the depth map and the segmentation mask to calculate the actual area of the eye muscle; the specific method includes calculating the number of pixels and the average depth value of the mask area, and then combining the camera internal parameters and the correction factor to obtain the eye muscle area; the measurement results are displayed in real time on the image in the form of masks and labels, providing intuitive measurement results; S54, data storage and recording: storing the processed images and calculation results as videos and log files, where the video records the processed image stream and the log file records the area calculation results of each frame.
8. The real-time intelligent measurement method of pig carcass eye muscle area based on deep learning as claimed in claim 2, characterized in that: In terms of two-dimensional image processing, S6 uses the YOLOv8Seg model to process RGB images. The specific steps are as follows: S61, system initialization and data acquisition: collect RGB images through a high-resolution camera; S62, Model loading and reasoning: Load the trained YOLOv8Seg model, process the collected RGB image, and use the model to predict the target area in the image and generate a segmentation mask; use the efficient segmentation capability of the YOLOv8Seg model; S63, area calculation and result annotation: combining the actual size of the image and the pixel area, calculating the actual area of the eye muscle; the specific method includes calculating the number of pixels in the mask area, and converting the actual area based on the physical size of the image; the measurement result is displayed in real time on the image by drawing a mask and a label; S64, data storage and recording: storing the processed image and calculation results as a CSV file and a processed image file; The CSV file records the area calculation results of each image, and the processed image files are saved in the specified storage directory.
9. The real-time intelligent measurement method of pig carcass eye muscle area based on deep learning as claimed in claim 2, characterized in that: S7 specifically includes: S71, intelligent labeling method for removing non-eye muscle parts: In the labeling method for intelligent labeling method for removing non-eye muscle parts, the labeling strategy has changed; during the labeling process, while accurately marking the eye muscle area, special attention is paid to removing the fascia and other non-eye muscle parts next to the eye muscle area; these labeled data without non-eye muscle parts are used to train the deep learning model to ensure that the model can learn the precise features of the eye muscle area while avoiding unnecessary parts; through this labeling strategy, the model can effectively distinguish between eye muscle and non-eye muscle parts during the training process, thereby improving the accuracy of segmentation; S72, model reasoning for intelligent removal of non-eye muscle parts: During the model reasoning process, since the non-eye muscle parts are accurately removed during the labeling and training stages, the trained deep learning model can intelligently remove these parts in the application; in the application, the model can automatically segment the eye muscle area and remove the fascia and non-eye muscle parts.
10. The real-time intelligent measurement method of pig carcass eye muscle area based on deep learning as claimed in claim 2, characterized in that: S8 builds a real-time measurement system including image acquisition module, data processing module and result display module. The system has two methods, one is three-dimensional image measurement and the other is two-dimensional image measurement. It also contains two models, one is a model for measuring the entire eye muscle area and the other is a model for intelligently removing the non-eye muscle part. The specific steps are as follows: S81, image acquisition module: uses high-speed cameras and depth cameras to collect three-dimensional data with depth maps in real time to ensure the comprehensiveness and accuracy of data acquisition; the depth map data provided by the depth camera enables the system to accurately measure the distance information in three-dimensional space, providing a reliable data basis for subsequent eye muscle area measurement; the camera and depth camera work synchronously; S82, data processing module: Use the trained YOLOv8Seg model to perform real-time analysis and processing on the collected image data; the YOLOv8Seg model has efficient segmentation capabilities and can accurately segment the eye muscle area under complex backgrounds; The data processing module includes the application of two models: one for measuring the entire eye muscle area, and the other for the pure eye muscle area with non-eye muscle parts intelligently removed; The model aligns and fuses the RGB image with the depth image to ensure the accurate position of each segmented area in three-dimensional space; the eye muscle area is calculated using the depth information and segmentation mask, and the data processing module calculates and records the eye muscle area immediately after segmentation; S83, result display module: real-time display of measurement results, including drawing segmented areas and marking eye muscle areas; The display content is clear and intuitive, which is convenient for operators to monitor and check the measurement results in real time. At the same time, the analyzed images are stored and visual reports are generated. The segmented areas and their area information are marked in the images, providing detailed measurement data. The measurement results are recorded in CSV and log tables, including detailed data and timestamps for each measurement, which is convenient for subsequent review and data analysis. The system automatically saves and manages the measurement data, provides historical data query and analysis functions, and supports breeding feedback and scientific research. S84, data recording and storage: The measurement results are not only displayed in real time, but also stored as visual images, in which the segmented areas are clearly drawn and the areas are marked; in addition, the measurement results are recorded in CSV and log tables, including detailed data and timestamps for each measurement, to facilitate subsequent review and data analysis.
Citation Information
Cited By
Non-contact in-vivo pig eye muscle area determination method based on point cloud and deep learning
CN120807615A
Method, system and equipment for estimating eye muscle area and backfat thickness of live pig based on deep learning
CN122289214A
