Intelligent food freshness monitoring device and method based on olfaction visualization
By integrating a smart food freshness detection device with real-time image information monitoring, the problem of data silos in food testing has been solved, enabling real-time intelligent monitoring and efficient evaluation of food freshness.
Patent Information
- Application Number
- CN202511371022.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-24
- Publication Date
- 2026-01-06
AI Technical Summary
Existing food testing methods are highly subjective, cumbersome, and time-consuming, failing to meet the needs for transparency and intelligent decision-making in food quality control. Furthermore, the offline architecture of olfactory visualization technology creates data silos in the testing system.
Design an intelligent detection device integrating an STM32 microcontroller, a Raspberry Pi 4B, a high-precision USB camera, a temperature and humidity sensor, and a modular reaction chamber. This device enables the synchronous acquisition of temperature, humidity, and image information, and combines convolutional neural networks (such as convolutional neural networks) to predict the freshness of food.
It enables real-time intelligent monitoring of food freshness, improves the reliability of detection and the transparency of data, and enhances the accuracy and efficiency of food freshness evaluation.
Smart Images

Figure CN121275731A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of non-destructive testing technology for agricultural product quality, specifically relating to an intelligent monitoring device and method for food freshness based on olfactory visualization. Background Technology
[0002] In the food consumption sector, freshness is directly related to food safety and consumer health, especially for pork, a major meat product consumed in my country. Traditional testing methods, such as sensory evaluation, physicochemical analysis, and microbiological methods, suffer from drawbacks such as high subjectivity, cumbersome operation, and long processing times, making it difficult to meet the requirements of modern food testing for efficiency, speed, and non-destructive testing. Although olfactory visualization technology is an emerging testing method that can capture changes in volatile organic compounds through olfactory sensors and combine them with algorithms to assess freshness, the existing testing system, due to its offline architecture, forms multi-source heterogeneous data silos, which cannot meet the needs of transparency and intelligent decision-making in food quality control processes.
[0003] Therefore, developing real-time, rapid, and non-destructive intelligent monitoring devices and methods for food freshness is of great practical significance for ensuring food safety, improving the quality control level of the food industry, and promoting the intelligent upgrading of the food industry. Summary of the Invention
[0004] To address the shortcomings of existing technologies, this invention provides an intelligent food freshness detection device and method based on olfactory visualization. This ensures the stable acquisition of quality and environmental data during meat spoilage. The device integrates an STM32 microcontroller, a Raspberry Pi 4B, a high-precision USB camera, a temperature and humidity sensor, and a modular reaction chamber. It enables the synchronous acquisition of temperature, humidity, and image information, constructs a food freshness prediction model, and thus achieves real-time intelligent monitoring of food freshness.
[0005] To achieve the above-mentioned objectives, the present invention provides the following solution:
[0006] The present invention first provides an intelligent food freshness monitoring device based on olfactory visualization. The monitoring device includes a handle, a lid base plate, a chassis shell, a temperature and humidity acquisition module, a main control unit, an edge computing node, a sensor reaction chamber, an image acquisition module, and a slide rail.
[0007] The grip is fixed to the cover base plate; the cover base plate is fixed to the top of the chassis shell; the chassis shell is fixedly connected to the sensor reaction chamber and the slide rail, and the edge computing node is placed in the slot provided on the chassis shell; the sensor reaction chamber is mounted on the slide rail and can slide freely on the slide rail track; the main control unit and the image acquisition module are fixedly connected to the slide rail.
[0008] The temperature and humidity acquisition module is installed on the main control unit; the image acquisition module is electrically connected to the edge computing node;
[0009] The image acquisition module has its own light source, and the sensor reaction chamber is located below the image acquisition module. The sensor reaction chamber is used to store the olfactory sensor and the sample. Before and after the olfactory sensor reacts with the sample, the image acquisition module acquires images. During the image acquisition process, the sensor reaction chamber and the slide rail are connected to form a light-proof environment to ensure the consistency of the image acquisition conditions.
[0010] Preferably, the grip includes a connecting post and a handle, the handle being connected to the cover base plate via the connecting post; the connecting post includes connecting post one and connecting post two;
[0011] Preferably, the chassis shell includes an outer wall, heat dissipation holes, an edge computing node receiving slot, and a data interface through hole; the heat dissipation holes are located on both sides of the outer wall, namely heat dissipation hole one and heat dissipation hole two, wherein heat dissipation hole one is close to the edge computing node receiving slot; the data interface through hole is on the same side as the edge computing node receiving slot to avoid bending of the data cable;
[0012] Preferably, the sensor reaction chamber includes a triangular chute, a reaction chamber sidewall, a sensor receiving slot, and a partition; the triangular chute is located on both sides of the top of the reaction chamber sidewall and is matched with a slide rail; the sensor receiving slot and the partition are placed inside the sensor reaction chamber; during actual detection, the sample and the sensor are separated by the partition to ensure that the sensor is not contaminated by sample tissue fluid or other components.
[0013] The slide rail consists of slots and a groove body. The slots are designed to fix the main control unit and include slot 1, slot 2, slot 3, slot 4, slot 5 and slot 6; among them, slot 1 and slot 6 are on the same side as the data interface through hole.
[0014] The present invention also provides a method for monitoring changes in food freshness based on the aforementioned device, comprising the following steps:
[0015] Step 1: Use a smart food freshness monitoring device to collect raw images from olfactory sensors that react with foods of different freshness levels.
[0016] First, samples are selected. Different quality grades of samples correspond to different volatile odor substances, and different volatile odor substances will cause different color changes in the olfactory sensor. The samples include agricultural products and aquatic products. The different quality grades include the freshness grade of the sample or different sensory quality grades.
[0017] Then, the extraction steps for the feature variables in step 1 are as follows: After the sample is placed into the sensor housing, the image acquisition module is used to acquire the image of the olfactory sensor before the reaction; the olfactory sensor and the volatile organic compounds of the sample are allowed to react fully for a period of time; after the reaction, the edge computing node is used to control the image acquisition module to acquire the image of the olfactory sensor after the reaction, and the acquired image is saved in the computer; at the same time, the temperature and humidity acquisition module is controlled by the main control unit to acquire temperature and humidity data; the computer is used to locate the position of each color-sensitive unit in the images before and after the reaction; the image acquisition module is used to acquire the image of the olfactory sensor after the reaction, and the images of the olfactory sensor before and after the reaction are decomposed into R-channel, G-channel, and B-channel grayscale images; the difference between the grayscale mean values of the grayscale images before and after the reaction is obtained, and the difference in grayscale mean values is the feature variable of the color-sensitive unit; that is, ΔR = R a -R b △G=G a -G b △B=B a -B b Where subscript a represents the value after the reaction, and b represents the value before the reaction; and according to Calculate the Euclidean distance; △R, △G, △B and ED are the feature variables of a color-sensitive unit, and X color-sensitive units obtain Y feature variables, where Y = 4X; combine the feature variables contained in all samples to obtain the feature matrix, which is the color feature dataset D of the food freshness olfactory sensor.
[0018] Preferably, when the sample in step 1 is an agricultural product, the dosage is 2-5g, and when the sample is an aquatic product, the dosage is 10-15g; the olfactory sensor is fixed in the sensor receiving slot, and the reaction time is 10-20min.
[0019] In step 1, the number of samples used to construct the food freshness evaluation model is selected as N, which includes n quality grades, each grade has m samples, i.e., N = n * m; where n is a positive integer not less than 2, and m and N are both positive integers.
[0020] The olfactory sensor is a highly sensitive and specific olfactory sensor targeting trimethylamine, the main characteristic component of TVB-N, a spoilage marker in pork. It is obtained by grafting trimethylamine molecularly imprinted polymers (MIPs) onto the surface of metal organic frameworks (MOFs) as carriers. It is denoted as dye@MOF@MIPs.
[0021] Furthermore, the specific fabrication method of the olfactory sensor is as follows:
[0022] Synthesis of S1, MOF@MIPs materials
[0023] S1.1 Weigh 2-amino-p-phenyl dimethyl and FeCl3·6H2O and dissolve them in DMF to obtain a mixed solution; then add glacial acetic acid to the mixed solution and mix. After stirring evenly, place the mixture in a reaction vessel to carry out the reaction. Cool the reaction to room temperature and centrifuge to obtain a crystal precipitate; wash the crystal precipitate with anhydrous ethanol and then dry the washed precipitate to obtain a metal-organic framework material, denoted as Fe-MIL-88NH2;
[0024] S1.2 TMA (trimethylamine) solution, MAA (methacrylic acid), Fe-MIL-88NH2 and methanol were stirred at room temperature, and then crosslinking agent EGDMA (ethylene glycol dimethacrylate) and initiator AIBN (azobisisobutyronitrile) were added. Stirring continued until the mixed solution emulsified to obtain an emulsion. The emulsion was then purged with nitrogen to remove oxygen. After nitrogen purging, the resulting mixed solution was placed in a constant temperature water bath and stirred to obtain a polymer. Finally, Soxhlet extraction was performed using a mixture of methanol and acetic acid (to remove the template molecule TMA). The eluted solid was then dried to obtain the molecularly imprinted polymer, denoted as MOF@MIPs.
[0025] S2, Fabrication of dye@MOF@MIPs nano-olfactory visualization sensor
[0026] The pH indicator and the MOF@MIPs obtained in step S1 were added to anhydrous ethanol to obtain a color-sensitive solution and a MOF@MIPs dispersion, respectively. Then, the color-sensitive solution and the MOF@MIPs dispersion were mixed evenly to obtain a mixed solution. Polyethylene glycol-300 was added to the mixed solution, and then the mixture was continuously shaken in a shaker to obtain a dye@MOF@MIPs composite material. The obtained dye@MOF@MIPs composite material was centrifuged to collect the solid precipitate, and then redispersed in anhydrous ethanol to obtain a dye@MOF@MIPs solution. The dye@MOF@MIPs solution was then taken and dropped onto the surface of a PVDF membrane. After stabilization, an olfactory sensor was formed, which was denoted as the dye@MOF@MIPs olfactory sensor.
[0027] Preferably, in step S1.1, the ratio of 2-amino-p-phenyl dimethyl, FeCl3·6H2O, DMF, and glacial acetic acid is 0.252 g: 0.374 g: 15 mL: 200 μL. The reaction is carried out in a reactor at 120°C for 4 hours. The centrifugation conditions are 10000 r / min for 10 minutes. The drying conditions are drying at 70°C for 8 hours.
[0028] Preferably, in step S1.2, the ratio of TMA solution, MAA, Fe-MIL-88NH2, methanol, EGDMA, and AIBN is 30 μL: 80: 0.2 g: 20 mL: 3 mL EGDMA: 200 mg, wherein the concentration of TMA solution is 30 wt.%; the stirring time at room temperature is 20-30 minutes, and the nitrogen purging time is 15-20 minutes; the reaction time in a constant temperature water bath is 12 hours at a temperature of 70°C; the volume ratio of methanol to acetic acid is 9:1; and the drying condition is drying at 70°C for 24 hours.
[0029] Preferably, in step S2, both the color-sensitive solution and the MOF@MIPs dispersion have a concentration of 2 mg / mL; the volume ratio of the color-sensitive solution to the MOF@MIPs dispersion is 2:1; the volume ratio of polyethylene glycol-300 to the color-sensitive material dispersion is 0.3 μL: 1 ml; the shaking treatment time is 12 hours; the pH indicator includes bromocresol green, bromophenol blue, and neutral red; and the concentration of the dye@MOF@MIPs solution is 2 mg / mL.
[0030] Step 2, train the convolutional neural network (FocusNet) model based on the squeeze-excitation attention mechanism:
[0031] The FocusNet model consists of an input layer, a convolutional layer, a squeeze-excited attention module, a flattening layer, a fully connected layer, and an output layer. There are two convolutional layers, designated as Convolutional Layer 1 and Convolutional Layer 2. The FocusNet model also includes two pooling layers, designated as Max Pooling Layer 1 and Max Pooling Layer 2. The model takes the food freshness olfactory sensor color feature dataset D obtained in step 1 as input and the physicochemical index content of food freshness as output.
[0032] The optimization training steps for the FocusNet model are as follows:
[0033] The local features of the food freshness olfactory sensor color feature dataset D are extracted by performing row convolution operation on the convolutional layer 1. Then, the normalization layer is used for standardization, and then the max pooling layer 1 is introduced to process the pooled local features.
[0034] A second convolutional layer combined with the ReLU activation function is used to perform secondary convolution on the pooled local features to extract the high-order features contained therein. After processing by a batch normalization layer, the data dimensionality is further reduced by a max pooling layer 2 to retain key high-order features. A squeeze and excitation attention mechanism module is introduced to process the high-order features to obtain a weighted feature matrix. The weighted feature matrix is converted into a one-dimensional vector by a flattening layer and then input into a fully connected layer for feature mapping. Finally, the regression prediction values of the physicochemical index content of food freshness are directly output through a second fully connected layer.
[0035] Finally, the Adam optimizer and mean squared error (MSE) loss function are used for optimization training. Training is terminated when the validation set loss does not decrease for 15 consecutive rounds, and the initial FocusNet model is finally obtained. The model training is complete.
[0036] Furthermore, the specific operating steps are as follows:
[0037] S2.1 Feature extraction of convolutional layer 1: Convolutional layer 1 is configured with 32 output channels, using a 3×1 convolutional kernel, stride 1 and padding 1. It performs convolution operation on the input color feature dataset D through the ReLU activation function to extract local features in the dataset (i.e., local response features of color changes of the olfactory sensor).
[0038] S2.2 Batch Normalization and Pooling: The local features extracted in S2.1 are input into the batch normalization layer for standardization. The internal covariate shift is suppressed by adjusting the feature distribution. Then, max pooling layer 1 is introduced with a 2×1 pooling kernel and a stride of 2. While retaining the core information of the local features, the data dimension is compressed to 1 / 2 of the original size to obtain the pooled local features.
[0039] S2.3 High-order feature mining of convolutional layer 2: Convolutional layer 2 expands the output channels to 256, and adopts the same 3×1 convolutional kernel, stride 1 and padding 1 as convolutional layer 1. It combines the ReLU activation function to perform secondary convolution on the local features after pooling, and mines the high-order features contained therein (i.e., the deep features related to color change and food freshness).
[0040] S2.4 Secondary normalization and pooling: After the high-order features output from S2.3 are processed by the batch normalization layer, the data dimensionality is further reduced by the max pooling layer 2 (2×1 pooling kernel, stride 2) to retain key high-order features;
[0041] S2.5 Attention Mechanism Weighting: A squeeze-excitation attention mechanism module is introduced to process the higher-order features after S2.4 pooling.
[0042] S2.5.1 Compression operation (squeezing): The spatial dimension information of each channel is aggregated into a 1×1×C scalar vector Z by global average pooling, thereby integrating the global information of each channel;
[0043] S2.5.2 Activation Operation (Activation): The vector Z is transformed nonlinearly through a fully connected layer to generate the weight coefficient S of each channel, which strengthens the feature channels that are highly correlated with freshness and weakens redundant information.
[0044] S2.5.3 Weighted Fusion: Multiply the weight coefficients S with the input high-order features channel by channel to obtain the weighted feature matrix;
[0045] S2.6 Fully Connected Layer Feature Mapping: The weighted feature matrix output from S2.5 is flattened into a one-dimensional vector and then input into a fully connected layer (input node 1024, output node 256) for feature mapping; to prevent overfitting, a Dropout layer with a dropout rate of 0.2 is introduced to randomly mask some neurons;
[0046] S2.7 Output prediction results: The regression prediction values of the physicochemical index content of food freshness are directly output through the second fully connected layer (input node 256, output node 1); except for the output layer, each layer uses the ReLU activation function to ensure nonlinear modeling capability;
[0047] S2.8 Model Training Optimization: The Adam optimizer and mean squared error (MSE) loss function are used, with the initial learning rate set to 0.001. The learning rate is dynamically adjusted using a cosine annealing strategy. The batch size is set to 64, the maximum number of training epochs is 280, and an early stopping method (patience = 15) is used. Training is terminated when the validation set loss does not decrease for 15 consecutive epochs. Finally, the initial FocusNet model is obtained after training, and the model training is completed.
[0048] Preferably, the specific procedures for the compression and excitation operations described in steps S2.5.1 and S2.5.2 are as follows:
[0049] (1) Compression operation: Through global average pooling, the spatial dimensional information of each channel is compressed into a scalar. This step aggregates the global information of each channel. Assuming the input feature map T has dimensions H×W×C, where H is the height, W is the width, and C is the number of channels, then after global average pooling, a 1×1×C dimension vector Z will be obtained, as shown in formula (I):
[0050]
[0051] In formula (I), Z c T is the c-th element of the compressed Z vector; c(i,j) represents the value of the c-th channel at position (i,j).
[0052] (2) Activation operation: The vector obtained above is nonlinearly transformed through a fully connected layer to generate the weights of each channel, as shown in Equation (II):
[0053] S=Sigmoid(fz,W))=Sigmoid(W2ReLu(W1z)) (Ⅱ)
[0054] In formula (II), z is the real number generated after compression, f represents the nonlinear function expressed by the attention module through the fully connected layer, and W1 and W2 are the weight parameters of the first and second layers in the fully connected layer, respectively. Where C is the number of channels, and r represents the hyperparameter of dimensionality reduction, used to appropriately hide the number of neurons, usually r = 16.
[0055] Step 3: Based on the initial FocusNet model trained in Step 2, further optimize the food freshness evaluation model. The specific process is as follows:
[0056] Based on the color feature dataset of the food freshness olfactory sensor obtained in step 1, the feature dataset is input into the FocusNet model trained in step 2; the food freshness evaluation model is constructed by using the feature matrix as input and the quality index of the detected sample as output.
[0057] Model validation step: Select a validation set sample with known quality (not the sample to be tested), react according to the method described in step 1 to obtain its food freshness olfactory sensor color feature dataset, and then input the dataset into the food freshness evaluation model to verify the model accuracy.
[0058] Step 4: Quality monitoring of food freshness samples to be tested
[0059] Take the sample to be tested, and obtain the characteristic variables of the sample according to the operation in step 1. Input the extracted characteristic variables into the food freshness evaluation model in step 3, and the freshness physicochemical index content of the sample to be tested can be output, so as to realize the monitoring of the freshness of the sample to be tested during the food spoilage process.
[0060] The present invention also relates to a main control unit and a control program for an edge computing node, including a memory and a processor, wherein the processor and the memory are electrically connected to enable communication between them; the memory is used to store a program that supports the processor in executing the above-described method, and the processor is configured to execute the program stored in the memory;
[0061] The main control unit's underlying driver is based on the Keil μVision5 platform and developed in C language. It completes sensor data acquisition, communication protocol design, and interaction with edge computing nodes. The edge computing nodes are built using Python language to realize real-time image acquisition and local data storage. They also combine the Flask framework to develop lightweight network services to support real-time transmission of detection results and cloud interaction.
[0062] A smart food freshness monitoring program is provided. The front end of the program is developed based on the Vue.js framework, which integrates real-time dynamic monitoring and historical data query functions. The back-end service layer is based on the SpringBoot microservice framework and improves the efficiency of data transmission through asynchronous non-blocking RESTful interface design.
[0063] A computer data transmission protocol is disclosed, which is used for data transmission encryption between edge settlement nodes and intelligent monitoring platforms to prevent data tampering and ensure the transparency of the monitoring system. The transmission protocol adopts DES symmetric encryption technology, and each round of transformation includes four basic operations: byte substitution, row shift, column mixing, and round key addition. Byte substitution uses a fixed S-box for nonlinear transformation; row shift achieves position permutation through cyclic left shift; column mixing performs matrix multiplication on the finite field GF(2^8) to provide diffusion; the decryption process uses the round key in the reverse order of the encryption process. This reverse use of the round key strategy ensures that each operation can accurately cancel the corresponding operation in the encryption step, and finally recover the original data, ensuring the effectiveness and transparency of data transmission.
[0064] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0065] (1) This invention designs an intelligent food freshness monitoring device based on olfactory visualization. Through the main control unit, edge computing node, temperature and humidity sensor and image acquisition module designed in this invention, the sensor response image and environmental information can be dynamically captured during the actual sample detection process. The image acquisition device is installed inside the sealed space formed by the sensor reaction chamber and the slide rail, maintaining a light-proof environment, reducing the interference of the external environment on the acquisition of food freshness information, improving the stability of the image acquisition environment, and enhancing the reliability of predicting the content of physicochemical indicators of food freshness using olfactory visualization technology. In addition, the designed symmetric encryption protocol prevents data tampering and ensures the authenticity and transparency of the monitoring data.
[0066] (2) This invention designs a FocusNet model for monitoring changes in food freshness. This model adds a squeeze-excitation attention module to the traditional CNN model. It achieves channel-dimensional squeezing through global average pooling and then generates channel weights through a fully connected layer to complete the excitation process. This channel-dimensional weight calibration mechanism enables the model to extract local detailed features with the help of CNN and establish global feature associations through the attention mechanism, thereby more accurately capturing the key local features related to the content of physicochemical indicators of the test sample in the changes in food freshness. This method not only significantly improves the flexibility of model feature extraction, but also effectively suppresses noise channel interference through the feature recalibration mechanism and strengthens the expressive ability of key feature channels.
[0067] (3) This invention discloses an intelligent monitoring device and method for food freshness based on olfactory visualization. The main focus is to overcome the problem of data silos in food freshness detection devices caused by the offline architecture of the existing detection system. It achieves rapid evaluation of food freshness by acquiring information on volatile components of food and environmental information.
[0068] (4) This invention captures VOCs released during food spoilage using an olfactory sensor, combines a high-resolution industrial camera to collect sensor response images in real time, integrates a temperature and humidity sensor to monitor environmental parameters, and finally completes data analysis through an edge computing module and outputs the sensor detection results to an intelligent management platform.
[0069] (5) The FocusNet model for rapid evaluation of food freshness established in this invention uses the color feature dataset D of food freshness olfactory sensor as input and the content of physicochemical indicators of food freshness as output to establish a food freshness evaluation model. It has good universality, improves the efficiency of quality evaluation, and is of great significance for the evaluation of food quality. Attached Figure Description
[0070] Figure 1 This is a schematic diagram illustrating the design concept of an intelligent food freshness monitoring device based on olfactory visualization according to the present invention.
[0071] Figure 2 This is a schematic diagram of a device for intelligent monitoring of food freshness based on olfactory visualization according to the present invention.
[0072] Figure 3 This is a schematic diagram of the top cover, outer casing, slide rail, sensor reaction chamber, and slide rail of the present invention; Figure A is the top cover, Figure B is the outer casing, Figure C is the sensor reaction chamber, and Figure D is the slide rail.
[0073] Figure 4The diagram shows the structure of the FocusNet model for detecting the content of physicochemical indicators of food freshness; where A is the network diagram of the FocusNet model structure; B is a schematic diagram of the SE attention module; and C is a flowchart of the SE attention module.
[0074] Figure 5 The examples show the iterative curves and scatter plots of the FocusNet model predicting the volatile basic nitrogen content during pork spoilage; where A is the XRD pattern of MOF and B is the scatter plot of the FocusNet model.
[0075] Reference numerals: In the figure, 1-grip, 1.1.1-connecting post one, 1.1.2-connecting post two, 1.2-handle, 2-cover base plate, 3-chassis shell, 3.1-outer wall of the shell, 3.2.1-heat dissipation hole one, 3.2.2-heat dissipation hole two, 3.3-edge computing node receiving slot, 3.4-data interface through hole, 4-temperature and humidity acquisition module, 5-main control unit, 6-edge computing node, 7-sensor reaction chamber, 7.1-triangular slide, 7.2-reaction chamber side wall, 7.3-sensor receiving slot, 7.4-partition, 8-image acquisition module, 9-slide rail, 9.1.1-slot hole one, 9.1.2-slot hole two, 9.1.3-slot hole three, 9.1.4-slot hole four, 9.1.5-slot hole five, 9.1.6-slot hole six, 9.2-slot body. Detailed Implementation
[0076] Various exemplary embodiments of the present invention will now be described in detail. This detailed description should not be considered as a limitation of the present invention, but rather as a more detailed description of certain aspects, features, and embodiments of the present invention.
[0077] It should be understood that the terminology used in this invention is merely for describing particular embodiments and is not intended to limit the invention. Unless otherwise stated, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art.
[0078] Various improvements and variations can be made to the specific embodiments described in this specification without departing from the scope or spirit of the invention, which will be obvious to those skilled in the art.
[0079] Other embodiments derived from this specification will be apparent to those skilled in the art. The specification and embodiments are merely exemplary.
[0080] The olfactory sensor mentioned in this embodiment is a highly sensitive and specific dye@MOF@MIPs olfactory sensor designed to target trimethylamine, the main characteristic component of TVB-N, a spoilage marker in pork. The sensor uses metal-organic frameworks (MOFs) as a carrier and is created by surface grafting of molecularly imprinted polymers (MIPs) with trimethylamine. The specific preparation method is as follows:
[0081] Synthesis of S1.1 MOF@MIPs Materials
[0082] 0.252 g of 2-amino-p-phenyl dimethyl and 0.374 g of FeCl3·6H2O were weighed and dissolved in 15 mL of DMF to obtain a mixed solution. Then, 200 μL of glacial acetic acid was mixed with the mixed solution in a certain proportion, stirred thoroughly, and placed in a reaction vessel. The reaction was carried out at 120 °C for 4 hours. After cooling to room temperature, the crystals were obtained by centrifugation at 10000 r / min for 10 minutes. The crystals were washed three times with anhydrous ethanol to remove excess reactants. Finally, the washed precipitate was dried at 70 °C for 8 hours to obtain the metal-organic framework material, denoted as Fe-MIL-88NH2.
[0083] 30 μL of a 30 wt.% TMA solution, 80 μL of MAA, 0.2 g of Fe-MIL-88NH2, and 20 mL of methanol were stirred at room temperature for 30 minutes. Then, 3 mL of EGDMA crosslinking agent and 200 mg of AIBN initiator were added, and stirring continued for 20 minutes until the mixture emulsified. The emulsion was then purged with nitrogen to remove oxygen for 15 minutes. The resulting mixture was placed in a 70°C water bath and stirred for 12 hours to obtain the polymer. Finally, Soxhlet extraction was performed using a 9:1 mixture of methanol and acetic acid to remove the template molecule TMA. The eluted solid was dried at 70°C for 24 hours to obtain the molecularly imprinted polymer, denoted as MOF@MIPs. The synthesis method of the imprint-free material MOF@NIPs is similar to that of MOF@MIPs, but the template molecule TMA is not added during the synthesis process.
[0084] Fabrication of S1.2 dye@MOF@MIPs nano-olfactory visualization sensor
[0085] pH indicators (including bromocresol green, bromophenol blue, and neutral red) were added to anhydrous ethanol to obtain a color-sensitive solution with a concentration of 2 mg / mL. MOF@MIPs were added to anhydrous ethanol to obtain a MOF@MIPs dispersion with a concentration of 2 mg / mL. Subsequently, the color-sensitive solution and the MOF@MIPs dispersion were mixed at a volume ratio of 2:1 to prepare a homogeneous mixed solution. Polyethylene glycol-300 was added to the mixed solution (the ratio of polyethylene glycol-300 to the color-sensitive material dispersion was 0.3 μL: 1 mL), and the mixture was continuously shaken in a shaker for 12 hours to finally obtain the dye@MOF@MIPs composite material. The above dye@MOF@MIPs composite material was centrifuged, the solid was collected, and then redispersed in anhydrous ethanol to obtain a dye@MOF@MIPs solution with a concentration of 2 mg / mL. A dye@MOF@MIPs solution was aspirated using a capillary column, uniformly coated onto the surface of a PVDF membrane, and stabilized to form a dye@MOF@MIPs olfactory visualization sensor.
[0086] Example 1:
[0087] like Figure 1 and 2 As shown, the monitoring device includes a handle 1, a cover base plate 2, a chassis shell 3, a temperature and humidity acquisition module 4, a main control unit 5, an edge computing node 6, a sensor reaction chamber 7, an image acquisition module 8, and a slide rail 9. An STM32 microcontroller, a Raspberry Pi 4B, a USB camera, and a DHT11 temperature and humidity sensor are selected as the main control unit 5, the edge computing node 6, the temperature and humidity acquisition module 4, and the image acquisition module 8, respectively. The handle 1 is fixed to the cover base plate 2; the cover base plate 2 is fixed to the top of the chassis shell 3; the chassis shell 3 is fixedly connected to the sensor reaction chamber 7 and the slide rail 9; the edge computing node 6 is placed in a dedicated slot on the chassis shell 3; the sensor reaction chamber 7 is mechanically mounted on the slide rail 9 and can slide freely on the slide rail 9; the main control unit 5 and the image acquisition module 8 are fixedly connected to the slide rail 9.
[0088] The temperature and humidity acquisition module 4 is installed on the main control unit 5; the image acquisition module 8 is connected to the edge computing node 6 via a USB data cable; the image acquisition module 8 has its own light source, and the sensor reaction chamber 7 is located below the image acquisition module 8; the sample and the olfactory sensor are placed in the sensor reaction chamber 7. During the olfactory sensor image acquisition process, the sensor reaction chamber 7 and the slide rail 9 are connected to form a light-proof environment to ensure the consistency of image acquisition conditions.
[0089] like Figure 3As shown, the grip 1 includes a connecting post and a handle 1.2. The connecting post includes connecting post one 1.1.1 and connecting post two 1.1.2. The chassis shell 3 includes an outer shell wall 3.1, heat dissipation holes, an edge computing node receiving slot 3.3, and a data interface through hole 3.4. The heat dissipation holes are designed on the left and right sides of the outer shell wall 3.1, namely heat dissipation hole one 3.2.1 and heat dissipation hole two 3.2.2, wherein heat dissipation hole one 3.2.1 is close to the edge computing node receiving slot 3.3. The data interface through hole 3.4 is on the same side as the edge computing node receiving slot 3.3 to avoid bending of the data cable.
[0090] The sensor reaction chamber 7 includes a triangular slide 7.1, a reaction chamber side wall 7.2, a sensor receiving slot 7.3, and a partition 7.4. The triangular slide 7.1 is located on both sides of the top of the outer wall 7.2 of the reaction chamber and is matched and connected to the slide rail 9. The sensor receiving slot 7.3 and the partition 7.4 are placed inside the sensor reaction chamber 7. During actual detection, the sample and the sensor are separated by the partition 7.4 to ensure that the sensor is not contaminated by the sample tissue fluid or other components.
[0091] The slide rail 9 consists of slots and a groove body 9.2. The slots are designed to fix the main control unit 5 and include slot 1 9.1.1, slot 2 9.1.2, slot 3 9.1.3, slot 4 9.1.4, slot 5 9.1.5 and slot 6 9.1.6. Among them, slot 1 9.1.1 and slot 6 9.1.6 are on the same side as the data interface through hole 3.4.
[0092] The method for monitoring changes in pork freshness using the aforementioned device mainly includes the following steps:
[0093] Step 1: Pork Samples. Two batches of freshly slaughtered lean pork were selected as the research subjects. To ensure the sterility and freshness of the samples, they were immediately placed in a 4℃ constant temperature incubator after being sealed in aseptic sampling bags. The experimental period was set at 13 days, with samples taken and tested daily starting 24 hours after slaughter to systematically track the quality changes of pork during storage. The volatile basic nitrogen content of the pork was used as the physicochemical indicator for assessing freshness.
[0094] Step two: First, the image acquisition module 8 acquires an image of the olfactory sensor before the reaction. Then, 10g of pork sample is weighed and placed together with the sensor in the sensor reaction chamber 7. The olfactory sensor is fixed in the sensor housing 7.3, and the volatile components of the sensor and pork are allowed to react fully for 15 minutes at room temperature. Finally, the image acquisition module 8 acquires an image of the sensor after the reaction, and the obtained image is saved in the edge computing node 6. The position of each color-sensitive unit of the nanosensor is located using a computer. The images of the nanosensor before and after the reaction are decomposed into R-channel, G-channel, and B-channel grayscale images. The difference between the mean grayscale values of each sensitive unit before and after the reaction is calculated as ΔR = R. a -R b △G=G a -G b △B=B a -B b Where subscript a represents the value after the reaction, and b represents the value before the reaction; and according to The Euclidean distance was calculated; ΔR, ΔG, ΔB, and ED are characteristic variables of a color-sensitive unit. The sensor contains 9 color-sensitive units, yielding 36 characteristic variables. After 13 days of continuous sampling, an experimental matrix S with a scale of 13 days × 20 samples = 260 effective samples was finally formed (the characteristic matrix obtained by combining the characteristic variables contained in all samples is the color feature dataset D of the food freshness olfactory sensor), providing rich and systematic data support for subsequent data analysis and model building. These samples will be used to comprehensively evaluate the quality change pattern of pork during storage and the detection performance of the prepared monitoring device on pork freshness.
[0095] Step 3: Train the convolutional neural network (FocusNet) model based on the squeeze-excitation attention mechanism:
[0096] like Figure 4 The diagram shows the structure of the FocusNet model for detecting the content of physicochemical indicators of food freshness; where A is the network diagram of the FocusNet model structure; B is a schematic diagram of the SE attention module; and C is a flowchart of the SE attention module.
[0097] The FocusNet model consists of an input layer, a convolutional layer, a squeeze-excitement attention module, a flattening layer, a fully connected layer, and an output layer. There are two convolutional layers, referred to as convolutional layer 1 and convolutional layer 2. The FocusNet model also includes two pooling layers, referred to as max pooling layer 1 and max pooling layer 2.
[0098] The input is the color feature dataset D of the pork freshness olfactory sensor, which was defined in step two (this dataset is determined by the feature matrix formed by the combination of feature variables of all samples in step one), and the output is the content of physicochemical indicators of food freshness.
[0099] The specific data processing flow of the FocusNet model is as follows:
[0100] The convolutional layer is configured with 32 output channels, using a 3×1 convolutional kernel, a stride of 1, and padding of 1. Local features are extracted using the ReLU activation function, followed by batch normalization to suppress internal covariate shift. A max pooling layer with a 2×1 kernel and a stride of 2 is introduced to compress the data dimension to half its original size while preserving features. The squeeze-encouragement attention mechanism module first "squeezes" the feature map through global average pooling to aggregate spatial information, and then "encourages" it through a fully connected layer and a sigmoid activation function to generate weight factors, thereby achieving dual information extraction of local details and global correlations, and assigning higher weights to important features. The flattening layer, after flattening the multidimensional features, is input into a fully connected layer containing 1024 input nodes and 256 output nodes for feature mapping. To prevent overfitting, a dropout layer with a dropout rate of 0.2 is introduced to randomly shield some neurons. Finally, a second fully connected layer (256 input nodes, 1 output node) generates regression prediction values for the physicochemical index content of food freshness.
[0101] The specific operations for "squeeze" and "excitement" are as follows:
[0102] (1) Compression operation: Through global average pooling, the spatial dimensional information of each channel is compressed into a scalar. This step aggregates the global information of each channel. Assuming the input feature map T has dimensions H×W×C, where H is the height, W is the width, and C is the number of channels, then after global average pooling, a 1×1×C dimension vector Z will be obtained, as shown in formula (I):
[0103]
[0104] In formula (I), Z c T is the c-th element of the compressed Z vector; c (i,j) represents the value of the c-th channel at position (i,j).
[0105] (2) Activation operation: The vector obtained above is nonlinearly transformed through a fully connected layer to generate the weights of each channel, as shown in Equation (II):
[0106] S=Sigmoid(fz,W))=Sigmoid(W2ReLu(W1z)) (Ⅱ)
[0107] In formula (II), z is the real number generated after compression, f represents the nonlinear function expressed by the attention module through the fully connected layer, and W1 and W2 are the weight parameters of the first and second layers in the fully connected layer, respectively. Where C is the number of channels, and r represents the hyperparameter of dimensionality reduction, used to appropriately hide the number of neurons, usually r = 16.
[0108] Model training parameters and strategies: The model training uses the Adam optimizer and MSE loss function, with an initial learning rate of 0.001 dynamically adjusted using a cosine annealing strategy, a batch size of 64, 280 training epochs, and an early stopping method (patience = 15) to prevent overfitting. Training is terminated when the validation set loss does not decrease for 15 consecutive epochs; finally, the initial FocusNet model is obtained after training.
[0109] Figure 5 (a) shows the iterative curve and prediction results of the FocusNet model for evaluating pork freshness, which is based on sample information collected by the intelligent monitoring device for pork freshness. The correlation coefficient of the model prediction set is 0.9367, indicating that the model has high accuracy in predicting the content of physicochemical indicators of food freshness.
[0110] Step four: Based on the initial FocusNet model trained in step three, further optimize the food freshness evaluation model. The specific process is as follows:
[0111] Based on step two, the feature matrix is obtained by combining the feature variables contained in all samples, which is the color feature dataset of the food freshness olfactory sensor. The feature dataset is input into the FocusNet model trained in step three. The food freshness evaluation model is constructed by using the feature matrix as input and the quality index of the detected samples as output.
[0112] Step 5: Take 10 pork samples of unknown freshness and conduct 3 parallel tests on the samples using a monitoring device. To measure the stability of the system, calculate the coefficient of variation of the 3 parallel tests, which is the ratio of the standard deviation of the original data to the mean of the original data. Following the method described in Step 2, obtain 36 characteristic variables for the 10 pork samples to be tested, forming a characteristic variable matrix R (R is a 10*36 matrix). Call the FocusNet evaluation model constructed in Step 3, using the characteristic matrix R as input, and output matrix Q, which is the volatile basic nitrogen content corresponding to the 10 pork samples to be tested. Compare the obtained test results with the detection values of the national standard testing method.
[0113] The coefficient of variation of the predicted TVB-N content data of the equipment for 10 pork samples was less than 2%, which proves that the monitoring device can provide stable performance during repeated measurements and can achieve rapid evaluation of pork freshness.
[0114] Table 1. Results of TVB-N content detected by intelligent pork freshness monitoring device.
[0115]
[0116] Furthermore, this embodiment provides a main control unit and a control program for an edge computing node, an intelligent food freshness monitoring program, and a computer data transmission protocol. These can realize the dynamic capture of sensor response images and environmental information, which can be input into a trained FocusNet model to output the physicochemical index content of the sample to be tested, thereby realizing the quality monitoring of the sample to be tested during the process of food freshness changes.
[0117] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. Meanwhile, the storage medium includes various media that can store program code, such as ROM, RAM, magnetic disk, or optical disk.
[0118] Note: The above embodiments are only used to illustrate the present invention and are not intended to limit the technical solutions described in the present invention. Therefore, although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the present invention. All technical solutions and improvements that do not depart from the spirit and scope of the present invention should be covered within the scope of the claims of the present invention.
Claims
1. An intelligent monitoring device for food freshness based on olfactory visualization, characterized in that, The monitoring device comprises a handle (1), a cover base plate (2), a cabinet shell (3), a temperature and humidity acquisition module (4), a master control unit (5), an edge computing node (6), a sensor reaction chamber (7), an image acquisition module (8) and a sliding rail (9); The handle (1) is fixed on the cover base plate (2); the cover base plate (2) is fixed on the top of the cabinet shell (3); the cabinet shell (3) is fixedly connected with the sensor reaction chamber (7) and the sliding rail (9); the edge computing node (6) is arranged on the clamping groove of the cabinet shell (3); the sensor reaction chamber (7) is installed on the sliding rail (9) and can freely slide on the track of the sliding rail (9); the master control unit (5) and the image acquisition module (8) are fixedly connected with the sliding rail (9); The temperature and humidity acquisition module (4) is installed on the master control unit (5); the image acquisition module (8) is electrically connected with the edge computing node (6); The image acquisition module (8) is provided with a light source, and the sensor reaction chamber (7) is below the image acquisition module (8); the sensor reaction chamber (7) is used for storing an olfactory sensor and a sample; images of the olfactory sensor and the sample before and after reaction are acquired by the image acquisition module (8); during the image acquisition process, a light-proof environment is formed by the sensor reaction chamber (7) and the sliding rail (9) to ensure the consistency of image acquisition conditions.
2. The food freshness intelligent monitoring device based on olfactory visualization according to claim 1, characterized in that, The handle (1) comprises a connecting column and a handle (1.2), and the handle (1.2) is connected with the cover base plate (2) through the connecting column; the connecting column comprises a connecting column one (1.1.1) and a connecting column two (1.1.2); The cabinet shell (3) comprises an outer shell wall (3.1), heat dissipation holes, an edge computing node accommodating groove (3.3) and a data interface through hole (3.4); the heat dissipation holes are arranged on both sides of the outer shell wall (3.1) and are heat dissipation hole one (3.2.1) and heat dissipation hole two (3.2.2), wherein the heat dissipation hole one (3.2.1) is close to the edge computing node accommodating groove (3.3); the data interface through hole (3.4) is on the same side of the edge computing node accommodating groove (3.3) to avoid data line bending; The sensor reaction chamber (7) comprises a triangular sliding groove (7.1), a reaction chamber side wall (7.2), a sensor accommodating groove (7.3) and a partition plate (7.4); the triangular sliding groove (7.1) is located on both sides of the top end of the reaction chamber side wall (7.2) and is matched with the sliding rail (9); the sensor accommodating groove (7.3) and the partition plate (7.4) are arranged inside the sensor reaction chamber (7); during actual detection, the sample and the sensor are separated by the partition plate (7.4) to ensure that the sensor is not polluted by sample tissue fluid or other components; The slide rail (9) consists of slots and a groove body (9.2). The slots are designed to fix the main control unit (5) and include slot one (9.1.1), slot two (9.1.2), slot three (9.1.3), slot four (9.1.4), slot five (9.1.5) and slot six (9.1.6); among them, slot one (9.1.1) and slot six (9.1.6) are on the same side as the data interface through hole (3.4).
3. A method for monitoring the freshness change of food based on the food freshness intelligent monitoring device based on olfactory visualization according to claim 1 or 2, characterized in that, The steps are as follows: Step 1: Use a smart food freshness monitoring device to collect raw images from olfactory sensors that react with foods of different freshness levels. First, samples are selected. Different quality grades of samples correspond to different volatile odor substances, and different volatile odor substances will cause different color changes in the olfactory sensor. The samples include agricultural products and aquatic products. The different quality grades include the freshness grade of the sample or different sensory quality grades. Then, the extraction steps for the feature variables in step 1 are as follows: After the sample is placed into the sensor receiving slot (7.3), the image acquisition module (8) is used to acquire the image of the olfactory sensor before the reaction; the olfactory sensor and the volatile organic compounds of the sample are allowed to react fully for a period of time; after the reaction, the edge computing node (6) is used to control the image acquisition module (8) to acquire the image of the olfactory sensor after the reaction, and the acquired image is saved in the computer; at the same time, the temperature and humidity acquisition module (4) is controlled by the main control unit (5) to acquire temperature and humidity data; the position of each color-sensitive unit in the image before and after the reaction is located using the computer; the image acquisition module (8) is used to acquire the image of the olfactory sensor after the reaction. The camera captures images from the olfactory sensor before and after the reaction, which are then decomposed into grayscale images of the R, G, and B channels. The difference between the mean grayscale values of the images before and after the reaction is taken as the feature variable of the color-sensitive unit; that is, ΔR = Ra - Rb, ΔG = Ga - Gb, ΔB = Ba - Bb, where the subscript a represents the value after the reaction and b represents the value before the reaction. The Euclidean distance is calculated according to ED = . ΔR, ΔG, ΔB, and ED are the feature variables of one color-sensitive unit. X color-sensitive units yield Y feature variables, where Y = 4X. The feature matrix is obtained by combining the feature variables contained in all samples, which is the color feature dataset D of the food freshness olfactory sensor. Step 2, train the convolutional neural network (FocusNet) model based on the squeeze-excitation attention mechanism: The FocusNet model consists of an input layer, a convolutional layer, a squeeze-excited attention module, a flattening layer, a fully connected layer, and an output layer. There are two convolutional layers, designated as Convolutional Layer 1 and Convolutional Layer 2. The FocusNet model also includes two pooling layers, designated as Max Pooling Layer 1 and Max Pooling Layer 2. The model takes the food freshness olfactory sensor color feature dataset D obtained in step 1 as input and the physicochemical index content of food freshness as output. The optimization training steps for the FocusNet model are as follows: The local features of the food freshness olfactory sensor color feature dataset D are extracted by performing row convolution operation on the convolutional layer 1. Then, the normalization layer is used for standardization, and then the max pooling layer 1 is introduced to process the pooled local features. Convolutional layer 2 combined with ReLU activation function is used to perform secondary convolution on the pooled local features to mine the high-order features contained therein. After batch normalization layer processing, max pooling layer 2 is used to further reduce the data dimensionality and retain key high-order features. A squeeze-excitation attention mechanism module is introduced to process the high-order features to obtain a weighted feature matrix. After the weighted feature matrix is flattened into a one-dimensional vector, it is input into a fully connected layer for feature mapping, and then the regression prediction value of the physicochemical index content of food freshness is directly output through a second fully connected layer. Finally, the Adam optimizer and mean squared error loss function are used for optimization training. Training is terminated when the validation set loss does not decrease for 15 consecutive rounds, and the initial FocusNet model is finally obtained after training. The model training is complete. Step 3: Based on the initial FocusNet model trained in Step 2, further optimize the food freshness evaluation model. The specific process is as follows: Based on the color feature dataset of the food freshness olfactory sensor obtained in step 1, the feature dataset is input into the FocusNet model trained in step 2; the food freshness evaluation model is constructed by using the feature matrix as input and the quality index of the detected sample as output. Step 4: Quality monitoring of food freshness samples to be tested Take the sample to be tested, and obtain the characteristic variables of the sample according to the operation in step 1. Input the extracted characteristic variables into the food freshness evaluation model in step 3, and the freshness physicochemical index content of the sample to be tested can be output, so as to realize the monitoring of the freshness of the sample to be tested during the food spoilage process.
4. The method of claim 3, wherein the food freshness change is monitored by measuring the change in the color of the food. The steps are as follows: when the sample in step 1 is an agricultural product, the dosage is 2-5g; when the sample is an aquatic product, the dosage is 10-15g; the olfactory sensor is fixed in the sensor receiving slot (7.3) and reacts for a period of 10-20 minutes. In step 1, the number of samples used to construct the food freshness evaluation model is selected as N, which includes n quality grades, each grade has m samples, i.e., N = n * m; where n is a positive integer not less than 2, and m and N are both positive integers. The specific fabrication method of the olfactory sensor is as follows: Synthesis of S1, MOF@MIPs materials S1.1 Weigh 2-amino-p-phenyl dimethyl and FeCl3·6H2O and dissolve them in DMF to obtain a mixed solution; then add glacial acetic acid to the mixed solution and mix. After stirring evenly, place the mixture in a reaction vessel to carry out the reaction. Cool the reaction to room temperature and centrifuge to obtain a crystalline precipitate. The crystal precipitate was washed with anhydrous ethanol, and then the washed precipitate was dried to obtain a metal-organic framework material, denoted as Fe-MIL-88NH2. S1.
2. TMA solution, MAA, Fe-MIL-88NH2 and methanol were stirred at room temperature, and then crosslinking agent EGDMA and initiator AIBN were added. Stirring was continued until the mixed solution emulsified to obtain an emulsion. The emulsion was then purged with nitrogen to remove oxygen. After nitrogen purging, the resulting mixed solution was placed in a constant temperature water bath and stirred to react to obtain a polymer. Finally, Soxhlet extraction was performed with a mixture of methanol and acetic acid to remove the template molecule TMA. The eluted solid was dried to obtain the molecularly imprinted polymer, denoted as MOF@MIPs. S2. Add the pH indicator and the MOF@MIPs obtained in step S1 to anhydrous ethanol to obtain a color-sensitive solution and a MOF@MIPs dispersion. Then, mix the color-sensitive solution and the MOF@MIPs dispersion evenly to obtain a mixed solution. Add polyethylene glycol-300 to the mixed solution and then place it in a shaker for continuous shaking to finally obtain the dye@MOF@MIPs composite material. Centrifuge the obtained dye@MOF@MIPs composite material to collect the solid precipitate, and then redisperse it in anhydrous ethanol to obtain a dye@MOF@MIPs solution. Then, take the dye@MOF@MIPs solution and drop it onto the surface of a PVDF membrane. After stabilization, an olfactory sensor is formed, which is denoted as the dye@MOF@MIPs olfactory sensor.
5. The method of claim 4, wherein the food freshness change is monitored by measuring the change in the color of the food. In step S1.1, the ratio of 2-amino-p-phenyl dimethyl, FeCl3·6H2O, DMF, and glacial acetic acid is 0.252 g : 0.374 g FeCl3·6H2O : 15 mL : 200 μL. The reaction is carried out in a reactor at 120 °C for 4 hours. The centrifugation conditions are 10000 r / min for 10 minutes. The drying conditions are 70 °C for 8 hours. In step S1.2, the ratio of TMA solution, MAA, Fe-MIL-88NH2, methanol, EGDMA, and AIBN is 30 μL: 80: 0.2 g: 20 mL: 3 mL EGDMA: 200 mg, with the TMA solution concentration being 30 wt.%. Stirring at room temperature and continued stirring for 20-30 minutes, followed by nitrogen purging for 15-20 minutes, is carried out in a constant temperature water bath for 12 hours at 70°C. The volume ratio of methanol to acetic acid is 9:
1. Drying is performed at 70°C for 24 hours. Step S2 involves preparing a dispersion in which both the color-sensitive solution and the MOF@MIPs dispersion have a concentration of 2 mg / mL; the volume ratio of the color-sensitive solution to the MOF@MIPs dispersion is 2:1; the volume ratio of polyethylene glycol-300 to the color-sensitive material dispersion is 0.3 μL: 1 mL; the shaking treatment time is 12 hours; the pH indicator includes bromocresol green, bromophenol blue, and neutral red; and the concentration of the dye@MOF@MIPs solution is 2 mg / mL.
6. The method of claim 3, wherein the food freshness change is monitored by measuring the change in the color of the food. The specific steps for optimizing and training the FocusNet model in step 2 are as follows: S2.1 Feature extraction of convolutional layer 1: Convolutional layer 1 is configured with 32 output channels, using a 3×1 convolutional kernel, stride 1 and padding 1. It performs convolution operation on the input color feature dataset D through the ReLU activation function to extract local features from the dataset. S2.2 Batch Normalization and Pooling: The local features extracted in S2.1 are input into the batch normalization layer for standardization. The internal covariate shift is suppressed by adjusting the feature distribution. Then, max pooling layer 1 is introduced with a 2×1 pooling kernel and a stride of 2. While retaining the core information of the local features, the data dimension is compressed to 1 / 2 of the original size to obtain the pooled local features. S2.3 High-order feature mining of convolutional layer 2: Convolutional layer 2 expands the output channels to 256, and adopts the same 3×1 convolutional kernel, stride 1 and padding 1 as convolutional layer 1. It combines the ReLU activation function to perform secondary convolution on the local features after pooling to mine the high-order features contained therein. S2.4 Secondary normalization and pooling: After the high-order features output from S2.3 are processed by the batch normalization layer, the data dimensionality is further reduced by the max pooling layer 2 to retain key high-order features; S2.5 Attention Mechanism Weighting: A squeeze-excitation attention mechanism module is introduced to process the higher-order features after S2.4 pooling. S2.5.1 Compression operation: The spatial dimension information of each channel is aggregated into a 1×1×C scalar vector Z by global average pooling, thereby integrating the global information of each channel; S2.5.2 Activation Operation: The vector Z is transformed nonlinearly through a fully connected layer to generate the weight coefficient S of each channel, which strengthens the feature channels that are highly correlated with freshness and weakens redundant information. S2.5.3 Weighted Fusion: Multiply the weight coefficients S with the input high-order features channel by channel to obtain the weighted feature matrix; S2.6 Fully Connected Layer Feature Mapping: The weighted feature matrix output from S2.5 is flattened into a one-dimensional vector and then input into the fully connected layer for feature mapping; to prevent overfitting, a Dropout layer with a dropout rate of 0.2 is introduced to randomly mask some neurons; S2.7 Output Prediction Results: The regression prediction values of the physicochemical index content of food freshness are directly output through the second fully connected layer; except for the output layer, each layer uses the ReLU activation function to ensure nonlinear modeling capability; S2.8 Model Training Optimization: The Adam optimizer and mean squared error loss function are used, with the initial learning rate set to 0.
001. The learning rate is dynamically adjusted using a cosine annealing strategy. The batch size is set to 64, the maximum number of training epochs is 280, and an early stopping method is used. Training is terminated when the validation set loss does not decrease for 15 consecutive epochs. Finally, the initial FocusNet model is obtained after training, and the model training is completed.
7. The method of monitoring freshness changes in food according to claim 6, wherein, The specific procedures for the compression and excitation operations described in steps S2.5.1 and S2.5.2 are as follows: (1) Compression operation: Through global average pooling, the spatial dimension information of each channel is compressed into a scalar, and the global information of each channel is aggregated; assuming that the dimension of the input feature map T is H×W×C, where H is the height, W is the width, and C is the number of channels, then after global average pooling, a vector Z with a dimension of 1×1×C will be obtained, as shown in formula (I): In formula (I), Z c is the cth element of the compressed Z vector; T c (i,j) denotes the value of the c-th channel at position (i,j); (2) Activation operation: The vector obtained above is nonlinearly transformed through a fully connected layer to generate the weights of each channel, as shown in Equation (II): S=Sigmoid(fz,W))=Sigmoid(W2ReLu(W1z)) (Ⅱ) In formula (II), z is a real number generated after compression, f represents a nonlinear function expressed by a full connection layer of the attention module, W1 and W2 are weight parameters of the first layer and the second layer in the full connection layer respectively, where C is the number of channels, r represents a hyperparameter of dimension reduction, and is used to appropriately hide the number of neurons, and usually r = 16.
8. A control program of a master unit or an edge computing node, characterized in that, The system includes a memory and a processor, the processor and the memory being electrically connected to enable communication between them; the memory is used to store a program that supports the processor in executing any of the methods of claims 3-7, and the processor is configured to execute the program stored in the memory.
9. A food freshness intelligent monitoring program, characterized by, The program front-end is developed based on the Vue.js framework, which integrates real-time dynamic monitoring and historical data query functions; the back-end service layer is based on the Spring Boot microservice framework, and executes the method described in any one of claims 3-7 through an asynchronous non-blocking RESTful interface design.
10. A computer data transfer protocol, characterized by, The transmission protocol is used to encrypt data transmission between the edge settlement node and the intelligent monitoring platform, prevent data from being tampered with, ensure the transparency of the monitoring system, and perform the method described in any one of claims 3-7.
