Machine learning based pig carcass weight data evaluation system and method
By using a machine learning system to evaluate and optimize pig carcass image quality in real time, the problem of image instability during suspension was solved, and efficient and accurate pig carcass quality data evaluation was achieved.
Patent Information
- Application Number
- CN202610253303.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-03
- Publication Date
- 2026-05-29
AI Technical Summary
In existing technologies, slight swaying or rotation of pig carcasses during suspension leads to poor image stability and consistency, inaccurate feature extraction, and vibration causes image blurring, affecting the accuracy of quality data assessment.
The image quality is evaluated in real time by a machine learning-based quality optimization requirement judgment module, and necessary image quality enhancement and blur correction are performed. Combined with PID control and feedforward compensation to suppress vibration, image clarity is ensured.
This improved the accuracy and stability of pig carcass quality data assessment, reduced computational resource consumption, and enabled an efficient data assessment process.
Smart Images

Figure CN122116096A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of pig carcass quality data assessment and management technology, and in particular to a pig carcass quality data assessment system and method based on machine learning. Background Technology
[0002] Based on suspended conveyor technology, and combined with computer vision, deep learning, and traditional slaughtering and processing techniques, a pig carcass quality assessment process was constructed. The pig carcass grading device mainly includes a mechanical positioning device, image processing software, industrial cameras, carcass grading software, and a control system. Carcass images are acquired using industrial cameras, and convolutional neural networks (CNNs) are used to analyze the images to predict key quality parameters such as backfat thickness and lean meat percentage, ultimately achieving efficient and accurate carcass grading.
[0003] The mechanical positioning device in the pig carcass grading system works in conjunction with the suspended conveyor technology to transport pig carcasses along a predetermined path via tracks and suspension frames, significantly improving the efficiency and standardization of slaughtering and processing. Image acquisition is a fundamental step in pig carcass quality assessment. Industrial cameras capture images of pig carcasses, enabling automated acquisition on the production line. In the image preprocessing stage, image processing software employs techniques such as image enhancement and noise filtering to optimize image quality, laying the foundation for subsequent feature extraction and model analysis. The carcass grading software uses convolutional neural networks to construct analytical models targeting carcass features. By analyzing carcass images and morphological data, it predicts key parameters such as backfat thickness and lean meat percentage.
[0004] The control system, as the central hub of the pig carcass grading device, coordinates the operation of various modules such as mechanical positioning, image acquisition, and software analysis. Based on the quality parameters output by the grading software, it automatically executes grading decisions, ultimately achieving automated carcass sorting. The entire pig carcass grading device, through the deep integration of computer vision, deep learning, and traditional slaughtering and processing technologies, constructs a complete evaluation process from data acquisition to grading output.
[0005] For example, Chinese patent application CN120125141A discloses a smart identification and automated inbound / outbound management system for pork carcasses, comprising: a carcass acquisition module for collecting relevant data on pork carcasses; a model building module for establishing a three-dimensional standard carcass model with a spatial coordinate system for calculating the skin wrinkling degree and fat thickness of the pork carcass; an intelligent sorting module for setting thresholds for deviations in skin wrinkling degree and fat thickness of the pork carcasses and grading the pork carcasses according to the data; a carcass identification module for identifying and recording pork carcasses; an automated inbound / outbound module for selecting different inbound / outbound and delivery modes based on the classification level of the pork carcasses; and a process optimization module for optimizing and improving the existing production process.
[0006] For example, Chinese patent application CN112200446A discloses a method for comprehensive evaluation of pork quality, which includes obtaining sensory scores, edible quality scores, and nutritional scores of the pork to be evaluated. The comprehensive score is calculated as X × sensory score + Y × edible quality score + Z × nutritional score, where X = 47%–53%, Y = 32%–38%, and Z = 100% - XY. The maximum score for each of the sensory score, edible quality score, and nutritional score is 10 points. The quality of the pork is determined based on the obtained comprehensive score.
[0007] The above-mentioned technology has at least the following technical problems:
[0008] In existing technologies, the slight swaying or rotation of the carcass during suspension can alter the angles of its inner and outer surfaces relative to the camera, affecting image stability and consistency. During suspension, the carcass muscles and adipose tissue sag or stretch due to gravity, resulting in variations in surface shape and texture at different times. Certain areas (such as the inner thighs and abdominal folds) may be obscured during suspension, affecting the complete acquisition of key features (such as fat distribution and muscle texture). Furthermore, the camera angle determines the visibility and projection distortion of carcass features in the image. For example, the inner surface is the exposed cross-section after the carcass is split open, containing crucial information such as fat thickness and muscle texture. The camera must be directly facing the inner surface to reduce perspective distortion and ensure accurate feature measurement. An angle deviation may lead to blurred fat edges or texture distortion. Inappropriate lighting angles can cause excessive shadows on the carcass surface, affecting feature extraction. For example, if the light shines from directly above, details on the lower side of the carcass may be lost due to shadows. The surface of the carcass (especially the fat layer) has strong reflective properties. If light shines directly on the surface of the carcass, it can easily create highlight areas and obscure details.
[0009] Furthermore, uneven distribution of pig carcasses or other materials on the conveyor can cause the center of gravity of the suspension device to shift, resulting in vibration during operation. When the conveyor is carrying pig carcasses or other materials, the acceleration or deceleration of mechanical components during start-up and shutdown generates a certain impact force. This impact force is transmitted through mechanical structures such as chains and tracks, thus inducing vibration. Additionally, the inertia of the load generates a reaction force at the moment of start-up and shutdown, which also causes slight swaying or vibration of the conveyor. Vibration can cause slight displacement or swaying of the pig carcass during image acquisition, leading to image blurring or distortion and resulting in low accuracy in assessing pig carcass quality data. Summary of the Invention
[0010] To address the technical problem of low accuracy in pig carcass quality data assessment in existing technologies, this invention provides a machine learning-based pig carcass quality data assessment system and method. The technical solution is as follows:
[0011] On the one hand, a machine learning-based pig carcass quality data evaluation system is provided. This system includes: a quality optimization need judgment module, a quality influencing factor judgment and optimization module, and a pig carcass quality data quantification module. Specifically, the quality optimization need judgment module acquires initial pig carcass images using an industrial camera in a pig carcass grading device. Based on image parameters reflecting the quality of the initial pig carcass images, it determines whether there is a need for image quality optimization. If so, it sends an instruction reflecting the image quality influencing factors such as lighting conditions, equipment configuration, and transmission interference in the image acquisition environment; otherwise, it inputs the pig carcass quality data into the machine learning model for pig carcass quality data quantification. The image quality impact factor determination and optimization module is used to perform image acquisition confidence assessment after receiving instructions to measure the reliability of image acquisition. Based on the image acquisition confidence assessment results, it determines whether to perform image quality enhancement to improve the overall visual effect of the initial pig carcass image. If image quality enhancement is not performed, it further determines whether to perform image blur correction to restore the edge and texture details of the initial pig carcass image. The pig carcass quality data quantization module is used to input the pig carcass quality data into the machine learning model for pig carcass quality data quantification after image quality optimization to reduce interference in the initial pig carcass image, and feeds back the quantization results to the preset personnel.
[0012] On the other hand, a machine learning-based method for evaluating pig carcass quality data is provided. This method is applied to a machine learning-based pig carcass quality data evaluation system. The method includes: S1, acquiring initial pig carcass images through an industrial camera in a pig carcass grading device; determining whether there is a need for image quality optimization based on image parameters reflecting the quality of the initial pig carcass images; if so, sending an instruction reflecting the image quality influencing factors such as lighting conditions, equipment configuration, and transmission interference in the image acquisition environment; otherwise, inputting the pig carcass quality data into a machine learning model for pig carcass quality data quantification. Image quality optimization includes image quality... Enhancement and image blur correction; S2, after receiving the instruction, perform image acquisition confidence assessment to measure the reliability of image acquisition, and determine whether to perform image quality enhancement to improve the overall visual effect of the initial pig carcass image based on the image acquisition confidence assessment result. If image quality enhancement is not performed, further determine whether to perform image blur correction to restore the edge and texture details of the initial pig carcass image; S3, after image quality optimization to reduce interference in the initial pig carcass image, input the optimized pig carcass quality data into the machine learning model for pig carcass quality data quantization, and feed back the quantization result to the preset personnel.
[0013] The beneficial effects of the technical solutions provided in the embodiments of the present invention include at least the following:
[0014] 1. By analyzing the image parameters of the initial pig carcass images, it is determined whether image quality optimization is needed. If optimization is required, factors affecting image quality are assessed, avoiding unnecessary calculations for all pig carcass images. If optimization is not performed, pig carcass quality data is directly quantified, significantly shortening the evaluation cycle. Then, image acquisition confidence is assessed, reflecting the stability of the current image acquisition state and providing a basis for subsequent image quality enhancement. Image quality enhancement effectively addresses issues such as uneven lighting and improper exposure, improving the visual quality of pig carcass images. The process involves measuring the image and then determining whether to perform image blur correction. If image blur correction is performed, it can accurately repair local detail loss issues such as motion blur and inaccurate focus, restoring key edge and texture information. If image blur correction is not performed, it can avoid over-processing the pig carcass image, saving computational resources and achieving the best balance between repair effect and processing efficiency. Finally, the optimized pig carcass image is input into a machine learning model to quantify pig carcass quality data, which can fundamentally ensure the accuracy of the machine learning model's analysis results, thereby improving the accuracy of pig carcass quality data assessment.
[0015] 2. By acquiring the image acquisition confidence level, the system processes images in stages to avoid unnecessary computational overhead. If the confidence level is less than the first image acquisition confidence threshold, a preset personnel image acquisition anomaly is detected, and a backup image acquisition device is automatically switched to reduce interruptions caused by hardware failures or environmental changes. If the confidence level is not less than the second image acquisition confidence threshold, motion blur determination is performed directly; otherwise, image quality enhancement is performed. Image quality is monitored in real time to prevent images of excessively low quality from undergoing image quality optimization. Finally, histogram equalization and feature matching are combined to optimize image acquisition in real time. By redistributing the grayscale values of image pixels, the overall contrast is enhanced, making the grayscale distribution of the image more uniform. Feature matching is used to verify that the features of the enhanced image have not been destroyed, ensuring the reliability of image feature extraction. While image quality enhancement can optimize image quality, histogram equalization can overstretch local grayscale when strong reflections (such as highlights in the fat layer) and deep shadows (such as abdominal folds) are present on the surface of the pig carcass. This leads to overexposure in highlight areas and loss of detail in shadow areas. First, multi-level denoising significantly reduces image noise and artifacts, providing a color-accurate image foundation for subsequent image quality enhancement. Then, through enhancement models and contrast stretching, shadow and highlight details in the pig carcass image can be restored, solving the local overexposure / underexposure problem. Next, edge-preserving filtering and contrast stretching work together to improve the contour sharpness in the pig carcass image. Finally, combining prior knowledge of the carcass, the pig carcass is corrected, thus providing semantically correct input for subsequent quantification of pig carcass quality data and avoiding semantic errors caused by the algorithm (such as misclassifying fat as muscle).
[0016] 3. By determining whether image blur correction is needed based on the motion blur length, and then combining PID control and feedforward compensation, a reverse force can be generated more quickly and accurately to suppress vibration, effectively reducing the degree of image blur caused by vibration. This lays the foundation for obtaining clear images of pig carcasses. Finally, different feedforward gain acquisition methods are adopted according to the stability of the pig carcass weight. This ensures that when the weight is stable, the feedforward gain is obtained by mapping using a pre-established feedforward gain mapping set, which can quickly and accurately determine the feedforward gain. However, when the weight fluctuates greatly, it may not be possible to accurately map to a suitable feedforward gain. Therefore, adaptive filtering is used to adjust the feedforward gain in real time to adapt to the vibration compensation needs of pig carcasses of different weights, ensuring the vibration compensation effect and further improving the accuracy and adaptability of image blur correction. To address the issue of motion blur remaining in images due to actuator saturation, control delay, and other factors failing to completely suppress vibration, this method accurately records the motion trajectory of the pig carcass during image exposure. This provides a precise motion trajectory for subsequent Wiener filtering deconvolution processing, enabling more targeted removal of motion blur. The motion trajectory during image exposure is then input into the Wiener filter for deconvolution, effectively suppressing linear motion blur and improving the quality of the pig carcass image. Finally, guided filtering smoothing effectively suppresses artifacts generated after deconvolution, further optimizing the quality of the pig carcass image. This results in a clearer, more realistic image that more accurately reflects the actual condition of the pig carcass, reducing the interference of motion blur and improving the accuracy and stability of pig carcass quality data assessment. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a flowchart of pig carcass quality data evaluation provided in an embodiment of the present invention;
[0019] Figure 2 This is a schematic diagram of the structure of the machine learning-based pig carcass quality data evaluation system provided in an embodiment of the present invention;
[0020] Figure 3 This is a schematic diagram of the structure of the pig carcass grading device provided in an embodiment of the present invention;
[0021] Figure 4 This is a flowchart of a machine learning-based method for evaluating pig carcass quality data, provided in an embodiment of the present invention.
[0022] Figure 5 This is a flowchart of image quality enhancement provided in an embodiment of the present invention. Detailed Implementation
[0023] This application provides a machine learning-based system and method for evaluating pig carcass quality data, which solves the problem of low accuracy in pig carcass quality data evaluation in the prior art. The system determines whether image quality optimization is needed based on the image parameters of the initial pig carcass image. If not, the system directly quantifies the pig carcass quality data. If so, it determines whether image quality enhancement is needed based on the image acquisition confidence assessment results. If image quality enhancement is not needed, it further determines whether image blur correction is required. Finally, the optimized pig carcass quality data is quantified, thereby improving the accuracy of pig carcass quality data evaluation.
[0024] To better understand the above technical solutions, the technical solutions of the present invention will be described below with reference to the accompanying drawings.
[0025] like Figure 1 The flowchart shown for evaluating pig carcass quality data has the following specific logic: First, acquire an initial pig carcass image. If the image signal-to-noise ratio (SNR) is greater than that of the reference image, input the pig carcass quality data into a machine learning model for quantification. Otherwise, determine the factors influencing image quality. If the factors influencing image quality are determined, assess the image acquisition confidence level. If the image acquisition confidence level is less than the first image acquisition confidence threshold, indicate an abnormal image acquisition by the preset personnel and automatically switch to a backup image acquisition device. If the image acquisition confidence level is not less than the first image acquisition confidence threshold... If the image quality score is less than the second image acquisition confidence threshold, image quality enhancement is performed. If the image acquisition confidence score is not less than the second image acquisition confidence threshold, motion blur determination is performed. If the signal-to-noise ratio of the enhanced image is greater than the signal-to-noise ratio of the reference image, the pig carcass quality data is directly quantized; otherwise, motion blur determination is performed. Specifically, if the motion blur length is greater than the reference motion blur length, image blur correction is performed; otherwise, feedback is sent to the preset personnel. After image blur correction, the pig carcass quality data is input into the machine learning model for pig carcass quality data quantization.
[0026] Example 1: This embodiment of the invention provides a system and method for evaluating pig carcass quality data based on machine learning. For example... Figure 2 The diagram shows the structure of a machine learning-based pig carcass quality data assessment system. This system includes: a quality optimization need judgment module, a quality influencing factor judgment and optimization module, and a pig carcass quality data quantification module. Figure 3The schematic diagram of the pig carcass grading device shown includes a software system, an industrial camera, lights, a signal source, a pig carcass, and a positioning device. The software system includes image processing software, carcass grading software, and a control system. The signal source provides signals to the camera, mechanical device, and software system, which are signals related to taking pictures, grasping and releasing the carcass, and the carcass position, respectively.
[0027] The quality optimization requirement judgment module is used to acquire initial pig carcass images through an industrial camera in the pig carcass grading device (the installation position is set by preset personnel) to obtain complete and clear pig carcass images. Based on image parameters reflecting the quality of the initial pig carcass image, it determines whether there is a need for image quality optimization. If so, it sends an instruction reflecting the image quality influencing factors such as lighting conditions, equipment configuration, and transmission interference in the image acquisition environment. Otherwise, it inputs the pig carcass quality data into a machine learning model for pig carcass quality data quantification. Image quality optimization includes image quality enhancement and image blur correction. It can determine in real time whether the acquired initial pig carcass image meets the input requirements of the machine learning model, avoiding errors in pig carcass quality data quantification caused by excessively low image quality.
[0028] The quality influencing factor determination and optimization module is used to assess the image acquisition confidence level after receiving instructions to measure the reliability of image acquisition, quantitatively determine the image acquisition environment, improve the ability to perceive abnormal working conditions, and determine whether to perform image quality enhancement to improve the overall visual effect of the initial pig carcass image based on the image acquisition confidence level assessment results. If image quality enhancement is not performed, it further determines whether to perform image blur correction to restore the edge and texture details of the initial pig carcass image. By selecting image quality optimization measures that are more in line with the current working conditions, unnecessary computational resource consumption is reduced, thereby improving the clarity of the initial pig carcass image and providing a basis for the subsequent quantification of pig carcass quality data.
[0029] The pig carcass quality data quantification module is used to input pig carcass quality data into a machine learning model after image quality optimization to reduce interference from the initial pig carcass image. The quality-optimized image provides the machine learning model with cleaner and more complete features, improving the accuracy of pig carcass quality data quantification. The quantification results are fed back to preset personnel in real time, providing decision-making basis for pig carcass grading and quality inspection personnel, thereby improving the accuracy of pig carcass quality data assessment.
[0030] Furthermore, based on image parameters reflecting the quality of the initial pig carcass image, it is determined whether there is a need for image quality optimization. The specific process is as follows:
[0031] The image signal-to-noise ratio (SNR) is calculated by ratioing the power of the effective signal (i.e., the signal that truly reflects the characteristics of the pig carcass) in the initial pig carcass image (such as the pixel value variance of the effective feature region) to the power of noise (such as random interference generated during image acquisition, equipment thermal noise, etc.) (such as the pixel value variance of the background region). A higher SNR means better image quality and a clearer presentation of the details and features of the pig carcass. If the image SNR is greater than the reference image SNR (set by preset personnel), it indicates that there is no need for image quality optimization. Quantifying pig carcass quality data can obtain pig carcass quality information in a timely and accurate manner. Machine learning models can extract features of the pig carcass more accurately, thereby improving the accuracy and reliability of pig carcass quality data quantification.
[0032] If not, it indicates a need for image quality optimization. The process involves determining factors influencing image quality, including image acquisition confidence assessment and motion blur determination. Further analysis and judgment of these factors allow for the implementation of corresponding image quality optimization measures to improve the initial pig carcass image quality. This prevents deviations in pig carcass quality data assessment due to image quality issues, thereby enhancing the accuracy and reliability of pig carcass quality data assessment.
[0033] In this embodiment, the above steps enable rapid preliminary screening of image quality, avoiding image quality optimization for all initial pig carcass images, saving computing resources and time costs, and improving the operational efficiency of pig carcass quality data evaluation.
[0034] Furthermore, the specific methods for evaluating the confidence level of image acquisition are as follows:
[0035] First, relative deviation processing is performed on the image measured area of a calibration object (i.e., an object of known size and shape) used to provide a size relationship reference between the initial pig carcass image and the actual pig carcass, and the actual area of the calibration object, to obtain an image distortion coefficient, which measures the degree of geometric distortion of the pig carcass in the image caused by the shooting angle. First, an edge detection algorithm (such as the Canny algorithm) is used to detect the edges of the calibration object in the image. Then, a contour extraction algorithm (such as the findContours function) is used to extract the contour of the calibration object from the edge image. Finally, the contourArea function is used to calculate the area enclosed by the extracted contour, i.e., the image measured area. The relative deviation processing in this application refers to dividing the absolute value of the difference between the actual value and the reference value by the reference value, used to measure the difference between the two values. The degree of deviation between values; the calibration object and the reference illumination non-uniformity coefficient are set by preset personnel; the image distortion coefficient and the illumination non-uniformity contrast coefficient are relatively independent in affecting image quality, but they also work together. For example, in a severely distorted image, if there is also illumination non-uniformity, it will make the features of the pig carcass in the image more difficult to identify accurately; and image distortion may cause changes in the brightness distribution of different areas in the image. For example, when the pig carcass image is tilted and distorted, the originally uniform illumination may produce local brightness changes in the distorted image, increasing the difference between the maximum and minimum brightness, that is, increasing the brightness extreme contrast coefficient. This change is not due to the change in actual lighting conditions, but due to image distortion.
[0036] Secondly, the standard deviation of brightness in each region of the initial pig carcass image is denoted as the illumination non-uniformity coefficient. The illumination non-uniformity coefficient is compared with the reference illumination non-uniformity coefficient to obtain the illumination non-uniformity contrast coefficient, which reflects the difference in brightness in different regions of the initial pig carcass image. The contrast processing in this application represents ratio calculation. The color image is converted into a grayscale image using a weighted average method. After reading the grayscale image using the OpenCV library, the brightness of each pixel can be obtained by accessing the element values in the image matrix. The weights in the weighted average are based on the sensitivity of the human eye to different colors and international standards (such as ITU-R BT.601). For example, the weight of the red channel is 0.299, the weight of the green channel is 0.587, and the weight of the blue channel is 0.114. Illumination non-uniformity is an important reason for the increase of the brightness extreme value contrast coefficient. When the illumination distribution in the image is uneven, some areas will inevitably be too bright and some areas will be too dark, thus increasing the difference between the maximum brightness and the minimum brightness, i.e., increasing the brightness extreme value contrast coefficient.
[0037] Then, the brightness of each region in the initial pig carcass image is sorted in descending order to obtain the maximum and minimum brightness. The maximum and minimum brightness are compared to obtain the extreme brightness contrast coefficient, which reflects the extreme differences in brightness in the initial pig carcass image. The larger the extreme brightness contrast coefficient, the more likely there are overly bright or dark areas in the initial pig carcass image, affecting image quality. An excessively large extreme brightness contrast coefficient may also mask image distortion problems. If there are overly bright or dark areas in the image, it may blur the edges of the pig carcass, leading to inaccurate edge detection, interfering with the accurate judgment of the pig carcass shape, and making the calculation of the image distortion coefficient inaccurate.
[0038] Finally, an image confidence balance parameter is introduced to perform inverse proportional weighting coupling on the image deformation coefficient, illumination unevenness contrast coefficient, and brightness extreme value contrast coefficient to obtain the image acquisition confidence score. The image acquisition confidence score is used to quantitatively evaluate the reliability of image acquisition. The specific constraint expression for the image acquisition confidence score is as follows: In the formula, B represents the image acquisition confidence of the initial pig carcass image, B1 represents the image deformation coefficient of the initial pig carcass image, B2 represents the illumination non-uniformity contrast coefficient of the initial pig carcass image, B3 represents the brightness extreme value contrast coefficient of the initial pig carcass image, α1 represents the first image confidence balance parameter, α2 represents the second image confidence balance parameter, and α3 represents the third image confidence balance parameter.
[0039] The image confidence balance parameters involved are obtained from a preset database and set by preset personnel. Specifically, they include a first image confidence balance parameter, a second image confidence balance parameter, and a third image confidence balance parameter, the sum of which is 1. For example, the clean air output contrast coefficient and the first image confidence balance parameter form a corresponding first image confidence balance parameter mapping set. The real-time clean air output contrast coefficient is input into the first image confidence balance parameter mapping set to obtain the first image confidence balance parameter. The first image confidence balance parameter represents the degree of influence of the image distortion coefficient on the image acquisition confidence. The second image confidence balance parameter represents the degree of influence of the illumination unevenness contrast coefficient on the image acquisition confidence. The third image confidence balance parameter represents the degree of influence of the brightness extreme value contrast coefficient on the image acquisition confidence.
[0040] In this embodiment, by taking into account multiple factors such as image deformation, uneven illumination, and extreme brightness values through the above steps, the image acquisition confidence level is obtained. This allows for the timely detection of problems in the initial pig carcass images, effectively screening out reliable pig carcass images, and providing a reliable basis for subsequent image quality enhancement.
[0041] Furthermore, based on the image acquisition confidence assessment results, it is determined whether to perform image quality enhancement to improve the overall visual effect of the initial pig carcass images. The specific process is as follows:
[0042] If the image acquisition confidence level is less than the first image acquisition confidence threshold, it indicates a serious problem with image acquisition, which may not accurately reflect the condition of the pig carcass. An image acquisition anomaly alert is sent to pre-set personnel so that timely measures can be taken, such as checking for equipment malfunctions. The system automatically switches to a backup image acquisition device to ensure that image acquisition can continue normally, thus ensuring the continuity of image acquisition. The image acquisition device includes an industrial camera and a light source. The first and second image acquisition confidence thresholds are set by pre-set personnel, with the first image acquisition confidence threshold being less than the second image acquisition confidence threshold.
[0043] If the image acquisition confidence level is not less than the first image acquisition confidence level threshold and less than the second image acquisition confidence level threshold, it indicates that there is a certain problem with the image acquisition quality, but it has not yet reached the level of serious abnormality. It is necessary to enhance the image quality of the initial pig carcass image to improve the overall visual effect of the initial pig carcass image; otherwise, motion blur determination should be performed directly.
[0044] If the signal-to-noise ratio of the enhanced image is greater than that of the reference image, then the pig carcass quality data quantization is performed directly; otherwise, motion blur determination is performed. When the image quality meets the requirements, the quality data quantization is performed directly, which improves the efficiency of data processing and reduces unnecessary processing steps. By further determining whether there is motion blur in the initial pig carcass image, the causes affecting image quality can be identified more accurately, providing a basis for subsequent targeted processing measures.
[0045] Image quality enhancement specifically involves: using histogram equalization to adjust the grayscale distribution of the initial pig carcass image to enhance image contrast; then using feature matching to match and optimize feature points in the image; combining these two methods to optimize the acquired initial pig carcass image in real time, ensuring the clarity of the outline and the reliability of features in the optimized pig carcass image, thus providing a better foundation for subsequent accurate quantification of pig carcass quality data.
[0046] Further, a decision is made on whether to perform image blur correction to restore edge and texture details of the initial pig carcass image. The specific process is as follows:
[0047] If the motion blur length is greater than the reference motion blur length, image blur correction is performed; otherwise, feedback is sent to the preset personnel. The reference motion blur length and reference weight standard deviation are set by the preset personnel. An accelerometer is fixed on the pig carcass grading device to collect acceleration data in real time during the pig carcass transport process. The acceleration data is then integrated once to obtain velocity data, and then integrated a second time to obtain displacement data. Finally, the displacement change within the image exposure time is recorded as the motion blur length. By setting a reference motion blur length, it is possible to quickly determine whether blur correction of the pig carcass image is needed, avoiding unnecessary processing and improving the efficiency of pig carcass quality data evaluation.
[0048] Image blur correction specifically involves: acquiring vibration signals during pig carcass transport using an accelerometer in the pig carcass grading device; extracting the amplitude and phase angle of the vibration signals; and combining these with feedforward gain (used to adjust the influence of the vibration signal on the generation of the reverse force) to input the amplitude and phase angle of the vibration signals into a proportional-integral-derivative (PID) controller and feedforward compensation to generate a reverse force opposite to the vibration direction, thereby suppressing vibration and reducing its impact on image quality.
[0049] It is important to understand that the normalized vibration signal undergoes a Fast Fourier Transform (FFT) to convert the time-domain signal into a frequency-domain signal, obtaining the main frequency components of the pig carcass vibration (i.e., the frequencies with the largest amplitudes). Then, based on the corresponding frequency points, the amplitude and phase angle of that frequency point are extracted from the FFT result. Next, the extracted vibration signal amplitude is multiplied by the feedforward gain to obtain the adjusted amplitude signal, while keeping the phase angle unchanged. Immediately afterward, the vibration signal (amplitude and phase angle) adjusted by the feedforward gain is synthesized with the control quantity output by the PID control (the synthesis method can be addition or multiplication, etc., depending on specific needs). Finally, based on the synthesized control signal, a reverse force is generated through an actuator (such as a motor, hydraulic cylinder, etc.). Among these steps, the control quantity output by the PID control is calculated according to the PID control algorithm based on the error signal (i.e., the error between the actual conveying speed or position of the current pig carcass and the target value, calculated in real time).
[0050] If the standard deviation of pig carcass weight is less than the standard deviation of reference weight, the pig carcass weight and motion fuzz length are input into the feedforward gain mapping set for mapping to obtain the feedforward gain. Otherwise, the feedforward gain is updated in real time through adaptive filtering (e.g., dynamically adjusting the filter weights based on the error between the input vibration signal and the preset expected vibration signal according to the least mean square algorithm). The feedforward gain mapping set is a collection obtained from a preset database representing the mapping relationship between pig carcass weight, motion fuzz length, and feedforward gain. Different feedforward gain acquisition methods are selected according to the fluctuation of pig carcass weight. When the weight fluctuation is small, the feedforward gain mapping set can be used to quickly and accurately obtain the feedforward gain; when the weight fluctuation is large, adaptive filtering is used to update the feedforward gain in real time, which can better adapt to different situations and improve the robustness and performance of pig carcass quality data evaluation.
[0051] Furthermore, the quality data of the pig carcasses is quantified, and the specific process is as follows:
[0052] If the initial pig carcass image is not optimized for image quality, then the pig carcass quality data (such as backfat thickness and lean meat percentage) is input into the machine learning model for quantification of pig carcass quality data; otherwise, the effectiveness of image quality optimization is determined. When it is determined that the initial image quality meets the requirements, the pig carcass quality data is directly input into the machine learning model for quantification, reducing data processing steps and speeding up the evaluation. At the same time, since no optimization processing that may introduce additional errors is performed, the originality and authenticity of the initial pig carcass image are guaranteed, which is conducive to the machine learning model to make accurate evaluations based on the pig carcass quality data.
[0053] The specific process for determining the effectiveness of image quality optimization is as follows: If the image acquisition confidence level is not less than the second image acquisition confidence level threshold, and the motion blur length is not greater than the reference motion blur length, then the pig carcass quality data is input into the machine learning model for quantification; otherwise, feedback is provided to the designated personnel. By comprehensively considering the two key indicators of image acquisition confidence level and motion blur length, the effect of image quality optimization can be comprehensively and objectively evaluated, avoiding the limitations of relying on a single indicator and improving the accuracy and reliability of pig carcass quality data quantification. When image quality optimization is determined to be effective, inputting the pig carcass quality data into the machine learning model for quantification provides the model with high-quality input data, thereby improving the accuracy and stability of quality assessment and providing strong support for accurate pig carcass quality assessment. When image quality optimization is ineffective, timely feedback to the designated personnel ensures that the problem is addressed promptly, guaranteeing that the pig carcass quality data assessment can be quickly adjusted and improved when problems arise, ensuring the smooth progress of the entire pig carcass quality data assessment process.
[0054] It should be added that the pig carcass quality data is input into a machine learning model (such as a convolutional neural network) for quantification. Specifically, during the production line operation, a mechanical device grabs the carcass after it has been split in half and misaligns the two halves. A pneumatically driven positioning mechanism quickly responds and fixes one half of the carcass, so that the inner cavity of the carcass faces an industrial camera. The industrial camera captures images of the pig carcass. By collecting a large number of pig carcass images, the biometrics, measurement, and calculation functions are repeatedly trained to build a model, which ultimately becomes the core software for pig carcass identification and analysis. The received pig carcass images are analyzed to obtain the required pig carcass quality data, which is then transmitted to carcass grading software. The carcass grading software has various data collection functions and tracks and locates the pigs, linking data from different processes to the same individual pig. After comprehensive analysis, it provides carcass grading results, which are then classified and transmitted to guide terminal equipment in performing functions such as product grading and data printing.
[0055] Quantifying pig carcass quality data also includes:
[0056] If the inference time fluctuation coefficient (such as the standard deviation of inference time) of the quantification of pig carcass quality data within the preset time period is greater than the reference inference time fluctuation coefficient (set by preset personnel), then model fitting optimization is performed; otherwise, model fitting optimization is not performed. The inference time fluctuation coefficient is used to measure the degree of fluctuation in the time spent on each inference during the quantification of pig carcass quality data within the preset time period. The larger the inference time fluctuation coefficient, the greater the fluctuation of the inference time, that is, the inference time is unstable and needs to be optimized in a timely manner to ensure the real-time performance and stability of pig carcass quality data evaluation.
[0057] Model fitting optimization specifically involves: applying loss weights (a set of weights used to measure the influence of different features on the model's loss function, with one loss weight corresponding to each pig carcass quality data point) to the loss function; calculating the gradient of the loss function with respect to the model parameters through automatic differentiation; and updating the model parameters (such as weights used to control the influence of different pig carcass quality data points on the quantization results of pig carcass quality data, or weights used to adjust the bias of the quantization results of pig carcass quality data) based on the gradient using optimization algorithms (such as stochastic gradient descent or adaptive moment estimation). By introducing loss weights for each pig carcass quality data point, the model can achieve optimal performance. During parameter tuning, the machine learning model can more effectively process different carcass quality data. Greater weight is given to carcass quality data that significantly impacts inference time and carcass quality fluctuations, allowing the model to focus more on these data and thus improving its processing capabilities. This enhances the overall performance of the machine learning model. After parameter tuning, the model can better adapt to changes in carcass quality data, reducing inference time fluctuations and improving the accuracy and stability of carcass quality data quantification.
[0058] The loss weights for each pig carcass quality data are obtained by mapping the inference duration fluctuation coefficient and the fluctuation coefficient of each pig carcass quality data within a preset time period into the corresponding loss weight mapping set of the pig carcass quality data. The loss weight mapping set is a collection obtained from a preset database that represents the mapping relationship between the inference duration fluctuation coefficient, the fluctuation coefficient of each pig carcass quality data within a preset time period, and the loss weights of each pig carcass quality data.
[0059] like Figure 4 The flowchart shown illustrates a machine learning-based method for evaluating pig carcass quality data. This embodiment of the invention provides a machine learning-based method for evaluating pig carcass quality data, which includes the following steps:
[0060] S1 acquires initial pig carcass images via an industrial camera in the pig carcass grading device, enabling rapid and efficient collection of carcass appearance information. This provides foundational data support for subsequent quality data evaluation. Based on image parameters reflecting the quality of the initial carcass images, it determines whether image quality optimization is needed. If so, it sends an instruction reflecting factors affecting image quality, such as lighting conditions, equipment configuration, and transmission interference in the image acquisition environment. Otherwise, it inputs the carcass quality data into a machine learning model for quantification. Image quality optimization includes image enhancement and image blur correction. By identifying image quality optimization needs, problems in the images can be identified promptly, preventing deviations in subsequent analysis due to image quality issues. Sending instructions to determine factors affecting image quality helps to understand the reasons for poor image quality, providing a basis for targeted image quality optimization and making the optimization process more accurate and effective.
[0061] S2, after receiving the instruction, performs an image acquisition confidence assessment to measure the reliability of image acquisition. Based on the image acquisition confidence assessment result, it determines whether to perform image quality enhancement to improve the overall visual effect of the initial pig carcass image. If image quality enhancement is not performed, it further determines whether to perform image blur correction to restore the edge and texture details of the initial pig carcass image. The image acquisition confidence assessment provides an objective basis for whether to perform subsequent image quality optimization, avoiding unnecessary optimization processing and improving processing efficiency. Through image quality enhancement and image blur correction, the overall visual effect of the image can be improved in a targeted manner, increasing the image clarity and recognizability, making the pig carcass features in the image more obvious, which is beneficial for subsequent quality data extraction and quantitative evaluation.
[0062] S3. After optimizing the image quality to reduce interference from the initial pig carcass image, the optimized pig carcass quality data is input into the machine learning model for pig carcass quality data quantification, and the quantification results are fed back to the preset personnel. Since the optimized image data is more accurate and reliable, it can improve the evaluation accuracy of the machine learning model.
[0063] Example 2: Although the image quality enhancement in Example 1 can optimize image quality to a certain extent, when there are both strong reflections (such as highlights in the fat layer) and deep shadows (such as abdominal folds) on the surface of the pig carcass, histogram equalization will overstretch the local grayscale, resulting in overexposure in the highlight areas and loss of details in the shadow areas. Example 2 needs to be executed to restore the details of the shadow and highlight areas in the image, improve the clarity of the contours, avoid artifacts, and make the pig carcass image more consistent with the actual situation of the pig carcass.
[0064] like Figure 5 The flowchart for image quality enhancement shown is as follows:
[0065] The first step is to preprocess the initial pig carcass image. Preprocessing includes denoising (such as non-local mean denoising) and white balance correction (such as gray-world method or perfect reflection method). Denoising reduces interference information in the image, making the image clearer. White balance correction is used to adjust the color balance of the image, so that white objects in the image can appear true white under different lighting conditions, thereby ensuring the accuracy of other colors in the image. By removing noise from the image and adjusting the color balance, a cleaner and more color-accurate image foundation is provided for subsequent image enhancement processing.
[0066] The second step involves inputting the pig carcass image into an image enhancement model (such as a Retinex neural network or zero-reference depth curve estimation) to obtain an enhanced pig carcass image. The image enhancement model can effectively address common shadow and highlight issues in pig carcass images, restore details in shadow and highlight areas, and improve the information richness of the pig carcass image.
[0067] The third step involves contrast stretching the pig carcass image using a contrast limiting factor (used to limit the degree of contrast stretching) (e.g., a contrast-limited adaptive histogram equalization algorithm). This enhances the contrast between the pig carcass and the background and other parts of the image, further improving the clarity of the pig carcass outline. At the same time, the contrast limiting factor prevents excessive stretching that could lead to image distortion. The contrast limiting factor represents the result obtained by inputting the image acquisition confidence level, average image brightness, and illumination non-uniformity coefficient into the contrast limiting factor mapping set. The contrast limiting factor mapping set is a collection obtained from a preset database that represents the mapping relationship between the image acquisition confidence level, average image brightness, illumination non-uniformity coefficient, and contrast limiting factor.
[0068] The fourth step involves applying edge-preserving filtering (such as guided filtering) to the pig carcass image using the neighborhood radius used to determine the image processing range. The neighborhood radius represents the result obtained by inputting the image acquisition confidence level and image edge density (such as the pixel ratio after Canny edge detection, reflecting the richness of edge information in the image) into a neighborhood radius mapping set. This neighborhood radius mapping set is a collection obtained from a pre-defined database representing the mapping relationship between image acquisition confidence level, image edge density, and neighborhood radius. Edge-preserving filtering enhances image contrast while preserving edge information. By mapping to obtain the neighborhood radius, it avoids generating false edges or textures (artifacts) in the image due to excessive contrast enhancement, thus improving the quality and realism of the pig carcass image.
[0069] The fifth step involves semantically correcting the pig carcass images by combining prior knowledge of the carcass (such as typical color distribution, representing pre-known information about the pig carcass, such as its shape, structure, texture, and other features). This makes the images more consistent with the actual characteristics and structure of the pig carcass, further improving the accuracy and reliability of the images and providing a guarantee for subsequent accurate pig carcass quality data evaluation.
[0070] Example 3: After image blur correction in Example 1, vibration could not be completely suppressed due to actuator saturation, control delay, etc., resulting in motion blur in the pig carcass image. Example 3 needs to be executed to enhance the adaptability of image blur correction to different working conditions and ensure the image processing effect under various complex conditions.
[0071] Therefore, the specific process for image blur correction also includes:
[0072] Step 1: The motion trajectory during image exposure is recorded by the accelerometer in the pig carcass grading device. Accurate recording of the motion trajectory is the basis for subsequent deconvolution processing. Only by knowing the motion of the pig carcass during exposure can targeted deblurring be performed.
[0073] Step two involves inputting the motion trajectory during image exposure into Wiener filtering for deconvolution. Wiener filtering, based on the minimum mean square error criterion, can deconvolve blurred images according to motion trajectory information, effectively suppressing linear motion blur and restoring some edge and texture details of the image.
[0074] Step 3: Input the deconvolutioned pig carcass image into guided filtering for smoothing to obtain the optimized pig carcass image. Deconvolution may produce artifacts. Guided filtering can preserve edge information while smoothing the image. Guided filtering can effectively suppress artifacts and further improve the image quality, making the optimized pig carcass image clearer and more realistic.
[0075] In summary, this embodiment determines whether image quality optimization should be performed based on the image parameters of the acquired initial pig carcass images. If image quality optimization is required, the factors affecting image quality are assessed, avoiding unnecessary calculations for all pig carcass images. If image quality optimization is not performed, pig carcass quality data is directly quantified, significantly shortening the pig carcass quality data evaluation cycle. Then, image acquisition confidence assessment is performed, reflecting the stability of the current image acquisition state and providing a basis for subsequent image quality enhancement. Through image quality enhancement, problems such as uneven lighting and improper exposure are effectively addressed, improving the quality of pig carcass images. The image's visual quality is assessed, and then it is determined whether image blur correction should be performed. If image blur correction is performed, it can accurately repair local detail loss problems such as motion blur and inaccurate focus, restoring key edge and texture information. If image blur correction is not performed, it can avoid over-processing on the pig carcass image, saving computing resources and achieving the best balance between repair effect and processing efficiency. Finally, the optimized pig carcass image is input into a machine learning model to quantify pig carcass quality data, which can fundamentally ensure the accuracy of the machine learning model's analysis results, thereby improving the accuracy of pig carcass quality data evaluation.
[0076] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0077] This invention is described with reference to flowchart illustrations and / or block diagrams of systems, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0078] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0079] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0080] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.
[0081] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
[0082] It should also be understood that the memory in the embodiments of the present invention can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDR SDRAM), enhanced synchronous DRAM (ESDRAM), synchronous linked DRAM (SLDRAM), and direct rambus RAM (DR RAM).
[0083] The above embodiments can be implemented, in whole or in part, by software, hardware (such as circuits), firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive.
[0084] It should be understood that the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. A and B can be singular or plural. Additionally, the character " / " in this article generally indicates an "or" relationship between the preceding and following related objects, but it can also represent an "and / or" relationship. Please refer to the context for a more accurate understanding.
[0085] In this invention, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of a single item or a plurality of items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be a single item or multiple items.
[0086] It should be understood that, in various embodiments of the present invention, the order of the above-mentioned process numbers does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0087] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0088] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the devices, apparatuses, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0089] In the several embodiments provided by this invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0090] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0091] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0092] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0093] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A machine learning-based system for evaluating pig carcass quality data, characterized in that, include: The module includes a quality optimization requirement judgment module, a quality influencing factor judgment and optimization module, and a pig carcass quality data quantification module. The quality optimization requirement judgment module is used to acquire initial pig carcass images through an industrial camera in the pig carcass grading device, and determine whether there is a need for image quality optimization based on image parameters reflecting the quality of the initial pig carcass images. If there is a need, an instruction is sent to determine the image quality influencing factors reflecting the lighting conditions, equipment configuration, and transmission interference in the image acquisition environment. Otherwise, the pig carcass quality data is input into a machine learning model for pig carcass quality data quantification. The quality influencing factor determination and optimization module is used to perform image acquisition confidence assessment after receiving the instruction to measure the reliability of image acquisition, and to determine whether to perform image quality enhancement to improve the overall visual effect of the initial pig carcass image based on the image acquisition confidence assessment result. If image quality enhancement is not performed, it further determines whether to perform image blur correction to restore the edge and texture details of the initial pig carcass image. The pig carcass quality data quantification module is used to input the pig carcass quality data into a machine learning model for quantification after image quality optimization to reduce interference in the initial pig carcass image, and to feed the quantification results back to a preset person.
2. The machine learning-based pig carcass quality data evaluation system according to claim 1, characterized in that, The specific process for determining whether image quality optimization is needed based on image parameters reflecting the initial pig carcass image quality is as follows: If the signal-to-noise ratio of the image is greater than that of the reference image, it means that there is no need for image quality optimization, and the pig carcass quality data is quantified. If not, it indicates that there is a need for image quality optimization, and the factors affecting image quality need to be determined. The determination of factors affecting image quality includes image acquisition confidence assessment and motion blur determination.
3. The machine learning-based pig carcass quality data evaluation system according to claim 1, characterized in that, The specific method for evaluating the confidence level of image acquisition is as follows: The image distortion coefficient is obtained by performing relative deviation processing on the image measured area and the actual area of the calibration object, which is used to provide a reference for the size relationship between the initial pig carcass image and the actual pig carcass, in order to measure the degree of geometric distortion of the pig carcass in the image caused by the shooting angle. The standard deviation of brightness in each region of the initial pig carcass image is recorded as the illumination non-uniformity coefficient. The illumination non-uniformity coefficient and the reference illumination non-uniformity coefficient are compared to obtain the illumination non-uniformity contrast coefficient. The brightness of each region in the initial pig carcass image is sorted in descending order to obtain the maximum and minimum brightness. The maximum and minimum brightness are then compared to obtain the brightness extreme value contrast coefficient. An image confidence balancing parameter is introduced, and the image deformation coefficient, illumination unevenness contrast coefficient, and brightness extreme value contrast coefficient are subjected to inverse proportional weighting coupling processing to obtain the image acquisition confidence. The image acquisition confidence is used to quantitatively evaluate the reliability of image acquisition.
4. The machine learning-based pig carcass quality data evaluation system according to claim 3, characterized in that, The specific process for determining whether to perform image quality enhancement to improve the overall visual effect of the initial pig carcass images based on the image acquisition confidence assessment results is as follows: If the image acquisition confidence level is less than the first image acquisition confidence level threshold, a preset personnel image acquisition abnormality will be indicated, and a backup image acquisition device will be automatically switched. The image acquisition device includes an industrial camera and a light source. If the image acquisition confidence level is not less than the first image acquisition confidence level threshold and less than the second image acquisition confidence level threshold, then image quality enhancement is performed; otherwise, motion blur determination is performed directly. If the signal-to-noise ratio of the enhanced image is greater than that of the reference image, then the pig carcass quality data quantization is performed directly; otherwise, motion blur determination is performed. The image quality enhancement specifically involves combining histogram equalization and feature matching to optimize image acquisition in real time, ensuring the clarity of the outline and the reliability of features in the optimized pig carcass image.
5. The machine learning-based pig carcass quality data evaluation system according to claim 4, characterized in that, The image quality enhancement process is as follows: The first step is to preprocess the initial pig carcass image, which includes noise reduction and white balance correction; The second step is to input the pig carcass image into the image enhancement model to restore the details of the shadow and highlight areas in the pig carcass image; The third step is to perform contrast stretching on the pig carcass image in conjunction with the contrast limit, so as to further improve the outline clarity of the pig carcass image. The contrast limit represents the result obtained by inputting the image acquisition confidence, average image brightness and illumination non-uniformity coefficient into the contrast limit mapping set. The fourth step involves applying edge-preserving filtering to the pig carcass image using the neighborhood radius used to determine the image processing range, in order to avoid artifacts caused by excessive contrast enhancement. The neighborhood radius represents the result obtained by inputting the image acquisition confidence and image edge density into the neighborhood radius mapping set. The fifth step is to perform semantic correction on the pig carcass image by combining prior knowledge of the carcass.
6. The machine learning-based pig carcass quality data evaluation system according to claim 1, characterized in that, The specific process for determining whether to perform image blur correction to restore edge and texture details of the initial pig carcass image is as follows: If the motion blur length is greater than the reference motion blur length, image blur correction is performed; otherwise, feedback is sent to the preset personnel. The image blur correction specifically includes: The vibration signal of the pig carcass during transport is obtained by the accelerometer in the pig carcass grading device. The amplitude and phase angle of the vibration signal are extracted and then combined with the feedforward gain to input the amplitude and phase angle of the vibration signal into the PID control and feedforward compensation to generate a reverse force. If the standard deviation of pig carcass weight is less than the standard deviation of reference weight, the pig carcass weight and motion fuzz length are input into the feedforward gain mapping set for mapping to obtain the feedforward gain; otherwise, the feedforward gain is updated in real time through adaptive filtering.
7. The machine learning-based pig carcass quality data evaluation system according to claim 6, characterized in that, The image blur correction process is as follows: Step 1: Record the motion trajectory during image exposure using an accelerometer in the pig carcass grading device; Step two: Input the motion trajectory during the image exposure into Wiener filter for deconvolution to suppress linear motion blur; Step 3: Input the deconvolutioned pig carcass image into the guided filter for smoothing to obtain an optimized pig carcass image, in order to suppress artifacts after deconvolution.
8. The machine learning-based pig carcass quality data evaluation system according to claim 1, characterized in that, The specific process for quantifying pig carcass quality data is as follows: If the initial pig carcass image is not optimized for image quality, the pig carcass quality data is input into the machine learning model for pig carcass quality data quantification; otherwise, the effectiveness of image quality optimization is determined. The specific process for determining the effectiveness of image quality optimization is as follows: if the image acquisition confidence level is not less than the second image acquisition confidence level threshold and the motion blur length is not greater than the reference motion blur length, then the pig carcass quality data is input into the machine learning model for pig carcass quality data quantification; otherwise, feedback is sent to the preset personnel.
9. The machine learning-based pig carcass quality data evaluation system according to claim 8, characterized in that, The quantification of pig carcass quality data also includes: If the inference time fluctuation coefficient of the quantified pig carcass quality data within the preset time period is greater than the reference inference time fluctuation coefficient, then model fitting optimization will be performed; otherwise, model fitting optimization will not be performed. The model fitting optimization specifically involves adjusting the parameters in the machine learning model by incorporating the loss weights. The loss weight is obtained by mapping the inference duration fluctuation coefficient and the fluctuation coefficient of each pig carcass quality data within a preset time period into the loss weight mapping set of the corresponding pig carcass quality data.
10. A machine learning-based method for evaluating pig carcass quality data, applied to the machine learning-based pig carcass quality data evaluation system described in any one of claims 1-9, characterized in that, Includes the following steps: S1. An initial pig carcass image is acquired through an industrial camera in the pig carcass grading device. Based on the image parameters reflecting the quality of the initial pig carcass image, it is determined whether there is a need for image quality optimization. If so, an instruction reflecting the image quality influencing factors such as lighting conditions, equipment configuration, and transmission interference in the image acquisition environment is sent. Otherwise, the pig carcass quality data is input into a machine learning model for pig carcass quality data quantification. The image quality optimization includes image quality enhancement and image blur correction. S2, after receiving the instruction, performs an image acquisition confidence assessment to measure the reliability of image acquisition, and determines whether to perform image quality enhancement to improve the overall visual effect of the initial pig carcass image based on the image acquisition confidence assessment result. If image quality enhancement is not performed, it further determines whether to perform image blur correction to restore the edge and texture details of the initial pig carcass image. S3. After image quality optimization to reduce interference from the initial pig carcass image, the optimized pig carcass quality data is input into the machine learning model for pig carcass quality data quantification, and the quantification results are fed back to the preset personnel.
Citation Information
Patent Citations
Method for comprehensively evaluating pork quality
CN112200446A
White-strip pig intelligent identification and automatic warehouse-in and warehouse-out management system
CN120125141A