A machine vision identification method and system for commercially doped frozen mutton slices
By using machine vision recognition methods, combined with joint modeling of multi-color space and gray-level co-occurrence matrix texture features and PCA dimensionality reduction, the problem of rapid and accurate identification of adulterated commercial frozen mutton slices was solved, achieving efficient identification in ordinary computing environments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA AGRI UNIV
- Filing Date
- 2026-03-30
- Publication Date
- 2026-07-03
Smart Images

Figure CN122336740A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of food quality authenticity testing and computer vision technology, and in particular to a machine vision recognition method and system for commercially available frozen mutton slices adulterated with other products. Background Technology
[0002] Frozen lamb slices are a common meat product in hot pot and home consumption, and commonly come in three forms: whole-cut lamb slices, prepared lamb slices, and reconstituted lamb slices. According to standards such as SB / T 10379-2012 "Quick-frozen Prepared Foods" and SB / T 10482-2008 "Quality and Safety Requirements for Pre-prepared Meat Foods," the market has set basic requirements for the quality and safety of frozen prepared meat products. However, in actual circulation, there are still cases where reconstituted meat, mixed meat, or other heterogeneous meat and meat products are used to impersonate high-quality whole-cut lamb slices, which not only harms consumer rights but also increases the difficulty for regulatory authorities to verify the authenticity of commercially available frozen lamb slices.
[0003] Existing methods for identifying adulteration in meat products mostly employ laboratory techniques such as physicochemical testing, immunological analysis, or molecular biological detection. Some methods also utilize instruments like near-infrared spectroscopy for qualitative and quantitative analysis of raw meat. While these methods have some ability to detect adulteration, they typically require complex sample pretreatment, expensive specialized equipment, and skilled technicians. The testing cycles are long and costly, making them unsuitable for large-scale, rapid screening in slaughterhouses, processing plants, distribution channels, and catering establishments. Furthermore, existing research on meat identification based on image processing largely relies on single color spaces or limited texture features. Feature design is highly empirical, resulting in limited classification accuracy and generalization ability.
[0004] Commercially available frozen mutton slices, whether whole-cut, processed, or reconstituted, exhibit complex color and texture differences in visible light images due to the combined effects of fat and muscle tissue distribution, seasoning treatment, and compression molding processes. Traditional methods lack a standardized preprocessing approach under uniform imaging conditions, which simultaneously extracts color and texture features from multiple color spaces and gray-level co-occurrence matrices. Furthermore, this approach requires a technical solution for rapidly and objectively classifying pure and adulterated samples using feature reduction and machine learning models. Therefore, it is necessary to provide a machine vision-based method for identifying adulterated frozen mutton slices in commercially available frozen mutton, to improve identification efficiency and engineering applicability while ensuring detection accuracy. Summary of the Invention
[0005] To overcome the shortcomings of existing technologies, the purpose of this invention is to provide a machine vision recognition method and system for commercially available frozen mutton slices adulterated with chemicals. By using standardized visible light imaging conditions, joint modeling of multi-color space and gray-level co-occurrence matrix texture features, and PCA dimensionality reduction, a stable and highly discriminative feature representation system suitable for commercially available frozen mutton slices is constructed, thereby overcoming the problem of traditional methods being highly dependent on illumination and empirical feature selection.
[0006] To achieve the above objectives, the present invention provides the following solution:
[0007] A machine vision method for identifying commercially available frozen mutton slices adulterated with other meats includes:
[0008] After thawing and flattening the frozen mutton slices on a white PP board on black cardstock, the mutton slices were placed in a photography box. A JPG image was taken of each sample in the photography box using a visible light imaging system to obtain the original mutton slice image set.
[0009] The original mutton slice image set is subjected to unified resolution and normalization processing. In each image of the original mutton slice image set, a circular region of interest containing mutton slices is located and cropped. The circular region of interest is placed in the center of a black background of a preset size. At the same time, data enhancement is performed by rotation, scaling, cropping, adding noise and color jitter to obtain a preprocessed image set.
[0010] Each image in the preprocessed image set is converted to three color spaces: RGB, HSV, and Lab. The pixel values of each color channel in the three color spaces are extracted. The mean and standard deviation of each color channel are calculated according to the color matrix. The mean and standard deviation of each color channel are concatenated in channel order to form a color feature vector and a color feature sample set is constructed.
[0011] Each image in the preprocessed image set is converted into a grayscale image. A grayscale co-occurrence matrix is constructed under a given step size and multiple orientation angles. Five texture parameters, namely homogeneity, contrast, correlation, energy and entropy, are calculated. The five texture parameters are concatenated in a predetermined order to form a texture feature vector and a texture feature sample set is constructed.
[0012] The color feature sample set and the texture feature sample set are combined into a high-dimensional feature sample set. Principal component analysis (PCA) is performed on the high-dimensional feature sample set, and the top principal components with a cumulative contribution rate of more than 99% are selected to obtain the dimensionality-reduced feature sample set.
[0013] Using the reduced feature sample set and the corresponding labels of original sliced mutton, prepared mutton, and reconstituted mutton as training data, a random forest (RF) classification model is trained. The random forest (RF) classification model is then used to classify the frozen mutton slice images to be tested. Samples identified as reconstituted mutton slices are determined to be frozen mutton slices adulterated with foreign meat and meat products.
[0014] Preferably, the visible light imaging system includes: a camera, a pure white LED light source, and a background plate, wherein the camera is a dual rear ultra-wide-angle lens of an iPhone 15, the lens model is IMX803, the aperture is f / 1.6, and the focal length is 6 mm; the pure white LED light source consists of two pure white LED bulbs fixed in the rectangular camera box by a bracket; the background plate is a white PP board with dimensions of 150 mm × 200 mm × 3 mm laid on black cardstock.
[0015] Preferably, the frozen mutton slices to be tested are thawed and flattened on a white PP board on black cardstock, including:
[0016] The frozen mutton slices to be tested were placed on the white PP board to thaw naturally, and then the frozen mutton slices to be tested were spread out with cotton swabs to keep the mutton fat and muscle tissue intact and avoid separation or tearing before taking pictures.
[0017] Preferably, in each image of the original mutton slice image set, a circular region of interest containing mutton slices is located and cropped, and the circular region of interest is placed in the center of a black background of a preset size, including:
[0018] The OpenCV library in Python was used to automatically locate and extract the circular region of interest containing the mutton slices in each image of the original mutton slice image set;
[0019] The circular region of interest is placed in the center of a black background with a size of 3000×3000 pixels to unify the image resolution.
[0020] Preferably, the plurality of said orientation angles include: 0°, 45°, 90° and 135°.
[0021] Preferably, when training the Random Forest (RF) classification model, a bagging method is used to perform bootstrap sampling on the dimensionality-reduced feature sample set to construct multiple decision trees, and only a portion of the features are randomly selected from all features to participate in the split at each split decision node in order to reduce the correlation between different decision trees.
[0022] Preferably, the number of trees in the random forest (RF) classification model is 100, and the random number seed is set to 42.
[0023] Preferably, it further includes:
[0024] The classification results of the Random Forest (RF) classification model are evaluated using four metrics: accuracy, precision, recall, and F1 score.
[0025] Preferably, it further includes:
[0026] The Kruskal-Wallis H test was used to perform statistical analysis on the color feature sample set and the texture feature sample set, respectively. When a significant difference was detected, the Dunn post-hoc test was performed to verify the differences in the mean and standard deviation of the original cut mutton slices, the prepared mutton slices and the reconstituted mutton slices in each color channel and in the five texture parameters, so as to provide a basis for feature selection and result interpretation of the random forest RF classification model.
[0027] A machine vision method for identifying commercially available frozen mutton slices adulterated with other meats includes:
[0028] The image acquisition unit is used to thaw and flatten the frozen mutton slices placed on a white PP board on black cardboard and then put them into the photography box. The visible light imaging system, which includes a camera, a pure white LED light source and a background board, takes a JPG image of each sample in the photography box to obtain the original mutton slice image set.
[0029] The image preprocessing unit is used to perform unified resolution and normalization processing on the original mutton slice image set, locate and crop a circular region of interest containing mutton slices in each image of the original mutton slice image set, and place the circular region of interest in the center of a black background of a preset size. At the same time, data enhancement is performed by rotation, scaling, cropping, adding noise and color jitter to obtain a preprocessed image set.
[0030] The color feature extraction unit is used to convert each image in the preprocessed image set to three color spaces: RGB, HSV, and Lab, extract the pixel values of each color channel, calculate the mean and standard deviation of each color channel according to the color matrix, and concatenate the mean and standard deviation of each color channel in channel order to form a color feature vector, thereby constructing a color feature sample set.
[0031] The texture feature extraction unit is used to convert each image in the preprocessed image set into a grayscale image, construct a grayscale co-occurrence matrix under a given step size and multiple orientation angles, calculate five texture parameters: homogeneity, contrast, correlation, energy and entropy, and concatenate the five texture parameters in a predetermined order to form a texture feature vector and construct a texture feature sample set.
[0032] The feature dimensionality reduction unit is used to combine the color feature sample set and the texture feature sample set into a high-dimensional feature sample set, perform principal component analysis (PCA) on the high-dimensional feature sample set, select the top principal components with a cumulative contribution rate of more than 99%, and obtain the dimensionality-reduced feature sample set.
[0033] The classification modeling and doping discrimination unit is used to train a random forest RF classification model using the dimensionality-reduced feature sample set and the corresponding labels of original cut mutton slices, prepared mutton slices and reconstituted mutton slices as training data, and to classify the frozen mutton slice images to be tested using the random forest RF classification model. The samples identified as reconstituted mutton slices are determined to be frozen mutton slices doped with foreign meat and meat products.
[0034] The present invention discloses the following technical effects:
[0035] This invention achieves standardization and repeatability in the image acquisition and preprocessing stages. Existing methods for detecting adulteration in meat products largely rely on laboratory chemical testing or non-standardized image acquisition, lacking unified imaging conditions. This results in identification results being significantly affected by differences in lighting, angle, and equipment. This invention constructs a visible light imaging system consisting of a camera, a pure white LED light source, and a background panel, and completes image capture in a standard photographic box, enabling each sample to obtain high-quality images with consistent brightness and color temperature. Combined with circular region of interest extraction and unified resolution normalization preprocessing, it ensures comparability between input samples and stability of subsequent feature extraction, fundamentally solving the problems of uneven lighting and background interference in traditional image acquisition.
[0036] This invention achieves multi-space fusion of color and texture information at the feature extraction level. Traditional recognition methods based on a single color space struggle to reflect the subtle differences in multidimensional spectral features between prepared and reconstituted meat. This invention extracts color matrix features from each channel in RGB, HSV, and Lab color spaces, and combines these features with five texture parameters—homogeneity, contrast, correlation, energy, and entropy—from the gray-level co-occurrence matrix to form a high-dimensional comprehensive feature sample set. After dimensionality reduction using Principal Component Analysis (PCA), key information with a cumulative contribution rate exceeding 99% is retained, significantly improving the compactness and discriminativeness of the feature representation and overcoming the subjectivity of traditional manual feature selection.
[0037] This invention achieves a balance between accuracy and interpretability in classification modeling and detection efficiency. Compared to the limitations of deep networks, which require large-scale samples and high computing power, this invention employs a Random Forest (RF) model, constructing multiple decision trees through bagging and random feature selection mechanisms, thereby improving the model's resistance to overfitting and its generalization performance. Verification has shown that the model consistently outputs high accuracy, precision, recall, and F1 score in the classification of whole-cut, processed, and reconstituted mutton slices. This method enables rapid identification and traceability in ordinary computer environments, making it suitable for rapid detection scenarios by market regulators and enterprises, significantly improving the practicality and reliability of identifying adulterated commercially available frozen mutton slices. Attached Figure Description
[0038] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the 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.
[0039] Figure 1 A flowchart of the method provided in an embodiment of the present invention;
[0040] Figure 2 This is a schematic diagram of the technical route provided in the embodiments of the present invention;
[0041] Figure 3 This is a schematic diagram of the preprocessing process provided in an embodiment of the present invention;
[0042] Figure 4 This is a schematic diagram of the confusion matrix of the Random Forest (RF) model provided in an embodiment of the present invention. Detailed Implementation
[0043] 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.
[0044] The purpose of this invention is to provide a machine vision recognition method and system for commercially available frozen mutton slices adulterated with other meats. The method uses a random forest (RF) model to classify whole-cut, processed, and reconstituted mutton slices, taking into account recognition accuracy, computational efficiency, and result interpretability. It achieves rapid and reliable identification of frozen mutton slices adulterated with other meats and meat products under normal computing conditions.
[0045] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0046] Figure 1 A flowchart of the method provided in the embodiments of the present invention, such as Figure 1 As shown, the present invention provides a machine vision recognition method for commercially available frozen mutton slices adulterated with meat, comprising:
[0047] Step 100: Place the frozen mutton slices to be tested on a white PP board on black cardboard to thaw and flatten them. Then place them in a photography box and use a visible light imaging system including a camera, a pure white LED light source and a background board to take a JPG image of each sample in the photography box to obtain the original mutton slice image set.
[0048] Step 200: Perform resolution and normalization processing on the original mutton slice image set. Locate and crop the circular region of interest containing mutton slices in each image of the original mutton slice image set, and place the circular region of interest in the center of a black background of a preset size. At the same time, perform data enhancement by rotation, scaling, cropping, adding noise and color jitter to obtain the preprocessed image set.
[0049] Step 300: Convert each image in the preprocessed image set to RGB, HSV and Lab color spaces, extract the pixel values of each color channel, calculate the mean and standard deviation of each color channel according to the color matrix, and concatenate the mean and standard deviation of each color channel in channel order to form a color feature vector and construct a color feature sample set.
[0050] Step 400: Convert each image in the preprocessed image set into a grayscale image, construct a grayscale co-occurrence matrix under a given step size and multiple orientation angles, calculate five texture parameters: homogeneity, contrast, correlation, energy, and entropy, and concatenate the five texture parameters in a predetermined order to form a texture feature vector, and construct a texture feature sample set.
[0051] Step 500: Combine the color feature sample set and the texture feature sample set into a high-dimensional feature sample set. Perform principal component analysis (PCA) on the high-dimensional feature sample set and select the top principal components with a cumulative contribution rate of over 99% to obtain the dimensionality-reduced feature sample set.
[0052] Step 600: Using the reduced feature sample set and the corresponding labels of original sliced mutton, prepared mutton, and reconstituted mutton as training data, train a random forest (RF) classification model, and use the random forest (RF) classification model to classify the frozen mutton slice images to be tested. The samples identified as reconstituted mutton slices are determined to be frozen mutton slices adulterated with foreign meat and meat products.
[0053] Specifically, the method in this embodiment is based on the principles of visible light imaging and machine learning. By collecting and analyzing the color and texture differences of different varieties of frozen mutton slices under visible light, it achieves rapid detection and classification of pure and adulterated samples. This embodiment is applicable to the qualitative determination of adulteration in different varieties of frozen mutton slices. Without changing the technical principles, it can also be applied to the identification of adulteration in other similar sliced frozen meat products such as frozen beef slices, as well as the qualitative detection of prepared meat products that meet the relevant standards for the quality and safety requirements of quick-frozen prepared foods and pre-prepared meat products. In this embodiment, the "visible light imaging system" refers to an imaging device combination used to acquire images of the sample surface, specifically designed to acquire images of mutton slices under uniform illumination conditions, providing a stable data source for subsequent feature extraction and classification.
[0054] In this embodiment, purified water and ethanol are selected as the basic reagents for maintaining the experimental environment and equipment. The purified water is Grade I water that meets relevant standards and is mainly used to clean the sample placement area, the background plate surface, and auxiliary tools that come into contact with the samples. This reduces the impact of environmental residues and stains on image acquisition, thereby ensuring the authenticity of the color and texture information of the meat slices. The ethanol is chromatographically pure and is mainly used to wipe and disinfect the background plate surface, the inside of the imaging box, and its supporting components. This removes grease and stains, reduces the risk of microbial contamination, and avoids abnormal bright or dark spots in the image caused by surface reflections, stains, or residue, ensuring a clean background and clear contrast in the acquired images. By limiting the specifications and usage scenarios of the above reagents, this embodiment enables those skilled in the art to directly reproduce the experimental environment.
[0055] In this embodiment, the instrument and equipment configuration is optimized by constructing a unified visible light imaging system and a stable computing platform, ensuring the operability and repeatability of the method in practical applications. The camera used in this embodiment is a dual-lens ultra-wide-angle rear camera from a smartphone, with fixed lens pixels and optical parameters. The aperture and focal length are suitable for obtaining clear images of meat slices within a limited space. Two pure white light bulbs are used as the light source and are fixed inside a rectangular imaging box by a bracket, ensuring uniform and stable white light illumination of the sample in a closed space, reducing ambient light interference. The background board is a white board laid on black cardstock, with a fixed size, used to provide a high-contrast background, facilitating accurate segmentation of the mutton slice area during image preprocessing. The computer configuration used in this embodiment includes an operating system, processor, memory, hard disk, and corresponding interpreted execution environment for running image preprocessing, feature extraction, and machine learning model training and inference programs. The above equipment together constitutes a hardware and software environment suitable for implementing this method, giving the machine vision recognition method described in claim 1 a clear implementation path and repeatability.
[0056] This embodiment further supplements the specific composition and function of the visible light imaging system to ensure that the present invention has sufficient disclosure and can be directly implemented by those skilled in the art. The camera used in this embodiment is a dual-lens ultra-wide-angle lens from the rear of an iPhone 15 smartphone, with an IMX803 lens, an aperture of f / 1.6, and a focal length of 6mm. The aforementioned lens model and optical parameters ensure that the captured images of frozen mutton slices have high clarity and a large amount of light intake, thereby enhancing the ability to capture color details and texture information and avoiding image noise caused by insufficient lighting. The light source used in this embodiment is two pure white LED bulbs, fixed in a rectangular photography box by a metal bracket, so that the sample receives uniform white light illumination from a fixed direction during the shooting process, reducing brightness fluctuations caused by environmental changes. The background board is a white PP board, measuring 150mm × 200mm × 3mm, uniformly laid on a black cardboard surface to form a high-contrast background, ensuring that the frozen mutton slices placed on it have clear edges and stable recognition in subsequent image segmentation and region of interest localization steps, thereby improving the accuracy of the model in extracting the meat slice area.
[0057] Specifically, the analysis steps in this embodiment are as follows:
[0058] (1) Sample preparation and image acquisition:
[0059] Before shooting, the lamb rolls were thawed on a white PP board and unfolded with cotton swabs, taking care to avoid separating or tearing the lamb fat and muscle tissue. Then, the flattened lamb slices, along with the background board, were placed in a photography box for shooting. One image was taken for each sample and saved in JPG format.
[0060] (2) Image preprocessing:
[0061] Preprocessing includes operations such as resolution unification, normalization, region of interest (ROI) extraction, and data augmentation. Resolution unification scales the original image to ensure pixel values meet the network dimensionality requirements during model training. Normalization adjusts the range of pixel values to make them more stable during model computation. ROI extraction locates and extracts target regions containing key information for subsequent feature extraction and classification. Data augmentation involves applying random transformations to the original image, such as rotation, scaling, cropping, adding noise, and color jitter, to increase the diversity of the dataset and improve the model's generalization ability.
[0062] (3) Feature extraction:
[0063] 1) Color characteristics:
[0064] The color channel component values of HSV, RBG, and Lab color spaces are extracted, and the variance and mean of each channel are calculated to construct the color characteristics of the mutton slices. The calculation method of the color matrix is as follows:
[0065] ;
[0066] ;
[0067] in, Indicates the first The average pixel value of each color channel. The standard deviation of a color channel. For the first The pixel in the first The values of each color channel, The total number of pixels in each color channel.
[0068] 2) Texture features:
[0069] This method uses gray-level co-occurrence matrix analysis to analyze the texture features of mutton slices. The calculation method is as follows:
[0070] For the grayscale image to be analyzed Let the number of pixels in the horizontal and vertical directions be respectively and The number of pixel gray levels is Then grayscale image It can be represented as:
[0071] ;
[0072] Based on this, two external parameters are introduced: step size and step size. and direction angle .in, Represents the midpoint of the coordinate system Time The distance between, This represents the angle between the line connecting these two points and the positive x-axis. Typically, the line connecting these two points along the x-axis is set to... The counter-clockwise direction is considered the positive direction. Define the gray-level co-occurrence matrix. grayscale and In step length ,direction The probability of the following two items appearing together is:
[0073] ;
[0074] because It is a symmetric matrix that satisfies the following symmetry relation: , , , Therefore, usually only consider The probability of pixel pairs in the gray-level co-occurrence matrix (GLCM) at angles of 0°, 45°, 90°, and 135°. The calculation method is as follows:
[0075] ;
[0076] ;
[0077] ;
[0078] ;
[0079] in, These are the coordinates of the reference pixel in the co-occurrence matrix; It corresponds to the reference pixel, and the direction is... Distance is The adjacent pixel coordinates; It is the spatial extent of the image (width × height), that is, the set of all pixel coordinates.
[0080] Different feature parameters can convey different texture information. This study selected five parameters—contrast, correlation, homogeneity, energy, and entropy—for analysis. The specific meanings and calculation formulas are shown in Table 1.
[0081] Table 1 Texture Features
[0082] (4) Artificial intelligence model.
[0083] 1) Random Forest:
[0084] Random Forest (RF) methods employ a bagging approach to process data, randomly selecting a subset from the original dataset during training to ensure the diversity of training data for each decision tree. When constructing each decision tree, RF introduces randomness into feature selection, choosing only a portion of the total feature set for splitting decision nodes each time to reduce correlation between different trees. Finally, RF makes the final prediction using either voting (classification) or averaging (regression).
[0085] 2) Convolutional Neural Networks:
[0086] The Inception V3 convolutional neural network model takes a 224×224 three-channel image as input. The network's front end performs initial feature extraction and image compression through convolution and pooling operations. Then, it enters multiple Inception modules for deeper feature learning. Each Inception module consists of multiple parallel branches using convolutional kernels of different sizes and structures. All branch results are concatenated using Filter Concat to fuse multi-scale information.
[0087] Optionally, this method selects four indicators—accuracy, precision, recall, and F1 score—to evaluate the method's identification performance. The meanings and calculation formulas are shown in Table 2.
[0088] Table 2 Model Evaluation Indicators
[0089] Note: T p The number of samples that are actually positive and are identified as positive; F p The number of samples that are actually negative but are misclassified as positive by the model; F n The number of samples that are actually positive but are misclassified as negative by the model; N refers to the total number of samples.
[0090] This method collects 600 images of mutton slices, including 200 original slices, 200 processed slices, and 200 reconstituted slices. These images are preprocessed and used to train a random forest (RF) model. Finally, accuracy, precision, recall, and F1 score are reported to evaluate the model performance.
[0091] After image acquisition, the OpenCV library in Python was used to locate and extract circular regions of interest (ROIs) containing lamb slices from each image. These extracted circular regions were then centered on a 3000×3000 pixel black background to standardize image resolution and facilitate subsequent normalization processing. The preprocessing steps are detailed below. Figure 2 .
[0092] This method extracts the mean and standard deviation of each channel in the RGB, HSV, and Lab color spaces as the color features of the mutton slices. The results are shown in Table 3.
[0093] Table 3 Mean values of color features
[0094] feature Reconstituted mutton slices Prepared Lamb Slices Original sliced mutton R-mean 45.63 46.14 57.66 G mean 23.72 25.75 28.2 B mean 55.34 57.06 59.39 H-mean 2.87 2.77 3.13 S-mean 45.63 46.15 57.67 V mean 56.37 57.38 72.13 L mean 36.91 37.6 44.74 a mean 134.5 133.88 136.41 b-mean 9.03 9.28 14.45 R standard deviation 31.37 32.06 35.48 G standard deviation 78.6 77.41 84.83 B standard deviation 43.39 47.32 50.28 H standard deviation 32.07 32.39 44.15 S standard deviation 5 5.53 5.61 V standard deviation 78.6 77.41 84.83 L standard deviation 132.76 132.9 135.96 a standard deviation 64.06 64.61 68.23 b Standard deviation 11.33 10.15 13.41
[0095] Table 3 shows that the original cut mutton slices have the highest mean values for each color channel, indicating that the color of these slices is redder and brighter, reflecting the natural, fresh, and unprocessed characteristics of pure meat products. At the same time, the original cut mutton slices also have the largest standard deviation for each channel, due to the significant color difference between muscle and fat tissues. Reconstituted mutton slices have the lowest mean values for the R, G, and B channels, indicating an overall duller color and insufficient redness; the S, V, and b channels also have the lowest mean values, indicating weaker color saturation and brightness. Reconstituted mutton slices have the smallest standard deviations across multiple channels, indicating more uniform color, which may be related to the mixing and pressing of fat and muscle during production. The color characteristics of processed mutton slices fall between those of original cut and reconstituted mutton slices, being closer to reconstituted mutton slices, because although different types of meat are used in their production, the processing procedures are quite similar.
[0096] To investigate whether there are differences in color characteristics among the three types of mutton slices, this method used the Kruskal-Wallis H test to statistically analyze the mean and standard deviation of each color channel (Table 4). The results showed that all color features differed significantly among the different types of mutton slices (p < 0.05), indicating that color features have good discriminative potential in sample classification. Therefore, all color features will be used for training the machine learning model. A post-hoc Dunn test revealed significant differences in the mean and standard deviation of all color features between whole-cut mutton slices and reconstituted mutton slices (p < 0.05), indicating that the color difference between whole-cut and reconstituted mutton slices was the greatest.
[0097] Table 4. Kruskal-Wallis H test and Dunn post-hoc test for color characteristics.
[0098] feature Kruskal_Stat p-value Recombination vs. Conditioning Recombination vs. Original Cut Conditioning vs. Original Cut R-mean 133.439 <0.001 1.000 <0.001 <0.001 G mean 20.177 <0.001 0.018 <0.001 0.264 B mean 21.949 <0.001 0.002 <0.001 0.821 H-mean 25.891 <0.001 1.000 <0.001 <0.001 S-mean 133.439 <0.001 1.000 <0.001 <0.001 V mean 150.878 <0.001 0.086 <0.001 <0.001 L mean 92.455 <0.001 0.435 <0.001 <0.001 a mean 120.302 <0.001 0.056 <0.001 <0.001 b-mean 21.949 <0.001 0.002 <0.001 0.821 R standard deviation 33.129 <0.001 1.000 <0.001 <0.001 G standard deviation 78.096 <0.001 1.000 <0.001 <0.001 B standard deviation 34.659 <0.001 <0.001 <0.001 0.915 H standard deviation 185.523 <0.001 1.000 <0.001 <0.001 S standard deviation 14.553 0.001 <0.001 0.020 1.000 V standard deviation 78.096 <0.001 1.000 <0.001 <0.001 L standard deviation 194.214 <0.001 <0.001 <0.001 <0.001 a standard deviation 34.936 <0.001 0.011 <0.001 <0.001 b Standard deviation 34.659 <0.001 <0.001 <0.001 0.915
[0099] This method extracted homogeneity, contrast, correlation, energy, and entropy as texture features of mutton slices, and the results are shown in Table 5. Original-cut mutton slices had the highest energy and entropy, indicating that they had the richest texture information and the most complex structure, consistent with the characteristics of clear texture and distinct layers in original-cut meat. Reconstituted mutton slices had the highest uniformity and correlation, indicating the smoothest texture and the most consistent direction. However, they also had the lowest entropy and energy, indicating less texture variation and a lack of natural texture. Most of the texture indicators for processed mutton slices fell between those of original-cut and reconstituted mutton slices, indicating that while they retained some natural texture during processing, they were also affected by mixing, seasoning, and other treatments.
[0100] Table 5 Mean values of texture features
[0101] feature Reconstituted mutton slices Prepared Lamb Slices Original sliced mutton homogeneity 0.89 0.87 0.86 Contrast 1.18 1.90 1.78 Relevance 0.96 0.93 0.94 energy 2.25 2.48 2.92 entropy 1.52 1.68 1.96
[0102] This method used the Kruskal-Wallis H test to statistically analyze the texture features (Table 6). The results showed that all texture features were significantly different among different types of mutton slices (p < 0.05), indicating that texture features can distinguish different types of mutton slices, and all texture features will be used for training the machine learning model. Dunn post-hoc tests showed that all texture features of prepared or whole-cut mutton slices were significantly different from reconstituted mutton slices (p < 0.05), indicating that the surface texture of reconstituted mutton slices was significantly different from the other two types of mutton slices. However, there were no significant differences in contrast and correlation between prepared mutton slices and whole-cut mutton slices, indicating that they were similar in the directionality and roughness of their surface texture.
[0103] Table 6. Kruskal-Wallis H test and Dunn post-hoc test for texture features
[0104] feature Kruskal_Stat p-value Recombination vs. Conditioning Recombination vs. Original Cut Conditioning vs. Original Cut homogeneity 95.759 <0.001 <0.001 <0.001 <0.001 Contrast 71.808 <0.001 <0.001 <0.001 1.000 Relevance 131.242 <0.001 <0.001 <0.001 0.136 energy 124.862 <0.001 0.001 <0.001 <0.001 entropy 123.397 <0.001 <0.001 <0.001 <0.001
[0105] This method simplifies the data and reduces the computational complexity of the model through dimensionality reduction. PCA is used for feature dimensionality reduction. As shown in Table 7, the cumulative contribution rate of the first 7 principal components exceeds 99%.
[0106] Table 7 Summary of Statistical Characteristics of Principal Components
[0107] principal component Eigenvalues Contribution rate Cumulative contribution rate 1 11.930 0.518 0.518 2 6.088 0.264 0.782 3 2.904 0.126 0.908 4 0.870 0.038 0.946 5 0.562 0.024 0.970 6 0.342 0.015 0.985 7 0.184 0.008 0.993
[0108] This method employs a Random Forest (RF) machine learning model, using the seven principal components obtained after PCA dimensionality reduction as input to train the lamb slice classification model. Model parameters: N_estimators: 100; Random_state: 42. The RF model is trained and tested on the dimensionality-reduced feature data; the results are shown in Table 8. Figure 3 The confusion matrix shows that 187 out of 200 whole-cut mutton slices were accurately identified, 13 were identified as processed mutton slices, and no samples were identified as reconstituted mutton slices. Among the reconstituted mutton slices (i.e., adulterated mutton slices), 192 were accurately identified, 8 were identified as processed mutton slices, and no reconstituted mutton slices were classified as whole-cut mutton slices. The overall classification accuracy of the method was 90.00%. Furthermore, the RF model demonstrated good classification performance, with an average precision, recall, and F1 score of 92%.
[0109] Table 8. Recognition accuracy of the mutton slice dataset in the RF model.
[0110]
[0111] This embodiment extracts 23 features from the RGB, HSV, and Lab color spaces, including the mean, standard deviation of each channel, and homogeneity, correlation, contrast, energy, and entropy from the gray-level co-occurrence matrix. Dimensionality reduction is achieved using PCA, and the first seven principal components are used as model inputs for training four classifiers: K-Neighbor Neighbor (KNN), Linear Discriminant Analysis (LDA), Random Forest (RF), and Support Vector Machine (SVM). Results show that the RF model outperforms the other three models overall, achieving a classification accuracy of 91.67%.
[0112] In this embodiment, a deep learning model is used for lamb slice classification. The training and test sets are divided in a 9:1 ratio. Based on the transfer learning approach, three classic convolutional neural networks—VGG16, InceptionV3, and ResNet50—are introduced. The fully connected layer structure is modified, and the bottom-level weights are frozen to adapt to the current task. The results show that VGG16 achieves a classification accuracy of 99.17% on the test set, demonstrating the best performance. InceptionV3 has advantages in deployment in terms of model size, training efficiency, and inference speed, resulting in the best overall performance.
[0113] like Figure 4 As shown, the overall technical route of the image recognition method for commercially available adulterated frozen mutton slices provided in this embodiment includes four main stages: image acquisition, image preprocessing, mutton slice image classification, and model evaluation. Specifically, the image acquisition stage acquires JPG format images of frozen mutton slices laid on a white PP background board; the image preprocessing stage includes region of interest (ROI) extraction and data augmentation operations based on rotation, scaling, cropping, noise reduction, and color jitter; the image classification stage is divided into two categories: traditional machine learning paths and deep learning paths. The traditional path includes the extraction of color and texture features, principal component analysis for dimensionality reduction, and training of classification models such as KNN, LDA, RF, and SVM. The deep learning path includes the training of convolutional neural network models such as VGG16, InceptionV3, and ResNet50; the model evaluation stage uses accuracy, precision, recall, and F1 score to evaluate the classification performance.
[0114] Combination Figure 4In this embodiment, images of mutton slices are first acquired using a visible light imaging system to obtain the original image dataset. Then, in the image preprocessing stage, the OpenCV library in Python is used to extract the Region of Interest (ROI) from each image, separating the main region containing the mutton slices from the complex background. This is combined with uniform resolution, normalization, and data augmentation to construct representative and rich training samples. For traditional machine learning classification, this embodiment sequentially extracts color matrix features from RGB, HSV, and Lab color spaces and five texture parameters from the gray-level co-occurrence matrix. Principal component analysis (PCA) is used to compress the high-dimensional features into principal component vectors with a cumulative contribution rate exceeding 99%, which are then used to train KNN, LDA, RF, and SVM models. For deep learning, the preprocessed images are input into VGG16, InceptionV3, or ResNet50 networks for end-to-end feature learning and classification. Finally, this embodiment uses accuracy, precision, recall, and F1 score to comprehensively evaluate the classification performance of the above models to verify the usability and reliability of the method in the mutton slice adulteration identification scenario.
[0115] Corresponding to the above method, the present invention also provides a machine vision recognition system for commercially available products adulterated with frozen mutton slices, comprising:
[0116] The image acquisition unit is used to thaw and flatten the frozen mutton slices placed on a white PP board on black cardboard and then put them into the photography box. The visible light imaging system, which includes a camera, a pure white LED light source and a background board, takes a JPG image of each sample in the photography box to obtain the original mutton slice image set.
[0117] The image preprocessing unit is used to perform unified resolution and normalization processing on the original mutton slice image set, locate and crop a circular region of interest containing mutton slices in each image of the original mutton slice image set, and place the circular region of interest in the center of a black background of a preset size. At the same time, data enhancement is performed by rotation, scaling, cropping, adding noise and color jitter to obtain a preprocessed image set.
[0118] The color feature extraction unit is used to convert each image in the preprocessed image set to three color spaces: RGB, HSV, and Lab, extract the pixel values of each color channel, calculate the mean and standard deviation of each color channel according to the color matrix, and concatenate the mean and standard deviation of each color channel in channel order to form a color feature vector, thereby constructing a color feature sample set.
[0119] The texture feature extraction unit is used to convert each image in the preprocessed image set into a grayscale image, construct a grayscale co-occurrence matrix under a given step size and multiple orientation angles, calculate five texture parameters: homogeneity, contrast, correlation, energy and entropy, and concatenate the five texture parameters in a predetermined order to form a texture feature vector and construct a texture feature sample set.
[0120] The feature dimensionality reduction unit is used to combine the color feature sample set and the texture feature sample set into a high-dimensional feature sample set, perform principal component analysis (PCA) on the high-dimensional feature sample set, select the top principal components with a cumulative contribution rate of more than 99%, and obtain the dimensionality-reduced feature sample set.
[0121] The classification modeling and doping discrimination unit is used to train a random forest RF classification model using the dimensionality-reduced feature sample set and the corresponding labels of original cut mutton slices, prepared mutton slices and reconstituted mutton slices as training data, and to classify the frozen mutton slice images to be tested using the random forest RF classification model. The samples identified as reconstituted mutton slices are determined to be frozen mutton slices doped with foreign meat and meat products.
[0122] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the systems disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple; relevant parts can be referred to the method section.
[0123] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. Furthermore, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A machine vision method for identifying commercially available frozen mutton slices adulterated with meat, characterized in that, include: After thawing and flattening the frozen mutton slices on a white PP board on black cardstock, the mutton slices were placed in a photography box. A JPG image was taken of each sample in the photography box using a visible light imaging system to obtain the original mutton slice image set. The original mutton slice image set is subjected to unified resolution and normalization processing. In each image of the original mutton slice image set, a circular region of interest containing mutton slices is located and cropped. The circular region of interest is placed in the center of a black background of a preset size. At the same time, data enhancement is performed by rotation, scaling, cropping, adding noise and color jitter to obtain a preprocessed image set. Each image in the preprocessed image set is converted to three color spaces: RGB, HSV, and Lab. The pixel values of each color channel in the three color spaces are extracted. The mean and standard deviation of each color channel are calculated according to the color matrix. The mean and standard deviation of each color channel are concatenated in channel order to form a color feature vector and a color feature sample set is constructed. Each image in the preprocessed image set is converted into a grayscale image. A grayscale co-occurrence matrix is constructed under a given step size and multiple orientation angles. Five texture parameters, namely homogeneity, contrast, correlation, energy and entropy, are calculated. The five texture parameters are concatenated in a predetermined order to form a texture feature vector and a texture feature sample set is constructed. The color feature sample set and the texture feature sample set are combined into a high-dimensional feature sample set. Principal component analysis (PCA) is performed on the high-dimensional feature sample set, and the top principal components with a cumulative contribution rate of more than 99% are selected to obtain the dimensionality-reduced feature sample set. Using the reduced feature sample set and the corresponding labels of original sliced mutton, prepared mutton, and reconstituted mutton as training data, a random forest (RF) classification model is trained. The random forest (RF) classification model is then used to classify the frozen mutton slice images to be tested. Samples identified as reconstituted mutton slices are determined to be frozen mutton slices adulterated with foreign meat and meat products.
2. The machine vision recognition method for commercially available adulterated frozen mutton slices according to claim 1, characterized in that, The visible light imaging system includes: a camera, a pure white LED light source, and a background plate. The camera is a dual-lens ultra-wide-angle lens on the back of an iPhone 15, with an IMX803 lens, an aperture of f / 1.6, and a focal length of 6 mm. The pure white LED light source consists of two pure white LED bulbs fixed inside the rectangular camera box by a bracket. The background plate is a white PP board measuring 150 mm × 200 mm × 3 mm laid on black cardstock.
3. The machine vision recognition method for commercially available adulterated frozen mutton slices according to claim 1, characterized in that, The frozen mutton slices to be tested were placed on a white PP board on black cardstock to thaw and flatten, including: The frozen mutton slices to be tested were placed on the white PP board to thaw naturally, and then the frozen mutton slices to be tested were spread out with cotton swabs to keep the mutton fat and muscle tissue intact and avoid separation or tearing before taking pictures.
4. The machine vision recognition method for commercially available adulterated frozen mutton slices according to claim 1, characterized in that, In each image of the original mutton slice image set, a circular region of interest containing mutton slices is located and cropped, and the circular region of interest is placed in the center of a black background of a preset size, including: The OpenCV library in Python was used to automatically locate and crop the circular region of interest containing the mutton slices in each image of the original mutton slice image set; The circular region of interest is placed in the center of a black background with a size of 3000×3000 pixels to unify the image resolution.
5. The machine vision recognition method for commercially available adulterated frozen mutton slices according to claim 1, characterized in that, The plurality of said orientation angles include: 0°, 45°, 90° and 135°.
6. The machine vision recognition method for commercially available adulterated frozen mutton slices according to claim 1, characterized in that, When training the Random Forest (RF) classification model, the bagging method is used to perform bootstrap sampling on the dimensionality-reduced feature sample set to construct multiple decision trees. At each split decision node, only a portion of the features are randomly selected from all features to participate in the split, so as to reduce the correlation between different decision trees.
7. The machine vision recognition method for commercially available adulterated frozen mutton slices according to claim 1, characterized in that, The random forest (RF) classification model has 100 trees and a random number seed of 42.
8. The machine vision recognition method for commercially available adulterated frozen mutton slices according to claim 1, characterized in that, Also includes: The classification results of the Random Forest (RF) classification model are evaluated using four metrics: accuracy, precision, recall, and F1 score.
9. The machine vision recognition method for commercially available adulterated frozen mutton slices according to claim 1, characterized in that, Also includes: The Kruskal-Wallis H test was used to perform statistical analysis on the color feature sample set and the texture feature sample set, respectively. When a significant difference was detected, the Dunn post-hoc test was performed to verify the differences in the mean and standard deviation of the original cut mutton slices, the prepared mutton slices and the reconstituted mutton slices in each color channel and in the five texture parameters, so as to provide a basis for feature selection and result interpretation of the random forest RF classification model.
10. A machine vision recognition method for commercially available frozen mutton slices adulterated with meat, characterized in that, include: The image acquisition unit is used to thaw and flatten the frozen mutton slices placed on a white PP board on black cardboard and then put them into the photography box. The visible light imaging system, which includes a camera, a pure white LED light source and a background board, takes a JPG image of each sample in the photography box to obtain the original mutton slice image set. The image preprocessing unit is used to perform unified resolution and normalization processing on the original mutton slice image set, locate and crop a circular region of interest containing mutton slices in each image of the original mutton slice image set, and place the circular region of interest in the center of a black background of a preset size. At the same time, data enhancement is performed by rotation, scaling, cropping, adding noise and color jitter to obtain a preprocessed image set. The color feature extraction unit is used to convert each image in the preprocessed image set to three color spaces: RGB, HSV, and Lab, extract the pixel values of each color channel, calculate the mean and standard deviation of each color channel according to the color matrix, and concatenate the mean and standard deviation of each color channel in channel order to form a color feature vector, thereby constructing a color feature sample set. The texture feature extraction unit is used to convert each image in the preprocessed image set into a grayscale image, construct a grayscale co-occurrence matrix under a given step size and multiple orientation angles, calculate five texture parameters: homogeneity, contrast, correlation, energy and entropy, and concatenate the five texture parameters in a predetermined order to form a texture feature vector and construct a texture feature sample set. The feature dimensionality reduction unit is used to combine the color feature sample set and the texture feature sample set into a high-dimensional feature sample set, perform principal component analysis (PCA) on the high-dimensional feature sample set, select the top principal components with a cumulative contribution rate of more than 99%, and obtain the dimensionality-reduced feature sample set. The classification modeling and doping discrimination unit is used to train a random forest RF classification model using the dimensionality-reduced feature sample set and the corresponding labels of original cut mutton slices, prepared mutton slices and reconstituted mutton slices as training data, and to classify the frozen mutton slice images to be tested using the random forest RF classification model. The samples identified as reconstituted mutton slices are determined to be frozen mutton slices doped with foreign meat and meat products.