Intelligent detection method and system for illegal food addition and storage medium
Through multi-target SERS substrate and multi-wavelength laser scanning combined with intelligent data processing, the problem of interference substances in food detection is solved, and high-sensitivity and high-efficiency detection of various food additives is achieved, which is suitable for food safety monitoring.
Patent Information
- Application Number
- CN202510681944.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-26
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2045-05-26
AI Technical Summary
Existing SERS detection technology is affected by interfering substances such as citrate in food safety testing, resulting in insufficient detection sensitivity and specificity. It is difficult to simultaneously detect multiple illegal food additives, and lacks intelligent data processing, resulting in inaccurate and inefficient detection results.
A multi-target surface-enhanced Raman scattering substrate and three lasers of different wavelengths are used to perform multi-point scanning of the same detection area. Combined with wavelet noise reduction and spectral alignment technology, the characteristic peak combination fingerprint is extracted. Feature fusion and multi-task learning are performed through a multi-path parallel structured attention neural network to identify multiple additives.
It achieves ultra-high sensitivity detection in complex food matrices, with a detection limit of up to 100 fg/mL. It can simultaneously detect 30 common illegal food additives in one go, with a detection time of only 15 minutes, significantly improving detection efficiency and accuracy.
Smart Images

Figure CN120594481A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent detection technology, and in particular to an intelligent detection method, system and storage medium for illegal food additives. Background Art
[0002] Food safety issues are becoming increasingly serious, and the detection of illegal additives is a crucial component of food safety regulation. Traditional detection methods, such as gas chromatography-mass spectrometry and high-performance liquid chromatography-tandem mass spectrometry, offer high accuracy, but these methods are expensive, complex, and require long detection cycles. Furthermore, they lack the ability to rapidly detect food on-site. Surface-enhanced Raman scattering (SERS) technology, due to its high sensitivity, rapid, non-destructive nature, and molecular fingerprinting capabilities, is gaining increasing application in food safety testing.
[0003] However, existing SERS detection technology has several technical deficiencies. First, the food matrix is complex, and in particular, the strong interference signals generated by common components such as citrate ions seriously affect the detection precision and accuracy. Second, the traditional SERS substrate has large differences in the enhancement effect on different types of additives, which makes it difficult to meet the needs of simultaneous detection of multiple additives. Third, existing SERS spectral data processing methods mainly rely on single wavelength excitation and simple peak recognition, which lack specificity and are susceptible to matrix interference. Finally, the interpretation of detection results usually relies on manual experience and judgment, and lacks intelligent and automated data processing and decision-making methods.
[0004] Traditional single SERS substrates cannot effectively suppress the signals of interfering substances in complex food matrices, resulting in limited detection sensitivity and specificity. The spectral data from single-wavelength excitation has limited information and cannot fully characterize the characteristics of different additives. Existing feature extraction methods do not fully utilize multidimensional spectral information, making it difficult to construct unique identification features for additives. Traditional data analysis methods cannot handle the detection tasks of multiple additives simultaneously, requiring multiple tests, which is inefficient and prone to cross-interference. Summary of the Invention
[0005] The present application provides an intelligent detection method, system and storage medium for illegal food additives, which are used to solve the problem that SERS technology is affected by interfering substances such as citrate in food safety detection, resulting in insufficient detection sensitivity and specificity. It breaks through the technical bottleneck that traditional methods are difficult to simultaneously detect multiple illegal food additives, and overcomes the problem of low accuracy and efficiency of detection results caused by the lack of intelligent data processing in the existing technology.
[0006] In a first aspect, the present application provides an intelligent detection method for illegal food additives, which includes: reacting a silver nitrate solution with a sodium borohydride solution, adding calcium chloride to promote hotspot formation, and adding potassium iodide to construct a selective coordination layer that suppresses interference from citrate ions, thereby obtaining a multi-target surface-enhanced Raman scattering substrate; extracting and processing a food sample and then injecting it into the multi-target surface-enhanced Raman scattering substrate, using three different wavelength lasers to perform multi-point scanning on the same detection area to obtain a multidimensional spectral data set; performing wavelet denoising and spectral alignment on the multidimensional spectral data set, extracting key parameters of characteristic peaks at each wavelength and calculating characteristic peak combination fingerprints to obtain a unique identification feature matrix for each additive; training an attention neural network with a multi-way parallel structure based on the unique identification feature matrix, and simultaneously identifying multiple additives through a feature fusion module and a multi-task learning mechanism to obtain the existence probability and concentration value of each additive.
[0007] Optionally, the silver nitrate solution is reacted with the sodium borohydride solution, calcium chloride is added to promote the formation of hot spots, and potassium iodide is added to construct a selective coordination layer that suppresses the interference of citrate ions to obtain a multi-target surface-enhanced Raman scattering substrate, comprising:
[0008] mixing the silver nitrate solution with deionized water, and stirring at a constant temperature to obtain a reaction solution;
[0009] adding sodium borohydride solution dropwise to the reaction solution, controlling the dropping rate and maintaining strong stirring to obtain nanosilver sol;
[0010] adding a calcium chloride solution to the nano-silver sol and stirring the solution, so that the calcium ions promote the self-assembly of the nano-silver particles to form a hot spot structure, thereby obtaining an enhanced nano-silver sol;
[0011] adding potassium iodide solution dropwise to the enhanced nano-silver sol and stirring, so that iodide ions form a coordination layer on the surface of the nano-silver particles to obtain a modified nano-silver sol;
[0012] The modified nanosilver sol is centrifuged and washed and redispersed in deionized water to obtain purified nanosilver sol;
[0013] The purified nanosilver sol is added dropwise onto a pretreated polydimethylsiloxane microfluidic substrate, and a vacuum filtration device is used to uniformly distribute the nanosilver particles, followed by drying to obtain the multi-target surface-enhanced Raman scattering substrate.
[0014] Optionally, after the food sample is extracted and processed, it is injected into the multi-target surface-enhanced Raman scattering substrate, and three lasers of different wavelengths are used to perform multi-point scanning on the same detection area to obtain a multidimensional spectral data set, including:
[0015] Add a mixed extract of acetonitrile and water to the food sample and homogenize it using a high-speed homogenizer to obtain a sample suspension;
[0016] Ultrasonic treatment is performed on the sample suspension to promote the full release of illegal additives from the food matrix to obtain an ultrasonic extract;
[0017] Centrifuging the ultrasonic extract and collecting the supernatant, then adding phosphate buffer to adjust the pH value to obtain a treated sample solution;
[0018] Filtering the treated sample solution to remove large particle impurities to obtain a purified sample solution;
[0019] Injecting the purified sample solution into the microfluidic channel of the multi-target surface-enhanced Raman scattering substrate, controlling the flow rate to ensure full contact between the sample and the substrate, and obtaining a test sample;
[0020] The detection samples were respectively subjected to three wavelength lasers of 532 nm, 638 nm and 785 nm, and Raman spectra were collected at multiple different sites in the same detection area. Each site was integrated for a fixed time to obtain the multidimensional spectral data set.
[0021] Optionally, performing wavelet denoising and spectral alignment on the multidimensional spectral dataset, extracting key parameters of characteristic peaks at each wavelength and calculating characteristic peak combination fingerprints to obtain a unique identification feature matrix for each additive includes:
[0022] performing baseline correction on the original spectral data in the multidimensional spectral dataset, determining the effective signal range using an improved polynomial fitting algorithm, and obtaining spectral data after baseline correction;
[0023] Normalizing the baseline-corrected spectral data, selecting the intensity of the strongest peak in each spectrum as a normalization standard, and obtaining normalized spectral data;
[0024] Performing wavelet transform noise reduction processing on the normalized spectral data, selecting Daubechies wavelet function and adaptive threshold, to obtain spectral data after noise reduction;
[0025] Performing singular value decomposition (SVD) spectral alignment on the denoised spectral data to eliminate the influence of spectral shifts at different excitation wavelengths, thereby obtaining aligned multi-wavelength spectral data;
[0026] Extracting the position, intensity, area, and half-peak width parameters of the characteristic peak at each wavelength from the aligned multi-wavelength spectral data, and calculating the intensity ratio and relative displacement of the same characteristic peak at different wavelengths to obtain a primary eigenvector;
[0027] The characteristic peak combinations of various illegal additives under multi-wavelength excitation are marked according to the primary characteristic vectors, and at least 5 characteristic peak combinations are constructed for each additive as a unique identifier to obtain a unique identification feature matrix for each additive.
[0028] Optionally, the training of an attention neural network with a multi-path parallel structure based on the unique identification feature matrix, simultaneously identifying multiple additives through a feature fusion module and a multi-task learning mechanism, and obtaining the presence probability and concentration value of each additive, includes:
[0029] A hierarchical fusion attention network structure was designed, and three parallel sub-networks were constructed to process the feature data at 532nm, 638nm, and 785nm excitation wavelengths respectively, to obtain a wavelength feature extraction network.
[0030] A feature extraction module and an attention module are constructed for each sub-network in the wavelength feature extraction network, wherein the feature extraction module is composed of a one-dimensional convolutional neural network, and the attention module includes channel attention and spatial attention, to obtain an attention-enhanced feature representation;
[0031] The attention-enhanced feature representation is obtained by obtaining channel information through global average pooling and maximum pooling, which is then fused through a multi-layer perceptron. At the same time, spectral position related information is obtained through a convolution operation to obtain enhanced features that highlight the characteristic peaks of illegal additives.
[0032] The enhanced features output by the three sub-networks are integrated through an adaptive feature fusion module, the weight coefficients of the features of each wavelength are calculated and fused according to the weight ratio to obtain a unified feature representation;
[0033] Based on the unified feature representation, a multi-output classification head is constructed, each classification head corresponds to a type of illegal additive, and a total of 30 classification heads work in parallel to obtain an output layer of the probability of existence and the concentration estimation output layer of each additive;
[0034] The network is trained using a multi-task loss function, which includes two parts: classification loss and regression loss. The classification loss adopts a weighted binary cross entropy function, and the regression loss adopts a weighted mean square error function. The weight coefficient is automatically adjusted according to the degree of hazard of the additive to obtain the existence probability and concentration value of each additive.
[0035] Optionally, a multi-output classification head is constructed based on the unified feature representation, each classification head corresponds to a type of illegal additive, and a total of 30 classification heads work in parallel to obtain an output layer of the probability of existence and a concentration estimation output layer of each additive, including:
[0036] Performing feature decomposition on the unified feature representation to separate global features from additive features to obtain a general feature representation and an additive-related feature representation;
[0037] Building a shared backbone network based on the universal feature representation, comprising three fully connected layers, each followed by a batch normalization layer and a ReLU activation function, to obtain deep shared features;
[0038] 30 sub-networks are branched from the deep shared features, each corresponding to a type of illegal additive, and a residual connection structure is used to connect the additive-related feature representation with the deep shared features to obtain the additive-specific feature representation;
[0039] Adding an attention gating mechanism to the additive-specific feature representation, controlling feature flow through a soft threshold function, and obtaining additive identification features;
[0040] A dual-output structure is constructed based on the additive identification features. Branch 1 uses a Sigmoid function to output the probability of the additive's presence, and branch 2 uses a linear activation function to output the concentration prediction value to obtain the discrimination results of each additive.
[0041] A post-processing algorithm is applied to the discrimination results to eliminate false positive detections through threshold filtering and correlation analysis, and the reliability of the results is evaluated by variance analysis combined with multiple detections to obtain the output of the probability of existence and concentration estimation of each additive.
[0042] Optionally, adding an attention gating mechanism to the additive-specific feature representation, controlling feature flow through a soft threshold function, and obtaining additive identification features, includes:
[0043] Perform channel attention calculation on the additive-specific feature representation, generate channel descriptors through global average pooling and maximum pooling, and merge them to obtain channel attention weights;
[0044] The channels in the additive-specific feature representation are weighted according to the channel attention weight, highlighting the channel information with higher SERS characteristic peak signals to obtain the channel-enhanced feature representation;
[0045] The spatial attention map is calculated for the channel-enhanced feature representation, and the convolution operation is used to capture the spectral position related information to obtain the spatial attention mask;
[0046] The spatial attention mask is applied to the channel-enhanced feature representation, and the spectral information of the preset target wavenumber position of the additive is filtered through element-wise multiplication operation to obtain the dual attention-enhanced features.
[0047] A soft threshold activation function is applied to the dual attention enhanced features, and a dynamic threshold parameter is set according to the background interference of the food matrix, so that the positions where the feature value is below the threshold are gradually attenuated instead of hard truncated, thus obtaining the filtered features;
[0048] Combining additive-specific feature representation with filtering features, a skip connection is constructed using a weighted sum operation of gating parameters to obtain additive identification features.
[0049] In a second aspect, the present application provides an intelligent detection system for illegal food additives, the intelligent detection system for illegal food additives comprising:
[0050] A reaction module is used to react a silver nitrate solution with a sodium borohydride solution, add calcium chloride to promote hotspot formation, and add potassium iodide to construct a selective coordination layer to suppress interference from citrate ions, thereby obtaining a multi-target surface-enhanced Raman scattering substrate;
[0051] A scanning module is used to extract and process food samples and then inject them into the multi-target surface-enhanced Raman scattering substrate, and use three different wavelength lasers to perform multi-point scanning on the same detection area to obtain a multidimensional spectral data set;
[0052] An extraction module is used to perform wavelet denoising and spectral alignment on the multidimensional spectral dataset, extract key parameters of characteristic peaks at each wavelength and calculate the characteristic peak combination fingerprint to obtain a unique identification feature matrix for each additive;
[0053] The recognition module is used to train an attention neural network with a multi-way parallel structure based on the unique identification feature matrix, and simultaneously identify multiple additives through a feature fusion module and a multi-task learning mechanism to obtain the existence probability and concentration value of each additive.
[0054] In a third aspect, a computer-readable storage medium is provided, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes the above-mentioned intelligent detection method for illegal food additives.
[0055] In the technical solution provided in the present application, by reacting silver nitrate solution with sodium borohydride solution, and innovatively adding calcium chloride to promote hot spot formation and potassium iodide to construct a selective coordination layer to suppress the interference of citrate ions, the key problem of interfering substance signals strongly affecting the detection accuracy in traditional SERS detection is solved, the signal-to-noise ratio of detection is significantly improved, and ultra-high sensitivity detection can be achieved even in complex food matrices, with a detection limit of up to 100 fg / mL, which is significantly better than traditional detection methods; an innovative strategy of multi-point scanning of the same detection area using three different wavelength lasers (532nm, 638nm and 785nm) is used to make full use of the selective enhancement effect of different wavelength lasers on different types of additives, thereby expanding the detection coverage and solving the technical problem that a single wavelength laser is difficult to detect multiple additives, so that a comprehensive multidimensional spectral data set can be obtained in one test; Wavelet noise reduction and spectral alignment technology are used to effectively eliminate the influence of random noise and spectral displacement under different excitation wavelengths, extract key parameters such as the position, intensity, area and half-peak width of the characteristic peaks at each wavelength, and calculate the characteristic peak combination fingerprint. For each additive, at least 5 characteristic peak combinations are constructed as a unique identification feature matrix, which greatly improves the specificity and anti-interference ability of detection; based on the multi-way parallel structure attention neural network trained with the unique identification feature matrix, the advantages of artificial intelligence algorithms in complex pattern recognition are fully utilized. The feature data at different wavelengths are processed separately through three parallel sub-networks. The attention mechanism effectively highlights the characteristic peak information of the additive and suppresses background interference. The adaptive feature fusion module automatically assigns weights of different wavelength features according to the characteristics of the additive. The multi-task learning mechanism optimizes the classification and regression tasks at the same time, enabling the system to detect 30 common illegal food additives at one time, greatly improving the detection efficiency.
[0056] The multi-task learning design also automatically adjusts the weight coefficient according to the degree of hazard of the additive, so that the detection focuses more on high-risk additives; the entire detection process, from sample pretreatment to result output, takes only 15 minutes, achieving the goal of rapid on-site food safety detection. Its application in food safety monitoring can greatly improve supervision efficiency and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0058] Figure 1 This is a schematic diagram of an embodiment of an intelligent detection method for illegal food additives in an embodiment of the present application;
[0059] Figure 2 This is a schematic diagram of an embodiment of an intelligent detection system for illegal food additives in an embodiment of the present application. DETAILED DESCRIPTION
[0060] The embodiments of the present application provide a kind of intelligent detection method, system and storage medium for illegal addition of food. The terms "first", "second", "third", "fourth" etc. (if any) in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe order or precedence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described here can be implemented in a sequence other than that illustrated or described here. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or equipment comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0061] For ease of understanding, the specific process of the embodiment of the present application is described below. Figure 1 In one embodiment of the present application, an intelligent method for detecting illegal food additives includes:
[0062] Step S101: reacting a silver nitrate solution with a sodium borohydride solution, adding calcium chloride to promote hotspot formation, and adding potassium iodide to construct a selective coordination layer to suppress interference from citrate ions, thereby obtaining a multi-target surface-enhanced Raman scattering substrate;
[0063] Step S102: After extracting and processing the food sample, a multi-target surface-enhanced Raman scattering substrate is injected, and three lasers of different wavelengths are used to perform multi-point scanning on the same detection area to obtain a multidimensional spectral data set;
[0064] Step S103: performing wavelet denoising and spectral alignment on the multidimensional spectral dataset, extracting key parameters of characteristic peaks at each wavelength and calculating characteristic peak combination fingerprints to obtain a unique identification feature matrix for each additive;
[0065] Step S104: training an attention neural network with a multi-way parallel structure based on the unique identification feature matrix, and simultaneously identifying multiple additives through a feature fusion module and a multi-task learning mechanism to obtain the presence probability and concentration value of each additive.
[0066] It is understandable that the execution subject of this application can be an intelligent detection system for illegal food additives, or a terminal or a server, which is not limited here. The embodiment of this application is described by taking the server as the execution subject as an example.
[0067] Specifically, a nanosilver sol is prepared by reacting a silver nitrate solution with a sodium borohydride solution. Sodium borohydride acts as a reducing agent to reduce silver ions into nanosilver particles. Calcium chloride solution is then added to promote the self-assembly of the nanosilver particles, forming hotspot structures. Hotspot structures are regions of electromagnetic field enhancement where the nanosilver particles aggregate, and are key to enhancing the SERS signal. Potassium iodide solution is then added, and the iodide ions form a specific coordination layer on the surface of the nanosilver particles. This coordination layer selectively suppresses interference from citrate ions, a common interfering substance in food matrices, whose strong Raman signal often obscures the characteristic peaks of illegal additives. The purified nanosilver sol is then immobilized on a microfluidic substrate to create a multi-target SERS substrate. The food sample is extracted to separate illegal additives. Specifically, the sample is homogenized and sonicated with a mixed extraction solution of acetonitrile and water. Acetonitrile has good solubility for many illegal additives. The treated sample solution is then injected into the microfluidic channels of the SERS substrate, ensuring full contact between the additive molecules in the sample and the nanosilver surface. Subsequently, three different wavelengths of laser light, 532nm, 638nm, and 785nm, were used to perform multi-point scanning on the same detection area. Laser light of different wavelengths has different enhancement effects on different types of illegal additives. Multi-point scanning ensures the representativeness of the detection results, thereby obtaining a multidimensional spectral data set containing information on multiple additives.
[0068] Wavelet denoising of multidimensional spectral datasets utilizes the Daubechies wavelet function to decompose the spectral signal into distinct frequency components. Thresholding is then used to remove high-frequency noise, preserving the valid signal. Spectral alignment utilizes the singular value decomposition algorithm to eliminate the effects of spectral shifts at different excitation wavelengths, ensuring accurate alignment of characteristic peaks at different wavelengths. The position, intensity, area, and half-width (FWHM) of characteristic peaks at each wavelength are extracted from the processed spectra. These parameters collectively constitute the spectral signature of the additive. By calculating the intensity ratios and relative shifts of the same characteristic peaks at different wavelengths, a unique identifier for each additive is established, representing a combination of at least five characteristic peaks, forming a unique identification matrix for the additive. Based on this unique identification matrix, a multi-way parallel attention neural network is trained. This network comprises three parallel subnetworks, each processing data at three wavelengths. Each subnetwork consists of a feature extraction module and an attention module. The attention module acquires channel information through global average pooling and max pooling, while simultaneously acquiring spectral position information through convolution operations, enabling the network to automatically focus on key information corresponding to the characteristic peaks of the additive. The wavelength features are integrated using an adaptive feature fusion module, which calculates weight coefficients and proportionally fuses them. The final output layer of the network contains 30 parallel classification heads, each corresponding to a common illegal additive, and simultaneously outputs the probability of existence and concentration value, optimizing these two objectives simultaneously through a multi-task learning mechanism.
[0069] In a specific embodiment, the process of executing step S101 may specifically include the following steps:
[0070] mixing the silver nitrate solution with deionized water, and stirring at a constant temperature to obtain a reaction solution;
[0071] Adding sodium borohydride solution dropwise to the reaction solution, controlling the dropwise addition rate and maintaining strong stirring, to obtain nanosilver sol;
[0072] adding calcium chloride solution to the nanosilver sol and stirring the solution, so that the calcium ions promote the self-assembly of the nanosilver particles to form a hot spot structure, thereby obtaining an enhanced nanosilver sol;
[0073] adding potassium iodide solution dropwise to the enhanced nanosilver sol and stirring, so that iodide ions form a coordination layer on the surface of the nanosilver particles to obtain a modified nanosilver sol;
[0074] The modified nanosilver sol is centrifuged and washed and redispersed in deionized water to obtain purified nanosilver sol;
[0075] The purified nanosilver sol was added dropwise to the pretreated polydimethylsiloxane microfluidic substrate, and the nanosilver particles were evenly distributed using a vacuum filtration device and then dried to obtain a multi-target surface-enhanced Raman scattering substrate.
[0076] Specifically, the concentration was 1.0×10 -2 A 1.5 mol / L silver nitrate solution and deionized water were mixed in a 1:20 ratio and stirred continuously at a constant temperature of 90°C to form a homogeneous reaction solution. This constant temperature ensured a stable temperature during the reaction, preventing temperature fluctuations that could lead to uneven nanoparticle size. Sodium borohydride solution was then added dropwise to the reaction solution at a controlled rate of 0.2 mL / min and vigorous stirring at 600 rpm. The sodium borohydride solution, acting as a reducing agent, reduced silver ions to silver atoms, which gradually aggregated to form silver nanoparticles. The solution color gradually changed from colorless to yellow to dark yellow, signaling the formation of a silver nanosol. Calcium chloride solution was added to the resulting silver nanosol and stirred for 30 minutes. The calcium ions acted as a bridging agent, connecting the different silver nanoparticles and promoting their self-assembly to form "hotspots." Hotspots are interstitial regions between silver nanoparticles that generate strong electromagnetic field enhancement and are key locations for SERS signal enhancement. These hotspots can enhance the Raman signal of molecules adsorbed on their surfaces by tens of thousands or even millions of times, enabling highly sensitive detection of trace amounts of illegal additives.
[0077] Then, potassium iodide solution was added dropwise to the enhanced nanosilver sol and stirred for 15 minutes. Iodide ions formed a specific coordination layer on the surface of the nanosilver particles through coordination. This coordination layer has a selective inhibition function, especially for suppressing the signals of interfering substances such as citrate ions commonly found in food, while reducing background fluorescence interference. Citrate ions are substances widely present in food. Their Raman signal intensity is strong and can easily mask the characteristic signals of illegal additives. Iodide ion modification can significantly reduce this interference. The modified nanosilver sol was centrifuged and washed at 10,000 rpm for 15 minutes, the supernatant was discarded, and the precipitate was re-dispersed with deionized water. This process was repeated three times to remove by-products and unreacted reagents produced during the reaction to obtain purified nanosilver sol. The purification process ensures the purity and uniformity of the SERS substrate and prevents impurities from interfering with subsequent detection processes.
[0078] Finally, the purified nanosilver sol was dripped onto a pretreated polydimethylsiloxane (PDMS) microfluidic substrate. The PDMS microfluidic substrate had previously been fabricated with a specific microchannel structure using photolithography and soft etching techniques. A vacuum filtration device was used under a negative pressure of 20 kPa to evenly distribute the nanosilver particles across the inner surface of the microfluidic channels. The substrate was then dried at 60°C for 24 hours, completing the preparation of a multi-target surface-enhanced Raman scattering substrate. This substrate integrates microfluidics and SERS detection technology, enabling automated sample introduction, enrichment, and efficient detection.
[0079] In a specific embodiment, the process of executing step S102 may specifically include the following steps:
[0080] Add a mixed extract of acetonitrile and water to the food sample and homogenize it using a high-speed homogenizer to obtain a sample suspension;
[0081] Ultrasonic treatment is performed on the sample suspension to promote the full release of illegal additives from the food matrix to obtain an ultrasonic extract;
[0082] The ultrasonic extraction solution was centrifuged and the supernatant was collected, and then a phosphate buffer was added to adjust the pH value to obtain a treated sample solution;
[0083] Filtering the treated sample solution to remove large particle impurities to obtain a purified sample solution;
[0084] The purified sample solution is injected into the microfluidic channel of the multi-target surface-enhanced Raman scattering substrate, and the flow rate is controlled to ensure full contact between the sample and the substrate to obtain a test sample;
[0085] The samples were tested using three wavelength lasers: 532nm, 638nm, and 785nm. Raman spectra were collected at multiple different sites in the same detection area. Each site was integrated for a fixed time to obtain a multidimensional spectral data set.
[0086] Specifically, 5.00g of the food sample to be tested was taken and 20mL of an extract prepared by mixing acetonitrile and water in a volume ratio of 8:2 was added. Acetonitrile is an organic solvent with good solubility for a variety of illegal additives, while water helps to extract water-soluble additives. The mixture was homogenized for 5 minutes using a high-speed homogenizer with a rotation speed of 10,000rpm. The homogenization process fully crushed the food tissue, increased the contact area, and formed a uniformly dispersed sample suspension. Homogenization is a mechanical crushing technology that dissociates the sample tissue into tiny particles through shear force, increasing the extraction efficiency. The sample suspension was then ultrasonically treated with ultrasound at a frequency of 40kHz for 15 minutes. Ultrasonic waves generate cavitation effects, that is, tiny bubbles formed and collapsed in the liquid, generating strong local impact forces and microjets. These physical effects can further destroy the food matrix structure and promote the release of illegal additives from the complex food matrix, especially some additives bound to protein or fat, to obtain an ultrasonic extract. Ultrasonic treatment is a very effective sample pretreatment technology that can significantly improve extraction efficiency. The ultrasonic extract was centrifuged at 10,000 rpm for 10 minutes. The centrifugal force precipitated the solid particles, while the illegal additives dissolved in the supernatant. The supernatant was carefully collected and pH adjusted with 0.1 mol / L phosphate buffer, keeping the pH within the range of 7.0 ± 0.2 to obtain the treated sample solution. pH adjustment is a critical step, as different illegal additives exhibit different extraction efficiencies and chemical stabilities at different pH levels. Neutral pH conditions favor the stability of most additives.
[0087] The treated sample solution was filtered through a 0.22μm pore size filter membrane to remove large particle impurities and microorganisms remaining in the solution, obtaining a clarified purified sample solution. Membrane filtration is a physical separation method that can effectively remove interfering substances that may affect subsequent detection and improve detection accuracy. The purified sample solution was injected into the microfluidic channel of the multi-target surface-enhanced Raman scattering substrate at a constant flow rate of 10μL / min via a microinjection pump. The flow rate control process utilized the precise fluid control capabilities of microfluidics technology. The lower flow rate ensured that the sample solution was in full contact with the SERS substrate, allowing the illegal additive molecules to be fully adsorbed on the active sites on the surface of the nanosilver particles to obtain the test sample. Spectra of the test samples were collected using a confocal Raman spectrometer equipped with three lasers, using lasers with wavelengths of 532nm, 638nm and 785nm respectively. Raman spectra were collected at 20 different sites in the same detection area, and the integration time for each site was set to 5 seconds. Lasers of different wavelengths have selective enhancement effects on different types of illegal additives. The 532nm laser has a significant enhancement effect on additives containing aromatic ring structures (such as sodium benzoate), the 638nm laser has an excellent enhancement effect on additives containing nitrogen heterocyclic structures (such as melamine), and the 785nm laser has a significant enhancement effect on additives containing sulfur groups (such as thiourea). By using the combination of the three wavelengths, comprehensive coverage of various illegal additives is achieved. Multi-point scanning in the same area can reduce sampling errors and improve the representativeness of the detection. All collected spectral data are wavelength-calibrated and background-subtracted to form a multidimensional spectral data set.
[0088] Taking the detection of salbutamol in meat products as an example, 5 g of meat sample was added to 40 mL of acetonitrile:water (8:2) mixed extract. After high-speed homogenization, ultrasonic extraction, and centrifugation, the supernatant was obtained. The pH was adjusted to 7.0, filtered, and injected into the SERS substrate. The spectrum was collected using three wavelength lasers. Under 638 nm laser excitation, the characteristic peak of salbutamol was at 1085 cm -1 and 1604cm -1 The peaks are clearly visible at 532nm and 785nm, while the intensity of these characteristic peaks is weaker under excitation of 532nm and 785nm. By comparing the spectral characteristics at three wavelengths and combining intensity ratio analysis, the presence of salbutamol can be accurately identified without being interfered by background signals such as fat and protein in the meat matrix, which solves the problems of low specificity and high false positive rate in traditional single wavelength detection.
[0089] In a specific embodiment, the process of executing step S103 may specifically include the following steps:
[0090] Baseline correction is performed on the original spectral data in the multidimensional spectral dataset, and an improved polynomial fitting algorithm is used to determine the effective signal range to obtain the baseline-corrected spectral data.
[0091] The baseline-corrected spectral data were normalized, and the intensity of the strongest peak in each spectrum was selected as the normalization standard to obtain normalized spectral data;
[0092] The normalized spectral data were subjected to wavelet transform denoising, and Daubechies wavelet function and adaptive threshold were selected to obtain the denoised spectral data.
[0093] Perform singular value decomposition (SVD) on the denoised spectral data to align the spectrum, eliminating the influence of spectral shifts at different excitation wavelengths and obtaining aligned multi-wavelength spectral data.
[0094] Extract the position, intensity, area and half-peak width parameters of the characteristic peak at each wavelength from the aligned multi-wavelength spectral data, and calculate the intensity ratio and relative displacement of the same characteristic peak at different wavelengths to obtain the primary eigenvector;
[0095] The characteristic peak combinations of various illegal additives under multi-wavelength excitation are marked according to the primary characteristic vectors. At least 5 characteristic peak combinations are constructed for each additive as a unique identification to obtain a unique identification feature matrix for each additive.
[0096] Specifically, the multidimensional spectral data processing first performs baseline correction on the original spectral data, and adopts an improved polynomial fitting algorithm, which fits the spectral background in an iterative manner. Specifically, the 500-2000cm -1 For data points within the specified range, a fifth-order polynomial function is first used to fit the baseline. The residual between the fitted curve and the original spectrum is calculated. Points with residuals exceeding a set threshold are removed, and the remaining points are then refitted. This process is repeated five times to obtain an accurate baseline curve. This baseline curve is then subtracted from the original spectrum to obtain baseline-corrected spectral data. Baseline correction eliminates baseline shifts caused by background fluorescence and instrument drift, improving the accuracy of peak position and intensity measurements.
[0097] The baseline-corrected spectral data were normalized. First, the strongest peak in each spectrum was identified and its intensity value recorded. Then, the intensity of each point in the entire spectrum was divided by the intensity of the strongest peak, so that the intensity of the strongest peak in the normalized spectrum was unified to 1. Normalization eliminates absolute differences in spectral intensity caused by factors such as laser power fluctuations and sample concentration differences, making spectra acquired under different conditions comparable. Normalization is a necessary step for comparing spectral features from different samples and under different excitation conditions. Wavelet transform denoising was performed on the normalized spectral data. The Daubechies 4 (db4) wavelet function was selected to decompose the spectral signal into four levels of wavelet coefficients: approximate coefficients and detail coefficients. The detail coefficients contain noise information. The adaptive SURE (Stein's Unbiased Risk Estimate) thresholding method was used to determine the threshold for each level of detail coefficients. Coefficients below the threshold were set to zero, and coefficients above the threshold were subjected to soft threshold shrinkage. Finally, the signal was reconstructed to obtain the denoised spectral data. Wavelet denoising effectively removes high-frequency random noise while preserving spectral details, especially the characteristic peaks of weak signals.
[0098] The denoised spectral data requires singular value decomposition (SVD) spectral alignment. First, the 532nm excitation spectrum is selected as the reference spectrum, and the 638nm and 785nm excitation spectra are aligned with the reference spectrum. During the SVD alignment process, the cross-correlation matrix between the spectrum to be aligned and the reference spectrum is calculated. This matrix is subjected to singular value decomposition, the main eigenvectors are extracted, and a wavenumber mapping relationship is established. Then, point-to-point matching is performed using interpolation to eliminate the influence of spectral shifts at different excitation wavelengths, resulting in aligned multi-wavelength spectral data. Spectral alignment ensures the accurate correspondence of the positions of the same characteristic peaks at different wavelengths, laying the foundation for subsequent feature extraction.
[0099] Extract characteristic peak parameters from the aligned multi-wavelength spectral data. Use the peak detection algorithm to first find the local maximum point as the peak position, and then determine the precise position, intensity, half-peak width and peak area of each peak through Gaussian fitting. At the same time, calculate the intensity ratio of the same characteristic peak at different wavelengths (such as I 532 / I 638 , I 638 / I 785 , I 532 / I 785 ) and relative displacement (such as Δν 532-638 , Δν 638-785 , Δν 532-785), these parameters together constitute the primary feature vector. This feature vector contains complete characteristic information about the additive under multi-wavelength excitation and serves as the core data for subsequent identification. The characteristic peak combinations of various illegal additives are labeled based on the primary feature vector. For each additive, at least five highly recognizable characteristic peak combinations that appear at all three wavelengths are selected as its unique identifier, forming a unique identification feature matrix.
[0100] In a specific embodiment, the process of executing step S104 may specifically include the following steps:
[0101] A hierarchical fusion attention network structure was designed, and three parallel sub-networks were constructed to process the feature data at 532nm, 638nm, and 785nm excitation wavelengths respectively, to obtain a wavelength feature extraction network.
[0102] For each sub-network in the wavelength feature extraction network, a feature extraction module and an attention module are constructed. The feature extraction module is composed of a one-dimensional convolutional neural network, and the attention module includes channel attention and spatial attention, thereby obtaining an attention-enhanced feature representation.
[0103] The feature representation of attention enhancement is obtained by global average pooling and maximum pooling to obtain channel information, which is then fused through a multi-layer perceptron. At the same time, spectral position related information is obtained through convolution operations to obtain enhanced features that highlight the characteristic peaks of illegal additives.
[0104] The enhanced features output by the three sub-networks are integrated through the adaptive feature fusion module, the weight coefficient of each wavelength feature is calculated and fused according to the weight ratio to obtain a unified feature representation;
[0105] Based on the unified feature representation, a multi-output classification head is constructed. Each classification head corresponds to a different illegal additive. A total of 30 classification heads work in parallel to obtain the presence probability output layer and concentration estimation output layer of each additive.
[0106] The network is trained using a multi-task loss function, which consists of two parts: classification loss and regression loss. The classification loss uses a weighted binary cross entropy function, and the regression loss uses a weighted mean square error function. The weight coefficient is automatically adjusted according to the degree of hazard of the additive to obtain the existence probability and concentration value of each additive.
[0107] Specifically, a hierarchical fusion attention network structure was designed to address the technical challenges of simultaneous multi-target detection. The network comprises three parallel subnetworks, processing feature data at three excitation wavelengths: 532nm, 638nm, and 785nm. Each subnetwork's input is a uniquely identified feature matrix at the corresponding wavelength, and its output is a wavelength-specific feature representation. This parallel architecture exploits the selective enhancement of different additives by different wavelengths, improving detection comprehensiveness. Within each subnetwork, a feature extraction module and an attention module are further constructed. The feature extraction module consists of three layers of one-dimensional convolutional neural networks with kernel sizes of 5, 3, and 3, respectively, and the number of kernels is 32, 64, and 128. The activation function uses the Reluctant Unit (ReLU) function. This design extracts local feature patterns from spectral data. The attention module comprises two components: channel attention, which focuses on the importance of different feature channels, and spatial attention, which focuses on key regions of the spectral position. The two components combine to form an attention-enhanced feature representation, highlighting the characteristic information of illegal additives.
[0108] The attention-enhanced feature representation is further processed to obtain channel descriptors through global average pooling and maximum pooling. Pooling is a dimensionality reduction operation that extracts feature statistics. Average pooling captures the global distribution of channels, while maximum pooling captures the most salient features. These two descriptors are then fused using a shared multi-layer perceptron. A convolution operation is then performed on the feature map using a 7×7 convolution kernel to capture the spatial relationships between spectral positions. These operations work together to highlight key regions containing the characteristic peaks of illegal additives and suppress background noise, resulting in enhanced features. The enhanced features output by the three sub-networks are then integrated through an adaptive feature fusion module. This module first calculates weight coefficients for each wavelength feature by training a small neural network whose input is the concatenation of the three wavelength features and whose output is three weights, constrained to sum to 1. The features are then weighted and summed proportionally to obtain a unified feature representation. This adaptive fusion approach automatically adjusts weights based on the response characteristics of different additives at different wavelengths, optimizing feature fusion.
[0109] Based on a unified feature representation, a multi-output classification head was constructed, with each head corresponding to a specific illegal additive. A total of 30 heads operated in parallel, each consisting of two branches: a binary classification task for determining the presence of an additive, outputting a probability of presence; and a regression task for predicting the additive's concentration, outputting a concentration value. This multi-head design enables the network to simultaneously identify multiple illegal additives, resolving the issue of traditional methods requiring multiple tests. The network was trained using a multi-task loss function consisting of both classification and regression losses. The classification loss used a weighted binary cross entropy function, while the regression loss used a weighted mean squared error function. The weight coefficients were automatically adjusted based on the additive's hazard level, giving higher weights to more harmful additives. Training was performed using 5,000 samples containing various combinations of food matrices and additives. Mini-batch gradient descent with a batch size of 64 and a learning rate of 0.001 was used for 200 epochs, ultimately resulting in a model that outputs the probability of presence and concentration of each additive.
[0110] In a specific embodiment, the process of executing the step of constructing a multi-output classification head based on the unified feature representation may specifically include the following steps:
[0111] Perform feature decomposition on the unified feature representation to separate the global features from the additive features, and obtain the general feature representation and the additive-related feature representation;
[0112] A shared backbone network is constructed based on the universal feature representation, which consists of three fully connected layers, each followed by a batch normalization layer and a ReLU activation function to obtain deep shared features;
[0113] 30 sub-networks are branched out from the deep shared features, each corresponding to a type of illegal additive. A residual connection structure is used to connect the additive-related feature representation with the deep shared features to obtain the additive-specific feature representation;
[0114] An attention gating mechanism is added to the additive-specific feature representation, and the feature flow is controlled by a soft threshold function to obtain the additive identification feature;
[0115] A dual-output structure is constructed based on the identification features of additives. Branch 1 uses a Sigmoid function to output the probability of the presence of the additive, and branch 2 uses a linear activation function to output the concentration prediction value to obtain the discrimination results of each additive.
[0116] A post-processing algorithm is applied to the discrimination results. False positive detections are eliminated through threshold filtering and correlation analysis. The reliability of the results is evaluated by variance analysis combined with multiple detections to obtain the output of the probability of existence and concentration estimation of each additive.
[0117] Specifically, the feature representation is decomposed into two matrices using a non-negative matrix factorization algorithm: one containing common feature information shared by the food matrix and the other containing feature information specific to each additive. Non-negative matrix factorization is a dimensionality reduction technique that decomposes the original feature matrix V into a W×H matrix, where W is the common feature representation and H is the additive-specific feature representation. The decomposition process minimizes reconstruction error through iterative optimization. This decomposition method effectively separates the background signal of the food matrix from the characteristic signals of the additives, addressing the interference problem of complex food matrices. Based on the decomposed common feature representation, a shared backbone network is constructed. The network consists of three fully connected layers with 256, 128, and 64 nodes, respectively. Each layer is followed by a batch normalization layer and a Reinforced Luminance (ReLU) activation function. Batch normalization is a standardization technique that normalizes the data by calculating the mean and standard deviation of each mini-batch, accelerating network convergence and preventing vanishing gradients. The Reinforced Luminance (ReLU) activation function, defined as f(x) = max(0, x), outputs 0 for negative values and remains unchanged for positive values. It is computationally simple and can mitigate the vanishing gradient problem. This network structure extracts deep shared features in the food matrix through multi-layer nonlinear transformations, laying the foundation for subsequent additive identification.
[0118] Thirty subnetworks branch out from the deep shared features, each corresponding to a common illegal additive, such as melamine, Sudan red, and clenbuterol. Each subnetwork uses a residual connection structure, adding the additive-related feature representation to the deep shared features before passing it through a fully connected network layer. Residual connections are a type of skip connection that effectively solves the vanishing gradient problem of deep networks by directly adding input features to output features, ensuring efficient information transfer. This design enables each subnetwork to utilize common information while focusing on the differential characteristics of specific additives, forming additive-specific feature representations. An attention gating mechanism is added to each additive-specific feature representation, controlling feature flow by introducing a gating unit. This is implemented using a soft threshold function g(x) = α × sigmoid(β × x) × x, where x is the feature value and α and β are learnable parameters that adjust the sensitivity of the gating. The gating mechanism allows important features to pass through and suppresses irrelevant features. It automatically adjusts the importance weights of features for different additives and different food matrices to obtain screened and enhanced additive identification features, thereby improving the accuracy and robustness of recognition.
[0119] A dual-output structure is constructed based on the identification features of additives. Branch 1 uses the Sigmoid function to map the features to between 0 and 1 and output the probability of the presence of the additive; branch 2 uses a linear activation function to predict the concentration of the additive. The Sigmoid function is defined as σ(x) = 1 / (1+e (-x)), maps any real number to the interval (0,1), which is suitable for binary classification tasks; linear activation, that is, f(x) = x, is suitable for regression tasks. This dual-output design can complete qualitative and quantitative detection at the same time, providing comprehensive information for food safety supervision. A post-processing algorithm is applied to the discrimination results. First, the test results with a probability lower than 0.5 are removed through threshold filtering, and then the correlation coefficients between the test results of different additives are calculated to identify and exclude false positive detections. Correlation analysis is based on the coexistence law of additives. Some additives are often used together, while some rarely appear at the same time. Finally, the same sample is tested multiple times, and the mean and standard deviation of the existence probability and concentration value are calculated. The reliability of the results is evaluated by the size of the standard deviation to obtain the final test result.
[0120] In a specific embodiment, the process of adding an attention gating mechanism to the additive-specific feature representation may specifically include the following steps:
[0121] Perform channel attention calculation on the additive-specific feature representation, generate channel descriptors through global average pooling and maximum pooling, and merge them to obtain channel attention weights;
[0122] The channels in the additive-specific feature representation are weighted according to the channel attention weight, highlighting the channel information with higher SERS characteristic peak signals to obtain the channel-enhanced feature representation;
[0123] The spatial attention map is calculated for the channel-enhanced feature representation, and the convolution operation is used to capture the spectral position related information to obtain the spatial attention mask;
[0124] The spatial attention mask is applied to the channel-enhanced feature representation, and the spectral information of the preset target wavenumber position of the additive is filtered through element-wise multiplication operation to obtain the dual attention-enhanced features.
[0125] A soft threshold activation function is applied to the dual attention enhanced features, and a dynamic threshold parameter is set according to the background interference of the food matrix, so that the positions where the feature value is below the threshold are gradually attenuated instead of hard truncated, thus obtaining the filtered features;
[0126] Combining additive-specific feature representation with filtering features, a skip connection is constructed using a weighted sum operation of gating parameters to obtain additive identification features.
[0127] Specifically, channel attention calculation is performed on the additive-specific feature representation, where channels refer to different dimensions of the feature vector, and each dimension corresponds to a different feature in the SERS spectrum. Channel descriptors are generated through global average pooling and maximum pooling. Average pooling calculates the average value of each channel to reflect the overall characteristics of the channel; maximum pooling extracts the maximum value of each channel to highlight significant features. The two descriptors are processed by a shared multi-layer perceptron and added together to generate channel attention weights. The larger the weight value, the more important the information contained in the channel. According to the calculated channel attention weights, each channel in the additive-specific feature representation is weighted, which is mathematically expressed as multiplying the channel weight vector by the feature representation channel by channel. The information of high-weight channels is retained and enhanced, and the information of low-weight channels is suppressed. This processing highlights the channel information with higher SERS characteristic peak signals, such as the 695cm-1 peak unique to melamine. -1 The channel where the peak is located will receive a higher weight, while the channel where the food matrix background signal is located will receive a lower weight, thus obtaining a channel-enhanced feature representation.
[0128] The spatial attention map is calculated for the channel-enhanced feature representation, where space refers to the wavenumber position in the spectrum. A 7×1 convolution kernel is used for the convolution operation. The convolution kernel size is designed to be 7 in order to capture a sufficiently large receptive field to detect characteristic peaks of different widths. The convolution operation is followed by a sigmoid activation function to map the output to between 0 and 1 to generate a spatial attention mask. Spatial attention focuses on the position information in the spectral data. For example, the characteristic peaks of Sudan red are mainly distributed between 1500 and 1600 cm -1 The calculated spatial attention mask is applied to the channel-enhanced feature representation, and element-wise multiplication is used to accurately filter the spectral information at specific wavenumber positions. Element-wise multiplication involves multiplying the values at corresponding positions. Information at positions with mask values close to 1 is largely retained, while information at positions close to 0 is significantly suppressed. This operation strengthens the wavenumber positions where the additive's characteristic peaks reside, while weakening information at other positions, resulting in a dual-attention-enhanced feature that considers both channel importance and spatial position importance.
[0129] A soft threshold activation function is applied to the features enhanced by dual attention. The soft threshold function takes the form f(x) = sign(x) · max(|x| - θ, 0), where x is the feature value, θ is the dynamic threshold parameter, and sign(x) maintains the sign of the input. Unlike hard thresholding, which directly truncates the feature value, soft thresholding allows the feature value to change gradually as it deviates from the threshold, allowing for a smooth transition. The threshold parameter θ is automatically adjusted based on the background interference level of the food matrix, setting a higher threshold for samples with strong background interference and a lower threshold for samples with weak background interference. Through soft thresholding, noise and interference features below the threshold are smoothly suppressed, resulting in filtered features.
[0130] Finally, the additive-specific feature representation is combined with the filtered features using a weighted summation operation: Output = α·FilteredFeature + (1-α)·OriginalFeature, where Output is the final additive-specific feature, FilteredFeature is the filtered feature after dual attention and soft thresholding, and OriginalFeature is the original additive-specific feature representation. α is a gating parameter that controls the ratio of the two features to be fused, ranging from 0 to 1. When the value of α is close to 1, the final feature primarily retains the filtered information; when the value of α is close to 0, the final feature primarily retains the original feature information. In practical applications, the value of α is typically set to around 0.7, which preserves the enhanced effect of the filtered features on the additive characteristic peaks while avoiding information loss that may result from over-filtering. This skip connection structure ensures that important information is not completely lost during the filtering process while retaining the advantages of the filtered features, ultimately resulting in an additive-specific feature with strong discriminative capabilities.
[0131] The above describes the intelligent detection method for illegal food additives in the embodiment of the present application. The following describes the intelligent detection system for illegal food additives in the embodiment of the present application. Figure 2 In one embodiment of the present application, an intelligent detection system for illegal food additives includes:
[0132] Reaction module 201 is used to react a silver nitrate solution with a sodium borohydride solution, add calcium chloride to promote hotspot formation, and add potassium iodide to construct a selective coordination layer to suppress interference from citrate ions, thereby obtaining a multi-target surface-enhanced Raman scattering substrate;
[0133] Scanning module 202 is used to extract and process food samples and then inject them into a multi-target surface-enhanced Raman scattering substrate, using three different wavelength lasers to perform multi-point scanning on the same detection area to obtain a multi-dimensional spectral data set;
[0134] Extraction module 203, for performing wavelet denoising and spectral alignment on the multidimensional spectral dataset, extracting key parameters of characteristic peaks at each wavelength and calculating characteristic peak combination fingerprints to obtain a unique identification feature matrix for each additive;
[0135] The recognition module 204 is used to train an attention neural network with a multi-way parallel structure based on the unique identification feature matrix, and simultaneously identify multiple additives through a feature fusion module and a multi-task learning mechanism to obtain the presence probability and concentration value of each additive.
[0136] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. The computer-readable storage medium stores instructions, which, when executed on a computer, cause the computer to execute the steps of the intelligent detection method for illegal food additives.
[0137] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems, systems and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0138] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions to enable an intelligent detection device for illegal food additives (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0139] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. An intelligent detection method for illegal food additives, characterized in that: The method comprises: Silver nitrate solution was reacted with sodium borohydride solution, calcium chloride was added to promote the formation of hot spots, and potassium iodide was added to construct a selective coordination layer to suppress the interference of citrate ions, thus obtaining a multi-target surface-enhanced Raman scattering substrate. After extracting and processing the food sample, the multi-target surface-enhanced Raman scattering substrate is injected, and three different wavelength lasers are used to perform multi-point scanning on the same detection area to obtain a multidimensional spectral data set; Performing wavelet denoising and spectral alignment on the multidimensional spectral dataset, extracting key parameters of characteristic peaks at each wavelength and calculating characteristic peak combination fingerprints to obtain a unique identification feature matrix for each additive; Based on the unique identification feature matrix, an attention neural network with a multi-path parallel structure is trained, and multiple additives are simultaneously identified through a feature fusion module and a multi-task learning mechanism to obtain the existence probability and concentration value of each additive.
2. The intelligent detection method for illegal food additives according to claim 1, characterized in that: The method comprises reacting a silver nitrate solution with a sodium borohydride solution, adding calcium chloride to promote hotspot formation, and adding potassium iodide to construct a selective coordination layer to suppress interference from citrate ions, thereby obtaining a multi-target surface-enhanced Raman scattering substrate, comprising: mixing the silver nitrate solution with deionized water, and stirring at a constant temperature to obtain a reaction solution; adding sodium borohydride solution dropwise to the reaction solution, controlling the dropping rate and maintaining strong stirring to obtain nanosilver sol; adding a calcium chloride solution to the nano-silver sol and stirring the solution, so that the calcium ions promote the self-assembly of the nano-silver particles to form a hot spot structure, thereby obtaining an enhanced nano-silver sol; adding potassium iodide solution dropwise to the enhanced nano-silver sol and stirring, so that iodide ions form a coordination layer on the surface of the nano-silver particles to obtain a modified nano-silver sol; The modified nanosilver sol is centrifuged and washed and redispersed in deionized water to obtain purified nanosilver sol; The purified nanosilver sol is added dropwise onto a pretreated polydimethylsiloxane microfluidic substrate, and a vacuum filtration device is used to uniformly distribute the nanosilver particles, followed by drying to obtain the multi-target surface-enhanced Raman scattering substrate.
3. The intelligent detection method for illegal food additives according to claim 1, characterized in that: The food sample is extracted and processed, and then injected into the multi-target surface-enhanced Raman scattering substrate. Three lasers with different wavelengths are used to perform multi-point scanning on the same detection area to obtain a multidimensional spectral data set, including: Add a mixed extract of acetonitrile and water to the food sample and homogenize it using a high-speed homogenizer to obtain a sample suspension; Ultrasonic treatment is performed on the sample suspension to promote the full release of illegal additives from the food matrix to obtain an ultrasonic extract; Centrifuging the ultrasonic extract and collecting the supernatant, then adding phosphate buffer to adjust the pH value to obtain a treated sample solution; Filtering the treated sample solution to remove large particle impurities to obtain a purified sample solution; Injecting the purified sample solution into the microfluidic channel of the multi-target surface-enhanced Raman scattering substrate, controlling the flow rate to ensure full contact between the sample and the substrate, and obtaining a test sample; The detection samples were respectively subjected to three wavelength lasers of 532 nm, 638 nm and 785 nm, and Raman spectra were collected at multiple different sites in the same detection area. Each site was integrated for a fixed time to obtain the multidimensional spectral data set.
4. The intelligent detection method for illegal food additives according to claim 1, characterized in that: The multidimensional spectral data set is subjected to wavelet denoising and spectral alignment, key parameters of characteristic peaks at each wavelength are extracted, and characteristic peak combination fingerprints are calculated to obtain a unique identification feature matrix for each additive, including: performing baseline correction on the original spectral data in the multidimensional spectral dataset, determining the effective signal range using an improved polynomial fitting algorithm, and obtaining spectral data after baseline correction; Normalizing the baseline-corrected spectral data, selecting the intensity of the strongest peak in each spectrum as a normalization standard, and obtaining normalized spectral data; Performing wavelet transform noise reduction processing on the normalized spectral data, selecting Daubechies wavelet function and adaptive threshold, to obtain spectral data after noise reduction; Performing singular value decomposition (SVD) spectral alignment on the denoised spectral data to eliminate the influence of spectral shifts at different excitation wavelengths, thereby obtaining aligned multi-wavelength spectral data; Extracting the position, intensity, area, and half-peak width parameters of the characteristic peak at each wavelength from the aligned multi-wavelength spectral data, and calculating the intensity ratio and relative displacement of the same characteristic peak at different wavelengths to obtain a primary eigenvector; The characteristic peak combinations of various illegal additives under multi-wavelength excitation are marked according to the primary characteristic vectors, and at least 5 characteristic peak combinations are constructed for each additive as a unique identifier to obtain a unique identification feature matrix for each additive.
5. The intelligent detection method for illegal food additives according to claim 1, characterized in that: The method of training an attention neural network with a multi-path parallel structure based on the unique identification feature matrix, and simultaneously identifying multiple additives through a feature fusion module and a multi-task learning mechanism to obtain the presence probability and concentration value of each additive includes: A hierarchical fusion attention network structure was designed, and three parallel sub-networks were constructed to process the feature data at 532nm, 638nm, and 785nm excitation wavelengths respectively, to obtain a wavelength feature extraction network. A feature extraction module and an attention module are constructed for each sub-network in the wavelength feature extraction network, wherein the feature extraction module is composed of a one-dimensional convolutional neural network, and the attention module includes channel attention and spatial attention, to obtain an attention-enhanced feature representation; The attention-enhanced feature representation is obtained by obtaining channel information through global average pooling and maximum pooling, which is then fused through a multi-layer perceptron. At the same time, spectral position related information is obtained through a convolution operation to obtain enhanced features that highlight the characteristic peaks of illegal additives. The enhanced features output by the three sub-networks are integrated through an adaptive feature fusion module, the weight coefficients of the features of each wavelength are calculated and fused according to the weight ratio to obtain a unified feature representation; Based on the unified feature representation, a multi-output classification head is constructed, each classification head corresponds to a type of illegal additive, and a total of 30 classification heads work in parallel to obtain an output layer of the probability of existence and the concentration estimation output layer of each additive; The network is trained using a multi-task loss function, which includes two parts: classification loss and regression loss. The classification loss adopts a weighted binary cross entropy function, and the regression loss adopts a weighted mean square error function. The weight coefficient is automatically adjusted according to the degree of hazard of the additive to obtain the existence probability and concentration value of each additive.
6. The intelligent detection method for illegal food additives according to claim 5, characterized in that: The multi-output classification head is constructed based on the unified feature representation. Each classification head corresponds to a type of illegal additive. A total of 30 classification heads work in parallel to obtain the presence probability output layer and concentration estimation output layer of each additive, including: Performing feature decomposition on the unified feature representation to separate global features from additive features to obtain a general feature representation and an additive-related feature representation; Building a shared backbone network based on the universal feature representation, comprising three fully connected layers, each followed by a batch normalization layer and a ReLU activation function, to obtain deep shared features; 30 sub-networks are branched from the deep shared features, each corresponding to a type of illegal additive, and a residual connection structure is used to connect the additive-related feature representation with the deep shared features to obtain the additive-specific feature representation; Adding an attention gating mechanism to the additive-specific feature representation, controlling feature flow through a soft threshold function, and obtaining additive identification features; A dual-output structure is constructed based on the additive identification features. Branch 1 uses a Sigmoid function to output the probability of the additive's presence, and branch 2 uses a linear activation function to output the concentration prediction value to obtain the discrimination results of each additive. A post-processing algorithm is applied to the discrimination results to eliminate false positive detections through threshold filtering and correlation analysis, and the reliability of the results is evaluated by variance analysis combined with multiple detections to obtain the output of the probability of existence and concentration estimation of each additive.
7. The intelligent detection method for illegal food additives according to claim 6, characterized in that: The method of adding an attention gating mechanism to the additive-specific feature representation and controlling the feature flow through a soft threshold function to obtain the additive identification feature includes: Perform channel attention calculation on the additive-specific feature representation, generate channel descriptors through global average pooling and maximum pooling, and merge them to obtain channel attention weights; The channels in the additive-specific feature representation are weighted according to the channel attention weight, highlighting the channel information with higher SERS characteristic peak signals to obtain the channel-enhanced feature representation; The spatial attention map is calculated for the channel-enhanced feature representation, and the convolution operation is used to capture the spectral position related information to obtain the spatial attention mask; The spatial attention mask is applied to the channel-enhanced feature representation, and the spectral information of the preset target wavenumber position of the additive is filtered through element-wise multiplication operation to obtain the dual attention-enhanced features. A soft threshold activation function is applied to the dual attention enhanced features, and a dynamic threshold parameter is set according to the background interference of the food matrix, so that the positions where the feature value is below the threshold are gradually attenuated instead of hard truncated, thus obtaining the filtered features; Combining additive-specific feature representation with filtering features, a skip connection is constructed using a weighted sum operation of gating parameters to obtain additive identification features.
8. An intelligent detection system for illegal food additives, characterized in that: For implementing the intelligent detection method for illegal food additives according to any one of claims 1 to 7, the intelligent detection system for illegal food additives comprises: A reaction module is used to react a silver nitrate solution with a sodium borohydride solution, add calcium chloride to promote hotspot formation, and add potassium iodide to construct a selective coordination layer to suppress interference from citrate ions, thereby obtaining a multi-target surface-enhanced Raman scattering substrate; A scanning module is used to extract and process food samples and then inject them into the multi-target surface-enhanced Raman scattering substrate, and use three different wavelength lasers to perform multi-point scanning on the same detection area to obtain a multidimensional spectral data set; An extraction module is used to perform wavelet denoising and spectral alignment on the multidimensional spectral dataset, extract key parameters of characteristic peaks at each wavelength and calculate the characteristic peak combination fingerprint to obtain a unique identification feature matrix for each additive; The recognition module is used to train an attention neural network with a multi-way parallel structure based on the unique identification feature matrix, and simultaneously identify multiple additives through a feature fusion module and a multi-task learning mechanism to obtain the existence probability and concentration value of each additive.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the processor is caused to execute the intelligent detection method for illegal food additives according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method for rapidly identifying true and false pesticides based on portable differential Raman technology
CN110736728A
Recombinant beef detection system based on Raman scattering imaging technology
CN115096868A
Intelligent protein detection method, device and equipment based on Raman spectrum signal
CN116297400A
Method for detecting unconventional additives in gasoline
CN117589711A
Method and device for detecting forbidden articles in complex environment based on multi-scale feature fusion
CN117765378A
Cited By
An intelligent water quality monitoring method based on multi-dimensional spectral technology
CN122451821A
