Device and method for detecting freshness of various meats based on gas sensor

By integrating gas sensors, micro cameras and ResASPP-CNN models into the freshness detection device, combined with the Stacking fusion method, the problem that existing devices can only detect a single type of meat is solved, and efficient and accurate detection of multiple types of meat is achieved. detection.

CN119335148APending Publication Date: 2025-01-21ZHENGZHOU WINSEN ELECTRONICS TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411652090.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-19
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

The existing freshness detection device can only detect a single type of meat, and it has a complex structure and large size, which is not suitable for daily use, and the detection time is long and the results are not accurate enough.

Method used

A variety of meat freshness detection devices based on gas sensors are used, combined with micro cameras and ResASPP-CNN models, to automatically identify meat types, and realize freshness detection of multiple meats through the stacking fusion method.

Benefits of technology

It realizes the freshness detection of a variety of meats, reduces the detection time, improves the detection accuracy, and makes the device miniaturized and easy to carry and use daily.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119335148A_ABST
    Figure CN119335148A_ABST
Patent Text Reader

Abstract

The invention provides a device and a method for detecting freshness of various meats based on a gas sensor, which are used for solving the technical scheme that the existing freshness detection device can only detect a single meat. The detection device comprises a shell, an air pump and an air chamber are arranged in the shell, a collection port, a camera, an indicator light, a detection button and a display screen are arranged on the shell, the air pump is communicated with the collection port and an air inlet of the air chamber through air pipes, the detection button is arranged on the air pump, an air sensor array is arranged in the air chamber, and an electromagnetic valve is arranged at an air outlet of the air chamber. The camera, the indicating lamp, the detection button, the display screen, the air pump, the electromagnetic valve and the gas sensor array are all connected with the single-chip microcomputer. By adding the micro camera and utilizing the corresponding meat type identification model, various types of meat can be detected without manually selecting the types of meat to be detected, so that one-to-many detection is realized, and the detection range and the detection accuracy are expanded; and the whole size is easy to carry and is more suitable for daily use.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of freshness detection, and in particular to a device and method for detecting the freshness of various meats. Background Art

[0002] The structure in the existing invention patent CN201811112800.7, "A device and method for detecting the freshness of pork", mainly adopts a gas sampling inlet, a gas analysis cavity, a gas sampling outlet, an airflow auxiliary unit, a gas composition sensitive unit and an embedded control unit. When performing detection, this patent uses a fan to make the gas pass through the cavity. The fan is always working during the detection process, causing the gas to be in a flowing state. In this dynamic process of the gas, the sensor signal is recorded and the freshness of the pork is detected. It is very susceptible to the airflow and the fan's own work. The sensor is greatly affected, thereby affecting the judgment of the freshness of the pork. Secondly, this method can only detect a single type of meat, pork, and is not suitable for daily use. In addition, there is no indication information in the device to inform the user whether the detection can be started at present, which will cause the detection device to be used before it is ready, affecting the detection results.

[0003] In the existing invention patent CN201310332947.8, "Chicken Breast Freshness Detection Device and Detection Method", two solenoid valves, two air pumps, and eight sensors are used to detect the freshness of chicken. This method uses too many structures, resulting in a large volume of the overall device, which is not easy to carry and is not suitable for daily use. In addition, the detection time required by this method is more than 30 minutes, and the freshness level is only divided into two levels, which has no great practical significance. Summary of the invention

[0004] In view of the technical problem that the existing freshness detection device can only detect a single type of meat, the present invention proposes a multiple meat freshness detection device and method based on gas sensors, which automatically identifies the type of meat by combining a micro camera and a ResASPP-CNN model, and uses the Stacking fusion method to realize the freshness detection of multiple meats.

[0005] In order to achieve the above object, the technical solution of the present invention is implemented as follows: a method for detecting the freshness of multiple meats based on a gas sensor, the steps of which are as follows: Step 1: The gas signals of different types of meat are collected multiple times through the gas sensor array in the gas chamber, and the gas characteristics are obtained by preprocessing to form a gas characteristic data set; the corresponding images of different types of meat are collected multiple times by using a camera and preprocessed to obtain an image characteristic data set, and the images of different types of meat in the image characteristic data set are combined into different meat image characteristic data sets; Step 2: Input the image feature data set into the meat recognition model for training to obtain a trained meat recognition model; Step 3: Input different meat image feature data sets into different types of image freshness detection models respectively to obtain trained image freshness detection models for different meats, and input the gas feature data sets corresponding to the meat images into the gas freshness detection model for training to obtain a trained gas freshness detection model; Step 4: The image freshness obtained by the trained image freshness detection model and the gas freshness obtained by the trained gas freshness detection model are used as new feature data sets and input into the adaptive Stacking algorithm for training; Step 5: The gas signal and meat image of the meat to be detected are collected by the gas sensor array and the camera respectively, and the gas signal and the meat image are preprocessed respectively, and the gas characteristics of the meat to be detected after the preprocessing are input into the trained gas freshness detection model to obtain the gas freshness of the meat to be detected; the image characteristics of the meat to be detected after the preprocessing are input into the trained meat recognition model to obtain the meat type of the meat to be detected, and the image characteristics of the meat to be detected after the preprocessing are input into the trained image freshness detection model corresponding to the meat type of the meat to be detected to obtain the image freshness of the meat to be detected; the image freshness and gas freshness of the meat to be detected are merged by the trained adaptive Stacking algorithm to obtain the final freshness of the meat to be detected.

[0006] Preferably, the gas characteristic is at least one of the peak signal size, peak signal position, and maximum change slope of the gas signal; preprocessing of images of different types of meat includes but is not limited to denoising, rotation, and cropping.

[0007] Preferably, the meat recognition model is a ResASPP-CNN network, and the ResASPP-CNN network adds an ASPP module to the convolution operation part of the CNN network; the ASPP module is composed of multiple parallel dilated convolutions, and a residual connection is added to each separate dilated convolution structure, and finally the features after the residual connection are fused together by splicing; the convolution operation of the dilated convolution of the ASPP module sets different expansion rates, and inserts "holes" in the convolution kernel elements.

[0008] Preferably, the image freshness detection model adopts a convolutional neural network, and the gas freshness detection model adopts a fully connected neural network. The image freshness detection model and the gas freshness detection model are trained by a gradient descent method.

[0009] Preferably, the adaptive Stacking algorithm uses the image freshness result of meat as the first feature, the gas freshness result as another feature, and the label of the sample as the label for training; the fusion network of the adaptive Stacking algorithm is a fully connected neural network, which is trained and optimized by the gradient descent method.

[0010] Preferably, the adaptive Stacking algorithm dynamically adjusts the weights according to the performance of the base model, and the adaptive process is as follows: the image freshness detection model based on image features uses a convolutional neural network to identify freshness while simultaneously judging the surrounding environment, and outputs the lighting conditions, background color or meat surface interferences in the image as a new background judgment data set, and inputs the background judgment data set into the convolutional neural network to obtain the background level, and divides the background level into levels 1-5, corresponding to the weights of the image freshness detection model of 0.2-0.4-0.6-0.8-1 respectively; similarly, in the gas freshness detection model based on gas features, the adaptive stacking algorithm uses the temperature of the surrounding environment and background gas noise as the odor background data set to train a fully connected neural network, and obtains the weight of the gas freshness detection model according to the background level.

[0011] Preferably, when the adaptive Stacking algorithm is trained, the original labels are used as labels of samples in the new feature data set, and training optimization is performed through the gradient descent method; The method for the adaptive Stacking algorithm to fuse the image freshness and gas freshness of the meat to be detected is: multiplying the corresponding weights by the image freshness result and the gas freshness result as feature values, and using the fusion network to obtain the final freshness recognition result.

[0012] A gas sensor-based device for detecting the freshness of various types of meat comprises a shell, an air pump and an air chamber are arranged in the shell, a collection port, a camera, an indicator light, a detection button and a display screen are arranged on the shell, the air pump is respectively connected with the collection port and the air inlet of the air chamber through an air pipe, a detection button is arranged on the air pump, a gas sensor array is arranged in the air chamber, an electromagnetic valve is arranged at the air outlet of the air chamber, the camera, the indicator light, the detection button, the display screen, the air pump, the electromagnetic valve and the gas sensor array are all connected to a single-chip microcomputer, and a meat recognition model and freshness detection models of different types of meat are arranged in the single-chip microcomputer.

[0013] Preferably, the solenoid valve is a two-way normally open solenoid valve, a two-way normally closed solenoid valve or a three-way solenoid valve; The collection port is a circular structure, and the camera is arranged on the housing near the collection port; The gas sensor array is composed of a variety of gas sensors, including but not limited to electrochemical and semiconductor VOC sensors, sulfur sensors, amine sensors, alcohol sensors, and ester sensors.

[0014] Preferably, by using the clock function in the single chip microcomputer, when shutting down, the single chip microcomputer automatically wakes up the sensors of the gas sensor array to preheat for two minutes and then shuts down; The single chip computer records the gas signal collected by the sensor in real time, and determines whether to use the sensor to measure the gas signal according to whether the fluctuation of the adjacent windows of the gas signal exceeds the set threshold; the fluctuation of the adjacent windows of the gas signal is: the difference between the average values ​​of the stable signals in adjacent time windows; the average value of the stable signal is the average of the gas signal in a time window minus its maximum and minimum values; The detection process is as follows: align the collection port with the meat to be detected, press the detection button, the air pump starts working, the drawn gas enters the air chamber, and is discharged at the end of the solenoid valve; at the same time, the camera takes a picture of the meat to be detected and transmits it to the single-chip microcomputer, which uses the meat recognition model to recognize the picture of the meat to be detected and obtains the type of meat; after 10 seconds, the air pump stops working, closes the solenoid valve, and the gas of the meat to be detected is in full contact with the gas sensor array in the air chamber; at the same time, the single-chip microcomputer selects different meat freshness detection models according to the meat type results identified by the meat recognition model; after a full reaction of 30 seconds, the freshness detection model of the single-chip microcomputer obtains the detection result based on the picture of the meat to be detected and the gas signal collected by the gas sensor array, and displays the result on the display screen; move the collection port away from the meat to be detected, open the solenoid valve and the air pump, and use the air pump to extract clean gas to clean the air chamber and air pipe; The microcontroller performs background environment calibration each time it is powered on. The calibration steps are as follows: after the sensor is stable, move the collection port away from the meat to be tested, record the stable baseline base, use an air pump to extract the background gas, and the sensor signal value becomes AD1. The background gas impact value AD2 = AD1 - base, then all the sensor signal changes AD3 detected are subtracted from AD2 to obtain the actual response value.

[0015] Compared with the prior art, the present invention has the following beneficial effects: 1. The present invention removes some auxiliary modules (indicator lights, detection buttons, batteries, etc.), and only one normally open solenoid valve, a sensor array, a micro camera and a micro air pump are actually used for detection. The overall size is less than 40*120mm, which is easy to carry and more suitable for daily use.

[0016] 2. The present invention can detect multiple types of meat by adding a micro camera to the detection device and using the corresponding meat type recognition algorithm, without the need to manually select the type of meat to be detected; in addition, the detection device of the present invention can automatically select the most appropriate algorithm model for the meat to be detected, and obtain a more accurate freshness result. The technical solution of the present invention omits the step of manually selecting meat, solves the problem that one device can only detect one type of meat in the past, realizes one-to-many detection, and expands the detection range and detection accuracy.

[0017] 3. The present invention adds an automatic wake-up solution, which greatly reduces the problem of long preheating time of the sensor due to long-term non-use; adds an indicator light and uses a corresponding algorithm to prompt the user whether the detection device is currently working, which improves the detection accuracy and enhances the user experience, making it more suitable for consumers' daily use.

[0018] 4. In the detection part, the air path of the entire detection device is a passage during the vacuum process of the present invention, which solves the influence of the air pressure change inside the air chamber during the ventilation process. After the detection gas is fully reacted in the closed air chamber, the freshness level is obtained through the algorithm. During this period, the air pump does not work and the gas is in a static state. The sensor signal obtained in this way is more stable, eliminating the influence of airflow disturbance and the operation of the air pump or fan on the sensor. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0020] Figure 1 It is a schematic diagram of the structure of the detection device of the present invention.

[0021] Figure 2 for Figure 1 The overall detection flow chart of the detection device shown.

[0022] Figure 3 for Figure 1 Schematic diagram of the detection process of the detection device shown.

[0023] Figure 4 Flow chart of the detection method of the present invention.

[0024] Figure 5 This is a network structure diagram of the ResASPP network module of the present invention.

[0025] In the figure, 1 is the collection port, 2 is the air pump, 3 is the air chamber, 4 is the solenoid valve, 5 is the indicator light, 6 is the air pipe (the dotted line in the figure indicates the part), 7 is the gas sensor array, 8 is the camera, and 9 is the display screen. DETAILED DESCRIPTION

[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0027] Example 1 like Figure 1 As shown, a gas sensor-based multiple meat freshness detection device is mainly used for freshness detection of fresh meat in daily life. The detection device is composed of a miniature camera 8, a collection port 1, a miniature air pump 2, an air chamber 3, a gas sensor array 7, a two-way normally open solenoid valve (hereinafter collectively referred to as a solenoid valve 4), an indicator light 5, a detection button and a display screen 9. The collection port 1, the air chamber 3, and the miniature air pump 2 are all connected to each other by air pipes, that is, the collection port 1 is connected to the air pump 2 through the air pipe 6, and the air pump 2 is connected to the air inlet of the air chamber 3 through the air pipe 6. The air outlet of the air chamber 3 is connected to one end of the electromagnetic valve 4 through the air pipe 6, and the other end of the electromagnetic valve 4 is connected to the air. The electromagnetic valve 4 is used to control the on-off of the right air path. When the air pump extracts gas, the electromagnetic valve 4 is a passage, which can keep the air pressure in the air chamber constant, thereby reducing the impact of the air pressure; when the air pump finishes extracting gas, the electromagnetic valve 4 is an open circuit, so that the gas extracted from the air intake chamber can fully react in a closed environment, otherwise it will leak. The detection button is set on the air pump 2. The function of the detection button is to start the air pump 2, the single-chip microcomputer and the miniature camera 8 to work. When the air pump 2 is working, the air path where the air pump is located is in a passage; when not working, the air path where the air pump 2 is located is in an open circuit. The air pump 2, the solenoid valve 4, the air chamber 3 and the gas sensor array 7 are all arranged in the shell, the collection port 1, the camera 8, the indicator light 5, the detection button and the display screen 9 are arranged on the shell, and the miniature camera 8, the indicator light 5, the detection button, the display screen 9, the air pump 2, the solenoid valve 4 and the gas sensor array 7 are all connected to the single-chip microcomputer.

[0028] The meat to be tested is placed near the collection port 1. The collection port 1 is made of PC material with low VOC (volatile organic compounds), which can effectively prevent the influence of the smell of the collection port 1 itself on the detection. The circular structure can detect a larger range during the detection. The micro camera 8 is set near the collection port 1. The micro camera 8 collects the image of the meat to be tested. The air pump 2 absorbs the odor information of the meat to be tested at the collection port 1 and transmits it to the air chamber 3. The gas sensor array 7 is set in the air chamber 3. The gas sensor array 7 is used to detect the gas signal of the meat to be tested. The indicator light 5 is used to indicate whether the gas sensor array 7 is working normally. The display screen 9 is used to display the image collected by the micro camera 8 and the type and freshness of the meat identified by the single chip microcomputer. The single chip microcomputer automatically identifies the type of meat to be tested according to the meat recognition model, identifies the freshness of the meat according to each freshness detection model, and displays the detection results on the display screen 9 to realize human-computer interaction. Meat types include but are not limited to chicken, pork, beef, etc.

[0029] The gas sensor array 7 is composed of a variety of gas sensors, including but not limited to electrochemical and semiconductor VOC sensors, sulfur sensors, amine sensors, alcohol sensors, and ester sensors.

[0030] Other alternatives might be to change the order within the detection device, Figure 1 In the actual scheme, from left to right are air pump 1, air chamber 3 (containing sensor) and solenoid valve 4. As other preferred implementation methods, from left to right may be solenoid valve 4, air chamber 3 (containing sensor) and air pump 1. The solenoid valve 4 of the present invention is a two-way normally open solenoid valve. As other preferred implementation methods, other alternatives may be implemented with a two-way normally closed solenoid valve or a three-way solenoid valve.

[0031] The entire detection process of the detection device of the present invention is as follows: Step 1: Turn on the detection device. Note: The solenoid valve 4 in the detection device is normally open when it is turned off (that is, the gas path is open). During the period when the detection device is just turned on, the gas sensors in the gas sensor array 7 have just been turned on and are not stable yet, so the indicator light 5 on the detection device is red at this time, indicating that the gas signal cannot be collected yet.

[0032] The detection device needs to be preheated before it is turned on. To ensure that the sensor is fully preheated and reduce the preheating time, the following methods are adopted: Method 1: Automatically wake up and shut down at a time point with a low probability of use every day. Use the clock function in the microcontroller to count 6 hours after the last shutdown. If the device does not work again within 6 hours, the microcontroller will automatically wake up the sensor to preheat for two minutes and then shut down. Repeat this wake-up action. The sensors of the gas sensor array 7 have the opportunity to be powered on briefly every day without affecting normal use, thereby reducing the preheating time when starting up.

[0033] Method 2: Record the sensor's fluctuation signal in real time, and determine whether the sensor can be used to measure the gas signal based on whether the fluctuation signal exceeds the set threshold. Take one of the sensors as an example, and take t seconds as a time window. In this time window, record the sensor signal as s, subtract the maximum and minimum values ​​in the recorded signal s, and then average to get the signal s_mean. For the two adjacent time windows t1 and t2 (the previous time window is t1, and the next time window is t2), the signals s_mean1 and s_mean2 can be obtained respectively. If s_mean2-s_mean1<=threshold (threshold is the set threshold, generally set to 5), the sensor is considered stable, indicator light 5 turns green, and detection can begin. The formula is as follows: s_mean1 = (s1-max1-min1) / n s_mean2 = (s2-max2-min2) / n If s_mean2 - s_mean1>threshold, the sensor is not stable yet, the indicator light is red, and detection is not possible; Among them, s1 represents all values ​​recorded in the previous time window t1, max1 represents the maximum value of the value in the previous time window t1, min1 represents the minimum value of the previous time window t1, n represents the number of signals collected by signal s1 minus 2, s_mean1 represents the value after subtracting the maximum and minimum values ​​from the previous window and averaging; similarly, s2, max2, min2 and s_mean2 are the signal, maximum, minimum and average values ​​of the next time window t2 respectively. threshold represents setting the threshold.

[0034] Step 2: After the sensor is stable, the indicator light 5 turns green, and the air pump 2 is turned on by pressing the detection button. The air pump 2 aims the collection port 1 at the meat to be tested to collect the gas signal, and the micro camera 8 collects the digital image of the meat to be tested at the collection port 1; the single-chip microcomputer recognizes the meat in the digital image through its built-in meat recognition model, and at the same time, the built-in freshness detection model integrates the information of the gas signal and the digital image to detect the freshness of the meat, and displays the freshness and type of the meat to be tested on the display screen 9; Figure 2 shown.

[0035] The detection process for step 2 is as follows: like Figure 3 As shown, after step 1, the state of the detection device is: the indicator light is green, the electromagnetic valve 4 is connected, and the air pump 2 is not working. Aim the collection port 1 at the meat to be detected, press the detection button, and the air pump 2 starts to work. At this time, all the air paths of the detection device are connected, and the gas drawn by the air pump 2 will enter the air chamber 3 according to the air path and be discharged at the end of the electromagnetic valve 4. And when the detection button is pressed, the micro camera 8 starts to work, and the micro camera will transmit the captured picture of the meat to be detected to the single chip microcomputer, and the meat recognition model will be used in the single chip microcomputer to identify the picture of the meat to be detected and obtain the type of meat.

[0036] After 10 seconds, the air pump 2 stops working, the solenoid valve 4 is closed, and the gas of the meat to be tested has been in full contact with the gas sensor array 7 in the air chamber 3. At this time, the state of the detection device is: the indicator light 5 is red, the solenoid valve 4 is disconnected, and the air pump 2 stops working (that is, the air pump is also disconnected), then a closed space is formed inside the detection device. The gas drawn in by the air pump will fully react with the sensor in the air chamber in this closed space. The single-chip microcomputer in the detection device will select different meat freshness detection models according to the meat type identified by the meat recognition model to meet the freshness detection of different meats. After fully reacting for 30 seconds, the freshness detection model of the single-chip microcomputer will use feature extraction technology and neural network algorithm to obtain the detection results, and display the results on the display screen 9.

[0037] Step 3: After the test is completed, clean the air chamber 3; during the cleaning process, the indicator light 5 is red; After the test results are obtained, the air chamber 3 and the air pipe 6 need to be cleaned. The collection port of the detection device is away from the meat to be tested, and the solenoid valve 4 and the air pump 2 are opened. At this time, the air path inside the detection device is open, and the air pump 2 is used to extract clean gas to clean the entire air chamber 3. The cleaning process does not exceed 120s.

[0038] In order to overcome the influence of gases in the environment, the background environment calibration will be performed every time the detection device is turned on. The calibration steps are as follows: after the sensor in step 1 is stable, move the collection port away from the meat to be detected, record the stable baseline base, and use the air pump to extract the background gas. At this time, the signal value of the sensor becomes AD1, and the background gas impact value AD2 = AD1 -base. Then, all subsequent sensor signal changes AD3 obtained by detection need to be subtracted from AD2 as the actual reaction amount. The gas extracted by moving the detection device away from the target to be detected is considered to be clean gas (because the influence of the background gas has been considered during the calibration process).

[0039] Step 4: Repeat steps 2 to 4; After cleaning the air chamber 3, the solenoid valve 4 remains open and the air pump 2 is turned off. After the indicator light turns green using method 2 in step 1, go to step 2 a and repeat steps 2-4. Wait for the sensor to stabilize again and turn green again, because each time the air pump is used to clean the air chamber 3, the sensor signal will fluctuate.

[0040] Step 5: Shut down.

[0041] Regarding step 5, after the detection device is turned off (ie, after the power is turned off), the solenoid valve 4 is in a passage state, and the air pump 2 does not work (ie, an open circuit state).

[0042] The detection device of the present invention uses the least number of devices to complete the overall detection logic; during the vacuum process, the entire gas path is a passage, which reduces the impact of air pressure changes inside the air chamber on the sensor; the gas to be detected is placed in a closed air chamber for reaction, which reduces the impact of gas flow and air pump operation; an automatic wake-up function is added to reduce the sensor preheating time; an indicator light 5 is added, and a corresponding algorithm, namely a method 2 for determining sensor stability, is included, which enhances user experience and reduces detection time.

[0043] Example 2 A method for detecting the freshness of various meats based on a gas sensor, the steps of which are as follows: Step 1: Collect gas signals of different types of meat through the gas sensor array in the gas chamber multiple times, and perform preprocessing to obtain a gas characteristic data set.

[0044] Gas characteristics include but are not limited to steady-state information, peak position, area under the curve, etc. The following preprocessing is performed on the gas signal: the peak signal size, peak signal position, and maximum change slope of the gas signal collected by the gas sensor are used as gas characteristics. Acquisition method: record all the signal points collected, and take the maximum value of the peak signal size; the peak signal position acquisition method: record all the signal points collected, first determine the maximum value, and then obtain the time point position of the point. The maximum change slope acquisition method: calculate the slopes of two adjacent signal points respectively, and take the maximum value. These gas characteristics are input into the model as independent features.

[0045] Step 2: Use a camera to collect images of different types of meat multiple times, and preprocess them to obtain an image feature data set. At the same time, the images of different types of meat in the image feature data set are divided into different meat image feature data sets.

[0046] Preprocessing of images of different types of meat, including but not limited to denoising, rotation, cropping, etc., can increase the quality and quantity of the images themselves.

[0047] Step 3: Input the image feature data set into the meat recognition model for training to obtain a trained meat recognition model.

[0048] The meat recognition model uses the ResASPP-CNN network structure to recognize preprocessed images. The ResASPP-CNN network adds the ASPP (Atrous Spatial Pyramid Pooling) module to the traditional CNN network. The ASPP module is set in the convolution operation part of the CNN network.

[0049] The ASPP module consists of multiple parallel dilated convolutions, and a residual connection is added to each separate dilated convolution structure. Finally, the features after the residual connection are fused together by splicing to form a more comprehensive feature representation. Figure 5As shown in the figure, the ASPP module includes three parallel dilated convolutions. The convolution structure of the ASPP module can effectively solve the problems of insufficient feature extraction and loss of information details in meat type recognition caused by external factors such as the kitchen environment in traditional CNN. The convolution operation of the dilated convolution of the ASPP module sets different dilation rates on the basis of traditional convolution, and inserts "holes" in the convolution kernel elements, so that the convolution kernel can increase the receptive field without increasing the number of parameters and computational complexity, and can extract more features from the image, which can reduce the depth and computational complexity of the network. In addition, a residual connection is added to each structure after the dilated convolution in the ASPP module to ensure that the characteristic signal of meat will not be completely lost after passing through the dilated convolution, and the problem of gradient disappearance or gradient explosion is weakened. The combination of the two can better capture the multi-scale features of meat images, reduce the influence of external interference factors, and improve the stability of the model and the accuracy of meat type recognition.

[0050] Step 4: Input different meat image feature data sets into different types of image freshness detection models to obtain trained image freshness detection models for different meats, and input the gas feature data sets corresponding to the meat images into the gas freshness detection model for training to obtain a trained gas freshness detection model.

[0051] The image freshness detection model uses a convolutional neural network, and the gas freshness detection model uses a fully connected neural network. Both models are trained using the gradient descent method. Because the concentration and type of gas produced by different meats during the spoilage process are different, choosing image freshness detection models for different meats can avoid recognition errors caused by using the same freshness model for different meats.

[0052] Step 5: The image freshness obtained by the trained image freshness detection model and the gas freshness obtained by the trained gas freshness detection model are input as new feature data sets into the fusion network, i.e., the fully connected neural network for training to obtain a trained fully connected neural network.

[0053] Adaptive Stacking algorithm: The meat image freshness result a is used as the first feature, the gas freshness result b is used as another feature, and the original label of the sample is still used as the label for training. The model used is a fully connected neural network, and the training and optimization are performed through the gradient descent method. During each detection, the image collected by the camera and the gas signal collected by the gas sensor are one-to-one corresponding.

[0054] In the model for identifying freshness, the image features and gas features of meat are modeled separately, and the adaptive Stacking algorithm is used for fusion at the decision level. The image features of the meat image feature dataset are input into the convolutional neural network to output the recognition result a (model A); the gas features of the gas feature dataset are input into the fully connected neural network to output the recognition result b (model B); the recognition results a and b are fused at the decision level using the adaptive Stacking algorithm. The adaptive Stacking algorithm can dynamically adjust the weights according to the performance of the base model. The specific adaptive process is as follows: Model A based on image features can simultaneously judge the surrounding environment while using the convolutional neural network to identify freshness, and output the lighting conditions, background color, and interference on the meat surface in the image. The output results are used as a new background judgment data set, and the convolutional neural network is used to judge the background level based on the background judgment data set. The background level is divided into 1-5 levels, corresponding to the weight of model A in the overall model of 0.2-0.4-0.6-0.8-1 (the higher the level, the clearer the background environment, and the larger the corresponding weight). Similarly, in model B based on gas features, the adaptive stacking algorithm uses the temperature of the surrounding environment and background gas noise as the odor background data set to train the neural network model, and also divides the background level into 1-5 levels, corresponding to the weight of model B in the overall model of 0.2-0.4-0.6-0.8-1 (the higher the level, the cleaner the background smell, and the larger the corresponding weight). After completing the weight assignment of models A and B, the specific fusion process is as follows: multiply the corresponding weights by the results a and b as feature values, use the original labels as the labels of the new samples, re-use the fully connected neural network for training, and use the gradient descent method to train and optimize, and obtain the final freshness recognition result c, which is compared with the results on the training set to determine the final model parameters. This algorithm using adaptive stacking completes the fusion of image features and gas features at the decision-making level, solves the impact of lighting conditions, shooting angles, and the inability to observe internal changes on image detection, and also reduces the cross-interference and external gas impact of gas detection, and the two compensate each other.

[0055] Step 6: The gas signal and meat image of the meat to be detected are collected by the gas sensor array and the camera respectively, and processed by the preprocessing method in step 1 and step 2, and the gas characteristics of the meat to be detected after preprocessing are input into the trained gas freshness detection model to obtain the gas freshness of the meat to be detected; the image characteristics of the meat to be detected after preprocessing are input into the trained meat recognition model to obtain the meat type of the meat to be detected, and the image characteristics of the meat to be detected after preprocessing are input into the trained image freshness detection model of the same type selected according to the meat type of the meat to be detected to obtain the image freshness of the meat to be detected; the corresponding weights are multiplied by the image freshness and gas freshness of the meat to be detected as feature values ​​and input into the trained fully connected neural network to obtain the final freshness of the meat to be detected. The image freshness result and the gas freshness result are actually numbers between 0 and 1. This method completes the fusion of olfactory results and visual results at the decision layer, reducing the misjudgment of single judgment.

[0056] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for detecting the freshness of various meats based on a gas sensor, characterized in that: The steps are as follows: Step 1: The gas signals of different types of meat are collected multiple times through the gas sensor array in the gas chamber, and the gas characteristics are obtained by preprocessing to form a gas characteristic data set; the corresponding images of different types of meat are collected multiple times by using a camera and preprocessed to obtain an image characteristic data set, and the images of different types of meat in the image characteristic data set are combined into different meat image characteristic data sets; Step 2: Input the image feature data set into the meat recognition model for training to obtain a trained meat recognition model; Step 3: Input different meat image feature data sets into different types of image freshness detection models respectively to obtain trained image freshness detection models for different meats, and input the gas feature data sets corresponding to the meat images into the gas freshness detection model for training to obtain a trained gas freshness detection model; Step 4: The image freshness obtained by the trained image freshness detection model and the gas freshness obtained by the trained gas freshness detection model are used as new feature data sets and input into the adaptive Stacking algorithm for training; Step 5: The gas signal and meat image of the meat to be detected are collected by the gas sensor array and the camera respectively, and the gas signal and the meat image are preprocessed respectively, and the gas characteristics of the meat to be detected after the preprocessing are input into the trained gas freshness detection model to obtain the gas freshness of the meat to be detected; the image characteristics of the meat to be detected after the preprocessing are input into the trained meat recognition model to obtain the meat type of the meat to be detected, and the image characteristics of the meat to be detected after the preprocessing are input into the trained image freshness detection model corresponding to the meat type of the meat to be detected to obtain the image freshness of the meat to be detected; the image freshness and gas freshness of the meat to be detected are merged by the trained adaptive Stacking algorithm to obtain the final freshness of the meat to be detected.

2. The method for detecting freshness of various meats based on gas sensors according to claim 1, characterized in that: The gas characteristic is at least one of the peak signal size, peak signal position, and maximum change slope of the gas signal; preprocessing of images of different types of meat includes but is not limited to denoising, rotation, and cropping.

3. The method for detecting freshness of various meats based on a gas sensor according to claim 1 or 2, characterized in that: The meat recognition model is a ResASPP-CNN network, which adds an ASPP module to the convolution operation part of the CNN network; the ASPP module is composed of multiple parallel dilated convolutions, and a residual connection is added to each separate dilated convolution structure, and finally the features after the residual connection are fused together by splicing; the convolution operation of the dilated convolution of the ASPP module sets different expansion rates, and inserts "holes" in the convolution kernel elements.

4. The method for detecting freshness of various meats based on gas sensors according to claim 3, characterized in that: The image freshness detection model adopts a convolutional neural network, and the gas freshness detection model adopts a fully connected neural network. The image freshness detection model and the gas freshness detection model are trained by a gradient descent method.

5. The method for detecting freshness of various meats based on gas sensors according to claim 4, characterized in that: The adaptive stacking algorithm uses the image freshness result of the meat as the first feature, the gas freshness result as another feature, and the label of the sample as the label for training; The fusion network of the adaptive Stacking algorithm is a fully connected neural network, which is trained and optimized by the gradient descent method.

6. The method for detecting freshness of various meats based on gas sensors according to claim 5, characterized in that: The adaptive Stacking algorithm dynamically adjusts the weight according to the performance of the base model, and the adaptive process is as follows: the image freshness detection model based on image features uses a convolutional neural network to identify freshness while simultaneously judging the surrounding environment, outputs the lighting conditions, background color or meat surface interference in the image as a new background judgment data set, and inputs the background judgment data set into the convolutional neural network to obtain the background level, and divides the background level into levels 1-5, corresponding to the weights of the image freshness detection model of 0.2-0.4-0.6-0.8-1 respectively; similarly, in the gas freshness detection model based on gas features, the adaptive stacking algorithm uses the temperature of the surrounding environment and background gas noise as the odor background data set to train the fully connected neural network, and obtains the weight of the gas freshness detection model according to the background level.

7. The method for detecting freshness of various meats based on gas sensors according to claim 6, characterized in that: When the adaptive Stacking algorithm is trained, the original labels are used as labels of samples in the new feature data set, and training optimization is performed through the gradient descent method; The method for the adaptive Stacking algorithm to fuse the image freshness and gas freshness of the meat to be detected is: multiplying the corresponding weights by the image freshness result and the gas freshness result as feature values, and using the fusion network to obtain the final freshness recognition result.

8. A gas sensor-based device for detecting the freshness of various meats, characterized in that: The invention comprises a shell, wherein an air pump (2) and an air chamber (3) are arranged in the shell, a collection port (1), a camera (8), an indicator light (5), a detection button and a display screen (9) are arranged on the shell, the air pump (2) is respectively connected to the collection port (1) and the air inlet of the air chamber (3) through an air pipe (6), the air pump (2) is provided with a detection button, the air chamber (3) is provided with a gas sensor array (7), the air outlet of the air chamber (3) is provided with a solenoid valve (4), the camera (8), the indicator light (5), the detection button, the display screen (9), the air pump (2), the solenoid valve (4) and the gas sensor array (7) are all connected to a single-chip microcomputer, and the single-chip microcomputer is provided with a meat recognition model and a freshness detection model of different types of meat as claimed in claims 1 to 7.

9. The gas sensor-based device for detecting freshness of various meats according to claim 8, characterized in that: The solenoid valve (4) is a two-way normally open solenoid valve, a two-way normally closed solenoid valve or a three-way solenoid valve; The collection port (1) is a circular structure, and the camera (8) is arranged on the housing near the collection port (1); The gas sensor array (7) is composed of a variety of gas sensors, including but not limited to electrochemical and semiconductor VOC sensors, sulfur sensors, amine sensors, alcohol sensors, and ester sensors.

10. The gas sensor-based device for detecting freshness of various meats according to claim 8, characterized in that: By using the clock function in the single chip microcomputer, when the power is turned off, the single chip microcomputer automatically wakes up the sensors of the gas sensor array (7) to preheat for two minutes and then turns off; The single chip computer records the gas signal collected by the sensor in real time, and determines whether to use the sensor to measure the gas signal according to whether the fluctuation of the adjacent windows of the gas signal exceeds the set threshold; the fluctuation of the adjacent windows of the gas signal is: the difference between the average values ​​of the stable signals in adjacent time windows; the average value of the stable signal is the average of the gas signal in a time window minus its maximum and minimum values; The detection process is as follows: the collection port (1) is aligned with the meat to be detected, the detection button is pressed, the air pump (2) starts working, the gas drawn in enters the air chamber (3), and is discharged at the end of the electromagnetic valve (4); at the same time, the camera (8) takes a picture of the meat to be detected and transmits it to the single-chip microcomputer, the single-chip microcomputer uses the meat recognition model to recognize the picture of the meat to be detected and obtains the type of meat; after 10 seconds, the air pump (2) stops working, the electromagnetic valve (4) is closed, and the gas of the meat to be detected is fully in contact with the gas sensor array (7) in the air chamber (3); at the same time, the single-chip microcomputer selects different meat freshness detection models according to the meat type result identified by the meat recognition model; after a full reaction of 30 seconds, the freshness detection model of the single-chip microcomputer obtains the detection result according to the picture of the meat to be detected and the gas signal collected by the gas sensor array (7), and displays the result on the display screen (9); the collection port (1) is moved away from the meat to be detected, the electromagnetic valve (4) and the air pump (2) are opened, and the air pump (2) is used to extract clean gas to clean the air chamber (3) and the air pipe (6); Each time the microcontroller is turned on, it performs background environment calibration. The calibration steps are as follows: after the sensor is stable, move the collection port (1) away from the meat to be tested, record the stable baseline base, use the air pump (2) to extract the background gas, and the sensor signal value becomes AD1. The background gas impact value AD2 = AD1 - base, and then all the sensor signal changes AD3 detected are subtracted from AD2 to obtain the actual response value.

Citation Information

Patent Citations

  • Detection device and detection method for freshness of chicken breast

    CN103412102B

  • Device and method for testing freshness of pork

    CN110658313A