CN-120198726-B - Beef surface pollution identification method and system based on machine vision
Abstract
The invention relates to a beef surface pollution identification method and a beef surface pollution identification system based on machine vision, which relate to the field of computer vision and comprise the steps of identifying hidden pollution pixels of a beef image by adopting machine learning to obtain hidden pixel distribution; setting a search specification of adjacent pixel points according to fat distribution data of beef surface, carrying out search clustering of adjacent pixel points on a plurality of hidden pixel points in the hidden pixel point distribution according to the search specification of adjacent pixel points to obtain clustered hidden pixel point distribution, and carrying out pollution treatment screening to obtain a pollution identification result. The method can solve the technical problems that the traditional method is difficult to accurately distinguish the fat texture on the beef surface from the mold, and the accuracy and reliability of mold pollution identification are insufficient, and can effectively reduce misjudgment caused by the similarity of the mold and the fat texture by setting the dynamic search range of the adjacent pixel points to carry out pollution characteristic screening, thereby remarkably improving the accuracy, the accuracy and the reliability of mold pollution identification.
Inventors
- CAI XIBIAO
- ZHANG XINGSONG
- YANG HAIHUA
- TAN YEJUN
Assignees
- 广州尚好菜食品有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20250307
Claims (7)
- 1. The beef surface pollution identification method based on machine vision is characterized by comprising the following steps of: Acquiring a beef image on the surface of a target beef, and identifying hidden pollution pixels of the beef image by adopting machine learning to obtain hidden pixel distribution; setting a retrieval specification of adjacent pixel points according to fat distribution data of the beef surface, wherein the method comprises the following steps: obtaining the maximum fat distribution width of the surface of beef in the same batch, and obtaining the minimum pollution diameter of the mold pollution of the surface of beef; calculating the average value of the maximum fat distribution width and the minimum pollution diameter as the retrieval distance of the adjacent pixel points to obtain the retrieval specification of the adjacent pixel points; And according to the adjacent pixel point retrieval specification, carrying out adjacent pixel point retrieval clustering on a plurality of hidden pixel points in the hidden pixel point distribution to obtain clustered hidden pixel point distribution, and carrying out pollution treatment screening to obtain a pollution identification result.
- 2. The machine vision-based beef surface contamination identification method of claim 1, wherein acquiring a beef image of a target beef surface, identifying hidden contamination pixels of the beef image, and obtaining hidden pixel distribution comprises: acquiring a beef image of the surface of target beef, wherein the target beef is beef to be subjected to surface pollution identification; training a polluted pixel point identifier in advance by adopting machine learning; inputting the beef image into the polluted pixel point identifier, and identifying and outputting a polluted pixel point identification result to obtain a plurality of hidden pixel points; And constructing implicit pixel point distribution according to the plurality of implicit pixel points.
- 3. The machine vision based beef surface contamination identification method of claim 2, wherein the pre-training of the contamination pixel identifier using machine learning comprises: collecting a sample beef image set according to historical identification data of mold contamination on the surface of the beef; Marking the mould contamination pixel points on the surface of each sample beef image to obtain a sample contamination pixel point identification result set; Constructing a polluted pixel point identifier comprising an input layer, a convolution layer, a pooling layer, a full-connection layer and an output layer based on the convolution neural network; And training the polluted pixel point identifier by adopting the sample beef image set and the sample polluted pixel point identification result set until the test converges.
- 4. The machine vision-based beef surface contamination identification method of claim 2, wherein constructing an implicit pixel point distribution from the plurality of implicit pixel points comprises: Constructing an image coordinate system in the beef image; and labeling coordinates of the plurality of hidden pixel points in the image coordinate system to obtain hidden pixel point distribution.
- 5. The machine vision-based beef surface contamination identification method of claim 1, wherein performing neighboring pixel search clustering on a plurality of hidden pixels in the hidden pixel distribution according to the neighboring pixel search specification to obtain clustered hidden pixel distribution, comprises: setting and obtaining a plurality of adjacent pixel point retrieval ranges by taking coordinates of a plurality of hidden pixel points in the hidden pixel point distribution as a center point and taking the adjacent pixel point retrieval specification as a radius; and searching and clustering the pixel points in the searching range of the plurality of adjacent pixel points to obtain a plurality of clustering hidden pixel points which are used as clustering hidden pixel point distribution.
- 6. The machine vision-based beef surface contamination identification method of claim 5, wherein performing a contamination treatment screen to obtain a contamination identification result comprises: graying pixel values of all pixel points in the clustering hidden pixel point distribution to obtain clustering gray point distribution; According to the gray values of all the pixel points in the clustered gray point distribution, carrying out binary classification to obtain clustered binary point distribution, wherein the pixel points with the gray values larger than a preset gray threshold value are classified as1, and the pixel points with the gray values smaller than the preset gray threshold value are classified as 0; And counting the duty ratio of 1 in each clustering binary point in the clustering binary point distribution to obtain a plurality of 1-class pixel point duty ratios, screening the clustering hidden pixel points corresponding to the 1-class pixel point duty ratio which is larger than or equal to a preset duty ratio threshold value, and taking the clustering hidden pixel points as a pollution area to obtain a pollution identification result.
- 7. A machine vision based beef surface contamination identification system for implementing the machine vision based beef surface contamination identification method of any one of claims 1 to 6, comprising the steps of: The hidden pollution pixel point identification module is used for acquiring a beef image on the surface of the target beef, and carrying out identification of hidden pollution pixel points on the beef image by adopting machine learning to obtain hidden pixel point distribution; the adjacent pixel point retrieval specification setting module is used for setting the adjacent pixel point retrieval specification according to the fat distribution data of the beef surface, and comprises the following steps: obtaining the maximum fat distribution width of the surface of beef in the same batch, and obtaining the minimum pollution diameter of the mold pollution of the surface of beef; calculating the average value of the maximum fat distribution width and the minimum pollution diameter as the retrieval distance of the adjacent pixel points to obtain the retrieval specification of the adjacent pixel points; And the adjacent pixel point retrieval clustering module is used for carrying out adjacent pixel point retrieval clustering on a plurality of hidden pixel points in the hidden pixel point distribution according to the adjacent pixel point retrieval specification to obtain clustered hidden pixel point distribution, and carrying out pollution treatment screening to obtain a pollution identification result.
Description
Beef surface pollution identification method and system based on machine vision Technical Field The invention relates to the field of computer vision, in particular to a beef surface pollution identification method and system based on machine vision. Background With increasing importance of food safety problems, detection of surface contamination of food becomes an important link for guaranteeing food quality, especially for meat products such as beef, the surface of which may be contaminated with mold and other contaminants, which not only affects the appearance of the food, but also may threaten the health of consumers. At present, the conventional beef surface pollution identification method generally relies on an image processing technology to detect pollution by analyzing the characteristics of the beef surface such as color, texture and the like, however, the identification accuracy of partial pollution is lower, for example, mold pollution is usually represented as a white or nearly white area, and the fat texture of the beef surface is also mostly white or light lines or a grid-like structure. Disclosure of Invention Aiming at the technical problems that the traditional beef surface mould contamination identification method is difficult to accurately distinguish surface fat textures from mould, and the accuracy and reliability of mould contamination identification are insufficient, the invention provides a beef surface contamination identification method and a beef surface contamination identification system based on machine vision. The technical scheme for solving the technical problems is as follows: The beef surface pollution identification method based on machine vision comprises the steps of collecting beef images of a target beef surface, identifying hidden pollution pixels of the beef images by machine learning to obtain hidden pixel distribution, setting adjacent pixel retrieval specifications according to fat distribution data of the beef surface, carrying out adjacent pixel retrieval clustering on a plurality of hidden pixels in the hidden pixel distribution according to the adjacent pixel retrieval specifications to obtain clustered hidden pixel distribution, and carrying out pollution treatment screening to obtain pollution identification results. Preferably, the beef surface pollution identification method based on machine vision further comprises the steps of collecting beef images of the surface of target beef, wherein the target beef is beef to be subjected to surface pollution identification, training a pollution pixel point identifier in advance by adopting machine learning, inputting the beef images into the pollution pixel point identifier, identifying and outputting pollution pixel point identification results to obtain a plurality of hidden pixel points, and constructing hidden pixel point distribution according to the plurality of hidden pixel points. The beef surface pollution identification method based on machine vision preferably further comprises the steps of collecting a sample beef image set according to historical identification data of mold pollution on the beef surface, marking mold pollution pixel points on the surface of each sample beef image to obtain a sample pollution pixel point identification result set, constructing a pollution pixel point identifier comprising an input layer, a convolution layer, a pooling layer, a full-connection layer and an output layer based on a convolution neural network, and training the pollution pixel point identifier until testing is converged by adopting the sample beef image set and the sample pollution pixel point identification result set. Preferably, the beef surface pollution identification method based on machine vision further comprises the steps of constructing an image coordinate system in the beef image, and labeling coordinates of the hidden pixels in the image coordinate system to obtain hidden pixel distribution. Preferably, the beef surface pollution identification method based on machine vision further comprises the steps of obtaining the maximum fat distribution width of the beef surface of the same batch, obtaining the minimum pollution diameter of mold pollution of the beef surface, calculating the average value of the maximum fat distribution width and the minimum pollution diameter as the search distance of the adjacent pixel points, and obtaining the search specification of the adjacent pixel points. Preferably, the beef surface pollution identification method based on machine vision further comprises the steps of setting and obtaining a plurality of adjacent pixel point retrieval ranges by taking coordinates of a plurality of hidden pixels in the hidden pixel point distribution as a center point and taking the adjacent pixel point retrieval specification as a radius, and retrieving and clustering pixels in the plurality of adjacent pixel point retrieval ranges to obtain a plurality of clustered hidden pixel