Determination and early warning method and system for mercury content in food raw materials and storage medium

Through the combination of surface-enhanced Raman spectroscopy and deep learning framework, the complexity and inefficiency of mercury ion detection in food are solved, and the rapid and accurate detection of mercury content in food raw materials is achieved, which meets the needs of food safety detection.

CN119880872AActive Publication Date: 2025-04-25HUNAN RICE RES INST

Patent Information

Application Number
CN202411951077.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-04-25
Estimated Expiration
2044-12-27

AI Technical Summary

Technical Problem

The prior art has complex operation, long analysis time, poor reproducibility, poor sensitivity and accuracy in food, making it difficult to meet the needs of rapid detection and field detection.

Method used

Surface-enhanced Raman spectroscopy (SERS) combined with a deep learning framework is used to pre-process and data enhancement by obtaining surface-enhanced Raman spectroscopy data of food raw materials samples, extract spectral curve features and spectral image features, build data sets and establish identification and determination models to achieve rapid qualitative and quantitative analysis of mercury content.

Benefits of technology

It improves the accuracy and efficiency of mercury content measurement, reduces detection costs, is suitable for large-scale rapid testing, and provides a data basis for food safety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119880872A_ABST
    Figure CN119880872A_ABST
Patent Text Reader

Abstract

The invention discloses a determination and early warning method and system for mercury content in food raw materials and a storage medium, and relates to the technical field of food safety detection.The method comprises the steps that a surface enhanced Raman spectrum of a food raw material sample is obtained, preprocessing and data enhancement are carried out, spectral characteristics of enhanced Raman spectrum data are extracted, and a detection result is obtained; the optimal spectral feature combination is optimized to generate spectrogram features, a feature parameter combination is extracted based on the spectrogram features, and the feature parameter combination and the mercury content samples with different concentrations are synthesized to construct a data set; constructing a recognition determination model, training by utilizing the data set, collecting the surface enhanced Raman spectrum of the food raw material to be detected, and extracting spectrogram characteristics as model input to perform qualitative and quantitative analysis on the mercury content; when the mercury content concentration in the quantitative analysis result is larger than a preset mercury content threshold value, abnormal early warning information is generated. The rapid detection method for the mercury content in the food raw materials is constructed by using the surface enhanced Raman spectroscopy, and the accuracy of mercury content determination is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of food safety detection, and more specifically, to a method, system and storage medium for determining and warning the mercury content in food raw materials. Background Art

[0002] Mercury and its compounds are highly toxic substances and are trace metal elements that are harmful to the human body. They can accumulate in the body and are not easily excreted. They can be distributed to various tissues and organs with the blood and gradually accumulate (mainly brain tissue and liver), causing huge and irreparable damage to the organs of the human body. At the same time, it can cause a decrease in the immunity of the entire body, reduce the fertility of men and women, and cause deformities in offspring. Therefore, strict control of the mercury content in food is particularly important for human health. At present, there are many methods for analyzing mercury in food. The national standard has three methods: atomic fluorescence spectrometry, cold atomic absorption spectrometry, and disulfide colorimetric mercury analyzer determination technology. The operation is complicated, the analysis time is long, the reproducibility is poor, and the sensitivity and accuracy are also poor.

[0003] Traditional detection methods for mercury ions usually require expensive equipment and professional skills, and are not suitable for rapid detection and field testing. Secondly, traditional detection methods require a long time for sample preparation and analysis, which not only wastes time, but also leads to sample instability. It has strict requirements on the quantity and quality of samples, which may cause errors in the sample processing process. For example, interfering substances may be introduced during sample preparation, thereby affecting the accuracy of the analysis results. Due to the various limitations of traditional mercury ion detection methods, they are increasingly unable to meet people's needs for food safety. Therefore, how to quickly detect mercury ions in food raw materials, shorten detection time, improve detection efficiency and accuracy, and reduce detection costs at the same time, and facilitate large-scale rapid detection is an urgent problem to be solved. Summary of the invention

[0004] In order to solve the above technical problems, the present invention proposes a method, system and storage medium for determining and warning the mercury content in food raw materials. Surface enhanced Raman spectroscopy is used to select the best spectral features and a deep learning framework is combined to construct a rapid detection method for the mercury content in food raw materials, thereby improving the accuracy of mercury content determination.

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

[0006] Acquire surface enhanced Raman spectra of food raw material samples, preprocess the collected Raman spectrum data, and perform data enhancement on the preprocessed Raman spectrum data to generate high-quality Raman spectrum data;

[0007] Extracting spectral curve features and spectral image features of the enhanced Raman spectral data, selecting the best spectral feature combination to generate spectral features of the Raman spectral data, extracting a feature parameter combination based on the spectral features, and synthesizing the feature parameter combination with samples of different mercury concentrations to construct a data set;

[0008] Establishing an identification and determination model based on a deep learning architecture, using a data set to divide the training set and the test set to train the identification and determination model, collecting surface enhanced Raman spectra of food raw materials to be tested, and extracting spectral features as model input for qualitative and quantitative analysis of mercury content;

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

[0010] In this scheme, the surface enhanced Raman spectra of food raw material samples are obtained to preprocess the collected Raman spectral data, and the generative adversarial network is used for data enhancement, specifically:

[0011] Use Raman spectrometer to perform SERS detection on food raw material samples to obtain surface enhanced Raman spectra, build center-aligned judgment windows and baseline windows based on median filtering and mean filtering, and determine the size information of the judgment windows and baseline windows based on historical SERS detection;

[0012] The surface enhanced Raman spectrum is subjected to sliding window processing by using the determination window and the baseline window, the mean and standard deviation of the baseline outside the determination window and within the baseline window are calculated, a determination threshold is set based on a multiple value of the standard deviation, when the intensity of the center point of the determination window exceeds the determination threshold, the point is identified as a noise point, the value of the noise point is replaced by the mean, and the cosmic ray noise is deducted after traversing all surface enhanced Raman spectra;

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

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

[0015] A generative adversarial network is used for feature enhancement, and the conditional information is used as prior information for the generator network and the discriminator network. The generator network learns potential features from the original Raman spectral data based on the prior information and generates new data. The discriminator network evaluates the output of the generator based on the prior information and generates new Raman spectral data through an adversarial mechanism.

[0016] In this solution, the spectral curve characteristics and spectral image characteristics of the enhanced Raman spectral data are extracted, and the spectral curve characteristics are specifically:

[0017] Acquire spectrum curve samples according to the enhanced Raman spectrum data, perform first-order derivative on the spectrum curve samples to obtain derivative spectrum curve samples, use big data methods to retrieve and integrate spectrum curve features for target classification and recognition, and generate a spectrum curve feature index set;

[0018] Acquire spectral curve features of derivative spectral curve samples according to the spectral curve feature index set, acquire ROC curve area for mercury ion identification of each spectral curve feature, and sort the spectral curve features according to the ROC curve area;

[0019] Based on the sorting result, the spectral curve feature corresponding to the maximum ROC curve area is selected and stored in the spectral line feature set. Among the remaining spectral curve features, the spectral curve feature corresponding to the maximum ROC curve area is selected again and stored in the spectral line feature set.

[0020] The spectral line feature set is filled by iterative comparison. In each iteration, it is determined whether the ROC curve area corresponding to the spectral line feature set increases. When the ROC curve area no longer increases, the corresponding spectral line feature set is output.

[0021] In this solution, the spectral curve characteristics and spectral image characteristics of the enhanced Raman spectral data are extracted. The spectral image characteristics are specifically:

[0022] Acquire spectral image samples according to the enhanced Raman spectral data, preprocess the spectral image samples, and use the improved U-Net network to extract features from the preprocessed spectral image samples.

[0023] ResNet50 using dilated convolution is used to replace the original encoder network, to obtain multi-level feature maps in the spectral image sample, to downsample and propagate the multi-level feature maps obtained by encoding, to restore the multi-level feature maps by upsampling operation using the decoder network, and to use the restored feature maps of each layer as local information;

[0024] The CBMA attention mechanism is introduced, and the local information is processed by a parallel channel attention module and a spatial attention module. The channel attention weight and the spatial attention weight are used to obtain the corresponding channel description. A fused feature map is generated according to 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 best spectral feature combination is selected to generate the spectral features of Raman spectral data, and the characteristic parameter combination is extracted based on the spectral features. The characteristic parameter combination is synthesized with samples of different mercury concentrations to construct a data set, specifically:

[0026] An initial feature set is generated according to the spectral curve features in the spectral line feature set combined with the spectral image features, and features are selected in the initial feature set using an optimized genetic algorithm, and a ratio of spectral curve features to spectral image features is preset, and a spectral feature combination is randomly selected according to the preset ratio, and a chaotic population is generated by performing chaotic processing on the initial feature set;

[0027] Calculate the fitness of individuals in the population, select elite individuals based on the fitness, perform replication and cross-recombination operations on the elite individuals, optimize the search direction and selection process of the spectral feature combination, and when the preset termination standard is reached, output the optimal spectral feature combination to generate spectrum features, extract feature parameters according to the spectrum features in the enhanced Raman spectrum data, and generate a feature parameter combination;

[0028] The Raman spectral data of food raw materials with different mercury contents are obtained, and corresponding features are extracted based on the optimal spectral feature combination to construct samples with different mercury content concentrations. The samples with different mercury content concentrations are combined with the feature parameter combination for data superposition to synthesize and construct a data set.

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

[0030] Building a recognition and measurement model based on the CNN-GRU network structure, dividing the data set into a training set and a test set according to a preset ratio, training and testing the recognition and measurement model, and outputting the trained recognition and measurement model when the test result meets the preset performance standard;

[0031] Collecting surface enhanced Raman spectra of food raw materials to be tested, extracting spectral feature sequences and inputting them into the recognition and determination model, respectively extracting spatial correlation and sequence correlation between spectral features, and importing the acquired spectral feature maps into parallel output layers;

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

[0033] The second aspect of the present invention provides a system for determining and warning the mercury content in food raw materials, the system comprising a Raman spectrum acquisition unit, a spectrum feature extraction unit, a mercury content identification and determination unit, and an abnormality warning unit;

[0034] The Raman spectrum acquisition unit is responsible for acquiring the surface enhanced Raman spectrum of the food raw material to be tested, and performing preprocessing and data enhancement of the Raman spectrum data;

[0035] The spectrum feature extraction unit is responsible for selecting the best spectrum feature combination according to the spectrum curve characteristics and spectrum image characteristics of the food raw material, and generating the spectrum features of the Raman spectrum data according to the best spectrum feature combination;

[0036] The mercury content identification and determination unit is responsible for establishing an identification and determination model based on a deep learning architecture, constructing a data set based on a combination of characteristic parameters corresponding to the surface enhanced Raman spectrum of the food raw material sample and samples of different concentrations of mercury content, using the data set to train the model, and inputting the spectral features of the food raw material to be tested into the trained identification and determination model to perform qualitative and quantitative analysis of the mercury content;

[0037] The abnormal warning unit is responsible for determining a mercury content threshold according to the category information of the food raw material sample to be detected, and generates abnormal warning information when the mercury content concentration in the quantitative analysis result is greater than the mercury content threshold.

[0038] The second aspect of the present invention provides a computer-readable storage medium, which includes a program for a method for determining and warning the mercury content in food raw materials. When the program for the method for determining and warning the mercury content in food raw materials is executed by a processor, the steps of the method for determining and warning the mercury content in food raw materials are implemented.

[0039] Compared with the prior art, the present invention has the following beneficial effects:

[0040] The present invention selects a suitable preprocessing method to blur unnecessary data in the spectrum, extracts important data to generate a high-quality Raman spectrum, meets the demand for training samples in subsequent deep learning, and overcomes the one-sidedness of traditional spectrum preprocessing;

[0041] Surface enhanced Raman spectroscopy is used to extract spectral curve features and spectral image features, and genetic algorithms are used to select the best spectral features, providing an effective method for selecting efficient feature combinations and laying an important foundation for the rapid detection of mercury content. A rapid detection method for mercury content in food raw materials is constructed in combination with a deep learning framework to improve the accuracy of mercury content determination and provide food safety data basis for food raw material production and circulation. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0043] Figure 1 A flow chart showing an early warning method for determining mercury content in food raw materials;

[0044] Figure 2 A flow chart for screening spectral features of Raman spectroscopy data to determine a data set is shown;

[0045] Figure 3 A flow chart showing the qualitative and quantitative analysis and early warning of the mercury content of food raw materials to be tested;

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

[0047] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0048] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.

[0049] like Figure 1 As shown, an embodiment of the present invention provides a method for determining and warning the mercury content in food raw materials, comprising:

[0050] S102, obtaining a surface enhanced Raman spectrum of a food raw material sample, preprocessing the collected Raman spectrum data, and performing data enhancement on the preprocessed Raman spectrum data to generate high-quality Raman spectrum data;

[0051] S104, extracting spectral curve features and spectral image features of the enhanced Raman spectral data, selecting the best spectral feature combination to generate spectral features of the Raman spectral data, extracting a feature parameter combination based on the spectral features, and synthesizing the feature parameter combination with samples of different mercury concentrations to construct a data set;

[0052] S106, establishing an identification and determination model based on a deep learning architecture, using the data set to divide the training set and the test set to train the identification and determination model, collecting surface enhanced Raman spectra of the food raw materials to be tested, and extracting spectral features as model input to perform qualitative and quantitative analysis of mercury content;

[0053] S108, determining a mercury content threshold according to the category information of the food raw material sample to be tested, and generating abnormal warning information 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 collected raw Raman spectrum data is often affected by a variety of interference factors, such as instrument noise, sample surface morphology, environmental conditions, and cosmic ray interference. Interference factors will reduce the quality and reliability of the spectrum, and thus affect subsequent data analysis and interpretation. Based on median filtering and mean filtering, a center-aligned decision window and baseline window are constructed, and the size information of the decision window and baseline window is determined according to historical SERS detection; the surface enhanced Raman spectrum is subjected to sliding window processing using the decision window and baseline window, and the mean and standard deviation of the baseline outside the decision window and within the baseline window are calculated, and 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 value. After traversing all surface enhanced Raman spectra, the cosmic ray noise is deducted;

[0055] The main reasons for the baseline drift of Raman spectroscopy include fluorescence background, changes in scattering sources, instrument drift, changes in environmental conditions and sample inhomogeneity. The baseline correction methods are retained: least squares method, polynomial method and SNIP method. Preferably, the SNIP algorithm is used to correct the baseline of surface enhanced Raman spectroscopy. The SNIP algorithm is a baseline subtraction method widely used in the field of γ energy spectrum analysis. It can effectively estimate the baseline of the whole spectrum on the basis of correctly distinguishing the γ peak area and non-peak area. SG convolution smoothing is used to suppress random noise. SG smoothing performs least squares fitting on spectral data by adding convolution calculations. It does not need to calculate the data average value, and it highlights the role of the window center point, which greatly reduces the noise.

[0056] The preprocessed Raman spectral data is encoded using a stacked autoencoder network to obtain the potential features of the characteristic peaks, and conditional information is generated based on the potential features and feature distribution of the original Raman spectral data; the generative adversarial network is used for feature enhancement, and the conditional information is used as the prior information of the generator network and the discriminator network. The generator network learns the potential features from the original Raman spectral data based on the prior information and generates new data. The discriminator network evaluates the output of the generator based on the prior information, and generates new Raman spectral data through an adversarial mechanism. The generative adversarial network learns the feature information from the Raman spectral data into new data, retains the feature information in the original Raman spectral data, and the generated data is more realistic and in line with the actual scene. The properties of the generated Raman spectral data, such as the peak position and peak intensity of the spectral data, are controlled by setting the value of the conditional information. By introducing noise in the conditional variables, randomness is introduced in the generation process to generate diversified 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. A spectral curve sample is obtained according to the enhanced Raman spectral data, and the first-order derivative of the spectral curve sample is performed to obtain a derivative spectral curve sample to improve the efficiency of recognition. The spectral curve features for target classification and recognition are retrieved and integrated using a big data method to generate a spectral curve feature index set. Preferably, the spectral curve feature index set includes: peak wavelength, peak value, peak width, peak slope, total number of peaks, band depth, peak symmetry, etc. According to the spectral curve feature index set, the spectral curve features of the derivative spectral curve samples are obtained, the ROC curve area of ​​each spectral curve feature for mercury ion identification 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 maximum ROC curve area is selected and stored in the spectral line feature set, and among the remaining spectral curve features, the spectral curve feature corresponding to the maximum ROC curve area is selected again and stored in the spectral line feature set; the spectral line feature set is filled by iterative comparison, and in each iteration, it is determined whether the ROC curve area corresponding to the spectral line feature set increases, and when the ROC curve area no longer increases, the corresponding spectral line feature set is output.

[0058] According to the enhanced Raman spectrum data, a spectral image sample is obtained, the spectral image sample is preprocessed, and the preprocessed spectral image sample is feature extracted using an improved U-Net network. The original encoder network is replaced by ResNet50 using dilated convolution, and the receptive field is enhanced by introducing dilated convolution. The hierarchical residual connection and multi-scale feature acquisition capabilities of ResNet50 are used to comprehensively improve the extraction efficiency and accuracy of the target spectral image feature map. The multi-level feature map in the spectral image sample is obtained, the multi-level feature map obtained by encoding is downsampled and propagated, and the multi-level feature map is restored by upsampling operation using the decoder network, and the restored feature map of each layer is used as local information; the CBMA attention mechanism is introduced, and the local information is processed by a parallel channel attention module and a spatial attention module, and the corresponding channel description is obtained using the channel attention weight and the spatial attention weight, and the dependency between the image feature maps is explored. A fused feature map is generated according to the two channel descriptions and weights are assigned, and the fused feature map that meets the weight standard is intercepted according to the weight and imported into the fully connected layer to output the image feature vector as the spectral image feature.

[0059] Figure 2 A flow chart for screening spectral features of Raman spectroscopy data to determine a data set is shown.

[0060] According to an embodiment of the present invention, the optimal spectral feature combination is selected to generate the spectral features of Raman spectral data, a characteristic parameter combination is extracted based on the spectral features, and the characteristic parameter combination is synthesized with samples of different mercury concentrations to construct a data set, specifically:

[0061] S202, generating an initial feature set according to the spectral curve features in the spectral line feature set and the spectral image features, performing feature selection in the initial feature set using an optimized genetic algorithm, presetting the ratio of spectral curve features to spectral image features, randomly selecting spectral feature combinations according to the preset ratio, and generating a chaotic population by performing chaotic processing on the initial feature set;

[0062] S204, calculating the fitness of individuals in the population, selecting elite individuals based on the fitness, performing replication operations and cross-recombination operations on the elite individuals, optimizing the search direction and selection process of the spectral feature combination, and when a preset termination standard is reached, outputting the optimal spectral feature combination to generate a spectrum feature, extracting feature parameters according to the spectral features in the enhanced Raman spectrum data, and generating a feature parameter combination;

[0063] S206, obtaining Raman spectral data of food raw materials with different mercury contents, extracting corresponding features based on the optimal spectral feature combination to construct samples with different mercury contents, and superimposing the samples with different mercury contents with the feature parameter combination to synthesize and construct a data set.

[0064] It should be noted that it is difficult to accurately identify and determine the mercury content of food raw materials with a single spectral feature. Therefore, the more features there are, the more accurate the mercury content can be identified. However, the more features there are, the higher the redundancy of the feature combination will be, affecting the efficiency of the subsequent identification and determination model. Using genetic algorithms to determine appropriate feature combinations in spectral curve features and spectral image features is of great significance for the accurate and efficient determination of mercury content in food raw materials. The genetic algorithm is optimized and improved, and the chaos algorithm is used to make the initial population chaotic, so that the initial population distribution is more uniform. According to the error rate of the spectral feature combination as the fitness function, in the iteration of the genetic algorithm, the spectral feature combination with high fitness value is selected for replication, and the optimization direction of the spectral feature combination is obtained. The direction with low redundancy and high importance is searched, and the spectral feature combination with high fitness value is cross-recombined, so that important features are selected into the spectral feature combination, and the optimization selection process of the spectral feature combination is accelerated; when the error rate corresponding to the spectral feature combination is less than the preset threshold, the optimization process is terminated and the optimal spectral feature combination is output.

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

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

[0067] S302, constructing a recognition measurement model based on the CNN-GRU network structure, dividing the data set into a training set and a test set according to a preset ratio, training and testing the recognition measurement model, and outputting the trained recognition measurement model when the test result meets the preset performance standard;

[0068] S304, collecting surface enhanced Raman spectra of the food raw materials to be tested, extracting the spectral feature sequence and inputting it into the recognition and determination model, respectively extracting the spatial correlation and sequence correlation between the spectral features, and importing the obtained spectral feature map into the parallel output layer;

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

[0070] It should be noted that the CNN network treats all spectral features uniformly and extracts spatial features by convolution kernels. The GRU network recurrent neural network structure analyzes the sequential correlation of spectral feature sequences, and compared with the LSTM network, the GRU network has a faster learning process and can quickly complete the extraction of sequential correlation of spectral features. In addition, the recognition and measurement model is constructed using a multi-channel structure, so that different spectral features have independence in the process of spatial correlation extraction, and at the same time can enhance the robustness of the recognition and measurement model. A multi-task classifier is set in the recognition and measurement model, and the output layer of the multi-task classifier uses the Softmax activation function to complete the qualitative and quantitative tasks of mercury ions, thereby realizing the qualitative and quantitative analysis of the mercury content of 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] In the second embodiment of the present invention, a system 4 for determining and warning the mercury content in food raw materials is provided, the system comprising a Raman spectrum acquisition unit 401, a spectrum feature extraction unit 402, a mercury content identification and determination unit 403 and an abnormality warning unit 404;

[0073] The Raman spectrum acquisition unit is responsible for acquiring the surface enhanced Raman spectrum of the food raw material to be tested, and performing preprocessing and data enhancement of the Raman spectrum data;

[0074] The spectrum feature extraction unit is responsible for selecting the best spectrum feature combination according to the spectrum curve characteristics and spectrum image characteristics of the food raw material, and generating the spectrum features of the Raman spectrum data according to the best spectrum feature combination;

[0075] The mercury content identification and determination unit is responsible for establishing an identification and determination model based on a deep learning architecture, constructing a data set based on a combination of characteristic parameters corresponding to the surface enhanced Raman spectrum of the food raw material sample and samples of different concentrations of mercury content, using the data set to train the model, and inputting the spectral features of the food raw material to be tested into the trained identification and determination model to perform qualitative and quantitative analysis of the mercury content;

[0076] The abnormal warning unit is responsible for determining a mercury content threshold according to the category information of the food raw material sample to be detected, and generates abnormal warning information when the mercury content concentration in the quantitative analysis result is greater than the mercury content threshold.

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

[0078] It can be understood by those skilled in the art that all or part of the steps of the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiment are executed; and the aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks or optical disks. Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in various embodiments of the present invention. And the aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.

[0079] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.

Claims

1. A method for determining and warning the mercury content in food raw materials, characterized in that: The following steps are involved: Acquire surface enhanced Raman spectra of food raw material samples, preprocess the collected Raman spectrum data, and perform data enhancement on the preprocessed Raman spectrum data to generate high-quality Raman spectrum data; Extracting spectral curve features and spectral image features of the enhanced Raman spectral data, selecting the best spectral feature combination to generate spectral features of the Raman spectral data, extracting a feature parameter combination based on the spectral features, and synthesizing the feature parameter combination with samples of different mercury concentrations to construct a data set; Establishing an identification and determination model based on a deep learning architecture, using a data set to divide the training set and the test set to train the identification and determination model, collecting surface enhanced Raman spectra of food raw materials to be tested, and extracting spectral features as model input for qualitative and quantitative analysis of mercury content; The mercury content threshold is determined according to the category information of the food raw material sample to be tested, and when the mercury content concentration in the quantitative analysis result is greater than the mercury content threshold, an abnormal warning information is generated.

2. The method for determining and warning the mercury content in food raw materials according to claim 1, characterized in that: Obtain surface enhanced Raman spectra of food raw material samples, preprocess the collected Raman spectral data, and use generative adversarial networks for data enhancement, specifically: Use Raman spectrometer to perform SERS detection on food raw material samples to obtain surface enhanced Raman spectra, build center-aligned judgment windows and baseline windows based on median filtering and mean filtering, and determine the size information of the judgment windows and baseline windows based on historical SERS detection; The surface enhanced Raman spectrum is subjected to sliding window processing by using the determination window and the baseline window, the mean and standard deviation of the baseline outside the determination window and within the baseline window are calculated, a determination threshold is set based on a multiple value of the standard deviation, when the intensity of the center point of the determination window exceeds the determination threshold, the point is identified as a noise point, the value of the noise point is replaced by the mean, and the cosmic ray noise is deducted after traversing all surface enhanced Raman spectra; After removing the cosmic ray noise, the SNIP algorithm is used to perform baseline correction on the surface enhanced Raman spectrum, and the SG convolution smoothing is used to suppress random noise to achieve preprocessing of Raman spectrum data; The preprocessed Raman spectral data is encoded using a stacked autoencoder network to obtain the potential features of the characteristic peaks, and conditional information is generated based on the potential features and feature distribution of the original Raman spectral data; A generative adversarial network is used for feature enhancement, and the conditional information is used as prior information for the generator network and the discriminator network. The generator network learns potential features from the original Raman spectral data based on the prior information and generates new data. The discriminator network evaluates the output of the generator based on the prior information and generates new Raman spectral data through an adversarial mechanism.

3. The method for determining and warning the mercury content in food raw materials according to claim 1, characterized in that: Extract the spectral curve characteristics and spectral image characteristics of the enhanced Raman spectral data, wherein the spectral curve characteristics are specifically: Acquire spectrum curve samples according to the enhanced Raman spectrum data, perform first-order derivative on the spectrum curve samples to obtain derivative spectrum curve samples, use big data methods to retrieve and integrate spectrum curve features for target classification and recognition, and generate a spectrum curve feature index set; Acquire spectral curve features of derivative spectral curve samples according to the spectral curve feature index set, acquire ROC curve area for mercury ion identification of each spectral curve feature, and sort the spectral curve features according to the ROC curve area; Based on the sorting result, the spectral curve feature corresponding to the maximum ROC curve area is selected and stored in the spectral line feature set. Among the remaining spectral curve features, the spectral curve feature corresponding to the maximum ROC curve area is selected again and stored in the spectral line feature set. The spectral line feature set is filled by iterative comparison. In each iteration, it is determined whether the ROC curve area corresponding to the spectral line feature set increases. When the ROC curve area no longer increases, the corresponding spectral line feature set is output.

4. The method for determining and warning the mercury content in food raw materials according to claim 1, characterized in that: Extract the spectral curve characteristics and spectral image characteristics of the enhanced Raman spectral data, wherein the spectral image characteristics are specifically: Acquire spectral image samples according to the enhanced Raman spectral data, preprocess the spectral image samples, and use the improved U-Net network to extract features from the preprocessed spectral image samples. ResNet50 using dilated convolution is used to replace the original encoder network, to obtain multi-level feature maps in the spectral image sample, to downsample and propagate the multi-level feature maps obtained by encoding, to restore the multi-level feature maps by upsampling operation using the decoder network, and to use the restored feature maps of each layer as local information; The CBMA attention mechanism is introduced, and the local information is processed by a parallel channel attention module and a spatial attention module. The channel attention weight and the spatial attention weight are used to obtain the corresponding channel description. A fused feature map is generated according to 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.

5. The method for determining and warning the mercury content in food raw materials according to claim 1, characterized in that: The optimal spectral feature combination is selected to generate the spectral features of Raman spectral data, a feature parameter combination is extracted based on the spectral features, and the feature parameter combination is synthesized with samples of different mercury concentrations to construct a data set, specifically: An initial feature set is generated according to the spectral curve features in the spectral line feature set combined with the spectral image features, and features are selected in the initial feature set using an optimized genetic algorithm, and a ratio of spectral curve features to spectral image features is preset, and a spectral feature combination is randomly selected according to the preset ratio, and a chaotic population is generated by performing chaotic processing on the initial feature set; Calculate the fitness of individuals in the population, select elite individuals based on the fitness, perform replication and cross-recombination operations on the elite individuals, optimize the search direction and selection process of the spectral feature combination, and when the preset termination standard is reached, output the optimal spectral feature combination to generate spectral features, and extract feature parameters according to the spectral features in the enhanced Raman spectral data. Generate feature parameter combinations; The Raman spectral data of food raw materials with different mercury contents are obtained, and corresponding features are extracted based on the optimal spectral feature combination to construct samples with different mercury content concentrations. The samples with different mercury content concentrations are combined with the feature parameter combination for data superposition to synthesize and construct a data set.

6. The method for determining and warning the mercury content in food raw materials according to claim 1, characterized in that: Establish an identification and determination model to conduct qualitative and quantitative analysis of the mercury content in the food raw materials to be tested, and generate abnormal warning information based on the analysis results, specifically: Building a recognition and measurement model based on the CNN-GRU network structure, dividing the data set into a training set and a test set according to a preset ratio, training and testing the recognition and measurement model, and outputting the trained recognition and measurement model when the test result meets the preset performance standard; Collecting surface enhanced Raman spectra of food raw materials to be tested, extracting spectral feature sequences and inputting them into the recognition and determination model, respectively extracting spatial correlation and sequence correlation between spectral features, and importing the acquired spectral feature maps into parallel output layers; The parallel output layers are qualitative tasks and quantitative tasks respectively. The Softmax function is used to obtain the category probability distribution, complete the qualitative and quantitative analysis of the mercury content in the food raw materials to be tested, and obtain the mercury content threshold. When the mercury content in the food raw materials to be tested is greater than the mercury content threshold, an abnormal mercury content warning information is generated.

7. A system for early warning of the determination of mercury content in food raw materials, characterized in that: A method for determining and warning the mercury content in food raw materials according to any one of claims 1 to 6 is implemented, the system comprising a Raman spectrum acquisition unit, a spectrum feature extraction unit, a mercury content identification and determination unit, and an abnormality warning unit; The Raman spectrum acquisition unit is responsible for acquiring the surface enhanced Raman spectrum of the food raw material to be tested, and performing preprocessing and data enhancement of the Raman spectrum data; The spectrum feature extraction unit is responsible for selecting the best spectrum feature combination according to the spectrum curve characteristics and spectrum image characteristics of the food raw material, and generating the spectrum features of the Raman spectrum data according to the best spectrum feature combination; The mercury content identification and determination unit is responsible for establishing an identification and determination model based on a deep learning architecture, constructing a data set based on a combination of characteristic parameters corresponding to the surface enhanced Raman spectrum of the food raw material sample and samples of different concentrations of mercury content, using the data set to train the model, and inputting the spectral features of the food raw material to be tested into the trained identification and determination model to perform qualitative and quantitative analysis of the mercury content; The abnormal warning unit is responsible for determining a mercury content threshold according to the category information of the food raw material sample to be detected, and generates abnormal warning information when the mercury content concentration in the quantitative analysis result is greater than the mercury content threshold.

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

Citation Information

Patent Citations

  • Raman spectrum enhanced measurement system and measurement method

    CN112834481A

  • Raman spectrum preprocessing model generation method and system, terminal and storage medium

    CN115326783A

  • Multi-channel drug fuzzy recognition method and system based on surface enhanced Raman spectroscopy

    CN115774008A

  • Cytological methods for detecting a condition such as transplant efficiency by raman spectroscopic imaging

    US20120200850A1

Cited By

  • Method and system for identifying spectrogram of quaternary ammonium salt extracting solution in textile

    CN120539126A

  • A method and system for identifying quaternary ammonium salt extract spectra in textiles

    CN120539126B

  • Cuprous oxide-graphite phase carbon nitride SERS (Surface Enhanced Raman Scattering) enhanced substrate and application thereof in pesticide residue detection

    CN120971393A