Meat freshness anti-light interference detection method, device and program product

Through the image acquisition system and the improved MobileNetV3 model, combined with TVB-N value and pH value, the problem of meat freshness detection being disturbed by light in an open environment is solved, and high-accuracy, contactless meat freshness detection is achieved , suitable for a variety of scenarios.

CN119395009APending Publication Date: 2025-02-07JIANGSU ACAD OF AGRI SCI
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411292471.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-14
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

The existing meat freshness detection methods are disturbed by lights in an open environment, making it difficult to accurately judge meat freshness, and traditional computer image recognition algorithms cannot evaluate them in combination with environmental visual cues.

Method used

The image acquisition system was used to collect meat sample image data under different lighting conditions, combined with TVB-N values ​​and pH values ​​for freshness grading, and used the improved MobileNetV3 model for image preprocessing and feature extraction, and replaced Squeeze and through the Efficient Channel Attention module. Excitation module, combining 50% cross-verification and early stop strategy to train meat freshness detection models.

Benefits of technology

It realizes high-accuracy meat freshness detection under different lighting conditions, with the detection accuracy reaching 98.6%. Through contactless and non-destructive testing, the testing cost is reduced and it is suitable for supermarkets, farmers' markets and home environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119395009A_ABST
    Figure CN119395009A_ABST
Patent Text Reader

Abstract

The invention provides a meat freshness anti-light interference detection method and device and a program product, and the method comprises the steps: making a meat freshness data set through employing an image collection system under different illumination conditions, carrying out the preprocessing of an obtained image, optimizing a MobileNetV3 model through employing an Officent Channel Attention module, and carrying out the detection of the meat freshness through employing the MobileNetV3 model, thereby achieving the detection of the meat freshness through employing the MobileNetV3 model, and achieving the detection of the meat freshness through employing the MobileNetV3 model. After training, a meat freshness detection model with high accuracy and light weight is obtained. According to the invention, by introducing an anti-light interference technology and an improved deep learning model, the accuracy and adaptability of detection are significantly improved; non-contact detection is adopted, so that food safety is guaranteed; comprehensive detection results and suggestions are provided in a program product, so that the practicability is enhanced; the advanced image recognition technology is converted into convenient mobile application, and the use threshold is lowered. The method provides a simple, reliable and economical meat freshness detection approach for common consumers, and has a wide application prospect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of food detection, and in particular to a method, device and program product for detecting the freshness of meat against light interference. Background Art

[0002] Meat is rich in a variety of nutrients such as protein, fat, minerals and vitamins. These nutrients provide ideal conditions for the growth and reproduction of microorganisms, making meat extremely easy to rot and deteriorate. The process of meat deterioration is often difficult to judge intuitively, and accidentally eating spoiled meat may have adverse effects on the body.

[0003] At present, there are many methods for evaluating the freshness of meat. Min Li et al. used fluorescent sensors as indicator labels for the freshness of packaged meat, and collected label images through smartphones to predict the freshness of meat. Rafaela S. Andre et al. used computer-aided resonator design (CARD) technology and proposed to evaluate the freshness of meat through radio frequency (RF) tags. Jun Chen et al. designed an electronic nose system to detect and predict the freshness of pork, beef and mutton. Although the above methods have good recognition accuracy in practical applications, they all require the use of related sensors or equipment, which will incur certain additional costs. It is difficult for consumers to use these methods to judge the freshness of meat.

[0004] In places where meat is sold, such as supermarkets and wet markets, consumers will be disturbed by different lighting, resulting in subjective bias and misjudgment of the quality and freshness of meat. Different colors of light can give meat different visual effects. For example, when red light shines on the surface of meat, it will enhance the red color of the meat itself, making it look brighter and more rosy. However, traditional computer image recognition algorithms usually recognize based on a single image, lack understanding of other information, and cannot be combined with the environment in which the image is located or other visual clues. Therefore, by using traditional computer image recognition algorithms, it is difficult to analyze and evaluate the freshness quality of meat in various open environments.

[0005] At present, deep learning, as a powerful image processing and recognition technology, can overcome the defects of traditional image recognition algorithms. Deep convolutional neural networks (CNNs) can learn features in databases, and the learned features can be used for complex image processing and classification tasks. BhargavSagiraju et al. emphasized the importance of accurately assessing the freshness of pork, and achieved an accuracy of 93.13% using a fine-tuned ResNet18-FT model. M.ShyamalaDevi et al. designed a new 15-layer deep convolutional neural network (15L-DCNN) to predict the freshness quality of pork, with an accuracy of about 87%. Therefore, there is an urgent need for a simple, non-destructive, fast and low-cost method for detecting meat freshness that is resistant to light interference to meet the needs of consumers, and it is expected that deep learning technology can be used to achieve rapid on-site detection. Summary of the invention

[0006] Purpose of the invention: The purpose of the present invention is to provide a non-contact, high-accuracy meat freshness anti-light interference detection method, device and program product.

[0007] Technical solution: A method for detecting meat freshness against light interference, comprising the following steps:

[0008] (1) Using an image acquisition system, image data of meat samples under different lighting conditions are collected, TVB-N values ​​and pH values ​​of the meat samples are measured, freshness of the meat samples is graded, image data that is not within the freshness grading range is screened out, and the remaining image data is used as a meat image training set;

[0009] (2) Preprocessing the meat image training set;

[0010] (3) The MobileNetV3 model is used, and the Squeeze and Excitation module in the MobileNetV3 model is replaced with the Efficient Channel Attention module to obtain a new MobileNetV3 model. The preprocessed meat image training set is used as the input of the new MobileNetV3 model, and a 5-fold cross-validation method is used. After a set number of rounds of cyclic training, a meat freshness detection model is obtained;

[0011] (4) The image data of the meat sample to be evaluated is input into the meat freshness detection model to obtain the freshness grading result of the meat sample to be evaluated.

[0012] Specifically, the image acquisition system includes a box, a tray, a ring light source, a camera, a computer, and a ring light source controller. The tray is arranged at the bottom of the box, the ring light source is arranged above the tray, the camera is arranged above the ring light source, the ring light source controller is connected to the ring light source, and the computer is connected to the camera and the ring light source controller for controlling the camera to capture images, receiving image data collected by the camera and controlling the color and brightness of the ring light source.

[0013] Specifically, in step (1), after the TVB-N value and pH value of the meat sample are determined, the freshness of the meat sample is graded according to the set interval values ​​of the TVB-N value and the pH value, and the meat sample is divided into three grades from high to low: fresh, semi-fresh, and spoiled. If the two freshness grades obtained by the meat sample according to the TVB-N value and the pH value are different, the lower grade is used as the final result of the freshness grading of the meat sample.

[0014] Specifically, step (2) includes: automatically cropping the image data in the meat image training set, retaining the image area containing the meat sample, adjusting the image data to the same size, converting to the Lab color space, applying a contrast-limited adaptive histogram equalization algorithm to enhance the local contrast of the image data, and finally performing Gaussian filtering on the image data.

[0015] Specifically, in step (3), in each inverted residual block of the MobileNetV3 model, the Squeeze and Excitation module is replaced by the Efficient Channel Attention module, and the classification head is redesigned to have a fully connected structure that includes three hidden layers and one output layer. A ReLU activation function and a dropout function are set after each hidden layer. The output layer outputs the probability distribution of the freshness grade of the meat samples with a SoftMax activation function, thereby obtaining a new MobileNetV3 model.

[0016] Specifically, the 5-fold cross-validation method is as follows: randomly divide the meat image training set into 5 subsets, use 4 subsets as training sets in each training round, and use the remaining 1 subset as a validation set. Train 5 different models, evaluate the performance of the 5 different models on the validation sets respectively, record the accuracy of each model, repeat the above process until each subset is used as a validation set for model performance evaluation, complete a round of cross-validation, and use the model with the highest average accuracy as the final output model.

[0017] Preferably, step (3) further includes: adopting an early stopping strategy in model training, and after performing model performance evaluation on a validation set, if the model does not have a performance improvement exceeding a set threshold in a set number of consecutive training rounds, then stopping training, resetting model parameters, and then continuing training.

[0018] Preferably, the above-mentioned meat freshness anti-light interference detection method further comprises the following steps:

[0019] Using loss function, accuracy, precision, recall, confusion matrix, and model size as evaluation indicators, the performance of the meat freshness detection model and several deep learning CNN algorithm models were evaluated in the same operating environment and with the same meat image training set.

[0020] The present invention also provides a meat freshness detection device that is resistant to light interference, comprising:

[0021] Training set construction module: used to use the image acquisition system to collect image data of meat samples under different lighting conditions, measure the TVB-N value and pH value of the meat samples, grade the freshness of the meat samples, filter out image data that are not within the freshness classification range, and use the remaining image data as the meat image training set;

[0022] Image preprocessing module: used to preprocess the meat image training set;

[0023] Model training module: used to adopt the MobileNetV3 model and replace the Squeeze and Excitation module in the MobileNetV3 model with the Efficient Channel Attention module to obtain a new MobileNetV3 model. The preprocessed meat image training set is used as the input of the new MobileNetV3 model. The 5-fold cross-validation method is used to obtain the meat freshness detection model after a set number of rounds of cyclic training.

[0024] Image detection output module: used to input the image data of the meat sample to be evaluated into the meat freshness detection model to obtain the freshness grading result of the meat sample to be evaluated.

[0025] The present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the above-mentioned meat freshness anti-light interference detection method.

[0026] Beneficial effects: Compared with the prior art, the present invention has the following significant effects:

[0027] (1) The present invention designs an image acquisition system that can provide different lighting conditions, thereby obtaining meat sample image data under different lighting conditions for model training, which significantly improves the model's adaptability to various actual lighting environments. The output results of the meat freshness detection model obtained can maintain a high degree of accuracy in different actual scenarios such as supermarkets, farmers' markets or homes, effectively solving the problem that traditional methods are greatly affected by ambient light; at the same time, through image analysis, detection does not require direct contact with meat samples, avoiding the risk of cross contamination, and also achieving non-destructive testing. This non-contact detection method ensures food safety and the integrity of meat products.

[0028] (2) The present invention adopts the Efficient Channel Attention module to replace the Squeeze and Excitation module of the MobileNetV3 model for training. The Efficient Channel Attention module adaptively captures cross-channel interactions through one-dimensional convolution, which can effectively avoid the computational overhead brought by the fully connected layer in the Squeeze and Excitation module, while maintaining effective modeling of the importance of different channels. This improvement enhances the model's perception of key features such as meat texture and color while keeping the model lightweight. The lightweight model is also easy to deploy on the mobile terminal, which is suitable for ordinary consumers. It can achieve fast and accurate meat freshness detection without professional instruments and equipment, thus lowering the testing threshold. At the same time, by integrating a multi-functional user interface, it can provide meat freshness grading results, as well as meat storage suggestions, best shelf life suggestions, and food safety suggestions, thereby providing all-round information support for ordinary users.

[0029] (3) The 5-fold cross-validation method and early stopping strategy were used in the model training process to ensure the generalization ability and reliability of the model. The final meat freshness detection model can provide users with highly accurate detection results, with a detection accuracy rate of up to 98.6%. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 It is a flow chart of the method of embodiment 1 of the present invention.

[0031] Figure 2 It is a schematic diagram of the image acquisition system of Example 1 of the present invention.

[0032] Figure 3 It is the accuracy iteration curve of the improved MobileNetV3 model in Example 1 of the present invention.

[0033] Figure 4 It is the loss function value iteration curve of the improved MobileNetV3 model in Example 1 of the present invention.

[0034] Figure 5 This is a schematic diagram of the test set confusion matrix of the improved MobileNetV3 model in Example 1 of the present invention. DETAILED DESCRIPTION

[0035] The present invention is further described below in conjunction with the accompanying drawings.

[0036] Example 1

[0037] See also Figure 1 As shown, this embodiment provides a meat freshness anti-light interference detection method based on improved MobileNetV3, including the following steps:

[0038] (1) Using an image acquisition system, image data of meat samples under different lighting conditions are collected, the TVB-N (volatile basic nitrogen) value and pH value of the meat samples are measured, the freshness of the meat samples is graded, and image data that are not within the freshness classification range are screened out. The remaining image data are used as a meat image training set.

[0039] See also Figure 2 As shown, in this embodiment, the image acquisition system includes a box 1, a tray 2, a ring light source 3, a camera 4, a computer 5, and a ring light source controller 6. The tray 2 is arranged at the bottom of the box 1, the ring light source 3 is arranged above the tray 2, and the camera 4 is arranged directly above the ring light source 3. The ring light source controller 6 is electrically connected to the ring light source 3. The computer 5 is connected to the camera 4 and the ring light source controller 6 to control the camera 4 to shoot, receive image data collected by the camera 4 and control the color and brightness of the ring light source 3. The ring light source 3 and the camera 4 are both fixedly mounted on the bracket 7. The height of the tray 2 can be fine-tuned to adapt to meat samples of different thicknesses. The inner wall of the box 1 is coated with a special light-absorbing material, which can effectively reduce light reflection and scattering. The tray 2 is designed to be anti-reflective to ensure the quality of the captured image. In this embodiment, the ring light source 3 has independently controllable red light LED segments and white light LED segments, and the brightness can be adjusted steplessly.

[0040] In this embodiment, pork is used as an example of a meat sample. The carcasses of slaughtered animals are quickly cooled so that the carcass temperature (the center of the hind leg meat is the measurement point) drops to 0-4°C within 24 hours to obtain fresh meat, which is stored in a cold storage device and quickly transported to a sterile laboratory. Random slices of fresh meat are stored separately in sterilized ziplock bags, and a 14-day test cycle is carried out at 0-4°C. Samples are taken out every 12 hours for image acquisition and corresponding TVB-N and pH value detection.

[0041] In this embodiment, with reference to the provisions of "GB / T9959.2-2008 Cutting Fresh and Frozen Pork Lean Meat", "GB2707-2016 Fresh (Frozen) Livestock and Poultry Products", "NY / T632-2002 Chilled Pork" and "NY / T2793-2015 Objective Evaluation Method for Edible Quality of Meat", the freshness of pork is divided into three levels as shown in Table 1 below according to the TVB-N value and pH value.

[0042] Table 1

[0043]

[0044] The TVB-N value is determined by the automatic Kjeldahl nitrogen analyzer method in GB5009.228 2016 Determination of Volatile Basic Nitrogen in Foods; the pH value is determined by the meat block determination method in NY / T821-2019 Technical Specifications for Pork Quality Determination. If the pork sample is classified into different grades in the test results of the above two indicators, the final freshness grade of the pork sample shall be determined according to the lowest grade.

[0045] The above-mentioned image acquisition system is used to collect image data of pork samples. The process is as follows: place the pork sample 8 on the tray 2 in the box 1, and adjust the height of the tray 2 according to the sample thickness. Close the box 1 to ensure environmental isolation. The computer 5 controls the ring light source controller 6 to set the red or white light brightness of the ring light source 3 to simulate different brightness levels (the brightness range is from 10% to 100%, divided into 10 levels). The computer 5 controls the camera 4 to adjust the focus and other parameters to ensure image clarity. No less than 5 pork sample images are taken under each lighting condition to ensure the representativeness and reliability of the data. All collected images are automatically saved to the specified storage location of the computer 5 to prepare for subsequent image processing and analysis.

[0046] The TVB-N value and pH value determination method was used to detect and record the TVB-N value and pH value of pork samples. The pork freshness parameter range set in Table 1 was compared, and the pork sample image data that was not within the range was deleted. The image data that met the parameter range set in Table 1 formed a meat image training set.

[0047] (2) Preprocess the meat image training set.

[0048] In this embodiment, the image data in the meat image training set is preprocessed. The image is first automatically cropped to retain only the area containing the pork sample, and the image is adjusted to a uniform size and converted to the Lab color space to better capture the meat characteristics. Then the contrast-limited adaptive histogram equalization (CLAHE) algorithm is applied to enhance the local contrast, and a Gaussian filter operation is performed to reduce noise, and all images are uniformly normalized and standardized. Finally, in order to increase data diversity, data enhancement techniques such as random horizontal flipping, rotation, and translation adjustment are used.

[0049] (3) The MobileNetV3 model was adopted, and the Squeeze and Excitation module in the MobileNetV3 model was replaced with the Efficient Channel Attention module to obtain a new MobileNetV3 model. The preprocessed meat image training set was used as the input of the new MobileNetV3 model, and a 5-fold cross-validation method was used. After a set number of rounds of cyclic training, a meat freshness detection model was obtained.

[0050] In this embodiment, in each inverted residual block of the MobileNetV3 model, the Squeeze and Excitation (SE) module is replaced by the Efficient Channel Attention (ECA) module. The ECA module adaptively captures cross-channel interactions through one-dimensional convolution, which can effectively avoid the computational overhead brought by the fully connected layer in the SE module, while maintaining effective modeling of the importance of different channels; this improvement enhances the model's perception of key features such as pork texture and color while keeping the model lightweight. At the same time, a multi-layer fully connected structure is redesigned in the classification head part. The fully connected structure includes three hidden layers (2048, 512, 64 neurons) and an output layer. ReLU activation function and dropout function (value 0.2) are set after each hidden layer. The output layer outputs the probability distribution of the freshness classification of meat samples with the SoftMax activation function. This design enhances the model's ability to capture complex patterns of meat freshness through gradual dimensionality reduction and multiple nonlinear transformations. At the same time, the use of dropout effectively prevents overfitting and improves the generalization ability of the model.

[0051] In the training of the model, a 5-fold cross-validation method is used to evaluate and ensure the performance of the model, and to reduce the sensitivity of the model to specific data division. The meat image training set is randomly divided into 5 subsets. In each training round, 4 subsets are used as training sets, and the remaining 1 subset is used as a validation set. In each round of cross-validation, 5 different models are trained, and the performance of the 5 different models is evaluated on the validation set respectively. The accuracy of each model is recorded, and the above process is repeated until each subset is used as a validation set for model performance evaluation. After a round of cross-validation is completed, the model with the highest average accuracy is used as the final output model, and the hyperparameters corresponding to the model are used as the optimal hyperparameters. In order to further improve the generalization ability of the model, an early stopping strategy is adopted in model training. After the model performance is evaluated on the validation set, if the model does not have a performance improvement that exceeds the set threshold in a set number of continuous training rounds (10 epochs in this embodiment), the training is stopped, and the model is optimized and debugged again before continuing the training.

[0052] (4) The image data of the meat sample to be evaluated is input into the meat freshness detection model to obtain the freshness grading result of the meat sample to be evaluated.

[0053] The output of the meat freshness detection model includes multiple categories that represent different degrees of freshness, divided into "fresh", "semi-fresh", and "spoiled", and provides a confidence score for each category.

[0054] (5) Using loss function, accuracy, precision, recall, confusion matrix, and model size as evaluation indicators, the performance of the meat freshness detection model and several deep learning CNN algorithm models were evaluated in the same operating environment using the same meat image training set.

[0055] In order to comprehensively evaluate the meat freshness anti-light interference detection method provided by the present invention, loss function, accuracy, precision, recall, confusion matrix, and model size are used as evaluation indicators. The following is an explanation of each indicator: The loss function (Loss) can evaluate the performance of the model on the training data by comparing the difference between the model prediction value and the actual label; a lower loss value usually means that the model's prediction is closer to the actual label, indicating that the model has better performance. The accuracy (Accuracy) of the model reflects the proportion of samples correctly classified by the model. The precision (Precision) measures the accuracy of the model's prediction as a positive example in each category. The recall rate (Recall) indicates the proportion of samples that the model can correctly predict as positive examples among samples that are actually positive examples. The confusion matrix (Confusion Matrix) can intuitively display the classification results of the model in each category, as well as the corresponding relationship between the actual situation. The model size (Size) refers to the space occupied by the deep learning model in the storage device, which is used to evaluate the lightweight degree of the model.

[0056] In this embodiment, Ubuntu 22.04 is used as the operating system platform, a python environment is created in Anaconda, and all model training is performed on the Keras API of Tensorflow version 2.13.0.

[0057] The present invention uses the above-mentioned improved MobileNetV3 model for training and evaluation based on the collected meat image training set; please refer to Figure 3 As shown in Figure 2, during the training process, after fewer training rounds (epochs), the model achieved stable high accuracy performance, see Figure 4 As shown in Figure 2, the loss function value converges quickly after fewer training rounds.

[0058] After training, the model's detection performance on the test set is evaluated, including accuracy, precision, recall, F1-score, and confusion matrix. Figure 5 As shown in the figure, it is a schematic diagram of the confusion matrix of the test set. The results show that the meat freshness detection model has achieved remarkable performance in the pork freshness classification task with light interference, with an accuracy rate of 98.6%, and the model size is only 17.34MB.

[0059] Then, the meat freshness detection model based on the improved MobileNetV3 of the present invention is compared with other advanced deep learning CNN algorithm models, including VGG16, VGG19, ResNet101, ResNet101V2, DenseNet169, MobileNet, MobileNetV2, MobileNetV3, EfficientNetB0 and EfficientNetV2B0. The comparative experiment is carried out under the same data set and training conditions to ensure fairness, and the results are shown in Table 2 below.

[0060]

[0061]

[0062] It can be seen from Table 2 that the meat freshness detection model based on the improved MobileNetV3 provided by the present invention has the best results in the above index tests under the premise of minimizing the model size.

[0063] Example 2

[0064] This embodiment provides a meat freshness anti-light interference detection device corresponding to the meat freshness anti-light interference detection method described in Embodiment 1, including:

[0065] Training set construction module: used to use the image acquisition system to collect image data of meat samples under different lighting conditions, measure the TVB-N value and pH value of the meat samples, grade the freshness of the meat samples, filter out image data that are not within the freshness classification range, and use the remaining image data as the meat image training set;

[0066] Image preprocessing module: used to preprocess the meat image training set;

[0067] Model training module: used to adopt the MobileNetV3 model and replace the Squeeze and Excitation module in the MobileNetV3 model with the Efficient Channel Attention module to obtain a new MobileNetV3 model. The preprocessed meat image training set is used as the input of the new MobileNetV3 model, and a 5-fold cross-validation method is used. After a set number of rounds of cyclic training, a meat freshness detection model is obtained.

[0068] Image detection output module: used to input the image data of the meat sample to be evaluated into the meat freshness detection model to obtain the freshness grading result of the meat sample to be evaluated.

[0069] Example 3

[0070] This embodiment provides a computer program product that is compatible with the meat freshness anti-light interference detection method described in Example 1, including a computer program that, when executed by a processor, implements the steps of the meat freshness anti-light interference detection method described in Example 1.

[0071] The steps of designing the computer program product are as follows:

[0072] (1) Build and develop an executable program based on the improved MobileNetV3 meat freshness anti-light interference detection method.

[0073] In this embodiment, Python and TensorFlow framework are used to implement and train the improved MobileNetV3 model, and the trained model is exported as a SavedModel file. Then, the model is deployed using the official Docker image of TensorFlow Serving, which can provide model services quickly and efficiently, and the model path and version are specified by configuring the model.config file. Finally, the TensorFlow Serving container is deployed to the server to provide high-performance and scalable backend support for the mini program.

[0074] (2) Integrate the executable program into the mobile device.

[0075] Use WeChat developer tools to create a mini program project and design an intuitive user interface, including popular science knowledge and detection and identification pages. Implement image acquisition functions, including selecting from the album, real-time shooting, and uploading local files. Develop a module for WeChat mini program to communicate with the server to implement image uploading and result receiving. After comprehensive testing and optimization, submit the mini program for review and release so that it can run on mobile devices.

[0076] (3) Provide an interface for selecting a detection method.

[0077] Design three detection mode buttons on the main interface of the mini program: select from the album, shoot in real time, and upload local files. Implement the logic of each detection mode, including calling the corresponding communication terminal to obtain the image, and perform preliminary processing on the selected or shot image in preparation for uploading. Through the detection mode selection interface, users can flexibly choose the most convenient detection mode according to their needs and circumstances.

[0078] (4) Perform real-time processing and analysis on the input images.

[0079] The image selected by the user is uploaded to the server through the port. The server receives and preprocesses the image and then inputs it into the improved MobileNetV3 model running in the Docker container. The model performs inference and obtains the classification result and confidence of the freshness of meat.

[0080] (5) Output the test results of pork freshness.

[0081] The server returns the processed results to the mini program, which presents complete information on the result display page, including freshness classification, confidence score, storage recommendations, best before date, and food safety reminders. It also provides result saving and sharing functions to facilitate users to record and disseminate test results, improving user experience and practicality.

Claims

1. A method for detecting meat freshness against light interference, characterized in that: The following steps are involved: (1) Using an image acquisition system, image data of meat samples under different lighting conditions are collected, TVB-N values ​​and pH values ​​of the meat samples are measured, freshness of the meat samples is graded, image data that is not within the freshness grading range is screened out, and the remaining image data is used as a meat image training set; (2) Preprocessing the meat image training set; (3) The MobileNetV3 model is used, and the Squeeze and Excitation module in the MobileNetV3 model is replaced with the Efficient Channel Attention module to obtain a new MobileNetV3 model. The preprocessed meat image training set is used as the input of the new MobileNetV3 model, and a 5-fold cross-validation method is used. After a set number of rounds of cyclic training, a meat freshness detection model is obtained; (4) The image data of the meat sample to be evaluated is input into the meat freshness detection model to obtain the freshness grading result of the meat sample to be evaluated.

2. The method for detecting meat freshness against light interference according to claim 1, characterized in that: The image acquisition system comprises a box (1), a tray (2), an annular light source (3), a camera (4), a computer (5), and an annular light source controller (6); the tray (2) is arranged at the bottom of the box (1); the annular light source (3) is arranged above the tray (2); the camera (4) is arranged above the annular light source (3); the annular light source controller (6) is connected to the annular light source (3); the computer (5) is connected to the camera (4) and the annular light source controller (6) and is used to control the camera (4) to capture images, receive image data collected by the camera (4), and control the color and brightness of the annular light source (3).

3. The method for detecting meat freshness against light interference according to claim 1, characterized in that: In the step (1), after the TVB-N value and pH value of the meat sample are determined, the freshness of the meat sample is graded according to the set interval values ​​of the TVB-N value and the pH value, and the meat sample is divided into three grades from high to low: fresh, semi-fresh, and spoiled. If the two freshness grades obtained by the meat sample according to the TVB-N value and the pH value are different, the lower grade is used as the final result of the freshness grading of the meat sample.

4. The method for detecting meat freshness against light interference according to claim 1, characterized in that: The step (2) comprises: The image data in the meat image training set are automatically cropped to retain the image area containing the meat samples. The image data are adjusted to the same size and converted to the Lab color space. The contrast-limited adaptive histogram equalization algorithm is applied to enhance the local contrast of the image data. Finally, the image data is Gaussian filtered.

5. The method for detecting meat freshness against light interference according to claim 1, characterized in that: In the step (3), in each inverted residual block of the MobileNetV3 model, the Squeeze and Excitation module is replaced by the Efficient ChannelAttention module, and the classification head part is redesigned with a fully connected structure, wherein the fully connected structure comprises three hidden layers and one output layer, and a ReLU activation function and a dropout function are set after each hidden layer. The output layer outputs the probability distribution of the freshness grade of the meat samples with a SoftMax activation function, thereby obtaining a new MobileNetV3 model.

6. The method for detecting meat freshness against light interference according to claim 1, characterized in that: The 5-fold cross-validation method is as follows: the meat image training set is randomly divided into 5 subsets, 4 subsets are used as training sets in each training round, and the remaining 1 subset is used as a validation set, 5 different models are trained, and the performance of the 5 different models is evaluated on the validation sets respectively, and the accuracy of each model is recorded. The above process is repeated until each subset is used as a validation set for model performance evaluation, and a round of cross-validation is completed, and the model with the highest average accuracy is used as the final output model.

7. The method for detecting meat freshness against light interference according to claim 6, characterized in that: The step (3) also includes: adopting an early stopping strategy in model training, after performing model performance evaluation on a validation set, if the model does not have a performance improvement exceeding a set threshold in a set number of consecutive training rounds, then stopping training, resetting model parameters, and then continuing training.

8. The method for detecting meat freshness against light interference according to claim 1, characterized in that: The following steps are also included: The loss function, accuracy, precision, recall, confusion matrix, and model size were used as evaluation indicators. The performance of the meat freshness detection model and several deep learning CNN algorithm models were evaluated in the same operating environment using the same meat image training set.

9. A meat freshness detection device that resists light interference, characterized in that: include: Training set construction module: used to use the image acquisition system to collect image data of meat samples under different lighting conditions, measure the TVB-N value and pH value of the meat samples, grade the freshness of the meat samples, filter out image data that are not within the freshness classification range, and use the remaining image data as the meat image training set; Image preprocessing module: used to preprocess the meat image training set; Model training module: used to adopt the MobileNetV3 model and replace the Squeeze and Excitation module in the MobileNetV3 model with the Efficient Channel Attention module to obtain a new MobileNetV3 model. The preprocessed meat image training set is used as the input of the new MobileNetV3 model, and a 5-fold cross-validation method is used. After a set number of rounds of cyclic training, a meat freshness detection model is obtained. Image detection output module: used to input the image data of the meat sample to be evaluated into the meat freshness detection model to obtain the freshness grading result of the meat sample to be evaluated.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the meat freshness anti-light interference detection method described in any one of claims 1 to 8 are implemented.

Citation Information

Cited By

  • Lightweight pork freshness grading method and system based on improved MobileNetV4

    CN120635552A

  • Handheld AI electronic nose device, system and method

    CN121090779A