A method and system for determining and warning mercury content in food raw materials, and a storage medium

By combining surface-enhanced Raman spectroscopy and a deep learning framework, the complexity and inefficiency of mercury content detection in food have been solved, enabling rapid and accurate mercury content detection and early warning, which is suitable for the safety testing of food raw materials.

CN119880872BActive Publication Date: 2026-05-29HUNAN RICE RES INST

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUNAN RICE RES INST
Filing Date
2024-12-27
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing methods for detecting mercury content in food are complex, time-consuming, and have poor sensitivity and accuracy. They are also unsuitable for rapid and on-site testing, resulting in low efficiency and high cost, which makes it difficult to meet food safety requirements.

Method used

By employing surface-enhanced Raman spectroscopy combined with a deep learning framework, and through preprocessing, data augmentation, spectral feature extraction, and feature parameter combination, an identification and measurement model is constructed to achieve rapid qualitative and quantitative analysis of mercury content in food raw materials and generate abnormal early warning information.

Benefits of technology

It improves the accuracy and efficiency of mercury content determination, reduces testing costs, and provides food safety data for food raw material production and distribution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119880872B_ABST
    Figure CN119880872B_ABST
Patent Text Reader

Abstract

The application discloses a kind of determination early warning method, system and storage medium of mercury content in food raw materials, it is related to food safety detection technical field, comprising: obtaining the surface enhanced Raman spectrum of food raw material sample, and pretreatment and data enhancement, extract the spectral feature of enhanced Raman spectrum data, optimally generate spectrum feature with the best spectral feature combination, extract feature parameter combination based on spectrum feature, the data set is constructed with different concentration mercury content sample synthesis;Establish identification determination model, train using data set, collect the surface enhanced Raman spectrum of food raw material to be detected, extract spectrum feature as model input and carry out qualitative, quantitative analysis of mercury content;When quantitative analysis result in mercury content concentration is greater than preset mercury content threshold value, then generate abnormal early warning information.The application utilizes surface enhanced Raman spectrum to construct the rapid detection method of mercury content in food raw materials, improves the accuracy of mercury content determination.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of food safety testing technology, and more specifically, to a method, system, and storage medium for determining and warning of mercury content in food raw materials. Background Technology

[0002] Mercury and its compounds are highly toxic substances, trace metallic elements harmful to the human body. They can accumulate in the body, are difficult to excrete, and can be distributed to various tissues and organs through the bloodstream, gradually accumulating (mainly brain tissue and liver), causing enormous and irreparable damage to human organs. Simultaneously, they can reduce the body's overall immunity, decrease male and female fertility, and cause birth defects in offspring. Therefore, strictly controlling the mercury content in food is particularly important for human health. Currently, there are many methods for analyzing mercury in food. National standards specify three methods: atomic fluorescence spectrometry, cold atomic absorption spectrometry, and dithizone colorimetric method for mercury determination. However, these methods are complex to operate, time-consuming, have poor reproducibility, and relatively low sensitivity and accuracy.

[0003] Traditional methods for detecting mercury ions typically require expensive equipment and specialized skills, making them unsuitable for rapid and on-site testing. Furthermore, these methods involve lengthy sample preparation and analysis, which is not only time-consuming but also leads to sample instability. They impose strict requirements on sample quantity and quality, potentially introducing errors during sample processing. For example, interfering substances may be introduced during sample preparation, affecting the accuracy of the analytical results. Due to these limitations, traditional mercury ion detection methods are increasingly failing to meet the demands for food safety. Therefore, finding a rapid method for detecting mercury ions in food raw materials, shortening detection time, improving efficiency and accuracy, while simultaneously reducing costs and facilitating large-scale rapid detection, is a pressing issue that needs to be addressed. Summary of the Invention

[0004] To address the aforementioned technical problems, this invention proposes a method, system, and storage medium for determining and warning of mercury content in food ingredients. It utilizes surface-enhanced Raman spectroscopy to select optimal spectral features and combines them with a deep learning framework to construct a rapid detection method for mercury content in food ingredients, thereby improving the accuracy of mercury content determination.

[0005] The first aspect of this invention provides a method for determining and providing early warning of mercury content in food raw materials, comprising the following steps:

[0006] Surface-enhanced Raman spectra of food raw material samples are obtained, the collected Raman spectral data are preprocessed, and the preprocessed Raman spectral data is enhanced to generate high-quality Raman spectral data.

[0007] The spectral curve features and spectral image features of the enhanced Raman spectral data are extracted, and the optimal combination of spectral features is selected to generate the spectral features of the Raman spectral data. Based on the spectral features, feature parameter combinations are extracted, and the feature parameter combinations are synthesized with samples of different mercury concentrations to construct a dataset.

[0008] A recognition and measurement model is established based on a deep learning architecture. The model is trained by dividing the dataset into training and testing sets. Surface-enhanced Raman spectra of the food raw materials to be tested are collected, and the spectral features are extracted as input to the model for qualitative and quantitative analysis of mercury content.

[0009] The mercury content threshold is determined based on the category information of the food raw material sample to be tested. When the mercury concentration in the quantitative analysis result is greater than the mercury content threshold, an abnormal warning message is generated.

[0010] In this approach, the surface-enhanced Raman spectra of food raw material samples are obtained, the acquired Raman spectral data are preprocessed, and generative adversarial networks are used for data enhancement. Specifically:

[0011] SERS detection of food raw material samples was performed using a Raman spectrometer to obtain surface-enhanced Raman spectra. Center-aligned decision windows and baseline windows were constructed based on median filtering and mean filtering. The size information of decision windows and baseline windows was determined based on historical SERS detections.

[0012] The surface-enhanced Raman spectrum is processed by sliding window using the decision window and baseline window. The mean and standard deviation of the baseline outside the decision window and inside the baseline window are calculated. The decision threshold is set based on the multiple of the standard deviation. When the intensity of the center point of the decision window exceeds the decision threshold, the point is identified as a noise point. The value of the noise point is replaced with the mean. Cosmic ray noise is subtracted after traversing all surface-enhanced Raman spectra.

[0013] After removing cosmic ray noise, the SNIP algorithm is used to perform baseline correction on the surface-enhanced Raman spectrum, and SG convolution smoothing is used to suppress random noise, thus realizing the preprocessing of Raman spectral data.

[0014] The preprocessed Raman spectral data is encoded using a stacked autoencoder network to obtain the latent features of the characteristic peaks, and conditional information is generated based on the latent features and feature distribution of the original Raman spectral data.

[0015] Feature enhancement is achieved using generative adversarial networks (GANs). The conditional information is used as prior information for both the generator network and the discriminator network. The generator network learns latent features from the original Raman spectral data based on the prior information and generates new data. The discriminator network evaluates the generator's output based on the prior information, and new Raman spectral data is generated through an adversarial mechanism.

[0016] In this scheme, the spectral curve features and spectral image features of the enhanced Raman spectral data are extracted. Specifically, the spectral curve features are:

[0017] Spectral curve samples are obtained based on the enhanced Raman spectral data. The derivative spectral curve samples are obtained by taking the first derivative of the spectral curve samples. The spectral curve features used for target classification and recognition are retrieved and integrated using big data methods to generate a set of spectral curve feature indicators.

[0018] The spectral curve features of the derivative spectral curve samples are obtained based on the spectral curve feature index set. The ROC curve area for mercury ion recognition of each spectral curve feature is obtained, and the spectral curve features are sorted according to the ROC curve area.

[0019] Based on the sorting results, the spectral curve feature corresponding to the area of ​​the largest ROC curve is selected and stored in the spectral feature set. From the remaining spectral curve features, the spectral curve feature corresponding to the area of ​​the largest ROC curve is selected again and stored in the spectral feature set.

[0020] By iteratively comparing the filled spectral feature sets, it is determined in each iteration whether the area of ​​the ROC curve corresponding to the spectral feature set increases. When the area of ​​the ROC curve no longer increases, the corresponding spectral feature set is output.

[0021] In this scheme, the spectral curve features and spectral image features of the enhanced Raman spectral data are extracted. Specifically, the spectral image features are:

[0022] Spectral image samples are obtained based on the enhanced Raman spectral data. These spectral image samples are then preprocessed, and features are extracted from the preprocessed spectral image samples using an improved U-Net network.

[0023] The original encoder network is replaced with ResNet50 using dilated convolution to obtain multi-level feature maps in the spectral image samples. The multi-level feature maps obtained by encoding are downsampled and propagated. The decoder network is used to restore the multi-level feature maps through upsampling operations. Each restored feature map is used as local information.

[0024] The CBMA attention mechanism is introduced, and the local information is processed by parallel channel attention module and spatial attention module. The corresponding channel description is obtained by using channel attention weight and spatial attention weight. A fused feature map is generated based on the two channel descriptions. The fused feature map is imported into the fully connected layer to output the image feature vector as the spectral image feature.

[0025] In this scheme, the optimal combination of spectral features is selected to generate the spectral features of Raman spectral data. Based on the spectral features, a combination of feature parameters is extracted. The combination of feature parameters is then combined with samples of different mercury concentrations to construct a dataset. Specifically:

[0026] An initial feature set is generated by combining the spectral curve features in the spectral feature set with the spectral image features. An optimized genetic algorithm is used to select features from the initial feature set. The ratio of spectral curve features to spectral image features is preset. Spectral feature combinations are randomly selected according to the preset ratio. A chaotic population is generated by performing chaotic processing on the initial feature set.

[0027] The fitness of individuals in the population is calculated, elite individuals are selected based on the fitness, and replication and crossover operations are performed on the elite individuals to optimize the search direction and selection process of spectral feature combinations. When the preset termination criterion is reached, the optimal spectral feature combination is output to generate spectral features. Feature parameters are extracted from the enhanced Raman spectral data based on the spectral features to generate feature parameter combinations.

[0028] Raman spectral data of food raw materials with different mercury concentrations are obtained. Based on the optimal combination of spectral features, corresponding features are extracted to construct samples with different mercury concentrations. The samples with different mercury concentrations are superimposed with the combination of feature parameters to synthesize and construct a dataset.

[0029] In this scheme, an identification and measurement model is established to perform qualitative and quantitative analysis of mercury content in the food raw materials to be tested, and anomaly warning information is generated based on the analysis results, specifically:

[0030] A recognition and measurement model is constructed based on the CNN-GRU network structure. The dataset is divided into a training set and a test set according to a preset ratio. The recognition and measurement model is trained and tested. When the test results meet the preset performance standards, the trained recognition and measurement model is output.

[0031] Surface-enhanced Raman spectra of the food raw materials to be tested are collected, spectral feature sequences are extracted and input into the identification and measurement model, spatial correlation and sequence correlation between spectral features are extracted respectively, and the obtained spectral features are mapped and imported into the parallel output layer.

[0032] The parallel output layers are qualitative and quantitative tasks, respectively. The Softmax function is used to obtain the category probability distribution, complete the qualitative and quantitative analysis of mercury content in the food raw materials to be tested, obtain the mercury content threshold, and generate mercury content abnormality warning information when the mercury content in the food raw materials to be tested is greater than the mercury content threshold.

[0033] The second aspect of the present invention provides a system for determining and warning of mercury content in food raw materials. The system includes a Raman spectroscopy acquisition unit, a spectral feature extraction unit, a mercury content identification and determination unit, and an anomaly warning unit.

[0034] The Raman spectroscopy acquisition unit is responsible for acquiring the surface-enhanced Raman spectra of the food raw materials to be tested, and for preprocessing and enhancing the Raman spectral data.

[0035] The spectral feature extraction unit is responsible for selecting the optimal combination of spectral features based on the spectral curve features and spectral image features of the food raw materials, and generating the spectral features of the Raman spectral data based on the optimal combination of spectral features.

[0036] The mercury content identification and measurement unit is responsible for establishing an identification and measurement model based on a deep learning architecture. It constructs a dataset by combining the characteristic parameters corresponding to the surface-enhanced Raman spectra of food raw material samples with samples of different mercury concentrations. The dataset is used to train the model. The spectral features of the food raw material to be tested are input into the trained identification and measurement model for qualitative and quantitative analysis of mercury content.

[0037] The anomaly warning unit is responsible for determining the mercury content threshold based on the category information of the food raw material sample to be tested. When the mercury content concentration in the quantitative analysis result is greater than the mercury content threshold, an anomaly warning message is generated.

[0038] A second aspect of the present invention provides a computer-readable storage medium including a method program for determining and warning of mercury content in food ingredients. When the method program is executed by a processor, it implements the steps of a method for determining and warning of mercury content in food ingredients.

[0039] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0040] This invention selects a suitable preprocessing method to blur unnecessary data in the spectrum, extract important data to generate high-quality Raman spectra, meet the needs of subsequent deep learning for training samples, and overcome the one-sidedness of traditional spectral preprocessing.

[0041] Surface-enhanced Raman spectroscopy is used to extract spectral curve and image features, and a genetic algorithm is employed to select the optimal spectral features, providing an effective method for efficient feature combination selection and laying an important foundation for rapid mercury content detection. A rapid detection method for mercury content in food raw materials is constructed using a deep learning framework, improving the accuracy of mercury content determination and providing food safety data for food production and distribution. Attached Figure Description

[0042] To more clearly illustrate the technical solutions in the embodiments or examples of the present invention, the drawings used in the embodiments or examples will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained according to these drawings without creative effort.

[0043] Figure 1 A flowchart of a method for early warning of mercury content in food ingredients is shown;

[0044] Figure 2 This diagram illustrates a flowchart for determining the dataset by screening spectral features from Raman spectral data.

[0045] Figure 3 A flowchart illustrating the qualitative and quantitative analysis and early warning of mercury content in food raw materials to be tested is shown.

[0046] Figure 4 A block diagram of an early warning system for determining mercury content in food ingredients is shown. Detailed Implementation

[0047] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.

[0048] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and therefore the scope of protection of the invention is not limited to the specific embodiments disclosed below.

[0049] like Figure 1 As shown, this embodiment of the invention provides a method for early warning of mercury content in food raw materials, including:

[0050] S102: Obtain the surface-enhanced Raman spectrum of the food raw material sample, preprocess the acquired Raman spectral data, and perform data enhancement on the preprocessed Raman spectral data to generate high-quality Raman spectral data.

[0051] S104, extract the spectral curve features and spectral image features of the enhanced Raman spectral data, select the best combination of spectral features to generate the spectral features of the Raman spectral data, extract the feature parameter combination based on the spectral features, and synthesize the feature parameter combination with samples of different mercury concentrations to construct a dataset;

[0052] S106. A recognition and measurement model is established based on a deep learning architecture. The recognition and measurement model is trained by dividing the dataset into training and testing sets. Surface-enhanced Raman spectra of the food raw materials to be tested are collected, and spectral features are extracted as input to the model for qualitative and quantitative analysis of mercury content.

[0053] S108, determine the mercury content threshold based on the category information of the food raw material sample to be tested, and generate an abnormal warning message when the mercury content concentration in the quantitative analysis result is greater than the mercury content threshold.

[0054] It should be noted that when using a Raman spectrometer to perform SERS detection on food raw material samples to obtain surface-enhanced Raman spectra, the raw Raman spectral data acquired are often affected by various interference factors, such as instrument noise, sample surface morphology, environmental conditions, and cosmic ray interference. These interference factors reduce the quality and reliability of the spectra, thus affecting subsequent data analysis and interpretation. A center-aligned decision window and baseline window are constructed based on median filtering and mean filtering. The size information of the decision window and baseline window is determined based on historical SERS detections. The surface-enhanced Raman spectra are then processed using the decision window and baseline window to perform sliding window processing. The mean and standard deviation of the baseline outside the decision window and inside the baseline window are calculated. A decision threshold is set based on a multiple of the standard deviation. When the intensity of the center point of the decision window exceeds the decision threshold, the point is identified as a noise point, and the value of the noise point is replaced with the mean. Cosmic ray noise is subtracted after traversing all surface-enhanced Raman spectra.

[0055] The main causes of Raman spectrum baseline drift include fluorescence background, changes in the scattering source, instrument drift, changes in environmental conditions, and sample inhomogeneity. Baseline correction methods include: least squares method, polynomial method, and SNIP method. Preferably, the SNIP algorithm is used for baseline correction of surface-enhanced Raman spectra. The SNIP algorithm is a baseline subtraction method widely used in gamma-ray spectroscopy analysis, capable of effectively estimating the full-spectrum baseline while correctly distinguishing between gamma-ray peak and non-peak regions. SG convolution smoothing is used to suppress random noise. SG smoothing performs least-squares fitting of the spectral data by increasing convolution calculations, eliminating the need to calculate data averages and highlighting the role of the window center point, thus significantly reducing noise.

[0056] The preprocessed Raman spectral data is encoded using a stacked autoencoder network to obtain latent features of characteristic peaks. Conditional information is generated based on the latent features and feature distribution of the original Raman spectral data. A generative adversarial network (GAN) is then used for feature enhancement, with the conditional information serving as prior information for both the generator and discriminator networks. The generator network learns latent features from the original Raman spectral data based on the prior information and generates new data. The discriminator network evaluates the generator's output based on the prior information, generating new Raman spectral data through an adversarial mechanism. The GAN learns feature information from the Raman spectral data to create new data while retaining the feature information from the original Raman spectral data, resulting in more realistic data that conforms to real-world scenarios. The attributes of the generated Raman spectral data, such as peak position and peak intensity, are controlled by setting the values ​​of the conditional information. Noise is introduced into the conditional variables to introduce randomness during the generation process, resulting in diverse Raman spectral data.

[0057] It should be noted that the spectral curve features and spectral image features of the enhanced Raman spectral data are extracted. Spectral curve samples are obtained based on the enhanced Raman spectral data. The first derivative of these spectral curve samples is then obtained to improve recognition efficiency. Big data methods are used to retrieve and integrate spectral curve features for target classification and recognition, generating a set of spectral curve feature indicators. Preferably, the set of spectral curve feature indicators includes: peak wavelength, peak value, peak width, peak slope, total number of peaks, band depth, and peak symmetry. The spectral curve features of the derivative spectral curve samples are obtained based on the spectral curve feature index set. The ROC curve area for mercury ion recognition of each spectral curve feature is obtained, and the spectral curve features are sorted according to the ROC curve area. Based on the sorting result, the spectral curve feature corresponding to the largest ROC curve area is selected and stored in the spectral feature set. In the remaining spectral curve features, the spectral curve feature corresponding to the largest ROC curve area is selected again and stored in the spectral feature set. The spectral feature set is filled by iterative comparison. In each iteration, it is determined whether the ROC curve area corresponding to the spectral feature set increases. When the ROC curve area no longer increases, the corresponding spectral feature set is output.

[0058] Spectral image samples are obtained based on enhanced Raman spectral data. These samples are preprocessed, and features are extracted using an improved U-Net network. The original encoder network is replaced with a ResNet50 network employing dilated convolutions. The receptive field is enhanced by introducing dilated convolutions, and the ResNet50's layered residual connections and multi-scale feature acquisition capabilities comprehensively improve the extraction efficiency and accuracy of the spectral image feature maps. Multi-level feature maps are obtained from the spectral image samples. These encoded multi-level feature maps are downsampled and propagated. The decoder network then uses upsampling to reconstruct the multi-level feature maps, using each reconstructed feature map as local information. A CBMA attention mechanism is introduced, processing this local information through parallel channel attention and spatial attention modules. Channel attention weights and spatial attention weights are used to obtain corresponding channel descriptions, exploring the dependencies between image feature maps. A fused feature map is generated based on the two channel descriptions and assigned weights. The fused feature map conforming to the weight criteria is then extracted and imported into the fully connected layer to output the image feature vector as the spectral image feature.

[0059] Figure 2 A flowchart is shown to determine the dataset by screening spectral features of Raman spectral data.

[0060] According to an embodiment of the present invention, the optimal combination of spectral features is preferred to generate the spectral features of Raman spectral data. Based on the spectral features, a combination of feature parameters is extracted, and the combination of feature parameters is synthesized with samples of different mercury concentrations to construct a dataset. Specifically:

[0061] S202, an initial feature set is generated based on the spectral curve features in the spectral feature set and the spectral image features. An optimized genetic algorithm is used to select features in the initial feature set. The ratio of spectral curve features to spectral image features is preset. Spectral feature combinations are randomly selected according to the preset ratio. A chaotic population is generated by performing chaotic processing on the initial feature set.

[0062] S204, calculate the fitness of individuals in the population, select elite individuals based on the fitness, perform replication and crossover operations on the elite individuals, optimize the search direction and selection process of spectral feature combinations, and when the preset termination criterion is reached, output the optimal spectral feature combination to generate spectral features, extract feature parameters from the enhanced Raman spectral data according to the spectral features, and generate feature parameter combinations.

[0063] S206, acquire Raman spectral data of food raw materials with different mercury concentrations, extract corresponding features based on the optimal combination of spectral features to construct samples with different mercury concentrations, and superimpose the samples with different mercury concentrations and the combination of feature parameters to synthesize and construct a dataset.

[0064] It should be noted that a single spectral feature is insufficient for accurately identifying and measuring the mercury content in food ingredients. Therefore, the more features present, the more accurate the mercury content identification. However, a larger number of features increases the redundancy of feature combinations, affecting the efficiency of subsequent identification and measurement models. Utilizing genetic algorithms to determine suitable feature combinations from spectral curve and image features is crucial for the accurate and efficient determination of mercury content in food ingredients. The genetic algorithm is optimized and improved by using a chaotic algorithm to create an initial chaotic population, resulting in a more uniform initial population distribution. The error rate of the spectral feature combinations is used as the fitness function. During the iteration of the genetic algorithm, spectral feature combinations with high fitness values ​​are selected for replication to obtain the optimization direction of the spectral feature combinations. The search proceeds towards directions with low redundancy and high importance. Furthermore, spectral feature combinations with high fitness values ​​are cross-recombined to ensure that important features are included in the spectral feature combinations, accelerating the optimization process. When the error rate corresponding to a spectral feature combination is less than a preset threshold, the optimization process terminates and the optimal spectral feature combination is output.

[0065] Figure 3 The flowchart illustrates the qualitative and quantitative analysis and early warning of mercury content in food raw materials to be tested.

[0066] According to an embodiment of the present invention, an identification and measurement model is established to perform qualitative and quantitative analysis of mercury content in food raw materials to be tested, and an anomaly warning information is generated based on the analysis results, specifically as follows:

[0067] S302, Construct a recognition and measurement model based on the CNN-GRU network structure, divide the dataset into a training set and a test set according to a preset ratio, train and test the recognition and measurement model, and output the trained recognition and measurement model when the test results meet the preset performance standards.

[0068] S304, collect the surface-enhanced Raman spectrum of the food raw material to be tested, extract the spectral feature sequence and input it into the identification and measurement model, extract the spatial correlation and sequence correlation between the spectral features respectively, and map the obtained spectral features into the parallel output layer;

[0069] S306, the parallel output layers are qualitative and quantitative tasks respectively. The Softmax function is used to obtain the category probability distribution, complete the qualitative and quantitative analysis of mercury content in the food raw material to be tested, obtain the mercury content threshold, and generate mercury content abnormality warning information when the mercury content in the food raw material to be tested is greater than the mercury content threshold.

[0070] It should be noted that the CNN network treats all spectral features uniformly and extracts spatial features using convolutional kernels. The GRU network, a recurrent neural network structure, analyzes the sequential correlation of spectral feature sequences, and compared to the LSTM network, the GRU network has a faster learning process, enabling rapid extraction of the sequential correlation of spectral features. Furthermore, the identification and measurement model employs a multi-channel structure, ensuring the independence of different spectral features during spatial correlation extraction and enhancing the robustness of the identification and measurement model. A multi-task classifier is incorporated into the identification and measurement model, with the output layer of the classifier using the Softmax activation function to perform qualitative and quantitative mercury ion analysis, achieving qualitative and quantitative analysis of the mercury content in the food raw materials to be tested.

[0071] Figure 4 A block diagram of an early warning system for determining mercury content in food ingredients is shown.

[0072] The second embodiment of the present invention provides a detection and early warning system 4 for mercury content in food raw materials. The system includes a Raman spectroscopy acquisition unit 401, a spectral feature extraction unit 402, a mercury content identification and determination unit 403, and an anomaly early warning unit 404.

[0073] The Raman spectroscopy acquisition unit is responsible for acquiring the surface-enhanced Raman spectra of the food raw materials to be tested, and for preprocessing and enhancing the Raman spectral data.

[0074] The spectral feature extraction unit is responsible for selecting the optimal combination of spectral features based on the spectral curve features and spectral image features of the food raw materials, and generating the spectral features of the Raman spectral data based on the optimal combination of spectral features.

[0075] The mercury content identification and measurement unit is responsible for establishing an identification and measurement model based on a deep learning architecture. It constructs a dataset by combining the characteristic parameters corresponding to the surface-enhanced Raman spectra of food raw material samples with samples of different mercury concentrations. The dataset is used to train the model. The spectral features of the food raw material to be tested are input into the trained identification and measurement model for qualitative and quantitative analysis of mercury content.

[0076] The anomaly warning unit is responsible for determining the mercury content threshold based on the category information of the food raw material sample to be tested. When the mercury content concentration in the quantitative analysis result is greater than the mercury content threshold, an anomaly warning message is generated.

[0077] In a third embodiment of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium including a method program for determining and warning of mercury content in food raw materials, the method program for determining and warning of mercury content in food raw materials being executed by a processor to implement the steps of the method for determining and warning of mercury content in food raw materials.

[0078] 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. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks. Alternatively, if the integrated unit of the present invention is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.

[0079] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for early warning of mercury content in food raw materials, characterized in that, Includes the following steps: Surface-enhanced Raman spectra of food raw material samples are obtained, the acquired Raman spectral data are preprocessed, and the preprocessed Raman spectral data is enhanced to generate high-quality Raman spectral data. The spectral curve features and spectral image features of the enhanced Raman spectral data are extracted, and the optimal combination of spectral features is selected to generate the spectral features of the Raman spectral data. Based on the spectral features, feature parameter combinations are extracted, and the feature parameter combinations are synthesized with samples of different mercury concentrations to construct a dataset. A recognition and measurement model is established based on a deep learning architecture. The model is trained by dividing the dataset into training and testing sets. Surface-enhanced Raman spectra of the food raw materials to be tested are collected, and the spectral features are extracted as input to the model for qualitative and quantitative analysis of mercury content. The mercury content threshold is determined based on the category information of the food raw material sample to be tested. When the mercury content concentration in the quantitative analysis result is greater than the mercury content threshold, an abnormal warning message is generated. Extract the spectral curve features and spectral image features from the enhanced Raman spectral data. Specifically, the spectral image features are: Spectral image samples are obtained based on the enhanced Raman spectral data. These spectral image samples are then preprocessed, and features are extracted from the preprocessed spectral image samples using an improved U-Net network. The original encoder network is replaced with ResNet50 using dilated convolution to obtain multi-level feature maps in the spectral image samples. The multi-level feature maps obtained by encoding are downsampled and propagated. The decoder network is used to restore the multi-level feature maps through upsampling operations. Each restored feature map is used as local information. The CBMA attention mechanism is introduced, and the local information is processed by parallel channel attention module and spatial attention module. The corresponding channel description is obtained by using channel attention weight and spatial attention weight. A fused feature map is generated based on the two channel descriptions. The fused feature map is imported into the fully connected layer to output the image feature vector as the spectral image feature. The optimal combination of spectral features is selected to generate spectral features of Raman spectral data. Based on the spectral features, a combination of feature parameters is extracted. This combination of feature parameters is then combined with samples of different mercury concentrations to construct a dataset. Specifically: An initial feature set is generated by combining the spectral curve features in the spectral feature set with the spectral image features. An optimized genetic algorithm is used to select features from the initial feature set. The ratio of spectral curve features to spectral image features is preset. Spectral feature combinations are randomly selected according to the preset ratio. A chaotic population is generated by performing chaotic processing on the initial feature set. The fitness of individuals in the population is calculated, elite individuals are selected based on the fitness, and replication and crossover operations are performed on the elite individuals to optimize the search direction and selection process of spectral feature combinations. When the preset termination criterion is reached, the optimal spectral feature combination is output to generate spectral features. Feature parameters are extracted from the enhanced Raman spectral data based on the spectral features to generate feature parameter combinations. Raman spectral data of food raw materials with different mercury concentrations are obtained. Based on the optimal combination of spectral features, corresponding features are extracted to construct samples with different mercury concentrations. The samples with different mercury concentrations are superimposed with the combination of feature parameters to synthesize and construct a dataset.

2. The method for determining and warning of mercury content in food raw materials according to claim 1, characterized in that, Surface-enhanced Raman spectra of food raw material samples were obtained. The acquired Raman spectral data were preprocessed and then augmented using a generative adversarial network (GAN). Specifically: SERS detection of food raw material samples was performed using a Raman spectrometer to obtain surface-enhanced Raman spectra. Center-aligned decision windows and baseline windows were constructed based on median filtering and mean filtering. The size information of decision windows and baseline windows was determined based on historical SERS detections. The surface-enhanced Raman spectrum is processed by sliding window using the decision window and baseline window. The mean and standard deviation of the baseline outside the decision window and inside the baseline window are calculated. The decision threshold is set based on the multiple of the standard deviation. When the intensity of the center point of the decision window exceeds the decision threshold, the point is identified as a noise point. The value of the noise point is replaced with the mean. Cosmic ray noise is subtracted after traversing all surface-enhanced Raman spectra. After removing cosmic ray noise, the SNIP algorithm is used to perform baseline correction on the surface-enhanced Raman spectrum, and SG convolution smoothing is used to suppress random noise, thus realizing the preprocessing of Raman spectral data. The preprocessed Raman spectral data is encoded using a stacked autoencoder network to obtain the latent features of the characteristic peaks, and conditional information is generated based on the latent features and feature distribution of the original Raman spectral data. Feature enhancement is achieved using generative adversarial networks (GANs). The conditional information is used as prior information for both the generator network and the discriminator network. The generator network learns latent features from the original Raman spectral data based on the prior information and generates new data. The discriminator network evaluates the generator's output based on the prior information, and new Raman spectral data is generated through an adversarial mechanism.

3. The method for determining and warning of mercury content in food raw materials according to claim 1, characterized in that, Extract the spectral curve features and spectral image features from the enhanced Raman spectral data. Specifically, the spectral curve features are: Spectral curve samples are obtained based on the enhanced Raman spectral data. The derivative spectral curve samples are obtained by taking the first derivative of the spectral curve samples. The spectral curve features used for target classification and recognition are retrieved and integrated using big data methods to generate a set of spectral curve feature indicators. The spectral curve features of the derivative spectral curve samples are obtained based on the spectral curve feature index set. The ROC curve area for mercury ion recognition of each spectral curve feature is obtained, and the spectral curve features are sorted according to the ROC curve area. Based on the sorting results, the spectral curve feature corresponding to the area of ​​the largest ROC curve is selected and stored in the spectral feature set. From the remaining spectral curve features, the spectral curve feature corresponding to the area of ​​the largest ROC curve is selected again and stored in the spectral feature set. By iteratively comparing the filled spectral feature sets, it is determined in each iteration whether the area of ​​the ROC curve corresponding to the spectral feature set increases. When the area of ​​the ROC curve no longer increases, the corresponding spectral feature set is output.

4. The method for determining and warning of mercury content in food raw materials according to claim 1, characterized in that, A model for identifying and measuring mercury content in food ingredients is established for qualitative and quantitative analysis. Based on the analysis results, anomaly warning information is generated, specifically: A recognition and measurement model is constructed based on the CNN-GRU network structure. The dataset is divided into a training set and a test set according to a preset ratio. The recognition and measurement model is trained and tested. When the test results meet the preset performance standards, the trained recognition and measurement model is output. Surface-enhanced Raman spectra of the food raw materials to be tested are collected, spectral feature sequences are extracted and input into the identification and measurement model, spatial correlation and sequence correlation between spectral features are extracted respectively, and the obtained spectral features are mapped and imported into the parallel output layer; The parallel output layers are qualitative and quantitative tasks, respectively. The Softmax function is used to obtain the category probability distribution, complete the qualitative and quantitative analysis of mercury content in the food raw materials to be tested, obtain the mercury content threshold, and generate mercury content abnormality warning information when the mercury content in the food raw materials to be tested is greater than the mercury content threshold.

5. A system for determining and warning the mercury content in food ingredients, characterized in that, The method for determining and warning of mercury content in food raw materials as described in any one of claims 1-4 includes a Raman spectroscopy acquisition unit, a spectral feature extraction unit, a mercury content identification and determination unit, and an anomaly warning unit. The Raman spectroscopy acquisition unit is responsible for acquiring the surface-enhanced Raman spectra of the food raw materials to be tested, and for preprocessing and enhancing the Raman spectral data. The spectral feature extraction unit is responsible for selecting the optimal combination of spectral features based on the spectral curve features and spectral image features of the food raw materials, and generating the spectral features of the Raman spectral data based on the optimal combination of spectral features. The mercury content identification and measurement unit is responsible for establishing an identification and measurement model based on a deep learning architecture. It constructs a dataset by combining the characteristic parameters corresponding to the surface-enhanced Raman spectra of food raw material samples with samples of different mercury concentrations. The dataset is used to train the model. The spectral features of the food raw material to be tested are input into the trained identification and measurement model for qualitative and quantitative analysis of mercury content. The anomaly warning unit is responsible for determining the mercury content threshold based on the category information of the food raw material sample to be tested. When the mercury content concentration in the quantitative analysis result is greater than the mercury content threshold, an anomaly warning message is generated.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a method program for determining and warning of mercury content in food ingredients. When the method program is executed by a processor, it implements the steps of the method for determining and warning of mercury content in food ingredients as described in any one of claims 1 to 4.