Meat product freshness detection method and system

By constructing an improved CNN network, using the Inception module and global average pooling, the problems of low detection accuracy and large resource usage in existing chicken detection methods are solved, and efficient and accurate chicken freshness detection is achieved, with a detection accuracy rate of over 96%. .

CN118711049AInactive Publication Date: 2024-09-27LINYI DESHANG FOOD CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410643811.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-23
Publication Date
2024-09-27
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing chicken detection methods have problems such as small detection area, time-consuming and labor-intensive detection, low detection accuracy and poor applicability. In particular, the method using hyperspectrometer is costly and requires high image acquisition quality, making it difficult to effectively detect the freshness of chicken.

Method used

Construct an improved CNN network, adopt a 6-layer convolution structure, and use the Inception module in the fifth and sixth layer convolution modules to activate neurons with different sizes of receptive fields, combined with global average pooling and Dropout, to improve chicken image texture recognition and operating efficiency, and finally access the softmax classifier.

Benefits of technology

The accuracy of chicken freshness detection is over 96%, the hardware resources are small, the network structure is simplified, and detection efficiency and accuracy are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118711049A
    Figure CN118711049A
Patent Text Reader

Abstract

The invention relates to the technical field of chicken detection, in particular to a meat product freshness detection method and system.The method comprises the steps that chicken images of different freshness classifications are collected, and data sets are divided; the method comprises the steps that an improved CNN network is constructed, the improved CNN network is composed of six layers of convolutional neural networks and an average pooling layer, after average pooling, Dropout is utilized to randomly discard part of neurons according to a set proportion, a leakyrelu activation function is adopted, and a BN layer is inserted in front of each activation layer; and finally, accessing a full connection layer and a softmax classifier. According to the method, an improved CNN network is constructed, six layers of convolution structures are utilized, Inception modules are adopted in the fifth and sixth layers of convolution modules, neurons of receptive fields of different sizes are activated, texture recognition of chicken images of different freshness classifications is improved, and parameter reduction is performed by adopting global flat pooling, so that the operation efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of chicken meat detection, and in particular to a meat product freshness detection method and system. Background Art

[0002] With the improvement of people's living standards and the upgrading of consumption capacity, people are more and more concerned about the freshness of chicken ingredients such as chicken and chicken fillets, and people are paying more and more attention to food safety, especially when dining in restaurants and barbecue stalls. The freshness of food has a great impact on people's health, so an effective method for detecting the freshness of chicken ingredients is needed, which can provide supervisors with effective detection means.

[0003] The existing chicken detection method mainly detects the freshness of chilled chicken by the content of TVB-N. This method has the problems of small detection area and time-consuming and labor-intensive.

[0004] The patent with publication number CN117825292A obtains hyperspectral images of raw chicken samples; determines the content of multiple components in chicken; corrects hyperspectral image data; collects hyperspectral data after correction; preprocesses hyperspectral data; extracts characteristic spectra using multi-label supervision; and establishes a multi-label regression prediction model based on hyperspectra. This method requires the use of a hyperspectr, which has high practical costs, and has very high requirements on the quality of image acquisition through spectral analysis, and is not very applicable.

[0005] The patent with publication number CN115201142A consists of a feature information extraction module and a chicken breast quality grading module; the detection method and technology consist of three-dimensional synchronous fluorescence technology, Fourier infrared technology and nuclear magnetic resonance technology; the feature parameter extraction module extracts 8 feature parameters of chicken breast, and uses the BP neural network model for modeling and prediction. This method has the problem of low detection accuracy. Summary of the invention

[0006] In view of the shortcomings of the existing methods, the present invention constructs an improved CNN network, utilizes a 6-layer convolution structure, and adopts Inception modules in the fifth and sixth convolution modules to activate neurons with receptive fields of different sizes, improve the texture recognition of chicken images classified with different freshness, and use global average pooling for parameter reduction to improve operating efficiency.

[0007] The technical solution adopted by the present invention is: a method for detecting the freshness of meat products comprises the following steps:

[0008] Step 1: Collect chicken images of different freshness categories and divide the data set;

[0009] As a preferred embodiment of the present invention, the freshness includes: fresh meat, second-fresh meat level 1, second-fresh meat level 2, rotten meat level 1, and rotten meat level 2.

[0010] As a preferred embodiment of the present invention, the preprocessing of the chicken image includes: image compression, cropping and resizing.

[0011] As a preferred embodiment of the present invention, the chicken image is subjected to random adjustment of image brightness, random change of contrast, random change of saturation, random change of definition, random flipping, random rotation, random cropping and random addition of Gaussian noise.

[0012] Step 2: Build an improved CNN network. The improved CNN network consists of a 6-layer convolutional neural network and an average pooling layer. After average pooling, Dropout is used to randomly discard some neurons according to the set ratio, and the leaky_relu activation function is used. A BN layer is inserted before each activation layer; finally, a fully connected layer and a softmax classifier are connected;

[0013] As a preferred embodiment of the present invention, the size of the 6-layer convolutional neural network includes: the first to sixth convolutional layers, wherein the convolution kernel sizes of the first to fourth convolutional layers are all 3*3, the step size is 1, the padding is 1, and the BatchNorm sizes are divided into 64, 128, 256 and 512; the fifth and sixth convolutional layers use Inception modules.

[0014] As a preferred embodiment of the present invention, the Inception module includes: two 1*1 convolutions followed by one 3*3 convolution, followed by one 1*3 convolution and one 5*5 convolution, followed by one 3x3 maximum pooling, and performing a 3x3 maximum pooling operation to reduce the spatial size and capture higher-level features; the pooling operation is followed by a 1x1 convolution to reduce the number of channels.

[0015] As a preferred implementation of the present invention, the improved CNN network uses precision, recall, F1, and confusion matrix to evaluate classification indicators.

[0016] As a preferred embodiment of the present invention, a meat product freshness detection system includes: a memory for storing instructions executable by a processor; and a processor for executing the instructions to implement a meat product freshness detection method.

[0017] As a preferred embodiment of the present invention, a computer readable medium stores computer program codes, and the computer program codes implement a meat product freshness detection method when executed by a processor.

[0018] Beneficial effects of the present invention:

[0019] 1. Improved CNN network structure is simple. By building a 6-layer convolutional neural network, the chicken image recognition accuracy exceeds 96%;

[0020] 2. Compared with the existing network structure, it occupies less hardware resources and can be used for application integration. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 The present invention is a flow chart of the meat product freshness detection method. DETAILED DESCRIPTION

[0022] The present invention is further described below in conjunction with the accompanying drawings and embodiments. This figure is a simplified schematic diagram, which only illustrates the basic structure of the present invention in a schematic manner, and therefore it only shows the components related to the present invention.

[0023] like Figure 1 As shown, a method for detecting the freshness of meat products comprises the following steps:

[0024] Data is the basis of analysis. For deep learning, the importance of raw data is even more important. This is because the deep learning model autonomously learns the relevant features in the data through the data. The freshness pictures of good cold fresh chicken have a great influence on the accuracy of the classification of chicken freshness. At present, there is no public data on chicken with different freshness, so self-taken chicken images are used. To construct a data set of chicken with different freshness, the chicken freshness classification standard, chicken acquisition, experiment, shooting and image preprocessing will be based on the chicken freshness classification standard.

[0025] Traditionally, chicken freshness grading only has fresh and spoiled categories; however, from a biological and chemical perspective, chicken spoilage is actually a gradual process. Under the action of enzymes contained in the chicken, or due to environmental changes, microbial infection and other reasons, the chicken's tissue structure changes and corruption occurs, causing changes in the chicken's color, tenderness, pH value, odor, viscosity and texture.

[0026] Microbial detection mainly involves detecting the number of microbial colonies, using the microbial colonies in the field of view of a microscope for manual counting. Fewer colonies indicate fresher chicken, but the distribution of microorganisms is uneven, so there may be errors in the detection. The physical and chemical reactions mainly include pH detection and volatile basic total nitrogen (TVB-N). The decomposition of inositol and the aggregation of lactic acid and phosphate in chicken lead to a decrease in pH. During the corruption of chicken, protein decomposition will produce nitrogen-containing substances such as volatile ammonia and amines. However, TVB-N is not sensitive to individual differences. It is related to storage time, so it is suitable for evaluating the freshness of chicken.

[0027] The invention measures the freshness of chilled chicken by detecting the content of TVB-N; using a volatile basic nitrogen testing instrument, 10g of the chicken sample to be tested is weighed each time, minced and mixed with 100ml of pure water, fully stirred and shaken, and left to stand for 15 minutes to obtain the supernatant. The detector is added to produce a chemical reaction to measure the volatile basic nitrogen; the chicken is divided into fresh meat, second-fresh meat level 1, second-fresh meat level 2, corrupt meat level 1, and corrupt meat level 2 according to the freshness, and numbered from 0 to 4.

[0028] Chicken images should be as consistent as possible with chicken cold chain transportation images; when taking chicken images, it is necessary to consider that the process from fresh chicken from the slaughterhouse to the cold chain market where it is sold is basically in a cold chain environment, and the temperature and humidity of the cold chain environment are strictly controlled.

[0029] The experimental environment is a simulated cold storage with a temperature of 0-4C°. Fresh chicken is placed in the simulated cold storage environment until the TVB-N content exceeds the standard, that is, the meat is completely spoiled; the TVB-N content of the chicken is tested at regular intervals, and photos are taken to record the chicken image at each test; considering that most of the actual application process is natural light or indoor LED light source environment, the chicken shooting environment is a laboratory multi-LED light source.

[0030] For image acquisition equipment, since the freshness judgment of chicken may involve color, texture and more detailed indicators, the higher the pixel of the collected image, the more features that can be captured to distinguish the freshness of different chickens can be captured. Therefore, a SLR camera is used for shooting.

[0031] According to the above experiment, we collected images of chicken of different freshness during the cold chain logistics process; on the morning of the first day, we selected and purchased the freshest chicken at the farmers' market, and purchased chicken samples of different sizes and qualities, and immediately stored them in a simulated cold storage environment of 0-4°C, and used TVB-N detection and image acquisition; the test results showed that the TVB-N content of the chicken was less than 3mg / 100g at the beginning, indicating that the meat was very fresh and the experiment was effective; in order to better highlight the outline and color of the chicken, the meat was placed on a tray, and the camera was used to collect images of different chickens in turn, with the size of each image being 5760*3840 pixels; following the same steps, we performed 6 times a day The time of content detection and image acquisition was 6:00, 11:00, 16:00 and 20:00 respectively, which was basically consistent with the purchase time; through experiments, it was found that the content of chicken on the 7th day had exceeded 35mg / 100g, so the experiment lasted for 7 days and finally 1000 original images were collected; among them, there were about 200 images of each freshness classification; and according to the content of TVB-N in the collection process, less than 10mg / 100g was defined as fresh meat, 10-15mg / 100g was defined as first-level fresh meat, 15-25mg / 100g was defined as second-level fresh meat, 25-35mg / 100g was defined as first-level rotten meat, and more than 35mg / 100g was defined as second-level rotten meat.

[0032] Image preprocessing includes: image compression, cropping the chicken part, and removing redundant invalid pixels. In order to avoid the problem of slow model training speed caused by excessive image size, the image is resized to 224*224, which can improve the training speed without affecting the training effect.

[0033] The image data is divided into training set and validation set in an 8:2 ratio. The training set is used to fit the parameters of the improved CNN model, and the test set is used to verify the model performance and generalization ability.

[0034] A variety of image augmentation methods are used, including random adjustment of image brightness, random change of contrast, random change of saturation, random change of clarity, random flipping, random rotation, random cropping and random addition of Gaussian noise.

[0035] Building an improved CNN network for image recognition usually includes multiple steps, including determining the network architecture, selecting the appropriate layer type, setting hyperparameters, etc.

[0036] Improved CNN network includes: Input Layer:

[0037] The size of the input image is usually determined by the task and dataset. For example, for a 224x224 RGB image, the input size will be (224,224,3); Convolutional layers are used to extract features from the input image;

[0038] Use multiple convolutional layers, each with a different number of filters; each convolutional layer is usually followed by a ReLU activation function to increase the nonlinearity of the network; and use batch normalization after the convolutional layer to speed up training and improve performance; pooling layers are used to reduce the spatial size of the feature map, thereby reducing the number of parameters and computational cost of the network.

[0039] The most commonly used pooling operation is max pooling, which takes the maximum value in each pooling window as the output; fully connected layers, after the convolution and pooling layers, the network usually contains one or more fully connected layers, which are used to convert the previously extracted feature maps into the final classification output; in the fully connected layer, each neuron is connected to all neurons in the previous layer; the number of neurons in the output layer is set according to the multi-classification task, and uses the softmax activation function and the same number of neurons as the number of categories.

[0040] And use the loss function (LossFunction) and optimizer (Optimizer): the loss function uses cross entropy loss (for multi-classification) or binary cross entropy loss (for binary classification).

[0041] Select the SGD optimizer to train the network.

[0042] First, consider that the Inception module of GoogleNet can extract features of different field of view ranges of the image in one layer, while VGG uses multiple small-sized convolution kernels to sense features of different field of view ranges. The GoogleNetInception module is used to solve the overfitting problem on the chicken image.

[0043] The present invention improves the CNN network by using the Inception module. Without increasing the number of network layers, neurons with different receptive fields can be automatically selected and activated in only one layer. In addition, although the overfitting phenomenon of VGG is relatively serious, the effect of the convolution layer of VGG with multiple layers of small-sized convolution kernels is better than that of one layer with large-sized convolution kernels.

[0044] The convolution kernel has an effect on the convolution layer; therefore, the present invention improves the CNN network, and when the number of network layers is 6, multiple 3x3 convolution layers are used to extract features, and after each convolution, a maximum pooling layer with a size and a step size of 2 is used to abstract and reduce the dimension of the features; after the convolution is completed, global average pooling is used to reduce the dimension of the network parameters while combining the low-level features, so that the global features of the image can be abstracted; while improving the model performance, the number of parameters is greatly reduced; and, Dropout is added before the fully connected layer, and Dropout randomly discards some neurons according to a set ratio, which is equivalent to training multiple networks and taking the average value, continuing to reduce network parameters and reducing the probability of overfitting; a leaky_relu activation function is used, and a BN layer is inserted before each activation layer to ensure that the feature map after convolution still satisfies the distribution with a mean of 0 and a variance of 1, thereby accelerating the network training speed and improving the generalization ability of the network.

[0045] The improved CNN network structure of the present invention is shown in Table 1:

[0046]

[0047]

[0048] The main task of the present invention is to classify the freshness of chicken, and its main evaluation index is the classification accuracy, hoping to obtain the highest possible classification accuracy; at the same time, other commonly used classification evaluation indexes are used to judge the quality of the network model during the experiment, including precision, recall and F1, and a confusion matrix is ​​used to assist in calculating these classification evaluation indexes; the confusion matrix includes: TP represents true positive class, FN represents false negative class, that is, the true attribute of the sample is positive class, but the result of model recognition is the number of negative class samples; FP represents false positive class, that is, the true attribute of the sample is negative class, but the result of model recognition is the number of positive class samples; TN represents true negative class, that is, the results of sample and model recognition are both the number of negative class samples.

[0049] Experimental environment:

[0050] The Python development language is used, and the deep learning framework is Paddlepaddle. It is carried out on the Aistudio online platform, GPU environment, and its hardware configuration is:

[0051] Table 2 Hardware configuration

[0052] name Configuration GPU TsiaV200 Video Memory 64G

[0053] Software environment:

[0054] Table 3 Software Configuration

[0055] name Configuration operating system Windows 10 Development Language Python 3.7

[0056] Table 4 Comparison of validation accuracy of different models

[0057] Model Accuracy(%) VGG Network 91.7 googlenet 92.7 ResNet 93.2 Improving CNNs 95.4

[0058] This paper proves the feasibility of using convolutional neural networks to complement graph convolutional networks; SDE-Net inherits the advantages of GCNs and CNNs, has a strong ability to model spatiotemporal dependencies, and provides new ideas for skeleton-based action recognition; by using adaptive graph convolutional layers with temporal convolution kernels of different sizes, local and global features are obtained respectively, and short connections are set to ensure the effective use of local temporal information; OPM is designed to connect FEM and convolutional neural networks, which solves the problem of loss of important joint structure information caused by data transmission between different networks.

[0059] Based on the above ideal embodiments of the present invention, the relevant staff can make various changes and modifications without departing from the technical concept of the present invention through the above description. The technical scope of the present invention is not limited to the contents of the specification, and its technical scope must be determined according to the scope of the claims.

Claims

1. A method for detecting the freshness of meat products, characterized in that: The following steps are involved: Step 1: Collect chicken images of different freshness categories and divide the data set; Step 2: Build an improved CNN network. The improved CNN network consists of a 6-layer convolutional neural network and an average pooling layer. After average pooling, Dropout is used to randomly discard some neurons according to the set ratio, and the leaky_relu activation function is used. A BN layer is inserted before each activation layer; finally, a fully connected layer and a softmax classifier are connected.

2. The method for detecting the freshness of meat products according to claim 1, characterized in that: The size of the 6-layer convolutional neural network includes: the first to the sixth convolutional layers, where the convolution kernel size of the first to the fourth convolutional layers is 3*3, the step size is 1, the padding is 1, and the BatchNorm size is 64, 128, 256 and 512; the fifth and sixth convolutional layers use the Inception module.

3. The method for detecting the freshness of meat products according to claim 2, characterized in that: The Inception module consists of two 1*1 convolutions followed by a 3*3 convolution, followed by a 1*3 convolution and a 5*5 convolution, followed by a 3x3 maximum pooling, and a 3x3 maximum pooling operation to reduce the spatial size and capture higher-level features; the pooling operation is followed by a 1x1 convolution to reduce the number of channels.

4. The method for detecting the freshness of meat products according to claim 1, characterized in that: Freshness includes: Fresh meat, second-grade fresh meat level 1, second-grade fresh meat level 2, rotten meat level 1, rotten meat level 2.

5. The method for detecting the freshness of meat products according to claim 1, characterized in that: The preprocessing of chicken images includes: image compression, cropping and resizing.

6. The method for detecting the freshness of meat products according to claim 1, characterized in that: The chicken images are randomly adjusted in brightness, randomly changed in contrast, randomly changed in saturation, randomly changed in definition, randomly flipped, randomly rotated, randomly cropped, and randomly added with Gaussian noise.

7. The method for detecting the freshness of meat products according to claim 1, characterized in that: The improved CNN network uses precision, recall, F1, and confusion matrix to evaluate classification indicators.

8. Meat product freshness detection system, characterized in that: include: a memory for storing instructions executable by a processor; A processor, used to execute instructions to implement the meat product freshness detection method as described in any one of claims 1-7.

9. A computer readable medium storing a computer program code, characterized in that: The computer program code, when executed by a processor, implements the meat product freshness detection method according to any one of claims 1 to 7.