Intelligent detection method and system for illegal addition of food and storage medium
Patent Information
- Application Number
- CN202510681944.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-26
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2045-05-26
AI Technical Summary
[0005]本申请提供了一种用于食品非法添加的智能检测方法、系统及存储介质,用于解决SERS技术在食品安全检测中受柠檬酸盐等干扰物质影响导致检测灵敏度和特异性不足的问题,突破了传统方法难以同时检测多种食品非法添加物的技术瓶颈,克服了现有技术中缺乏智能化数据处理导致检测结果准确性和效率低下的难题
[0055]The technical solution provided in this application solves the key problem of strong interference signals affecting detection accuracy in traditional SERS detection 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 that inhibits citrate ion interference. This significantly improves the signal-to-noise ratio, enabling ultra-high sensitivity detection even in complex food matrices, with a detection limit of up to 100 fg/mL, which is far superior to traditional detection methods. The innovative strategy of using three different wavelength lasers (532 nm, 638 nm, and 785 nm) to scan the same detection area at multiple points fully utilizes the selective enhancement effect of different wavelength lasers on different types of additives, expanding the detection coverage and solving the technical problem that a single wavelength laser cannot simultaneously detect multiple additives. This allows for the acquisition of a comprehensive multidimensional spectral dataset in a single detection. The multidimensional spectral dataset should be... Wavelet denoising and spectral alignment techniques effectively eliminate the influence of random noise and spectral shifts under different excitation wavelengths. Key parameters such as the position, intensity, area, and half-peak width of characteristic peaks at each wavelength are extracted, and characteristic peak combination fingerprints are calculated. At least five characteristic peak combinations are constructed as unique identifier feature matrices for each additive, greatly improving the specificity and anti-interference capability of detection. A multi-parallel attention neural network trained based on the unique identifier feature matrix fully leverages the advantages of artificial intelligence algorithms in complex pattern recognition. Three parallel sub-networks process feature data at different wavelengths respectively. The attention mechanism effectively highlights the characteristic peak information of the additive and suppresses background interference. The adaptive feature fusion module automatically assigns weights to features at different wavelengths according to the additive characteristics. A multi-task learning mechanism simultaneously optimizes classification and regression tasks, enabling the system to detect 30 common illegal food additives simultaneously, significantly improving detection efficiency.
Smart Images

Figure CN120594481B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of intelligent detection, in particular to an intelligent detection method and system for illegal food additives and a storage medium. BACKGROUND
[0002] Food safety problems are increasingly serious, and the detection of illegal additives is an important part of food safety supervision. Traditional detection methods include gas chromatography-mass spectrometry, high-performance liquid chromatography-tandem mass spectrometry, etc. Although these methods have high detection accuracy, they are expensive, complex to operate, and have a long detection period, and cannot achieve on-site rapid detection. Surface-enhanced Raman scattering (SERS) technology is gradually applied to the field of food safety detection due to its high sensitivity, rapid non-destructive and molecular fingerprint identification characteristics.
[0003] However, the existing SERS detection technology has many technical deficiencies. First, the food matrix is complex, and the strong interference signal produced by common components such as citrate ions seriously affects the detection accuracy and accuracy. Second, the traditional SERS substrate has large differences in enhancement effect for different types of additives, making it difficult to meet the demand for simultaneous detection of multiple additives. Third, the existing SERS spectral data processing method mainly relies on single-wavelength excitation and simple peak identification, which lacks specificity and is easily disturbed by the matrix. Finally, the interpretation of the detection results usually relies on artificial experience judgment, and lacks intelligent and automated data processing and decision-making methods.
[0004] Traditional single SERS substrate cannot effectively suppress the signal of interfering substances in complex food matrix, resulting in limited detection sensitivity and specificity. The spectral data information of single-wavelength excitation is limited, and cannot fully characterize the characteristics of different additives. The existing feature extraction method does not fully utilize the multi-dimensional spectral information, and it is difficult to construct a unique identification feature of the additive. The traditional data analysis method cannot simultaneously process the detection task of multiple additives, and needs to be detected multiple times, which is low in efficiency and easy to produce cross interference. SUMMARY
[0005] The present application provides an intelligent detection method and system for illegal food additives and a storage medium, which solves the problem of insufficient detection sensitivity and specificity caused by the influence of citrate and other interfering substances on SERS technology in food safety detection, breaks through the technical bottleneck of traditional methods that cannot 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 prior art.
[0006] In a first aspect, the application provides an intelligent detection method for illegal addition of food, which comprises: reacting silver nitrate solution with sodium borohydride solution, adding calcium chloride to promote hot spot formation, adding potassium iodide to construct a selective coordination layer to inhibit the interference of citrate ions, and obtaining a multi-target surface-enhanced Raman scattering substrate; after extracting and processing a food sample, injecting the multi-target surface-enhanced Raman scattering substrate, using three different wavelength lasers to perform multi-point scanning on the same detection area, and obtaining a multi-dimensional spectral data set; performing wavelet denoising and spectral alignment on the multi-dimensional spectral data set, extracting the key parameters of the characteristic peaks at each wavelength, and calculating the characteristic peak combination fingerprint to obtain a unique identification characteristic matrix of each additive; training an attention neural network with a multi-channel parallel structure based on the unique identification characteristic matrix, simultaneously identifying multiple additives through a feature fusion module and a multi-task learning mechanism, and obtaining the existence probability and concentration value of each additive.
[0007] Optionally, the reaction of silver nitrate solution with sodium borohydride solution, the addition of calcium chloride to promote hot spot formation, and the addition of potassium iodide to construct a selective coordination layer to inhibit the interference of citrate ions to obtain a multi-target surface-enhanced Raman scattering substrate comprises:
[0008] Mixing silver nitrate solution with deionized water under constant temperature conditions to obtain a reaction liquid;
[0009] Adding sodium borohydride solution dropwise to the reaction liquid, controlling the dropwise addition rate and maintaining strong stirring to obtain a nanosilver sol;
[0010] Adding calcium chloride solution to the nanosilver sol and stirring to promote the self-assembly of nanosilver particles to form hot spot structures, and obtaining an enhanced nanosilver sol;
[0011] Adding potassium iodide solution dropwise to the enhanced nanosilver sol and stirring to form a coordination layer of iodine ions on the surface of nanosilver particles, and obtaining a modified nanosilver sol;
[0012] Centrifuging and washing the modified nanosilver sol and redispersing it in deionized water to obtain a purified nanosilver sol;
[0013] Adding the purified nanosilver sol dropwise to a pretreated polydimethylsiloxane microfluidic substrate, uniformly distributing the nanosilver particles using a vacuum filtration device, and drying to obtain the multi-target surface-enhanced Raman scattering substrate.
[0014] Optionally, after extracting and processing a food sample, injecting the multi-target surface-enhanced Raman scattering substrate, using three different wavelength lasers to perform multi-point scanning on the same detection area, and obtaining a multi-dimensional spectral data set, comprises:
[0015] A mixed extract of acetonitrile and water was added to the food sample, and homogenized using a high-speed homogenizer to obtain a sample suspension.
[0016] The sample suspension was subjected to ultrasonic treatment to promote the full release of illegal additives from the food matrix, resulting in an ultrasonic extract.
[0017] The ultrasonic extract was centrifuged and the supernatant was collected. Then, phosphate buffer was added to adjust the pH value to obtain the processed sample solution.
[0018] The processed sample solution is filtered to remove large particulate impurities, resulting in a purified sample solution.
[0019] 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 that the sample and the substrate are in full contact, thereby obtaining the detection sample;
[0020] The test sample was subjected to Raman spectroscopy at three wavelengths: 532nm, 638nm, and 785nm. Multiple different sites were selected in the same detection area for Raman spectroscopy acquisition. The integration time was fixed for each site to obtain the multidimensional spectral dataset.
[0021] Optionally, the step of 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 identifier feature matrix for each additive includes:
[0022] 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.
[0023] The baseline-corrected spectral data is normalized, and the intensity of the strongest peak in each spectrum is selected as the normalization standard to obtain normalized spectral data.
[0024] The normalized spectral data is subjected to wavelet transform denoising processing. The Daubechies wavelet function and adaptive threshold are selected to obtain the denoised spectral data.
[0025] Singular value decomposition and spectral alignment are performed on the denoised spectral data to eliminate the influence of spectral shift under different excitation wavelengths, resulting in aligned multi-wavelength spectral data.
[0026] The position, intensity, area, and half-width of the characteristic peaks at each wavelength are extracted from the aligned multi-wavelength spectral data, and the intensity ratio and relative shift of the same characteristic peaks at different wavelengths are calculated to obtain the primary feature vector.
[0027] Based on the primary feature vector, the characteristic peak combinations of various illegal additives under multi-wavelength excitation are marked. At least 5 characteristic peak combinations are constructed for each additive as unique identifiers, and a unique identifier feature matrix for each additive is obtained.
[0028] Optionally, the training of an attention neural network with a multi-path parallel structure based on the unique identifier feature matrix, and the simultaneous identification of 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:
[0029] A hierarchical fusion attention network structure was designed, and three parallel sub-networks were constructed to process feature data under excitation wavelengths of 532nm, 638nm and 785nm respectively, resulting in a wavelength feature extraction network.
[0030] For each sub-network in the wavelength feature extraction network, a feature extraction module and an attention module are constructed respectively. 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 attention-enhanced feature representation.
[0031] The attention-enhanced feature representation obtains channel information through global average pooling and max pooling, which is then fused after passing through a multilayer perceptron. Simultaneously, spectral position-related information is obtained through convolution operations to obtain enhanced features that highlight the characteristic peaks of illegal additives.
[0032] The enhanced features output from the three sub-networks are integrated through an adaptive feature fusion module. The weight coefficients of each wavelength feature 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, with each classification head corresponding to one illegal additive. A total of 30 classification heads work in parallel to obtain the existence probability output layer and concentration estimation output layer for each additive.
[0034] 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 coefficients are automatically adjusted based on the degree of harm of the additives to obtain the probability of presence and concentration of each additive.
[0035] Optionally, the construction of a multi-output classification head based on the unified feature representation, with each classification head corresponding to one illegal additive, and a total of 30 classification heads working in parallel, yields an output layer for the presence probability of each additive and a concentration estimation output layer, including:
[0036] The unified feature representation is decomposed to separate the global features from the additive features, resulting in a general feature representation and an additive-related feature representation.
[0037] Based on the general feature representation, a shared backbone network is constructed, which includes three fully connected layers. Each layer is followed by a batch normalization layer and a ReLU activation function to obtain deep shared features.
[0038] Thirty sub-networks are branched from the deep shared features, each sub-network corresponding to an illegal additive. The additive-related feature representations are connected to the deep shared features using a residual connection structure to obtain additive-specific feature representations.
[0039] 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 additive identification features;
[0040] Based on the additive identification features, a dual-output structure is constructed. Branch 1 uses the Sigmoid function to output the probability of additive presence, and Branch 2 uses the linear activation function to output the concentration prediction value, thus obtaining the discrimination result of each additive.
[0041] The discrimination results are applied to a post-processing algorithm to eliminate false positives through threshold filtering and correlation analysis. The reliability of the results is evaluated by combining multiple tests with variance analysis, and the probability output of the presence of each additive and the concentration estimate output are obtained.
[0042] Optionally, the addition of an attention gating mechanism to the additive-specific feature representation, controlling feature flow through a soft threshold function to obtain additive identification features, includes:
[0043] Channel attention calculation is performed on the additive-specific feature representation. Channel descriptors are generated and merged through global average pooling and max pooling to obtain channel attention weights.
[0044] The channel in the additive-specific feature representation is weighted according to the channel attention weight to highlight the channel information with higher SERS feature peak signal, thus obtaining a channel-enhanced feature representation.
[0045] The spatial attention map is calculated from the feature representation of the channel enhancement, and the spatial attention mask is obtained by capturing spectral position-related information using convolution operations.
[0046] Spatial attention masks are applied to the feature representation of channel enhancement, and spectral information of the preset target wavenumber position of the additive is filtered through element-wise multiplication operations to obtain features with dual attention enhancement.
[0047] By applying a soft-threshold activation function to the features enhanced by dual attention, and setting a dynamic threshold parameter for food matrix background interference, the feature values below the threshold are gradually attenuated rather than hard-truncated, thus obtaining filtered features.
[0048] By combining additive-specific feature representation and filtering features, a skip connection is constructed using a weighted summation operation of gating parameters to obtain additive identification features.
[0049] Secondly, this application provides an intelligent detection system for illegal food additives, the intelligent detection system for illegal food additives comprising:
[0050] The reaction module is used to react silver nitrate solution and sodium borohydride solution. Calcium chloride is added to promote hot spot formation, and potassium iodide is added to construct a selective coordination layer that suppresses citrate ion interference, thus obtaining a multi-target surface-enhanced Raman scattering substrate.
[0051] The scanning module is used to extract and process food samples and then inject them into the multi-target surface-enhanced Raman scattering substrate. It uses three different wavelength lasers to perform multi-point scanning on the same detection area to obtain a multi-dimensional spectral dataset.
[0052] The 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 identifier feature matrix for each additive.
[0053] The identification module is used to train an attention neural network with a multi-path parallel structure based on the unique identifier feature matrix. Through the feature fusion module and the multi-task learning mechanism, it can simultaneously identify multiple additives and obtain the presence probability and concentration value of each additive.
[0054] Thirdly, a computer-readable storage medium is provided, wherein instructions are stored therein, which, when executed on a computer, cause the computer to perform the aforementioned intelligent detection method for illegal food additives.
[0055] The technical solution provided in this application solves the key problem of strong interference signals affecting detection accuracy in traditional SERS detection 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 that inhibits citrate ion interference. This significantly improves the signal-to-noise ratio, enabling ultra-high sensitivity detection even in complex food matrices, with a detection limit of up to 100 fg / mL, which is far superior to traditional detection methods. The innovative strategy of using three different wavelength lasers (532 nm, 638 nm, and 785 nm) to scan the same detection area at multiple points fully utilizes the selective enhancement effect of different wavelength lasers on different types of additives, expanding the detection coverage and solving the technical problem that a single wavelength laser cannot simultaneously detect multiple additives. This allows for the acquisition of a comprehensive multidimensional spectral dataset in a single detection. The multidimensional spectral dataset should be... Wavelet denoising and spectral alignment techniques effectively eliminate the influence of random noise and spectral shifts under different excitation wavelengths. Key parameters such as the position, intensity, area, and half-peak width of characteristic peaks at each wavelength are extracted, and characteristic peak combination fingerprints are calculated. At least five characteristic peak combinations are constructed as unique identifier feature matrices for each additive, greatly improving the specificity and anti-interference capability of detection. A multi-parallel attention neural network trained based on the unique identifier feature matrix fully leverages the advantages of artificial intelligence algorithms in complex pattern recognition. Three parallel sub-networks process feature data at different wavelengths respectively. The attention mechanism effectively highlights the characteristic peak information of the additive and suppresses background interference. The adaptive feature fusion module automatically assigns weights to features at different wavelengths according to the additive characteristics. A multi-task learning mechanism simultaneously optimizes classification and regression tasks, enabling the system to detect 30 common illegal food additives simultaneously, significantly improving detection efficiency.
[0056] The multi-task learning design also automatically adjusts the weight coefficients according to the degree of hazard of additives, making the detection more focused 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 detection of food safety, and can greatly improve regulatory efficiency and accuracy when applied to food safety monitoring. Attached Figure Description
[0057] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0058] Figure 1 This is a schematic diagram of one embodiment of the intelligent detection method for illegal food additives in this application.
[0059] Figure 2 This is a schematic diagram of one embodiment of an intelligent detection system for illegal food additives in this application. Detailed Implementation
[0060] This application provides an intelligent detection method, system, and storage medium for the illegal addition of substances to food. The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and accompanying drawings are used to distinguish similar objects and are not necessarily used to describe order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein. Furthermore, the terms "comprising" or "having" and any variations thereof are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0061] For ease of understanding, the specific process of the embodiments of this application is described below. Please refer to [link / reference]. Figure 1 One embodiment of the intelligent detection method for illegal food additives in this application includes:
[0062] Step S101: React silver nitrate solution with sodium borohydride solution, add calcium chloride to promote hot spot formation, add potassium iodide to construct a selective coordination layer to suppress citrate ion interference, and obtain a multi-target surface-enhanced Raman scattering substrate.
[0063] Step S102: After extracting and processing the food sample, inject it into a 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 dataset.
[0064] Step S103: 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 identifier feature matrix for each additive.
[0065] Step S104: Train an attention neural network with a multi-path parallel structure based on the unique identifier feature matrix. Through the feature fusion module and multi-task learning mechanism, identify multiple additives simultaneously and obtain the presence probability and concentration value of each additive.
[0066] It is understood that the executing entity of this application can be an intelligent detection system for illegal food additives, or it can be a terminal or a server; no specific limitation is made here. This application's embodiment uses a server as an example for illustration.
[0067] Specifically, a silver nanoparticle sol was prepared by reacting silver nitrate solution with sodium borohydride solution. Sodium borohydride, acting as a reducing agent, reduced silver ions to silver nanoparticles. Calcium chloride solution was then added to promote the self-assembly of the silver nanoparticles, forming a hotspot structure. This hotspot structure refers to the electromagnetic field enhancement region formed by the aggregation of silver nanoparticles, a key site for SERS signal enhancement. Potassium iodide solution was then added, causing iodide ions to form a specific coordination layer on the surface of the silver nanoparticles. This coordination layer selectively inhibits interference from citrate ions, a common food additive. Citrate ions are prevalent interferences in food matrices, and their strong Raman signals often mask the characteristic peaks of illegal additives. The purified silver nanoparticle sol was then immobilized on a microfluidic substrate to create a multi-target SERS substrate. Food samples were extracted to separate illegal additives. Specifically, the samples were homogenized and sonicated using a mixture of acetonitrile and water. Acetonitrile has good solubility for many illegal additives. The treated sample solution was injected into the microfluidic channels of the SERS substrate, ensuring sufficient contact between the additive molecules and the silver nanoparticle surface. Subsequently, three different wavelength lasers of 532nm, 638nm and 785nm were used to perform multi-point scanning on the same detection area. Different wavelength lasers have different enhancement effects on different types of illegal additives, and multi-point scanning ensures the representativeness of the detection results, thereby obtaining a multidimensional spectral dataset containing information on multiple additives.
[0068] Wavelet denoising of the multidimensional spectral dataset utilizes the Daubechies wavelet function to decompose the spectral signal into different frequency components. High-frequency noise is removed through thresholding, preserving the effective signal. Spectral alignment employs singular value decomposition (SVD) to eliminate the influence of spectral shifts at different excitation wavelengths, ensuring accurate correspondence of characteristic peaks at different wavelengths. The position, intensity, area, and half-peak width (HWHM) of characteristic peaks at each wavelength are extracted from the processed spectrum. These parameters collectively constitute the spectral features of the additive. By calculating the intensity ratio and relative shift of the same characteristic peaks at different wavelengths, a unique identifier is established for each additive, consisting of at least five characteristic peak combinations, forming a unique identifier feature matrix. Based on this unique identifier feature matrix, a multi-path parallel attention neural network is trained. This network comprises three parallel sub-networks processing data at three different wavelengths. Each sub-network consists of a feature extraction module and an attention module. The attention module acquires channel information through global average pooling and max pooling, and simultaneously obtains spectral position-related information through convolution operations, enabling the network to automatically focus on key information corresponding to the additive's characteristic peaks. The features at each wavelength are integrated through an adaptive feature fusion module, which calculates weight coefficients and fuses them proportionally. The final output layer of the network contains 30 parallel classification heads, each corresponding to a common illegal additive, and outputs the probability of presence and concentration values. The two objectives are optimized simultaneously through a multi-task learning mechanism.
[0069] In one specific embodiment, the process of performing step S101 may specifically include the following steps:
[0070] Silver nitrate solution was mixed with deionized water and stirred under constant temperature to obtain a reaction solution;
[0071] Sodium borohydride solution was added dropwise to the reaction solution, the dropping rate was controlled and strong stirring was maintained to obtain nano-silver sol;
[0072] Add calcium chloride solution to the silver nanoparticle sol and stir to allow calcium ions to promote the self-assembly of silver nanoparticles to form hot spot structures, thus obtaining an enhanced silver nanoparticle sol.
[0073] Potassium iodide solution was added dropwise to the enhanced silver nanoparticle sol and stirred to form a coordination layer of iodine ions on the surface of the silver nanoparticles, thus obtaining the modified silver nanoparticle sol.
[0074] The modified silver nanoparticle sol was centrifuged, washed, and redispersed in deionized water to obtain purified silver nanoparticle sol.
[0075] Purified silver nanoparticles were dropped onto a pretreated polydimethylsiloxane microfluidic substrate. After uniform distribution of the silver nanoparticles using a vacuum filtration device, the substrate was dried to obtain a multi-target surface-enhanced Raman scattering substrate.
[0076] Specifically, the concentration is 1.0 × 10 -2 A mol / L silver nitrate solution was mixed with deionized water at a ratio of 1:20 and continuously stirred at a constant temperature of 90℃ to form a homogeneous reaction solution. The constant temperature condition ensured temperature stability during the reaction, preventing temperature fluctuations that could lead to uneven nanoparticle size. Subsequently, sodium borohydride solution was added dropwise to the reaction solution at a controlled dropping rate of 0.2 mL / min while maintaining vigorous stirring at 600 rpm. Sodium borohydride, 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 deep yellow, marking the formation of a silver nanoparticle sol. Calcium chloride solution was then added to the formed silver nanoparticle sol and stirred for 30 minutes. Calcium ions acted as a bridging agent, connecting different silver nanoparticles and promoting the self-assembly of the nanoparticles to form "hot spot" structures. Hot spot structures refer to the interstitial regions between silver nanoparticles; these regions generate a strong electromagnetic field enhancement effect and are key locations for SERS signal enhancement. It is these hot spot regions that can enhance the Raman signal of molecules adsorbed on their surface by tens of thousands or even millions of times, thereby achieving highly sensitive detection of trace amounts of illegal additives.
[0077] Next, potassium iodide solution was added dropwise to the enhanced silver nanoparticle sol and stirred for 15 minutes. Iodide ions formed a specific coordination layer on the surface of the silver nanoparticles through coordination. This coordination layer has a selective inhibition function, specifically suppressing the signals of interfering substances such as citrate ions commonly found in food, while reducing background fluorescence interference. Citrate ions are widely present in food and have a strong Raman signal intensity, which can easily mask the characteristic signals of illegal additives. Iodide modification can significantly reduce this interference. The modified silver nanoparticle sol was centrifuged and washed at 10,000 rpm for 15 minutes. The supernatant was discarded, and the precipitate was redispersed with deionized water. This process was repeated three times to remove byproducts and unreacted reagents generated during the reaction, resulting in purified silver nanoparticle sol. The purification process ensured the purity and homogeneity of the SERS substrate and avoided impurities interfering with subsequent detection processes.
[0078] Finally, the purified silver nanoparticle sol was dropped onto a pretreated polydimethylsiloxane (PDMS) microfluidic substrate. The PDMS microfluidic substrate had a specific microchannel structure pre-fabricated using photolithography and soft etching techniques. A vacuum filtration device was used to uniformly distribute the silver nanoparticles on the inner surface of the microfluidic channels under a negative pressure of 20 kPa. The substrate was then dried at 60°C for 24 hours to complete the preparation of the multi-target surface-enhanced Raman scattering (SERS) substrate. This substrate integrates microfluidic technology and SERS detection technology, enabling automated sample introduction, enrichment, and efficient detection.
[0079] In one specific embodiment, the process of performing step S102 may specifically include the following steps:
[0080] A mixed extract of acetonitrile and water was added to the food sample, and homogenized using a high-speed homogenizer to obtain a sample suspension.
[0081] The sample suspension was subjected to ultrasonic treatment to promote the full release of illegal additives from the food matrix, resulting in an ultrasonic extract.
[0082] The ultrasonic extract was centrifuged and the supernatant was collected. Then, phosphate buffer was added to adjust the pH value to obtain the processed sample solution.
[0083] The processed sample solution is filtered to remove large particulate impurities, resulting in 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 that the sample and the substrate are in full contact, thus obtaining the detection sample;
[0085] Three wavelength lasers of 532nm, 638nm and 785nm were used to collect Raman spectra at multiple different sites in the same detection area. The integration time at each site was fixed to obtain a multidimensional spectral dataset.
[0086] Specifically, 5.00g of the food sample to be tested was taken and 20mL of an extraction solution prepared by mixing acetonitrile and water in a volume ratio of 8:2 was added. Acetonitrile is an organic solvent with good solubility for many illegal additives, while water helps in the extraction of water-soluble additives. The mixture was homogenized for 5 minutes using a high-speed homogenizer at 10,000 rpm. The homogenization process thoroughly breaks down the food tissue, increases the contact area, and forms a uniformly dispersed sample suspension. Homogenization is a mechanical disruption technique that uses shear force to dissociate the sample tissue into tiny particles, increasing extraction efficiency. Subsequently, the sample suspension was ultrasonically treated with ultrasound at a frequency of 40kHz for 15 minutes. Ultrasound generates cavitation effects—the formation and collapse of tiny bubbles in the liquid—producing strong local impact forces and microjets. These physical effects further disrupt the food matrix structure, promoting the release of illegal additives from the complex food matrix, especially some additives bound to proteins or fats, resulting in an ultrasonic extract. Ultrasonic treatment is a very effective sample pretreatment technique that can significantly improve extraction efficiency. The ultrasonic extract was centrifuged at 10,000 rpm for 10 minutes. Centrifugation caused the solid particles to precipitate, while the illicit additives dissolved in the supernatant. The supernatant was carefully collected, and 0.1 mol / L phosphate buffer was added to adjust the pH, maintaining it within the range of 7.0 ± 0.2, to obtain the processed sample solution. pH adjustment is a crucial step because different illicit additives exhibit varying extraction efficiencies and chemical stability under different pH conditions. Neutral pH conditions are conducive to the stable existence of most additives.
[0087] The processed sample solution was filtered through a 0.22 μm pore size membrane to remove residual large particulate impurities and microorganisms, resulting in a clear and purified sample solution. Membrane filtration is a physical separation method that effectively removes interfering substances that may affect subsequent detection, improving detection accuracy. The purified sample solution was injected into the microfluidic channel of a multi-target surface-enhanced Raman scattering (SERS) substrate at a constant flow rate of 10 μL / min using a microinjection pump. The controlled flow rate utilizes the precise fluid control capabilities of microfluidics; the low flow rate ensures sufficient contact between the sample solution and the SERS substrate, allowing illegally added molecules to fully adsorb onto the active sites on the surface of the silver nanoparticles, thus obtaining the detection sample. The samples were sampled using a confocal Raman spectrometer equipped with three lasers: 532 nm, 638 nm, and 785 nm. Twenty different sites within the same detection area were selected for Raman spectral acquisition, with an integration time of 5 seconds per site. Different laser wavelengths exhibited selective enhancement effects on different types of illegal additives. The 532 nm laser showed significant enhancement for additives containing aromatic ring structures (such as sodium benzoate), the 638 nm laser showed excellent enhancement for additives containing nitrogen-containing heterocyclic structures (such as melamine), and the 785 nm laser showed significant enhancement for additives containing sulfur groups (such as thiourea). The combined use of these three wavelengths achieved comprehensive coverage of various illegal additives. Multi-point scanning within the same area reduced sampling errors and improved the representativeness of the detection. All acquired spectral data were wavelength-calibrated and background-subtracted to form a multidimensional spectral dataset.
[0088] Taking the detection of salbutamol in meat products as an example, 5g of meat sample was added to 40mL of acetonitrile:water (8:2) mixed extraction solution. After high-speed homogenization, ultrasonic extraction, and centrifugation, the supernatant was obtained. The pH was adjusted to 7.0, filtered, and injected into a SERS substrate. The spectrum was collected using three wavelength lasers. Under 638nm laser excitation, the characteristic peak of salbutamol was at 1085cm⁻¹. -1 and 1604cm -1 The characteristic peaks are clearly visible, but the intensity of these characteristic peaks is weaker under excitation at 532nm and 785nm. By comparing the spectral characteristics under the three wavelengths and combining the intensity ratio analysis, the presence of salbutamol can be accurately identified without being interfered with by background signals such as fat and protein in the meat matrix. This solves the problems of low specificity and high false positive rate in traditional single-wavelength detection.
[0089] In one 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 was subjected to wavelet transform denoising. The Daubechies wavelet function and adaptive threshold were selected to obtain the denoised spectral data.
[0093] Singular value decomposition and spectral alignment are performed on the denoised spectral data to eliminate the influence of spectral shift under different excitation wavelengths and obtain aligned multi-wavelength spectral data.
[0094] The position, intensity, area, and half-width of characteristic peaks at each wavelength are extracted from the aligned multi-wavelength spectral data. The intensity ratio and relative shift of the same characteristic peak at different wavelengths are calculated to obtain the primary feature vector.
[0095] Based on the primary feature vector, the characteristic peak combinations of various illegal additives under multi-wavelength excitation are marked. At least 5 characteristic peak combinations are constructed for each additive as unique identifiers, and a unique identifier feature matrix for each additive is obtained.
[0096] Specifically, the multidimensional spectral data processing first performs baseline correction on the original spectral data, then employs an improved polynomial fitting algorithm. This algorithm iteratively fits the spectral background, specifically selecting a range of 500-2000 cm⁻¹. -1 For data points within the specified range, a 5th-order polynomial function is first used to fit the baseline. The residual between the fitted curve and the original spectrum is calculated, and points with residuals exceeding a set threshold are removed. Then, the remaining points are used to refit the spectrum. This process is iterated five times to obtain an accurate baseline curve. The original spectrum is then subtracted from this baseline curve to obtain the 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 was 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 uniformly 1. Normalization eliminates the difference in absolute spectral intensity caused by factors such as laser power fluctuations and sample concentration differences, making the spectra acquired under different conditions comparable. Normalization is a necessary step for comparing the spectral characteristics of 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, including approximation 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 of each level of detail coefficients. Coefficients below the threshold were set to zero, and coefficients above the threshold were subjected to soft thresholding. Finally, the signal was reconstructed to obtain the denoised spectral data. Wavelet denoising can effectively remove high-frequency random noise while preserving the detailed features of the spectrum, 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 SVD alignment, the cross-correlation matrix between the spectrum to be aligned and the reference spectrum is calculated. Singular value decomposition is then performed on this matrix to extract the main eigenvectors, establishing a wavenumber mapping relationship. Point-to-point matching is then performed using interpolation methods to eliminate the influence of spectral shifts at different excitation wavelengths, resulting in aligned multi-wavelength spectral data. Spectral alignment ensures accurate correspondence of the same characteristic peak positions at different wavelengths, laying the foundation for subsequent feature extraction.
[0099] Characteristic peak parameters are extracted from aligned multi-wavelength spectral data. A peak detection algorithm is used to first locate local maxima as peak positions, and then Gaussian fitting is applied to determine the precise position, intensity, half-width at half-maximum (WHM), and peak area of each peak. Simultaneously, the intensity ratios of the same characteristic peaks at different wavelengths (e.g., Ig) are calculated. 532 / I 638 I 638 / I 785 I 532 / I 785 ) and relative displacement (such as Δν) 532-638 ,Δν 638-785 ,Δν 532-785These parameters together constitute the primary feature vector. The feature vector contains complete feature information of the additive under multi-wavelength excitation and is the core data for subsequent identification. Based on the primary feature vector, the feature peak combinations of various illegal additives are marked. For each additive, at least 5 feature peak combinations that appear under all three wavelengths and have high identifiability are selected as its unique identifier, forming a unique identifier feature matrix.
[0100] In one 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 feature data under excitation wavelengths of 532nm, 638nm and 785nm respectively, resulting in a wavelength feature extraction network.
[0102] For each subnetwork 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, resulting in attention-enhanced feature representation.
[0103] The attention-enhanced feature representation obtains channel information through global average pooling and max pooling, and then fuses it after passing through a multilayer perceptron. At the same time, it obtains spectral position-related information through convolution operation to obtain enhanced features that highlight the feature peaks of illegal additives.
[0104] The enhanced features output from the three sub-networks are integrated through an adaptive feature fusion module. The weight coefficients of each wavelength feature are calculated and fused according to the weight ratio to obtain a unified feature representation.
[0105] Based on a unified feature representation, a multi-output classification head is constructed, with each classification head corresponding to one illegal additive. A total of 30 classification heads work in parallel to obtain the existence probability output layer and concentration estimation output layer for 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 coefficients are automatically adjusted based on the degree of harm of the additives, thus obtaining the probability of presence and concentration of each additive.
[0107] Specifically, a hierarchical fusion attention network structure was designed to address the technical challenge of simultaneous multi-target detection. This network comprises three parallel sub-networks, processing feature data from three excitation wavelengths: 532nm, 638nm, and 785nm. Each sub-network's input is a unique identifier feature matrix for its corresponding wavelength, and its output is a wavelength-specific feature representation. This parallel structure design leverages the selective enhancement properties of different wavelengths for different additives, improving detection comprehensiveness. Each sub-network further incorporates a feature extraction module and an attention module. The feature extraction module consists of three one-dimensional convolutional neural networks with kernel sizes of 5, 3, and 3, and the number of kernels being 32, 64, and 128, respectively. The ReLU activation function is used, enabling the extraction of local feature patterns from spectral data. The attention module includes channel attention and spatial attention. Channel attention focuses on the importance of different feature channels, while spatial attention focuses on key regions of the spectral location. The combination of these two components forms an attention-enhanced feature representation, highlighting the characteristic information of illegal additives.
[0108] The attention-enhanced feature representation is further processed by obtaining channel descriptors through global average pooling and max pooling operations. Pooling is a dimensionality reduction operation that can extract statistical information of features. Average pooling captures the global distribution of channels, while max pooling captures the most salient features. These two descriptors are fused after being processed by a shared multilayer perceptron. Simultaneously, a 7×7 convolution kernel is used to perform convolution operations on the feature map to capture the spatial relationships of spectral positions. These operations work together to highlight the key regions where the feature peaks of illegal additives are located, suppress background noise interference, and obtain enhanced features. The enhanced features output from the three sub-networks are integrated through an adaptive feature fusion module. This module first calculates the weight coefficients of each wavelength feature. Specifically, it trains a small neural network whose input is the concatenation of the three wavelength features, and whose output is three weight values, satisfying the constraint that the weights sum to 1. Then, the features are weighted and summed according to the weight ratio to obtain a unified feature representation. This adaptive fusion method can automatically adjust the weights according to the response characteristics of different additives at different wavelengths, optimizing the feature fusion effect.
[0109] A multi-output classification head is constructed based on a unified feature representation. Each classification head corresponds to one illegal additive, with a total of 30 classification heads working in parallel. Each classification head contains two branches: a binary classification task to determine the presence of the additive, outputting the probability of presence; and a regression task to predict the additive concentration, outputting the concentration value. This multi-head design enables the network to simultaneously identify multiple illegal additives, solving the problem of traditional methods requiring multiple detections. The entire network is trained using a multi-task loss function, which includes classification loss and regression loss. The classification loss uses a weighted binary cross-entropy function, and the regression loss uses a weighted mean squared error function. The weight coefficients are automatically adjusted according to the degree of harm of the additives, giving higher weights to additives with greater harm. During training, 5000 samples containing various food matrices and additive combinations are used, employing mini-batch gradient descent with a batch size of 64 and a learning rate of 0.001, for 200 training epochs, ultimately resulting in a model that can output the probability of presence and concentration value of each additive.
[0110] In one specific embodiment, the process of constructing a multi-output classification head based on the unified feature representation can specifically include the following steps:
[0111] The unified feature representation is decomposed to separate global features from additive features, resulting in a general feature representation and an additive-related feature representation.
[0112] A shared backbone network is constructed based on general feature representation, consisting of three fully connected layers, each followed by a batch normalization layer and a ReLU activation function, to obtain deep shared features.
[0113] Thirty sub-networks are branched from the deep shared features, each sub-network corresponding to an illegal additive. The additive-related feature representations are connected with the deep shared features using a residual connection structure to obtain additive-specific feature representations.
[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 additive identification features;
[0115] A dual-output structure is constructed based on the additive identification features. Branch 1 uses the Sigmoid function to output the probability of additive presence, and Branch 2 uses the linear activation function to output the concentration prediction value, thus obtaining the discrimination results for each additive.
[0116] A post-processing algorithm is applied to the discrimination results. False positives are eliminated through threshold filtering and correlation analysis. The reliability of the results is evaluated by combining multiple tests with variance analysis, and the probability output of the presence of each additive and the concentration estimate output are obtained.
[0117] Specifically, the feature representation is decomposed into two matrices using a nonnegative matrix factorization (NMF) algorithm. One matrix contains common feature information shared by the food matrix, while the other contains feature information specific to each additive. NMF is a dimensionality reduction technique that decomposes the original feature matrix V into W×H, where W is the common feature representation and H is the additive-related feature representation. The decomposition process minimizes the reconstruction error through iterative optimization. This decomposition method effectively separates the background signal of the food matrix from the feature signal of the additives, solving the problem of interference from complex food matrices. A shared backbone network is constructed based on the common feature representation obtained from the decomposition. This network contains three fully connected layers with 256, 128, and 64 nodes, respectively. Each layer is followed by a batch normalization layer and a ReLU activation function. Batch normalization is a standardization technique that standardizes the data by calculating the mean and standard deviation of each mini-batch, accelerating network convergence and preventing gradient vanishing. The ReLU activation function is defined as f(x) = max(0,x), which outputs 0 for negative values and remains unchanged for positive values. It has the advantages of simple computation and mitigating the gradient vanishing problem. This network structure extracts deep shared features from the food matrix through multi-layer nonlinear transformation, laying the foundation for subsequent additive identification.
[0118] Thirty subnetworks branch from deep shared features, each corresponding to a common illegal additive, such as melamine, Sudan Red, and clenbuterol. Each subnetwork employs a residual connection structure, adding the additive-related feature representation to the deep shared features before passing it through a fully connected layer. Residual connections are a type of skip connection that effectively solves the gradient vanishing problem in deep networks by directly adding input features to output features, ensuring effective information transfer. This design allows each subnetwork to utilize common information while also focusing on the specific additive-specific features, forming additive-specific feature representations. An attention gating mechanism is added to each additive-specific feature representation, controlling feature flow through gating units. Specifically, a soft thresholding function g(x) = α × sigmoid(β × x) × x is used, where x is the feature value, and α and β are learnable parameters that adjust the gating sensitivity. The gating mechanism allows important features to pass through while suppressing irrelevant features. It automatically adjusts the importance weight of features for different additives and different food matrices, resulting in screened and enhanced additive identification features, which improves the accuracy and robustness of identification.
[0119] A dual-output structure is constructed based on additive identification features. Branch 1 uses the Sigmoid function to map the features to the range of 0-1, outputting the probability of additive presence. Branch 2 uses a linear activation function to predict the additive concentration. The Sigmoid function is defined as σ(x) = 1 / (1+e^(-x)). (-x)The dual-output design maps any real number to the (0,1) interval, suitable for binary classification tasks; linear activation, i.e., f(x) = x, is suitable for regression tasks. This dual-output design can simultaneously perform qualitative and quantitative detection, providing comprehensive information for food safety supervision. A post-processing algorithm is applied to the discrimination results. First, threshold filtering removes detection results with probabilities below 0.5. Then, by calculating the correlation coefficient between detection results of different additives, false positives are identified and excluded. Correlation analysis is based on the co-existence patterns of additives; some additives are usually used together, while others almost never appear simultaneously. Finally, multiple tests are performed on the same sample, and the mean and standard deviation of the probability of presence and concentration values are calculated. The reliability of the results is evaluated by the magnitude of the standard deviation, yielding the final detection result.
[0120] In one specific embodiment, the process of adding an attention gating mechanism to the additive-specific feature representation may specifically include the following steps:
[0121] Channel attention calculation is performed on the additive-specific feature representation. Channel descriptors are generated and merged through global average pooling and max pooling to obtain channel attention weights.
[0122] The channel in the additive-specific feature representation is weighted according to the channel attention weight to highlight the channel information with higher SERS feature peak signal, thus obtaining a channel-enhanced feature representation.
[0123] The spatial attention map is calculated from the feature representation of the channel enhancement, and the spatial attention mask is obtained by capturing spectral position-related information using convolution operations.
[0124] Spatial attention masks are applied to the feature representation of channel enhancement, and spectral information of the preset target wavenumber position of the additive is filtered through element-wise multiplication operations to obtain features with dual attention enhancement.
[0125] By applying a soft-threshold activation function to the features enhanced by dual attention, and setting a dynamic threshold parameter for food matrix background interference, the feature values below the threshold are gradually attenuated rather than hard-truncated, thus obtaining filtered features.
[0126] By combining additive-specific feature representation and filtering features, a skip connection is constructed using a weighted summation operation of gating parameters to obtain additive identification features.
[0127] Specifically, channel attention calculation is performed on the additive-specific feature representation. Here, "channel" refers to different dimensions of the feature vector, each corresponding to a different feature in the SERS spectrum. Channel descriptors are generated through global average pooling and max pooling. Average pooling calculates the average value of each channel, reflecting the overall characteristics of the channel; max pooling extracts the maximum value of each channel, highlighting salient features. The two descriptors are then added after processing by a shared multilayer perceptron to generate channel attention weights. The larger the weight value, the more important the information contained in the channel. Based on the calculated channel attention weights, each channel in the additive-specific feature representation is weighted. Mathematically, this is represented by multiplying the channel weight vector with the feature representation channel by channel. Information from high-weight channels is preserved and enhanced, while information from low-weight channels is suppressed. This process highlights the information of channels with higher SERS characteristic peak signals, such as the 695 cm⁻¹ peak characteristic of melamine. -1 The channel containing the peak will receive a higher weight, while the channel containing the food matrix background signal will receive a lower weight, thus obtaining a channel-enhanced feature representation.
[0128] Spatial attention maps are calculated for the channel-enhanced feature representation, where "spatial" refers to the wavenumber positions in the spectrum. A 7×1 convolution kernel is used for the convolution operation; the kernel size of 7 is designed to capture a sufficiently large receptive field to detect feature peaks of different widths. A sigmoid activation function is then applied after the convolution operation to map the output to the range of 0-1, generating a spatial attention mask. Spatial attention focuses on positional information in the spectral data; for example, the characteristic peaks of Sudan Red are mainly distributed in the 1500-1600 cm⁻¹ range. -1 The region in question receives a high weight in the spatial attention mask. The calculated spatial attention mask is applied to the feature representation for channel enhancement, achieving precise filtering of spectral information at specific wavenumber positions through element-wise multiplication. Element-wise multiplication involves multiplying the values at corresponding positions; positions with mask values close to 1 are largely preserved, while those close to 0 are significantly suppressed. This operation enhances the wavenumber positions containing additive characteristic peaks, while weakening information at other positions, resulting in a dual attention-enhanced feature that considers both channel and spatial importance.
[0129] A soft-threshold activation function is applied to the features enhanced by dual attention. The soft-threshold function has 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, soft thresholding allows the feature value to gradually change with its difference from the threshold, providing a smooth transition space for the feature value. The threshold parameter θ is automatically adjusted according to the background interference level of the food matrix; a higher threshold is set for samples with strong background interference, and a lower threshold is set 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 feature using a weighted summation operation: Output = α·FilteredFeature + (1-α)·OriginalFeature, where Output is the final additive identification feature, FilteredFeature is the filtered feature after dual attention and soft thresholding, OriginalFeature is the original additive-specific feature representation, and α is a gating parameter controlling the fusion ratio of the two features, ranging from 0 to 1. When the α value is close to 1, the final feature mainly retains the filtered information; when the α value is close to 0, the final feature mainly retains the original feature information. In practical applications, the α value is usually set to around 0.7, which preserves the enhancement effect of the filtered feature on the additive feature peaks while avoiding information loss that may be caused by 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 feature, ultimately resulting in additive identification features with strong discriminative capabilities.
[0131] The above describes the intelligent detection method for illegal food additives in the embodiments of this application. The following describes the intelligent detection system for illegal food additives in the embodiments of this application. Please refer to [link / reference]. Figure 2 One embodiment of the intelligent detection system for illegal food additives in this application includes:
[0132] Reaction module 201 is used to react silver nitrate solution and sodium borohydride solution, add calcium chloride to promote hot spot formation, add potassium iodide to construct a selective coordination layer to suppress citrate ion interference, and obtain a multi-target surface-enhanced Raman scattering substrate.
[0133] The scanning module 202 is used to extract and process food samples and then inject them into a multi-target surface-enhanced Raman scattering substrate. It uses three different wavelength lasers to perform multi-point scanning on the same detection area to obtain a multi-dimensional spectral dataset.
[0134] Extraction module 203 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 identifier feature matrix for each additive;
[0135] The identification module 204 is used to train an attention neural network with a multi-path parallel structure based on a unique identifier feature matrix. It simultaneously identifies multiple additives through a feature fusion module and a multi-task learning mechanism, and obtains the presence probability and concentration value of each additive.
[0136] The present invention also provides a computer-readable storage medium, which can be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when the instructions are executed on a computer, cause the computer to perform the steps of the intelligent detection method for illegal food additives.
[0137] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0138] If the integrated unit is implemented as 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, in essence, 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. This computer software product is stored in a storage medium and includes several instructions to cause an intelligent detection device (which may be a personal computer, server, or network device, etc.) for detecting illegal food additives to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0139] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for intelligent detection of illegal additives in food, characterized in that, The method comprises: reacting silver nitrate solution with sodium borohydride solution, adding calcium chloride to promote hot spot formation, adding potassium iodide to build a selective coordination layer to inhibit the interference of citrate ions, and obtaining a multi-target surface enhanced Raman scattering substrate; after extracting and processing the food sample, injecting the multi-target surface enhanced Raman scattering substrate, using three different wavelengths of laser to perform multi-point scanning on the same detection area, and obtaining a multi-dimensional spectral data set; performing wavelet denoising and spectral alignment on the multi-dimensional spectral data set, extracting the key parameters of the characteristic peaks at each wavelength, and calculating the characteristic peak combination fingerprint to obtain a unique identification feature matrix of each additive, including: performing baseline correction on the original spectral data in the multi-dimensional spectral data set, determining the effective signal range by using an improved polynomial fitting algorithm to obtain the baseline-corrected spectral data; performing normalization processing on the baseline-corrected spectral data, selecting the intensity of the strongest peak in each spectrum as the normalization standard to obtain normalized spectral data; performing wavelet transform denoising processing on the normalized spectral data, selecting a Daubechies wavelet function and an adaptive threshold to obtain denoised spectral data; performing singular value decomposition spectral alignment on the denoised spectral data to eliminate the influence of spectral displacement under different excitation wavelengths to obtain aligned multi-wavelength spectral data; extracting the position, intensity, area and half-peak width parameters of the characteristic peaks at each wavelength from the aligned multi-wavelength spectral data, and calculating the intensity ratio and relative displacement of the same characteristic peaks under different wavelengths to obtain a primary characteristic vector; according to the primary characteristic vector, marking the characteristic peak combination of each illegal additive under multi-wavelength excitation, constructing at least 5 characteristic peak combinations as unique identification for each additive to obtain the unique identification feature matrix of each additive. The attention neural network with a multi-path parallel structure is trained based on the unique identification feature matrix, and a plurality of 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, including: a hierarchical fusion attention network structure is designed, three parallel sub-networks are constructed to process feature data under excitation wavelengths of 532 nm, 638 nm and 785 nm 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, the attention module includes channel attention and spatial attention, and an attention-enhanced feature representation is obtained; channel information is obtained by global average pooling and maximum pooling on the attention-enhanced feature representation, and the channel information is fused after passing through a multi-layer perceptron, and spectral position-related information is obtained through convolution operation to obtain enhanced features highlighting illegal additive feature peaks; the enhanced features output by the three sub-networks are integrated through an adaptive feature fusion module, the weight coefficients of the wavelength features are calculated and fused in proportion to the weight, and a unified feature representation is obtained; a multi-output classification head is constructed based on the unified feature representation, each classification head corresponds to one kind of illegal additive, and a total of 30 classification heads work in parallel to obtain an existence probability output layer and a concentration estimation output layer of each additive; the network is trained using a multi-task loss function, the loss function includes two parts of classification loss and regression loss, the classification loss uses a weighted binary cross-entropy function, the regression loss uses a weighted mean square error function, and the weight coefficients are automatically adjusted according to the harm degree of the additive to obtain the existence probability and concentration value of each additive.
2. The intelligent detection method for illegal addition of food according to claim 1, characterized in that, The silver nitrate solution and the sodium borohydride solution are reacted, calcium chloride is added to promote hot spot formation, and potassium iodide is added to build a selective coordination layer to inhibit the interference of citrate ions, to obtain a multi-target surface enhanced Raman scattering substrate, including: Mixing the silver nitrate solution with deionized water under constant temperature conditions to obtain a reaction solution; Adding the sodium borohydride solution dropwise to the reaction solution, controlling the dropwise speed and keeping strong stirring to obtain a nano-silver sol; Adding a calcium chloride solution to the nano-silver sol and stirring to make calcium ions promote the self-assembly of nano-silver particles to form a hot spot structure to obtain an enhanced nano-silver sol; Adding a potassium iodide solution dropwise to the enhanced nano-silver sol and stirring to make iodine ions form a coordination layer on the surface of the nano-silver particles to obtain a modified nano-silver sol; Centrifugal washing the modified nano-silver sol and redispersing it in deionized water to obtain a purified nano-silver sol; Dropping the purified nano-silver sol onto a pretreated polydimethylsiloxane microfluidic substrate, uniformly distributing the nano-silver particles using a vacuum filtration device, and drying to obtain the multi-target surface enhanced Raman scattering substrate.
3. The intelligent detection method for illegal addition of food according to claim 1, characterized in that, After extracting and processing the food sample, injecting the multi-target surface enhanced Raman scattering substrate into the same detection area, and using three different wavelengths of laser to perform multi-point scanning to obtain a multi-dimensional spectral data set, including: A mixture of acetonitrile and water is added to the food sample, and a high-speed homogenizer is used to homogenize the sample to obtain a sample suspension; The sample suspension is subjected to ultrasonic treatment to promote the complete release of the illegally added substances from the food matrix, and an ultrasonic extraction solution is obtained; The ultrasonic extraction solution is subjected to centrifugal separation and the supernatant is collected, and then a phosphate buffer is added to adjust the pH value, and a treated sample solution is obtained; The treated sample solution is filtered to remove large particle impurities, and a purified sample solution is obtained; 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 sufficient contact between the sample and the substrate, and a detection sample is obtained; The detection sample is subjected to Raman spectrum collection at multiple different sites in the same detection area using three wavelengths of 532 nm, 638 nm and 785 nm laser, and each site is integrated for a fixed time to obtain the multi-dimensional spectrum data set.
4. The intelligent detection method for illegal addition of food according to claim 1, characterized in that, Based on the unified feature representation, a multi-output classification head is constructed, each classification head corresponds to one illegally added substance, and a total of 30 classification heads work in parallel to obtain the existence probability output layer and the concentration estimation output layer of each added substance, including: The unified feature representation is decomposed into global features and added substance features to obtain general feature representation and added substance related feature representation; Based on the general feature representation, a shared backbone network is constructed, which includes three fully connected layers, each followed by a batch normalization layer and a ReLU activation function, to obtain deep shared features; From the deep shared features, 30 sub-networks are branched out, each corresponding to one illegally added substance, and a residual connection structure is used to connect the added substance related feature representation and the deep shared feature to obtain added substance specific feature representation; An attention gate mechanism is added to the added substance specific feature representation to control the flow of features through a soft threshold function to obtain added substance recognition features; Based on the added substance recognition features, a double-output structure is constructed, branch one uses a Sigmoid function to output the existence probability of the added substance, and branch two uses a linear activation function to output the concentration prediction value, to obtain the discrimination result of each added substance; A post-processing algorithm is applied to the discrimination result to eliminate false positive detections through threshold filtering and correlation analysis, and the reliability of the result is evaluated through variance analysis of multiple detections to obtain the existence probability output and the concentration estimation output of each added substance.
5. The intelligent detection method for illegal addition of food according to claim 4, characterized in that, The added substance specific feature representation is added with an attention gate mechanism, and the flow of features is controlled through a soft threshold function to obtain added substance recognition features, including: Channel attention calculation is performed on the added substance specific feature representation to generate channel descriptors through global average pooling and maximum pooling and to combine them to obtain channel attention weights; According to the channel attention weights, each channel in the added substance specific feature representation is weighted to highlight the channel information with high SERS feature peak signal, and a channel enhanced feature representation is obtained; A spatial attention map is calculated for the channel enhanced feature representation to capture spectral position related information through convolution operation to obtain a spatial attention mask; The spatial attention mask is applied to the channel-enhanced feature representation to screen the spectral information of the additive preset target wavenumber position through an element-level multiplication operation, obtaining a double-attention-enhanced feature; A soft threshold activation function is applied to the double-attention-enhanced feature, a dynamic threshold parameter is set for the food matrix background interference, and the positions with feature values lower than the threshold are gradually attenuated rather than hard cut-off, obtaining a filtered feature; The additive-specific feature representation and the filtered feature are combined, a weighted sum operation of the gating parameter is used to construct a skip connection, and an additive recognition feature is obtained.
6. An intelligent detection system for illegal addition of food, characterized in that, The intelligent detection system for illegal additives in food for implementing the intelligent detection method for illegal additives in food according to any one of claims 1-5 comprises: a reaction module for reacting silver nitrate solution and sodium borohydride solution, adding calcium chloride to promote hot spot formation, adding potassium iodide to build a selective coordination layer to inhibit the interference of citrate ions, and obtaining a multi-target surface-enhanced Raman scattering substrate; a scanning module for injecting the multi-target surface-enhanced Raman scattering substrate after extraction treatment of the food sample, and using three different wavelengths of laser to perform multi-point scanning on the same detection area to obtain a multi-dimensional spectral data set; an extraction module for wavelet denoising and spectral alignment of the multi-dimensional spectral data set, extracting the key parameters of the characteristic peaks at each wavelength and calculating the characteristic peak combination fingerprint to obtain a unique identification feature matrix of each additive; an identification module for training 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 existence probability and concentration value of each additive.
7. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program, when executed by a processor, causes the processor to perform the intelligent detection method for illegal additives in food according to any one of claims 1-5.
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