Method and system for identifying beef surface contamination based on machine vision

A contaminated pixel identifier built using machine learning and convolutional neural networks, combined with fat distribution data for neighboring pixel retrieval and clustering, solves the problem of distinguishing between mold and fat texture in traditional methods, and improves the accuracy and reliability of identifying mold contamination on the surface of beef.

CN120198726BActive Publication Date: 2026-05-08GUANGZHOU TOP FOOD CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGZHOU TOP FOOD CO LTD
Filing Date
2025-03-07
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Traditional methods for identifying surface contamination in beef struggle to accurately distinguish between mold and fat texture, resulting in insufficient accuracy and reliability in identification.

Method used

A contaminated pixel identifier was constructed using machine learning and convolutional neural networks. By combining fat distribution data to set the neighbor pixel retrieval specifications, neighbor pixel retrieval clustering and grayscale processing were performed to filter out contaminated areas.

Benefits of technology

It significantly improves the accuracy and reliability of identifying mold contamination on the surface of beef and reduces misjudgments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120198726B_ABST
    Figure CN120198726B_ABST
Patent Text Reader

Abstract

The present application relates to a kind of beef surface pollution identification method and system based on machine vision, it is related to computer vision field, including: using machine learning to carry out implicit pollution pixel point identification to beef image, obtain implicit pixel point distribution;According to the fat distribution data of beef surface, set adjacent pixel point search specification;According to adjacent pixel point search specification, carry out adjacent pixel point search clustering to multiple implicit pixel points in implicit pixel point distribution, obtain clustering implicit pixel point distribution, carry out pollution processing screening, obtain pollution identification result.The present application can solve the technical problems that traditional method is difficult to accurately distinguish beef surface fat texture and mould, leading to the accuracy and reliability of insufficient mould pollution identification;By setting dynamic adjacent pixel point search range to carry out pollution feature screening, can effectively reduce the misjudgment due to the similarity of mould and fat texture, significantly improve the precision, accuracy and reliability of mould pollution identification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision, and more particularly to a method and system for identifying surface contamination in beef based on machine vision. Background Technology

[0002] With increasing emphasis on food safety, the detection of surface contamination in food has become a crucial step in ensuring food quality. This is especially true for meat products, such as beef, whose surfaces may be contaminated with mold and other pollutants, affecting not only the appearance of the food but also potentially threatening consumers' health.

[0003] Currently, traditional methods for identifying surface contamination in beef typically rely on image processing technology to detect contamination by analyzing features such as color and texture on the beef surface. However, the accuracy of identifying some contaminations is low. For example, mold contamination usually appears as white or near-white areas, while the fat texture on the surface of beef is mostly white or light-colored lines or grid-like structures. Because the colors of the two are similar, traditional image processing methods often cannot accurately distinguish between mold and fat areas when performing color recognition, resulting in inaccurate identification results or even misjudgments. Summary of the Invention

[0004] This invention addresses the technical problem that traditional methods for identifying mold contamination on the surface of beef are unable to accurately distinguish between surface fat texture and mold, resulting in insufficient accuracy and reliability in mold contamination identification. It provides a machine vision-based method and system for identifying surface contamination in beef to solve this problem.

[0005] The technical solution of the present invention to solve the above-mentioned technical problems is as follows:

[0006] In a first aspect, the present invention provides a method for identifying surface contamination in beef based on machine vision, comprising: acquiring a beef image of the target beef surface; using machine learning to identify hidden contamination pixels in the beef image to obtain a distribution of hidden pixels; setting a neighboring pixel retrieval specification based on fat distribution data on the beef surface; performing neighboring pixel retrieval clustering on multiple hidden pixels within the distribution of hidden pixels according to the neighboring pixel retrieval specification to obtain a clustered hidden pixel distribution; performing contamination processing and screening to obtain a contamination identification result.

[0007] Preferably, the machine vision-based method for identifying surface contamination in beef further includes: acquiring an image of the surface of a target beef, wherein the target beef is the beef to be identified for surface contamination; using machine learning to pre-train a contamination pixel identifier; inputting the beef image into the contamination pixel identifier, identifying and outputting the contamination pixel identification result to obtain multiple hidden pixels; and constructing a hidden pixel distribution based on the multiple hidden pixels.

[0008] Preferably, the machine vision-based method for identifying surface contamination in beef further includes: collecting a set of sample beef images based on historical identification data of mold contamination on the surface of beef; labeling the mold contamination pixels on the surface of each sample beef image to obtain a set of sample contamination pixel identification results; constructing a contamination pixel recognizer based on a convolutional neural network, including an input layer, a convolutional layer, a pooling layer, a fully connected layer, and an output layer; and training the contamination pixel recognizer using the set of sample beef images and the set of sample contamination pixel identification results until the test converges.

[0009] Preferably, the machine vision-based method for identifying surface contamination in beef further includes: constructing an image coordinate system within the beef image; and marking the coordinates of the plurality of hidden pixels within the image coordinate system to obtain the distribution of hidden pixels.

[0010] Preferably, the machine vision-based method for identifying surface contamination in beef further includes: obtaining the maximum fat distribution width on the surface of the same batch of beef and obtaining the minimum contamination diameter of mold contamination on the beef surface; calculating the average of the maximum fat distribution width and the minimum contamination diameter as the distance for retrieving neighboring pixels, and obtaining the neighboring pixel retrieval specification.

[0011] Preferably, the machine vision-based method for identifying surface contamination in beef further includes: setting multiple neighboring pixel retrieval ranges with the coordinates of multiple hidden pixels within the distribution of hidden pixels as the center point and the neighboring pixel retrieval specification as the radius; retrieving and clustering pixels within the multiple neighboring pixel retrieval ranges to obtain multiple clustered hidden pixels, which serve as the clustered hidden pixel distribution.

[0012] Preferably, the machine vision-based method for identifying surface contamination in beef further includes: performing grayscale processing on the pixel values ​​of all pixels within the clustered hidden pixel distribution to obtain a clustered grayscale point distribution; performing binarization classification on the grayscale values ​​of all pixels within the clustered grayscale point distribution to obtain a clustered binary point distribution, wherein pixels with grayscale values ​​greater than a preset grayscale threshold are classified as 1, and pixels with grayscale values ​​less than a preset grayscale threshold are classified as 0; calculating the proportion of 1 in each clustered binary point within the clustered binary point distribution to obtain multiple proportions of 1-class pixels, and selecting the clustered hidden pixels corresponding to the proportions of 1-class pixels greater than or equal to a preset proportion threshold as contaminated areas to obtain contamination identification results.

[0013] Secondly, the present invention provides a machine vision-based beef surface contamination identification system, comprising: a hidden contamination pixel identification module, used to acquire beef images of the target beef surface, and to use machine learning to identify hidden contamination pixels in the beef images to obtain a hidden pixel distribution; a neighboring pixel retrieval specification setting module, used to set neighboring pixel retrieval specifications based on fat distribution data of the beef surface; and a neighboring pixel retrieval clustering module, used to perform neighboring pixel retrieval clustering on multiple hidden pixels within the hidden pixel distribution according to the neighboring pixel retrieval specifications, to obtain a clustered hidden pixel distribution, to perform contamination processing and screening, and to obtain a contamination identification result.

[0014] The beneficial effects of this invention are as follows: By employing machine learning to identify hidden contamination pixels in beef images, the distribution of hidden pixels is obtained; then, based on the fat distribution data on the beef surface, a neighboring pixel retrieval specification is set; then, according to the neighboring pixel retrieval specification, multiple hidden pixels within the hidden pixel distribution are clustered to obtain a clustered hidden pixel distribution; finally, contamination processing and screening are performed based on the clustered hidden pixel distribution to obtain contamination identification results; that is, by setting a dynamic neighboring pixel retrieval range based on mold contamination and fat texture features for contamination feature screening, mold and fat texture on the beef surface can be accurately distinguished, effectively reducing misjudgments caused by the similarity between mold and fat texture, and significantly improving the accuracy, reliability, and precision of mold contamination identification on the beef surface. Attached Figure Description

[0015] Figure 1 A schematic flowchart of the machine vision-based method for identifying surface contamination in beef provided by this invention;

[0016] Figure 2 This is a schematic diagram of the structure of the machine vision-based beef surface contamination identification system provided by the present invention.

[0017] The components represented by each number in the attached diagram are explained below:

[0018] The module includes a hidden contamination pixel identification module 10, a neighboring pixel retrieval specification setting module 20, and a neighboring pixel retrieval clustering module 30. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] In the description of this invention, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the stated features. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0021] In the description of this invention, the term "for example" is used to mean "used as an example, illustration, or description." Any embodiment described as "for example" in this invention is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use the invention. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that the invention can be made without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid obscuring the description of the invention with unnecessary detail. Therefore, the invention is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed herein.

[0022] Example 1, as Figure 1 As shown, this embodiment of the invention provides a method for identifying surface contamination in beef based on machine vision, specifically including the following steps:

[0023] S100: Acquire an image of the target beef surface, and use machine learning to identify hidden contamination pixels in the beef image to obtain the distribution of hidden pixels.

[0024] Furthermore, step S100 of the present invention further includes:

[0025] S110: Acquire an image of the target beef surface, wherein the target beef is the beef for which surface contamination identification is to be performed.

[0026] Specifically, an image acquisition device is used to capture images of the surface of the target beef, which is the beef to be identified for surface contamination. To ensure the accuracy of subsequent image processing and analysis, a high-resolution camera or image acquisition device is used to ensure that every detail of the beef surface is clearly captured, resulting in a surface image of the target beef. Accurately acquiring high-quality beef surface images provides a solid foundation for subsequent mold contamination identification, making the entire identification process more efficient and accurate.

[0027] S120: Employs machine learning to pre-train a contaminated pixel identifier.

[0028] Furthermore, step S120 of the present invention further includes:

[0029] S121: Collect a set of sample beef images based on historical identification data of mold contamination on the surface of beef; S122: Label the mold contamination pixels on the surface of each sample beef image to obtain a set of sample contamination pixel identification results; S123: Contamination pixel recognizer is constructed based on a convolutional neural network, including an input layer, a convolutional layer, a pooling layer, a fully connected layer, and an output layer; S124: Train the contamination pixel recognizer using the set of sample beef images and the set of sample contamination pixel identification results until the test converges.

[0030] Specifically, in order to improve the accuracy and robustness of mold contamination identification, images need to be collected from multiple batches of beef. These sample beef images will serve as the basic dataset for model training and validation. By collecting images of the surface of multiple sample beef, the mold contamination characteristics of beef surface under different conditions can be covered, thereby improving the identification capability.

[0031] First, based on historical identification data of mold contamination on the surface of beef, images of the beef surface under different conditions are collected as sample beef images to obtain a set of sample beef images. Next, the mold contamination pixels (such as white or light-colored areas) on the surface of each sample beef image are labeled. For example, labeling is done using image processing software. Mold contamination areas are usually white or light-colored. Each mold contamination area is marked, and its corresponding pixel is labeled as "contaminated". After labeling, each sample image will have a corresponding contaminated pixel identification result. It should be noted that the labeling here is only for white or light-colored areas. Since fat areas may also be white or light-colored, the fat areas on the surface of beef in the sample beef images are also labeled to obtain a set of sample contaminated pixel identification results.

[0032] Next, a contamination pixel identifier is constructed based on a convolutional neural network (CNN). A CNN is a deep learning model specifically designed for processing image data, particularly adept at automatically extracting features from images and performing tasks such as classification and recognition. It effectively extracts local features from images and gradually constructs higher-level abstract features, and is widely used in image classification, object detection, and other fields. Specifically, the contamination pixel identifier is used to automatically identify contaminated areas on the surface of beef images using a CNN. The identifier includes an input layer, a convolutional layer, a pooling layer, a fully connected layer, and an output layer. The input data for the input layer is the beef image. The convolutional layers extract local features (such as color and texture) from the image using convolutional kernels; through multiple convolutions, different levels of image features can be captured. The pooling layer downsamples the image to reduce its size while retaining the most important feature information. The fully connected layer integrates the features extracted by the convolutional and pooling layers to make the final classification decision. The output data of the output layer is the contamination pixel identification result.

[0033] Then, the sample beef image set and the sample contaminated pixel identification result set are used as training data, and the training data is divided into a sample training set, a sample validation set, and a sample test set according to a predetermined ratio. For example, the sample training set accounts for 70%, the sample validation set accounts for 20%, and the sample test set accounts for 10%. Further, using sample beef images as input and sample contaminated pixel identification results as supervision, the contaminated pixel identifier is supervised, validated, and tested using the sample training set, sample validation set, and sample test set. In the training phase, the input image data is first fed into a convolutional neural network model. Features are extracted through convolutional and pooling layers, and the extracted features are classified using fully connected layers to determine whether each pixel is a contaminated region. Then, the loss is calculated based on the model output and the actual label. The network weights are adjusted through backpropagation, and the loss is minimized using an optimization algorithm (such as Adam). This process is iterated multiple times, and the network weights are updated each time, until the network performance on the training set reaches the predetermined target or converges. In the validation phase, the model's performance is evaluated using a validation set to check its generalization ability on unseen data. The validation set is used to adjust hyperparameters (such as learning rate and kernel size) to avoid overfitting. First, predictions are made using the weights learned during training and the validation set data. Then, the model's output is compared with the true labels in the validation set, and the validation set loss is calculated. Based on the validation set results, some hyperparameters (e.g., learning rate, batch size) from training are adjusted. In the testing phase, the model's performance is evaluated on entirely new, unseen data to confirm its final generalization ability and accuracy. First, the trained model is used to predict on the test set. Then, the prediction results are compared with the true labels in the test set, and evaluation metrics such as accuracy, recall, and F1 score are calculated. When the test accuracy meets a preset accuracy threshold (e.g., output accuracy is 95%), the test converges, and the trained contaminated pixel identifier is obtained.

[0034] By constructing a contamination pixel identifier based on a convolutional neural network, the intelligence level of contamination pixel identification can be improved. The convolutional neural network can automatically learn the features in beef images, avoiding manual intervention in traditional image processing methods, reducing misjudgments and omissions, and thus improving the efficiency and accuracy of identification, providing reliable technical support for identifying mold contamination on the surface of beef.

[0035] S130: Input the beef image into the contaminated pixel identifier, identify and output the contaminated pixel identification result, and obtain multiple hidden pixels.

[0036] Specifically, the beef image is used as input data to a trained contaminated pixel identifier. After processing through multiple convolutional and pooling layers, the network determines whether each pixel belongs to a contaminated area. The output contaminated pixel identification result marks the possible contaminated areas, where these pixels are usually white or light-colored areas, consistent with the characteristics of mold. The output contaminated pixel identification result includes multiple hidden pixels, which represent areas in the image that may have mold contamination.

[0037] S140: Construct a hidden pixel distribution based on the plurality of hidden pixels.

[0038] Furthermore, step S140 of the present invention further includes:

[0039] S141: Construct an image coordinate system within the beef image; S142: Mark the coordinates of the plurality of hidden pixels within the image coordinate system to obtain the distribution of hidden pixels.

[0040] Specifically, a two-dimensional coordinate system is established within the beef image. Typically, the top-left corner of the image is used as the origin (0, 0), the horizontal axis is the x-axis, and the vertical axis is the y-axis. The coordinate unit is generally pixels. Next, the coordinates of the multiple hidden pixels are labeled within this coordinate system. For each hidden pixel, its position in the coordinate system is recorded; for example, its x and y coordinates are recorded. If a hidden contamination pixel is located in column 100 (x = 100) and row 150 (y = 150), its coordinates are (100, 150). By labeling the coordinates of all hidden pixels, a distribution of hidden pixels is formed, reflecting the areas where contamination may occur.

[0041] By constructing an image coordinate system and labeling the coordinates of each hidden pixel, the spatial distribution of contaminated areas within the beef image is obtained. This coordinate information provides a data foundation for subsequent clustering and screening of contaminated areas, thereby ensuring the accuracy and operability of the identification results.

[0042] S200: Based on the fat distribution data on the surface of beef, set the neighboring pixel retrieval specifications.

[0043] Furthermore, step S200 of the present invention further includes:

[0044] S210: Obtain the maximum fat distribution width on the surface of the same batch of beef, and obtain the minimum contamination diameter of mold contamination on the surface of the beef; S220: Calculate the average of the maximum fat distribution width and the minimum contamination diameter as the distance for neighboring pixel retrieval, and obtain the neighboring pixel retrieval specification.

[0045] Specifically, firstly, the maximum width of fat distribution on the surface of the same batch of beef is obtained. Fat distribution typically appears as white lines or a grid pattern, and the width of these lines represents the extent of fat distribution. By analyzing images of the surface of the same batch of beef, the maximum width of the fat distribution (i.e., the maximum width of the fat lines) is detected and calculated. This can be measured using image processing algorithms to find the widest part of the fat lines; for example, the widest fat line is 10 pixels wide. Secondly, the minimum diameter of mold contamination on the beef surface is obtained. Mold contamination generally appears as white circular spots, and the diameter of these spots is usually larger than the width of the fat texture lines. By analyzing the mold contamination areas in the beef images, the minimum diameter of the mold contamination area is calculated. This can be done by recognizing the outline of the white areas; for example, the smallest mold contamination spot diameter is 20 pixels.

[0046] Next, the average of the maximum fat distribution width and the minimum contamination diameter is calculated. The result of the average calculation is used as the distance for neighboring pixel retrieval. For example, assuming the widest fat line is 10 pixels wide and the smallest mold contamination spot diameter is 20 pixels, the distance for neighboring pixel retrieval is 15 pixels. This distance will be used as the range for neighboring pixel retrieval, which ensures that the retrieval range can cover the width of the fat texture without excessively expanding beyond the mold contamination area, thereby improving the accuracy of mold contamination identification.

[0047] The method provided in this application is applicable to surface contamination monitoring of beef with fine marbling fat distribution. The width of the fat on the surface of this type of beef is basically smaller than the diameter of the mold contamination spots. This ensures that the retrieval range can cover and be greater than the width of the fat texture, without excessively expanding beyond the mold contamination area, thus improving the accuracy of contamination identification.

[0048] Then, based on the calculated retrieval distance of neighboring pixels, the retrieval range, i.e., the neighboring pixel retrieval specification, is set. If there is a misclassification (e.g., fat texture mistakenly identified as mold contamination), there will definitely be dark pixels clustered into the beef muscle region within the retrieval range. This is because the lines of fat texture often exhibit significant variations, while mold contamination presents as uniform white spots. If there is no misclassification, almost all pixels within the retrieval range will be white pixels representing mold contamination, in which case the mold contamination area can be accurately identified. This method effectively distinguishes between fat texture and mold contamination, avoiding misclassifications common in traditional image processing methods and improving the accuracy of mold contamination identification.

[0049] S300: According to the neighbor pixel retrieval specifications, perform neighbor pixel retrieval and clustering on multiple hidden pixels within the hidden pixel distribution to obtain the clustered hidden pixel distribution, perform pollution processing and screening, and obtain pollution identification results.

[0050] Furthermore, step S300 of the present invention also includes:

[0051] S310: Using the coordinates of multiple hidden pixels within the distribution of hidden pixels as the center point and the neighboring pixel retrieval specification as the radius, set and obtain multiple neighboring pixel retrieval ranges; S320: Retrieve and cluster the pixels within the multiple neighboring pixel retrieval ranges to obtain multiple clustered hidden pixels, which serve as the clustered hidden pixel distribution.

[0052] Specifically, using the coordinates of multiple hidden pixels within the hidden pixel distribution as the center point and the neighboring pixel retrieval specification as the radius, a circular retrieval range is set for each hidden pixel, centered at that point with a radius equal to the neighboring pixel retrieval specification. All pixels within this circular area will be retrieved from the image. For example, assuming the neighboring pixel retrieval specification is 15 pixels, for the hidden pixel (100, 150), the retrieval range is a circular area centered at (100, 150) with a radius of 15 pixels. Then, pixels within the multiple neighboring pixel retrieval ranges are retrieved and clustered. That is, for the neighboring range of each hidden pixel, all pixels within that range are retrieved, resulting in multiple clustered hidden pixels. A clustered hidden pixel distribution is then constructed based on these multiple clustered hidden pixel distributions.

[0053] Furthermore, step S300 of the present invention also includes:

[0054] S330: Perform grayscale processing on the pixel values ​​of all pixels within the clustered hidden pixel distribution to obtain a clustered grayscale point distribution; S340: Perform binarization classification on the grayscale values ​​of all pixels within the clustered grayscale point distribution to obtain a clustered binary point distribution, wherein pixels with grayscale values ​​greater than a preset grayscale threshold are classified as 1, and pixels with grayscale values ​​less than a preset grayscale threshold are classified as 0; S350: Calculate the proportion of 1 in each clustered binary point within the clustered binary point distribution to obtain multiple proportions of 1-class pixels, and select the clustered hidden pixels corresponding to the proportions of 1-class pixels that are greater than or equal to a preset proportion threshold as contaminated areas to obtain contamination identification results.

[0055] Specifically, firstly, the pixel values ​​of all pixels within the clustered hidden pixel distribution are converted to grayscale, that is, the color value of each pixel in the image is converted into a grayscale value. Grayscale values ​​are typically represented as values ​​between 0 and 255, where 0 represents black and 255 represents white. Through grayscale processing, we can more easily analyze the brightness features in the image, helping to identify areas of mold contamination. Next, based on the grayscale values ​​of all pixels within the clustered grayscale point distribution, binary classification is performed, that is, pixels with grayscale values ​​greater than a preset grayscale threshold are classified as 1, and pixels with grayscale values ​​less than the preset grayscale threshold are classified as 0. Specifically, if the grayscale value of a pixel is greater than the preset grayscale threshold (e.g., 150), the pixel is classified as 1, indicating that it may be a region of mold contamination or fat; if the grayscale value of a pixel is less than the preset grayscale threshold (e.g., 150), the pixel is classified as 0, indicating that it may be a dark region of beef muscle; thus, a clustered binary point distribution is obtained.

[0056] Then, the proportion of 1 in each binary point of the cluster is calculated. That is, the proportion of pixels with a gray value greater than 150 (i.e., classified as 1) in each cluster region is calculated. For example, if there are 100 pixels in a certain cluster region, and 98 of them have a gray value greater than 150 (i.e., belong to the mold contamination or fat region), then the proportion of 1-class pixels in this cluster region is 98%, and multiple proportions of 1-class pixels are obtained.

[0057] If an error occurs, the retrieved clustered latent pixels may include some pixels representing dark meat areas (i.e., areas classified as 0), which should not be considered mold-contaminated areas. If there is no error, it means that all pixels within the retrieval range of neighboring pixels are mold-contaminated areas, typically appearing as white or light-colored regions. In practical applications, image acquisition and processing can be affected by various factors, such as image noise, uneven lighting, and uneven object surfaces. These factors can cause mold to resemble fat textures or other interfering areas, leading to errors. Therefore, setting a percentage threshold is crucial. By selecting only pixels of type 1 that account for a certain percentage as contaminated areas, some false positives can be effectively avoided. A preset percentage threshold is obtained (which can be set based on experience or historical data analysis, for example, 95%). Then, clusters of latent pixels corresponding to the percentage of type 1 pixels greater than or equal to the preset percentage threshold are selected as contaminated areas. That is, when the proportion of type 1 pixels in a certain cluster exceeds 95% of the total pixels, it indicates that most pixels in that cluster are white or light-colored pixels, and thus it is likely a mold contamination area. Only then will this cluster be considered a valid mold contamination area, resulting in multiple contaminated areas as the contamination identification result. If the proportion of type 1 pixels in a certain cluster does not exceed the preset percentage threshold, it indicates that there are many dark-colored pixels in that cluster, such as pixels formed from beef muscle. This suggests that the cluster is likely an area where beef fat and muscle are distributed, and not a mold contamination area.

[0058] By filtering the clustered hidden pixels corresponding to the first type of pixels that are greater than the preset proportion threshold, and based on the distribution characteristics of mold contamination pixels and beef fat pixels, the contamination area can be effectively and accurately identified. This can effectively reduce misjudgments caused by the similarity between mold and fat texture, and accurately identify the mold contamination area on the surface of beef.

[0059] The machine vision-based method for identifying surface contamination in beef provided in this invention has at least the following technical effects:

[0060] By employing machine learning to identify hidden contamination pixels in beef images, the distribution of hidden pixels is obtained. Then, based on the fat distribution data on the beef surface, a neighbor pixel retrieval specification is set. Next, according to the neighbor pixel retrieval specification, multiple hidden pixels within the hidden pixel distribution are clustered to obtain a clustered hidden pixel distribution. Finally, contamination processing and filtering are performed based on the clustered hidden pixel distribution to obtain the contamination identification result. In other words, by setting a dynamic neighbor pixel retrieval range based on mold contamination and fat texture features for contamination feature filtering, mold and fat texture on the beef surface can be accurately distinguished, effectively reducing misjudgments caused by the similarity between mold and fat texture, and significantly improving the accuracy, reliability, and precision of mold contamination identification on the beef surface.

[0061] Example 2, as Figure 2 As shown, based on the same inventive concept as the machine vision-based beef surface contamination identification method provided in Embodiment 1, this embodiment of the invention also provides a machine vision-based beef surface contamination identification system, including: a hidden contamination pixel identification module 10, used to acquire beef images of the target beef surface, and use machine learning to identify hidden contamination pixels in the beef image to obtain a hidden pixel distribution; a neighboring pixel retrieval specification setting module 20, used to set neighboring pixel retrieval specifications according to the fat distribution data of the beef surface; and a neighboring pixel retrieval clustering module 30, used to perform neighboring pixel retrieval clustering on multiple hidden pixels within the hidden pixel distribution according to the neighboring pixel retrieval specifications, obtain a clustered hidden pixel distribution, perform contamination processing and screening, and obtain a contamination identification result.

[0062] Furthermore, the machine vision-based beef surface contamination identification system is also used for: acquiring beef images of the target beef surface, wherein the target beef is the beef to be identified for surface contamination; using machine learning to pre-train a contamination pixel identifier; inputting the beef image into the contamination pixel identifier, identifying and outputting the contamination pixel identification result to obtain multiple hidden pixels; and constructing a hidden pixel distribution based on the multiple hidden pixels.

[0063] Furthermore, the machine vision-based beef surface contamination identification system is also used for: collecting a set of sample beef images based on historical identification data of mold contamination on the surface of beef; labeling the mold contamination pixels on the surface of each sample beef image to obtain a set of sample contamination pixel identification results; constructing a contamination pixel recognizer based on a convolutional neural network, including an input layer, a convolutional layer, a pooling layer, a fully connected layer, and an output layer; and training the contamination pixel recognizer using the set of sample beef images and the set of sample contamination pixel identification results until the test converges.

[0064] Furthermore, the machine vision-based beef surface contamination identification system is also used to: construct an image coordinate system within the beef image; and within the image coordinate system, label the coordinates of the plurality of hidden pixels to obtain the distribution of hidden pixels.

[0065] Furthermore, the machine vision-based beef surface contamination identification system is also used to: obtain the maximum fat distribution width on the surface of the same batch of beef, and obtain the minimum contamination diameter of mold contamination on the beef surface; calculate the average of the maximum fat distribution width and the minimum contamination diameter as the distance for neighboring pixel retrieval, and obtain the neighboring pixel retrieval specification.

[0066] Furthermore, the machine vision-based beef surface contamination identification system is also used to: set multiple neighboring pixel retrieval ranges with the coordinates of multiple hidden pixels within the distribution of hidden pixels as the center point and the neighboring pixel retrieval specification as the radius; retrieve and cluster pixels within the multiple neighboring pixel retrieval ranges to obtain multiple clustered hidden pixels, which serve as the clustered hidden pixel distribution.

[0067] Furthermore, the machine vision-based beef surface contamination identification system is also used for: performing grayscale processing on the pixel values ​​of all pixels within the clustered hidden pixel distribution to obtain a clustered grayscale point distribution; performing binarization classification on the grayscale values ​​of all pixels within the clustered grayscale point distribution to obtain a clustered binary point distribution, wherein pixels with grayscale values ​​greater than a preset grayscale threshold are classified as 1, and pixels with grayscale values ​​less than a preset grayscale threshold are classified as 0; calculating the proportion of 1 in each clustered binary point within the clustered binary point distribution to obtain multiple proportions of class 1 pixels, and selecting the clustered hidden pixels corresponding to the proportions of class 1 pixels greater than or equal to a preset proportion threshold as contaminated areas to obtain contamination identification results.

[0068] Although preferred embodiments of the invention have been described, those skilled in the art, once they have learned the basic inventive concept, can make other changes and modifications to these embodiments.

[0069] 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 this invention and its equivalents, this invention also intends to include these modifications and variations.

Claims

1. A method for identifying surface contamination in beef based on machine vision, characterized in that, The methods include: The beef image on the surface of the target beef is acquired, and machine learning is used to identify hidden contamination pixels in the beef image to obtain the distribution of hidden pixels. Based on the fat distribution data on the surface of beef, the neighbor pixel retrieval specifications are set, including: Obtain the maximum fat distribution width on the surface of beef in the same batch, and obtain the minimum contamination diameter of mold on the surface of beef; The average of the maximum fat distribution width and the minimum contamination diameter is calculated and used as the distance for neighboring pixel retrieval to obtain the neighboring pixel retrieval specification; According to the neighbor pixel retrieval specifications, multiple hidden pixels within the hidden pixel distribution are clustered by neighbor pixel retrieval to obtain the clustered hidden pixel distribution. Contamination processing and screening are then performed to obtain the contamination identification result.

2. The method for identifying surface contamination in beef based on machine vision according to claim 1, characterized in that, Acquire images of the surface of the target beef, identify hidden contamination pixels in the beef images, and obtain the distribution of hidden pixels, including: Acquire images of the surface of the target beef, wherein the target beef is the beef for which surface contamination identification is to be performed; Machine learning is used to pre-train a contaminated pixel identifier; The beef image is input into the contaminated pixel identifier, which identifies and outputs the contaminated pixel identification result to obtain multiple hidden pixels. Based on the multiple hidden pixels, a hidden pixel distribution is constructed.

3. The method for identifying surface contamination in beef based on machine vision according to claim 2, characterized in that, Machine learning is used to pre-train a contaminated pixel detector, including: Based on historical identification data of mold contamination on the surface of beef, a set of sample beef images was collected. The mold contamination pixels on the surface of each sample beef image are labeled to obtain a set of sample contamination pixel identification results. Based on convolutional neural networks, a contaminated pixel identifier is constructed, which includes an input layer, a convolutional layer, a pooling layer, a fully connected layer, and an output layer. The contaminated pixel identifier is trained using the set of sample beef images and the set of sample contaminated pixel identification results until the test converges.

4. The method for identifying surface contamination in beef based on machine vision according to claim 2, characterized in that, Based on the plurality of hidden pixels, a hidden pixel distribution is constructed, including: Construct an image coordinate system within the beef image; Within the image coordinate system, the coordinates of the plurality of hidden pixels are marked to obtain the distribution of hidden pixels.

5. The method for identifying surface contamination in beef based on machine vision according to claim 1, characterized in that, According to the neighbor pixel retrieval specifications, multiple hidden pixels within the hidden pixel distribution are clustered using neighbor pixel retrieval to obtain a clustered hidden pixel distribution, including: Using the coordinates of multiple hidden pixels within the distribution of hidden pixels as the center point and the neighboring pixel retrieval specification as the radius, a range for retrieving multiple neighboring pixels is set to obtain the range. Pixels within the retrieval range of the multiple neighboring pixels in the cluster are retrieved to obtain multiple cluster hidden pixels, which are used as the cluster hidden pixel distribution.

6. The method for identifying surface contamination in beef based on machine vision according to claim 5, characterized in that, Pollution treatment screening was conducted to obtain pollution identification results, including: The pixel values ​​of all pixels within the clustered hidden pixel distribution are converted to grayscale to obtain the clustered grayscale point distribution. Based on the gray values ​​of all pixels within the clustered gray value distribution, a binarization classification is performed to obtain the clustered binary point distribution. Pixels with gray values ​​greater than a preset gray value threshold are classified as 1, and pixels with gray values ​​less than the preset gray value threshold are classified as 0. The proportion of 1 in each binary point within the clustered binary point distribution is statistically analyzed to obtain the proportion of multiple 1-class pixels. Latent pixels in the cluster that have a proportion of 1-class pixels greater than or equal to a preset proportion threshold are selected as contaminated areas to obtain contamination identification results.

7. A machine vision-based system for identifying surface contamination in beef, characterized in that, The steps for implementing the machine vision-based method for identifying surface contamination in beef according to any one of claims 1 to 6 include: The hidden contamination pixel identification module is used to acquire beef images of the target beef surface, and to use machine learning to identify hidden contamination pixels in the beef images to obtain the distribution of hidden pixels. The neighboring pixel retrieval specification setting module is used to set the neighboring pixel retrieval specification based on the fat distribution data on the surface of beef, including: Obtain the maximum fat distribution width on the surface of beef in the same batch, and obtain the minimum contamination diameter of mold on the surface of beef; The average of the maximum fat distribution width and the minimum contamination diameter is calculated and used as the distance for neighboring pixel retrieval to obtain the neighboring pixel retrieval specification; The neighboring pixel retrieval and clustering module is used to perform neighboring pixel retrieval and clustering on multiple hidden pixels within the hidden pixel distribution according to the neighboring pixel retrieval specifications, obtain the clustered hidden pixel distribution, perform pollution processing and screening, and obtain pollution identification results.

Citation Information

Patent Citations

  • Fiberboard quality evaluation method based on image processing

    CN114419025A