A food contamination detection method and system based on multi-wavelength spectrophotometry

By employing a multi-wavelength spectrophotometric detection method, utilizing a tunable light source system and deep learning algorithms to analyze the spectral response of food samples, dynamically adjusting the light source wavelength, and generating a food safety assessment report, this approach addresses the shortcomings of existing spectral data mining technologies and achieves efficient and accurate food contamination detection.

CN120009209BActive Publication Date: 2025-10-28CSSC HAISHEN MEDICAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411936800.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-10-28
Estimated Expiration
2044-12-26

AI Technical Summary

Technical Problem

Existing multi-wavelength spectrophotometric detection methods lack the ability to deeply mine spectral data, making it difficult to effectively distinguish subtle spectral differences between natural components and potential pollutants. Furthermore, they fail to fully utilize preliminary identification results to optimize subsequent detection processes, resulting in low detection efficiency and unsatisfactory accuracy.

Method used

A tunable multi-wavelength light source system is used to generate the spectral response of food samples. A high-resolution spectrometer is used to form a multi-dimensional spectral image. Deep learning algorithms are used to analyze the spectral image, and an adaptive wavelength selection mechanism is implemented to dynamically adjust the wavelength of the light source. An evaluation report is generated by combining the data with a food safety standard database.

Benefits of technology

It improves detection accuracy, enhances pollutant identification capabilities, reduces unnecessary detection steps, increases detection efficiency, and ensures that the most relevant spectral information is obtained for each test, providing decision-making support for regulatory agencies, reducing energy consumption, and improving the stability and reliability of the detection system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120009209B_ABST
    Figure CN120009209B_ABST
Patent Text Reader

Abstract

This invention provides a food contamination detection method based on multi-wavelength spectrophotometry. In this embodiment, a tunable multi-wavelength light source system emits light within a series of wavelengths onto a food sample, generating a spectral response. This spectral response is collected using a high-resolution spectrometer to form a multi-dimensional spectral image. A deep learning algorithm is then used to analyze and identify subtle spectral differences between natural components and potential contaminants in the food sample, obtaining preliminary identification results. An adaptive wavelength selection mechanism is implemented to dynamically adjust the wavelength output of the light source, obtaining spectral response data. This data is then compared with a pre-set food safety standard database to generate a food safety assessment report. The food safety assessment report includes contaminant types and concentration distribution maps. The technical solution provided by this invention enables highly efficient and accurate identification of natural components and potential contaminants in food samples, significantly improving the sensitivity, specificity, and accuracy of contaminant detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of food contamination detection technology, and in particular to a food contamination detection method based on multi-wavelength spectrophotometry. Background Technology

[0002] In the field of food contamination detection, as public awareness of food safety increases, traditional detection methods are increasingly revealing their limitations. Currently used physical and chemical detection methods often rely on specific reagents or equipment, which are not only complex and time-consuming to operate, but also have limited ability to identify trace or emerging contaminants. Furthermore, traditional methods struggle to efficiently and accurately detect multiple contaminants simultaneously, especially when dealing with complex food samples, where interference between components can affect the reliability of the results. To address these challenges, multi-wavelength spectrophotometric detection technology has emerged. By illuminating food samples with light sources of different wavelengths and collecting the resulting spectral responses, it can more comprehensively capture the optical properties of food samples, providing a new approach to contaminant identification.

[0003] However, existing multi-wavelength spectrophotometric detection methods still have some shortcomings. Although they can generate the spectral response of food samples, they typically lack the ability to deeply mine the spectral data during analysis, making it difficult to effectively distinguish subtle spectral differences between natural components and potential contaminants. Furthermore, most methods fail to fully utilize preliminary identification results to optimize subsequent detection processes, resulting in low detection efficiency and insufficient accuracy. Summary of the Invention

[0004] This invention provides a food contamination detection method and system based on multi-wavelength spectrophotometry, addressing the shortcomings of existing technologies that often lack the ability to deeply mine spectral data, making it difficult to effectively distinguish subtle spectral differences between natural components and potential contaminants. Furthermore, most methods fail to fully utilize preliminary identification results to optimize subsequent detection processes, resulting in low detection efficiency and insufficient accuracy.

[0005] In a first aspect, embodiments of the present invention provide a food contamination detection method based on multi-wavelength spectrophotometry, comprising:

[0006] A tunable multi-wavelength light source system is used to emit light within a series of wavelengths onto a food sample, generating the spectral response of the food sample.

[0007] The spectral response of the food sample is collected using a high-resolution spectrometer to form a multi-dimensional spectral image;

[0008] The multi-dimensional spectral images are analyzed using deep learning algorithms to identify and distinguish subtle spectral differences between natural components and potential contaminants in food samples, thus obtaining preliminary contaminant identification results.

[0009] Based on the preliminary identification results of the pollutants, an adaptive wavelength selection mechanism is implemented to dynamically adjust the wavelength output of the light source and obtain spectral response data.

[0010] The spectral response data is compared with a preset food safety standard database to generate a food safety assessment report, which includes: a pollutant type and concentration distribution map.

[0011] Optionally, based on the preliminary identification results of the pollutants, an adaptive wavelength selection mechanism is implemented to dynamically adjust the wavelength output of the light source and obtain spectral response data, including:

[0012] Using the preliminary identification results of the pollutants, a multidimensional spectral feature library of the pollutants is constructed. The multidimensional spectral feature library of the pollutants includes: the absorption and reflection characteristics of the pollutants at different wavelengths and the variation law under different environmental conditions.

[0013] Based on the multidimensional spectral feature library, an adaptive wavelength selection algorithm is designed and applied to automatically select the optimal wavelength combination to obtain an optimized light source.

[0014] The food sample is irradiated a preset number of times using the optimized light source, and the spectral response data of the food sample under each irradiation is collected using a high-resolution spectrometer to form a multi-round spectral response sequence.

[0015] The spectral response sequences from the multiple rounds are compared and analyzed with the data in the multidimensional spectral feature library. The parameters of the adaptive wavelength selection algorithm are adjusted in an iterative update manner until the predetermined detection accuracy requirement is met, and the final optimized spectral response data is obtained.

[0016] Optionally, the spectral response sequences from the multiple rounds are compared and analyzed with the data in the multidimensional spectral feature library. The parameters of the adaptive wavelength selection algorithm are adjusted iteratively until the predetermined detection accuracy requirement is met, thus obtaining the final optimized spectral response data, including:

[0017] Based on the spectral response sequence of the multiple rounds, the standard spectral data in the multidimensional spectral feature library are compared and analyzed to obtain key feature points;

[0018] The fitness value of the current wavelength combination is calculated based on the degree of matching between the key feature points and the standard spectral data in the multidimensional spectral feature library.

[0019] Based on the fitness value of the current wavelength combination, the parameters of the adaptive wavelength selection algorithm are iteratively updated using an evolutionary computation method to obtain the updated adaptive wavelength selection algorithm parameters. The evolutionary computation method includes: genetic algorithm and particle swarm optimization algorithm.

[0020] The food samples were irradiated again with the updated parameters, and new spectral response data were collected using a high-resolution spectrometer to form an updated spectral response sequence.

[0021] The updated spectral response sequence is compared and analyzed again with the data in the multidimensional spectral feature library to calculate a new fitness value, and the parameters of the adaptive wavelength selection algorithm are adjusted based on the new fitness value.

[0022] Repeat the process from obtaining spectral response data to adjusting the parameters of the adaptive wavelength selection algorithm until the performance indicators of the detection system meet the predetermined detection accuracy requirements and optimized spectral response data is obtained. The predetermined detection accuracy requirements include the sensitivity, specificity, and accuracy of pollutant detection.

[0023] Optionally, the spectral response of the food sample is collected using a high-resolution spectrometer to form a multi-dimensional spectral image, including:

[0024] High-resolution spectrometers were used to scan the spectral response of food samples under different wavelengths of light to obtain full-band spectral information;

[0025] The full-band spectral information is organized according to three dimensions: wavelength, intensity, and spatial location to form a three-dimensional spectral dataset.

[0026] The three-dimensional spectral dataset is subjected to noise removal and smoothing using digital signal processing techniques to obtain a high-quality three-dimensional spectral dataset.

[0027] Based on the high-quality three-dimensional spectral dataset, a multi-dimensional spectral image is constructed, which reflects the spectral characteristics and spatial distribution information of the food sample at different wavelengths.

[0028] Optionally, the spectral response of the food sample is collected using a high-resolution spectrometer to form a multi-dimensional spectral image, including:

[0029] Pre-trained deep transfer learning techniques are used to extract features from multi-dimensional spectral images to obtain basic feature representations;

[0030] The basic feature representation is input into a multi-layer convolutional neural network model, and the basic features are deepened layer by layer using the multi-layer convolutional neural network model to obtain a multi-layer feature mapping map.

[0031] Based on the multi-level feature map, spectral features at different scales are extracted through the multi-scale spatial pyramid pooling module to form a multi-scale feature representation.

[0032] Based on the multi-scale feature representation, a bidirectional long short-term memory network is used to model the time-series characteristics of spectral data to generate dynamic feature representations;

[0033] An adaptive attention mechanism is applied to weight the dynamic feature representation to highlight the features of suspected contaminant regions, resulting in an optimized feature map.

[0034] Based on the optimized feature map, an ensemble learning strategy is used to classify suspected pollutants, resulting in preliminary pollutant identification results.

[0035] Optionally, the method is characterized by emitting light within a series of wavelengths onto the food sample using a tunable multi-wavelength light source system to generate the spectral response of the food sample, including:

[0036] A three-dimensional dataset was obtained by emitting light from a food sample within a range of wavelengths using a tunable multi-wavelength light source system with dynamic wavelength adjustment capability.

[0037] The spectral response characteristics after each wavelength adjustment in the three-dimensional dataset are recorded to form a spectral response record;

[0038] Using built-in sensors, the temperature and humidity in the experimental environment are monitored, and the performance of the light source is compensated to obtain environmentally compensated spectral response data.

[0039] By combining the intelligent feedback control system, the environmentally compensated spectral response data is evaluated in real time, and the irradiation parameters are automatically optimized to obtain the optimized irradiation parameters.

[0040] The food sample was irradiated multiple times using the optimized irradiation parameters to ensure that each key wavelength was fully analyzed in order to generate the spectral response of the food sample.

[0041] Optionally, the spectral response data is compared with a preset food safety standard database to generate a food safety assessment report, wherein the food safety assessment report includes: a contaminant type and concentration distribution map, including:

[0042] The spectral response data is compared and analyzed with standard spectral data in a preset food safety standard database to obtain preliminary matching results of contaminant types;

[0043] Statistical methods were used to estimate the pollutant concentrations in the preliminary matching results, resulting in a concentration distribution map.

[0044] Based on the pollutant types and concentration distribution maps, assess the safety level of the food samples;

[0045] Based on the aforementioned security level, corresponding handling recommendations will be formulated;

[0046] By integrating the pollutant types, concentration distribution maps, safety levels, and treatment recommendations, a food safety assessment report is generated.

[0047] Secondly, embodiments of this application provide a food contamination detection system based on multi-wavelength spectrophotometry, comprising:

[0048] The emission module is used to emit light from a range of wavelengths onto a food sample using a tunable multi-wavelength light source system, thereby generating the spectral response of the food sample.

[0049] The collection module is used to collect the spectral response of the food sample using a high-resolution spectrometer to form a multi-dimensional spectral image;

[0050] The analysis module is used to analyze the multi-dimensional spectral image using deep learning algorithms, identify and distinguish subtle spectral differences between natural components and potential contaminants in the food sample, and obtain preliminary identification results of contaminants.

[0051] The implementation module is used to implement an adaptive wavelength selection mechanism based on the preliminary identification results of the pollutants, dynamically adjust the wavelength output of the light source, and obtain spectral response data;

[0052] The comparison module is used to compare the spectral response data with a preset food safety standard database to generate a food safety assessment report, wherein the food safety assessment report includes: pollutant type and concentration distribution map.

[0053] Thirdly, embodiments of the present invention provide a computing device, including a processor and a memory, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute a food contamination detection method based on multi-wavelength spectrophotometry as described in any of the first aspects.

[0054] Fourthly, embodiments of the present invention provide a computer storage medium storing computer program instructions thereon, wherein the computer program instructions, when executed by a processor, implement a food contamination detection method based on multi-wavelength spectrophotometry as described in any one of the first aspects.

[0055] In this embodiment of the invention, a tunable multi-wavelength light source system is used to emit light within a series of wavelengths onto a food sample, generating a spectral response of the food sample. A high-resolution spectrometer collects the spectral response of the food sample, forming a multi-dimensional spectral image. A deep learning algorithm is used to analyze the multi-dimensional spectral image, identifying and distinguishing subtle spectral differences between natural components and potential contaminants in the food sample, obtaining preliminary contaminant identification results. Based on these preliminary contaminant identification results, an adaptive wavelength selection mechanism is implemented to dynamically adjust the wavelength output of the light source, obtaining spectral response data. This spectral response data is compared with a preset food safety standard database to generate a food safety assessment report. The technical solution provided by this invention improves detection accuracy, enhances contaminant identification capabilities, reduces unnecessary detection steps, improves detection efficiency, and ensures that the most relevant spectral information is obtained in each test. This provides important decision-making basis for regulatory agencies, helping them better understand food contamination status and formulate reasonable response measures.

[0056] Furthermore, by designing and applying an adaptive wavelength selection algorithm to automatically select the optimal wavelength combination, the number of times the light source is used can be minimized while ensuring detection sensitivity, reducing energy consumption and improving detection efficiency. By irradiating the food sample a preset number of times and forming a multi-round spectral response sequence, the parameters of the adaptive wavelength selection algorithm are continuously adjusted in an iterative update manner until the predetermined detection accuracy requirements are met. This not only increases the reliability of the detection results but also allows for continuous optimization of the algorithm performance in practice. The final optimized spectral response data is the result of multiple iterations and verifications, which greatly improves the stability and reliability of the entire detection system, maintaining high detection accuracy even when faced with complex food samples.

[0057] These or other aspects of the invention will become more apparent from the following description of the embodiments. Attached Figure Description

[0058] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art 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.

[0059] Figure 1 A flowchart illustrating a food contamination detection method based on multi-wavelength spectrophotometry, provided for an embodiment of the present invention;

[0060] Figure 2 A schematic diagram of a food contamination detection system based on multi-wavelength spectrophotometry provided in an embodiment of the present invention;

[0061] Figure 3 This is a schematic diagram of the structure of a computing device provided in an embodiment of the present invention. Detailed Implementation

[0062] To enable those skilled in the art to better understand the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings.

[0063] In some of the processes described in the specification, claims, and accompanying drawings of this invention, multiple operations appearing in a specific order are included. However, it should be clearly understood that these operations may not be executed in the order they appear herein, or may be executed in parallel. The operation numbers, such as 101, 102, etc., are merely used to distinguish different operations and do not represent any execution order. Furthermore, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel. It should be noted that the descriptions such as "first," "second," etc., in this document are used to distinguish different messages, devices, modules, etc., and do not represent a sequential order, nor do they limit "first" and "second" to different types.

[0064] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0065] Existing multi-wavelength spectrophotometric detection methods still have some shortcomings. Although they can generate the spectral response of food samples, they typically lack the ability to deeply mine spectral data during analysis, making it difficult to effectively distinguish subtle spectral differences between natural components and potential contaminants. Furthermore, most methods fail to fully utilize preliminary identification results to optimize subsequent detection processes, resulting in low detection efficiency and insufficient accuracy. Therefore, this invention provides a food contamination detection method based on multi-wavelength spectrophotometry, such as… Figure 1 ,include:

[0066] Step 101: Use a tunable multi-wavelength light source system to emit light within a series of wavelengths onto the food sample to generate the spectral response of the food sample;

[0067] In this step, a tunable multi-wavelength light source system refers to a device that can emit light of different wavelengths (colors), the wavelength of which can be adjusted as needed. Such a system can cover a wide wavelength range from ultraviolet to infrared.

[0068] Spectral response refers to the result of different wavelengths of light being absorbed, reflected, or transmitted by a food sample when light shines on it.

[0069] In this step, a tunable multi-wavelength light source system is used to emit light within a specific wavelength range onto the food sample. The light source system automatically adjusts the wavelength of the output light according to a preset program, and the food sample's response to the light of that wavelength is recorded after each change, thus generating the spectral response data of the sample.

[0070] Step 102: Collect the spectral response of the food sample using a high-resolution spectrometer to form a multi-dimensional spectral image;

[0071] In this step, a high-resolution spectrometer refers to an instrument used to accurately measure the change of light intensity with wavelength, capable of capturing very subtle spectral features and providing high-precision data;

[0072] Multidimensional spectral images refer to images that not only contain the color information (i.e., spectral information) of each pixel, but also retain spatial location information, forming a three-dimensional or higher-dimensional dataset.

[0073] In this step, a high-resolution spectrometer receives and records the food sample's response to light at different wavelengths, including its reflection, transmission, and scattering characteristics. This data is organized into a multi-dimensional spectral image that not only reflects the spectral characteristics of the food sample at various wavelengths but also preserves the sample's spatial distribution information.

[0074] Step 103: Analyze the multi-dimensional spectral image using a deep learning algorithm to identify and distinguish subtle spectral differences between natural components and potential contaminants in the food sample, and obtain preliminary identification results of contaminants;

[0075] In this step, deep learning algorithms refer to a type of machine learning technique, specifically those that use multi-layered neural networks to simulate how the human brain processes information in order to achieve complex pattern recognition and data analysis tasks.

[0076] Preliminary identification results refer to the initial conclusions drawn after algorithm processing, indicating which areas may contain pollutants and making a preliminary judgment on the type of pollutants;

[0077] In this step, a trained deep learning model is applied to perform in-depth analysis of the multi-dimensional spectral images. The model automatically identifies features in the images, distinguishes between natural components and potential contaminants in food samples, and marks the location of suspected contaminants and their corresponding spectral features, thereby obtaining preliminary identification results of contaminants.

[0078] Step 104: Based on the preliminary identification results of the pollutants, implement an adaptive wavelength selection mechanism to dynamically adjust the wavelength output of the light source and obtain spectral response data;

[0079] In this step, the adaptive wavelength selection mechanism refers to an intelligent control system that automatically adjusts the parameters (such as wavelength) of the light source system based on the information obtained during the detection process to optimize the subsequent detection process.

[0080] Spectral response data refers to the spectral information of a food sample that has been reacquired at the adjusted wavelength;

[0081] Based on the preliminary identification results of contaminants, the system automatically selects the most favorable combination of wavelengths for further analysis and illuminates the food sample again with light of these selected wavelengths. During this process, the wavelength output of the light source system is dynamically adjusted to ensure that the newly acquired spectral response data can more accurately reflect the characteristics of the contaminants.

[0082] Step 105: Compare the spectral response data with a preset food safety standard database to generate a food safety assessment report, wherein the food safety assessment report includes: contaminant type and concentration distribution map;

[0083] In this step, the food safety standard database refers to a database containing information such as the standard spectral characteristics of known contaminants and their safety thresholds, which is used to compare actual test results;

[0084] A food safety assessment report is a document that synthesizes all the analysis results, detailing the types, concentration levels, and distribution of contaminants detected, and providing decision support for food safety management.

[0085] The newly acquired spectral response data is compared and analyzed with the standard spectra in the food safety standard database to determine whether the food sample contains contaminants exceeding the standard, as well as the specific type and concentration distribution of the contaminants. Finally, the system will generate a comprehensive food safety assessment report for regulatory authorities to refer to, so as to take appropriate measures to protect public health.

[0086] To demonstrate how to efficiently and accurately detect contaminants in food using a multi-wavelength spectrophotometric method, the following is a complete example:

[0087] First, the food sample to be tested is placed on the detection platform, and a series of light in different wavelength ranges is emitted to the sample using a tunable multi-wavelength light source system. The light source system automatically adjusts the wavelength of the output light according to a preset program. After each change, the food sample's response to the light of that wavelength is recorded, which generates the spectral response data of the sample. These spectral responses not only capture the absorption, reflection or transmission characteristics of the food sample to different wavelengths of light, but also provide a basis for subsequent analysis.

[0088] Next, the response of food samples to light of different wavelengths is received and recorded by a high-resolution spectrometer, including reflection, transmission or scattering characteristics. These data are organized into a multi-dimensional spectral image, which not only reflects the spectral characteristics of the food sample at various wavelengths, but also preserves the spatial distribution information of the sample. This multi-dimensional dataset allows the optical properties of food samples to be analyzed from multiple perspectives, enhancing the ability to identify subtle features.

[0089] Then, the trained deep learning model is applied to perform in-depth analysis of the multi-dimensional spectral images. The model can automatically identify the features in the images, distinguish between natural components and potential contaminants in food samples, and mark the location of suspected contaminants and their corresponding spectral features, which helps to obtain preliminary identification results of contaminants and provides guidance for further optimization of the detection process.

[0090] Based on the preliminary identification results, the adaptive wavelength selection mechanism control system automatically selects the wavelength combination most conducive to further analysis and illuminates the food sample again with light of these selected wavelengths. The wavelength output of the light source system will be dynamically adjusted to ensure that the newly acquired spectral response data can more accurately reflect the characteristics of the contaminants. In this way, the detection sensitivity of specific contaminants can be enhanced and the detection accuracy can be improved.

[0091] The final step involves comparing the newly acquired spectral response data with standard spectra in the food safety standards database. This process determines whether the food sample contains contaminants exceeding the standards, and identifies the specific types and concentration distribution of these contaminants. Ultimately, the system generates a detailed food safety assessment report. This report not only lists the types, concentration levels, and distribution of detected contaminants but also provides regulatory authorities with scientific evidence to help them take appropriate measures to protect public health.

[0092] In this case, if test results show that a batch of apple juice contains trace amounts of pesticide residues, specifically cypermethrin, with concentrations slightly above safety standards in some areas, and the food safety assessment report clearly indicates the location and extent of the contamination, and recommends appropriate measures, such as cleaning or isolating the product, to ensure consumer health;

[0093] Based on the information provided in the food safety assessment report, relevant agencies can take immediate action, such as recalling affected product batches, strengthening production process controls, or improving raw material procurement channels. Furthermore, the data from this testing can be used to update the food safety standards database, providing more accurate references for future testing. The entire process demonstrates how advanced technologies can be used to achieve efficient food contamination detection, providing strong support for food safety management.

[0094] Based on this, the present invention provides a specific embodiment in which step 104, based on the preliminary identification results of the pollutants, implements an adaptive wavelength selection mechanism to dynamically adjust the wavelength output of the light source and obtain spectral response data, specifically including the following steps:

[0095] Step 201: Using the preliminary identification results of the pollutants, construct a multidimensional spectral feature library of the pollutants. The multidimensional spectral feature library of the pollutants includes: the absorption and reflection characteristics of the pollutants at different wavelengths and the variation law under different environmental conditions.

[0096] In this step, the preliminary identification results of contaminants refer to the information about the types of contaminants that may be present in the food sample obtained through previous analysis (such as deep learning algorithms);

[0097] A multidimensional spectral feature library refers to a dataset containing the absorption and reflection characteristics of pollutants at different wavelengths and their variation patterns under different environmental conditions;

[0098] Based on the preliminary identification results of the pollutants, a comprehensive multidimensional spectral feature library is constructed. This library not only includes the spectral characteristics of known pollutants at various wavelengths (such as absorption peaks and reflection valleys), but also records the variation patterns of these characteristics under different environmental conditions (such as temperature and humidity). To ensure the accuracy and comprehensiveness of the feature library, information from multiple sources, including laboratory measurements, literature research, and historical detection data, is integrated, providing a solid foundation for subsequent wavelength selection and optimization.

[0099] Step 202: Based on the multidimensional spectral feature library, design and apply an adaptive wavelength selection algorithm to automatically select the optimal wavelength combination and obtain the optimized light source;

[0100] In this step, the adaptive wavelength selection algorithm refers to an algorithm that can automatically select the optimal wavelength combination based on information in a multidimensional spectral feature library, aiming to improve detection accuracy;

[0101] An optimized light source refers to a light source system that outputs a specific combination of wavelengths after algorithm optimization, used to more accurately illuminate food samples;

[0102] Based on the constructed multidimensional spectral feature library, an adaptive wavelength selection algorithm was designed and applied. This algorithm considers the spectral characteristics of pollutants and their changes under different environmental conditions, and automatically selects the wavelength combination that is most conducive to further analysis. In this way, the detection sensitivity of specific pollutants can be enhanced in a targeted manner, the overall performance of the detection system can be improved, and finally a set of optimized light source parameters are obtained, which are ready to be applied to the next step of the irradiation experiment.

[0103] Traditional methods typically use fixed wavelength settings, making it difficult to adapt to different types or concentrations of pollutants. Adaptive wavelength selection algorithms, however, can dynamically adjust the wavelength based on actual conditions, enhancing the system's flexibility. The calculation method for the adaptive wavelength selection algorithm is as follows:

[0104]

[0105] Where F represents the overall fitness value of the current wavelength combination; N represents the number of data points in the spectral response sequence of multiple rounds; w i This represents the weight of each data point, set according to the importance or reliability of the data point, and can be dynamically adjusted through preset rules or machine learning models; sim(S i ,T i ) represents the spectral response sequence at the i-th data point (S) i ) and standard spectral data in the multidimensional spectral feature library (T i Similarity measures between () can be achieved using cosine similarity, Euclidean distance, or other appropriate similarity measures; f ( ΔE i) This represents the environmental condition influencing factor, reflecting the impact of changes in temperature, humidity, etc., in the experimental environment on the spectral response, and is quantified by the function f; g ( ΔC i) This indicates a concentration-dependent factor, taking into account the impact of pollutant concentration on the spectral response, ensuring that data points in high-concentration regions receive appropriate attention in the evaluation;

[0106] Among them, environmental condition influence factor f ( ΔE i) The calculation method is as follows:

[0107] f(ΔE i )=exp(-α|ΔE i |)

[0108] ΔE i This represents the change in environmental conditions (such as temperature and humidity) at the i-th data point; α represents the environmental sensitivity coefficient, used to adjust the degree of influence of changes in environmental conditions on the fitness value;

[0109] Among them, the concentration-dependent factor g(ΔC) i The calculation method for ) is as follows:

[0110] g(ΔC i )=1+β·tanh(γ·ΔC i )

[0111] ΔC iβ represents the change in pollutant concentration at the i-th data point relative to the background level; β represents the concentration sensitivity coefficient, used to adjust the degree of influence of concentration change on the fitness value; γ represents the concentration change rate coefficient, which controls the speed at which concentration change affects the fitness value.

[0112] By comparing the actual collected spectral response with the expected standard spectrum, the effectiveness of the current wavelength selection can be evaluated, and the wavelength can be adjusted accordingly to achieve the best detection effect. This method solves the problem that traditional fixed wavelength light sources cannot flexibly cope with different pollutants, and improves the sensitivity and specificity of detection.

[0113] Step 203: Irradiate the food sample a preset number of times using the optimized light source, and collect the spectral response data of the food sample under each irradiation using a high-resolution spectrometer to form a multi-round spectral response sequence.

[0114] In this step, the preset number of irradiations refers to irradiating the food sample multiple times according to a predetermined plan to ensure that all key wavelengths are fully analyzed.

[0115] A high-resolution spectrometer is an instrument that can accurately measure the change of light intensity with wavelength, providing high-precision data;

[0116] A multi-round spectral response sequence refers to a dataset consisting of a series of spectral response data collected from multiple irradiation experiments;

[0117] The optimized light source was used to irradiate the food samples a preset number of times, and a high-resolution spectrometer was used to collect the spectral response data of the food samples under each irradiation. After each irradiation, a new set of spectral response data was generated. These data were organized into a multi-round spectral response sequence, with each sequence corresponding to an irradiation result of a specific wavelength combination, providing a rich information basis for subsequent comparative analysis.

[0118] Step 204: Compare and analyze the spectral response sequences from the multiple rounds with the data in the multidimensional spectral feature library, and adjust the parameters of the adaptive wavelength selection algorithm by iterative update until the predetermined detection accuracy requirement is met, thereby obtaining the final optimized spectral response data;

[0119] In this step, comparative analysis refers to a detailed comparison of the spectral response sequences from multiple rounds with standard spectral data in a multidimensional spectral feature library;

[0120] Iterative updates refer to the process of gradually improving detection performance by repeatedly adjusting algorithm parameters;

[0121] The predetermined detection accuracy requirements refer to performance indicators such as the sensitivity, specificity, and accuracy of pollutant detection, which serve as the criteria for judging whether the optimization is successful.

[0122] Optimizing spectral response data refers to achieving the spectral response data that ultimately meets the predetermined detection accuracy requirements, ensuring the reliability of the detection results;

[0123] The generated multi-round spectral response sequences are compared and analyzed in detail with data in a multi-dimensional spectral feature library. The effectiveness of the current wavelength combination is evaluated by calculating the similarity between the two, and the parameters of the adaptive wavelength selection algorithm are adjusted iteratively. Based on the new data collected after each irradiation, the selection of the wavelength combination is re-evaluated to see if it meets the predetermined detection accuracy requirements. If not, the algorithm parameters are adjusted again, the wavelength combination is optimized, and irradiation and data collection are repeated. This process is repeated until the performance indicators of the detection system meet the predetermined requirements. Finally, optimized spectral response data is obtained, which more accurately reflects the presence of contaminants in food samples, providing a reliable basis for generating food safety assessment reports.

[0124] Based on this, the present invention provides a specific embodiment. Step 204 involves comparing and analyzing the multi-round spectral response sequence with the data in the multi-dimensional spectral feature library, adjusting the parameters of the adaptive wavelength selection algorithm using an iterative update method until the predetermined detection accuracy requirement is met, and obtaining the final optimized spectral response data. Specifically, this includes the following steps:

[0125] Step 301: Compare and analyze the standard spectral data in the multidimensional spectral feature library based on the spectral response sequence of the multiple rounds to obtain key feature points;

[0126] In this step, the multi-round spectral response sequence refers to a series of data collected from multiple irradiations of food samples, with each sequence corresponding to the irradiation result of a specific combination of wavelengths.

[0127] Standard spectral data refers to the standard spectral information of known pollutants from a multidimensional spectral feature library;

[0128] Key feature points refer to the spectral features identified in comparative analysis that can significantly distinguish pollutants from natural components;

[0129] A detailed comparative analysis was conducted between the multi-round spectral response sequences and standard spectral data in the multidimensional spectral feature library. By comparing the similarities and differences between the two, key feature points that can significantly distinguish pollutants from natural components were identified. These key feature points may include absorption peaks or reflection valleys at specific wavelengths, which serve as the basis for subsequent analysis.

[0130] Step 302: Calculate the fitness value of the current wavelength combination based on the degree of matching between the key feature points and the standard spectral data in the multidimensional spectral feature library;

[0131] In this step, the matching degree refers to the similarity level between the key feature points in the spectral response sequence and the standard spectral data; the fitness value refers to the indicator used to evaluate the effectiveness of the current wavelength combination for the detection target, and the higher the value, the better the match.

[0132] Based on key feature points and their matching degree with standard spectral data, the fitness value of the current wavelength combination is calculated. By quantifying the similarity between the two, the fitness value is used to assess whether the current wavelength combination helps to accurately identify pollutants. The fitness value not only reflects the effectiveness of the wavelength combination, but also provides a basis for the next step of parameter adjustment.

[0133] Step 303: Based on the fitness value of the current wavelength combination, the parameters of the adaptive wavelength selection algorithm are iteratively updated using an evolutionary calculation method to obtain the updated adaptive wavelength selection algorithm parameters. The evolutionary calculation method includes: genetic algorithm and particle swarm optimization algorithm.

[0134] In this step, evolutionary computation methods refer to a class of optimization algorithms that simulate the biological evolution process in nature, such as genetic algorithms and particle swarm optimization algorithms, which are used to search for optimal solutions;

[0135] Genetic algorithms are optimization algorithms that simulate natural selection and genetic mechanisms, using operations such as selection, crossover, and mutation to find the best solution to a problem.

[0136] Particle swarm optimization (PSO) is an optimization algorithm that simulates the foraging behavior of bird flocks, finding the optimal solution through cooperation and competition among individuals.

[0137] Based on the calculated fitness value, the parameters of the adaptive wavelength selection algorithm are iteratively updated using a genetic algorithm or a particle swarm optimization algorithm. This allows the algorithm to continuously optimize wavelength combinations, thereby improving the sensitivity and specificity of the detection system. After each iteration, the new parameter settings are applied to the light source system in preparation for the next round of irradiation experiments.

[0138] Step 304: Irradiate the food sample again with the updated parameters, collect new spectral response data using a high-resolution spectrometer, and form an updated spectral response sequence;

[0139] In this step, the food samples are irradiated again using the updated parameters, and new spectral response data are collected using a high-resolution spectrometer. This new data forms an updated spectral response sequence, which provides a basis for further comparative analysis. A new spectral response sequence is generated after each irradiation to evaluate the optimization effect.

[0140] Step 305: Compare and analyze the updated spectral response sequence with the data in the multidimensional spectral feature library again, calculate the new fitness value, and continue to adjust the parameters of the adaptive wavelength selection algorithm based on the new fitness value;

[0141] In this step, the updated spectral response sequence is compared and analyzed again with the standard spectral data in the multidimensional spectral feature library to calculate a new fitness value. This process repeats the operations of steps 301 to 302, but uses the updated spectral response sequence. The new fitness value is used to evaluate the effect of the latest round of optimization and to determine whether it is necessary to continue adjusting the parameters of the adaptive wavelength selection algorithm.

[0142] Step 306: Repeat the process from obtaining spectral response data to adjusting the parameters of the adaptive wavelength selection algorithm until the performance indicators of the detection system meet the predetermined detection accuracy requirements and optimized spectral response data is obtained. The predetermined detection accuracy requirements include: sensitivity, specificity and accuracy of pollutant detection.

[0143] In this step, the predetermined detection accuracy requirements refer to performance indicators such as the sensitivity, specificity, and accuracy of pollutant detection, which serve as the criteria for judging whether the optimization is successful.

[0144] The process of obtaining spectral response data and adjusting the parameters of the adaptive wavelength selection algorithm is repeated until the performance indicators of the detection system (such as the sensitivity, specificity, and accuracy of pollutant detection) meet the predetermined detection accuracy requirements. Each iteration aims to gradually improve the performance of the detection system and ultimately obtain optimized spectral response data, providing a reliable basis for food safety assessment. This process ensures the effectiveness and accuracy of the entire detection process and provides scientific support for subsequent food safety management.

[0145] Based on this, the present invention provides a specific embodiment in which step 102, collecting the spectral response of the food sample using a high-resolution spectrometer to form a multi-dimensional spectral image, specifically includes the following steps:

[0146] Step 401: Use a high-resolution spectrometer to scan the spectral response of the food sample under different wavelengths of light to obtain full-band spectral information;

[0147] In this step, a high-resolution spectrometer refers to an instrument that can accurately measure the change of light intensity with wavelength, providing high-precision data;

[0148] Full-band spectral information refers to the complete spectral response data of food samples under different wavelengths of light, covering a wide wavelength range from ultraviolet to infrared.

[0149] In this step, a high-resolution spectrometer is used to scan the spectral response of food samples under a series of different wavelengths of light. The light source system automatically adjusts the wavelength of the output light according to a preset program, and the food sample's response to the light at that wavelength is recorded after each change. In this way, the absorption, reflection, or transmission characteristics of food samples at different wavelengths can be fully captured, generating complete full-band spectral information, which provides a basis for subsequent analysis and ensures the comprehensiveness and accuracy of the test results.

[0150] Step 402: Organize the full-band spectral information according to three dimensions: wavelength, intensity, and spatial location to form a three-dimensional spectral dataset;

[0151] In this step, the three-dimensional spectral dataset refers to a data set that organizes spectral information according to three dimensions: wavelength, intensity, and spatial location. Each point not only contains spectral features but also retains its location information in the sample.

[0152] Based on the obtained full-band spectral information, the data are organized according to three dimensions: wavelength, intensity, and spatial location to construct a three-dimensional spectral dataset. This dataset not only contains the spectral response (i.e., light intensity) of the food sample at each wavelength, but also records the spatial distribution of each part of the sample. This three-dimensional structure allows for the analysis of the optical properties of the food sample from multiple perspectives, enhances the ability to identify subtle features, and provides structured data support for subsequent processing.

[0153] Step 403: Use digital signal processing techniques to remove noise and smooth the three-dimensional spectral dataset to obtain a high-quality three-dimensional spectral dataset;

[0154] In this step, digital signal processing technology refers to methods that apply mathematical algorithms and techniques to process and optimize digital signals, such as filtering and noise reduction.

[0155] High-quality three-dimensional spectral datasets refer to datasets that have been processed to reduce noise interference and have undergone smoothing, thereby improving the quality and reliability of the data.

[0156] To improve data quality, digital signal processing techniques are used to remove noise and smooth the 3D spectral dataset. This step includes, but is not limited to, applying filters to reduce the impact of random noise and using smoothing algorithms to eliminate unnecessary fluctuations, in order to ensure the authenticity and stability of the data. A high-quality 3D spectral dataset not only reduces the interference of external factors on the detection results, but also provides a more reliable foundation for subsequent image construction.

[0157] Step 404: Based on the high-quality three-dimensional spectral dataset, construct a multi-dimensional spectral image, which reflects the spectral characteristics and spatial distribution information of the food sample at different wavelengths;

[0158] In this step, the multidimensional spectral image refers to the image converted from the three-dimensional spectral dataset. It not only reflects the spectral characteristics of the food sample at different wavelengths, but also retains the spatial distribution information of the sample, and has a rich sense of hierarchy and detail.

[0159] Based on high-quality three-dimensional spectral datasets, multi-dimensional spectral images are constructed. These images not only show the spectral characteristics of food samples at different wavelengths, such as absorption peaks and reflection valleys, but also retain the spatial distribution information of each part of the sample. Through visualization, multi-dimensional spectral images make the spectral characteristics of potential pollutants more intuitive and visible, which helps subsequent deep learning algorithms to perform more accurate analysis and identification. In addition, this image format also provides researchers with a more convenient data interpretation tool, making it easier to discover valuable information hidden behind complex data.

[0160] Based on this, the present invention provides a specific embodiment. Step 103, which uses a deep learning algorithm to analyze the multi-dimensional spectral image, identifies and distinguishes subtle spectral differences between natural components and potential contaminants in the food sample, and obtains preliminary contaminant identification results, specifically includes the following steps:

[0161] Step 501: Use pre-trained deep transfer learning techniques to extract features from the multi-dimensional spectral image to obtain basic feature representations;

[0162] In this step, pre-trained deep transfer learning techniques refer to using models that have already been trained on large-scale datasets (such as ImageNet) and applying these models to new tasks through transfer learning. This approach can accelerate the training of new models and improve their performance.

[0163] Multidimensional spectral images refer to images that include the spectral characteristics of food samples at different wavelengths and their spatial distribution information.

[0164] In this step, pre-trained deep transfer learning techniques are used to extract features from multi-dimensional spectral images. Through transfer learning, pre-trained deep neural network models (such as convolutional neural networks) are used to capture basic features in spectral images. These basic features not only include the spatial structure of spectral information, but may also include visual features such as color and texture, providing a solid foundation for subsequent deeper analysis.

[0165] Step 502: Input the basic feature representation into a multi-layer convolutional neural network model, and use the multi-layer convolutional neural network model to deepen the basic features layer by layer to obtain a multi-layer feature mapping map;

[0166] In this step, the multi-layer convolutional neural network model refers to a deep learning model that contains multiple convolutional layers and can automatically learn and extract complex features from input data;

[0167] A feature map refers to the feature representation output by each convolutional layer, which reflects the abstract features of the input data at different levels learned by that layer.

[0168] The basic feature representations are input into a multi-layer convolutional neural network model. As the data is passed through the network, each layer performs further feature extraction and abstraction on the input data, ultimately resulting in multi-layer feature maps. These maps not only preserve the spatial information of the original spectral image, but also increase the depth of understanding of spectral features, making the subtle differences of potential pollutants more apparent.

[0169] Step 503: Based on the multi-level feature map, extract spectral features at different scales through the multi-scale spatial pyramid pooling module to form a multi-scale feature representation;

[0170] In this step, the multi-scale spatial pyramid pooling module refers to a technique for extracting features at different scales. By performing pooling operations on the feature map at different scales, it enhances the model's ability to recognize targets of different sizes.

[0171] Multi-scale feature representation refers to the feature representation generated by the multi-scale spatial pyramid pooling module, which can capture important information in spectral images at different scales;

[0172] Based on multi-level feature maps, spectral features at different scales are extracted through multi-scale spatial pyramid pooling modules. This approach ensures that the model not only focuses on global features but also pays attention to local details, thereby forming a more comprehensive multi-scale feature representation. Multi-scale feature representation enhances the model's ability to detect pollutants of different sizes or shapes and improves recognition accuracy.

[0173] Step 504: Based on the multi-scale feature representation, model the time series characteristics of the spectral data using a bidirectional long short-term memory network to generate a dynamic feature representation;

[0174] In this step, Bidirectional Long Short-Term Memory (BiLSTM) refers to an improved recurrent neural network that can simultaneously consider the dependencies between sequential data, making it particularly suitable for processing data with time-series characteristics.

[0175] Dynamic feature representation refers to the representation that reflects the time series variation characteristics of spectral data after processing by a bidirectional long short-term memory network;

[0176] Based on multi-scale feature representation, a bidirectional long short-term memory network is used to model the time-series characteristics of spectral data. This method captures the trends and patterns of spectral data as wavelength changes, generating dynamic feature representations. This helps to reveal the hidden patterns in spectral data, especially providing a more refined description of pollutant features that appear as time or wavelength changes.

[0177] Step 505: Apply an adaptive attention mechanism to weight the dynamic feature representation, highlight the features of suspected contaminant areas, and obtain an optimized feature map;

[0178] In this step, adaptive attention refers to a technique that enables the model to focus on important parts of the input data by calculating weights to emphasize key features and ignore irrelevant information.

[0179] The optimized feature map refers to the feature representation after weighted processing by an adaptive attention mechanism, which highlights the features of suspected pollutant areas and improves detection accuracy.

[0180] An adaptive attention mechanism is applied to weight the dynamic feature representation. This mechanism automatically adjusts the importance of features by calculating the importance weight of each feature, thereby highlighting the features of suspected contaminant areas. The optimized feature map not only enhances the ability to identify potential contaminants, but also reduces the false alarm rate and improves the overall performance of the detection system.

[0181] Step 506: Based on the optimized feature map, an ensemble learning strategy is used to classify suspected pollutants to obtain preliminary pollutant identification results;

[0182] In this step, ensemble learning strategies are methods that combine the results of multiple models or algorithms to improve prediction performance. Common examples include voting and stacking methods.

[0183] Preliminary identification results: Preliminary conclusions about the presence and type of pollutants obtained after processing by models or algorithms.

[0184] Specific operation content:

[0185] Based on the optimized feature map, an ensemble learning strategy is used to classify suspected contaminants. By integrating the prediction results of multiple classifiers, it is possible to more accurately determine whether food samples contain contaminants and the specific types of contaminants. Finally, the preliminary identification results of contaminants are output, providing a scientific basis for subsequent food safety assessments. The application of the ensemble learning strategy not only improves the accuracy of classification but also enhances the robustness and generalization ability of the model.

[0186] Based on this, the present invention provides a specific embodiment in which step 101, emitting light within a series of wavelengths onto the food sample using a tunable multi-wavelength light source system to generate the spectral response of the food sample, specifically includes the following steps:

[0187] Step 601: Use a tunable multi-wavelength light source system with dynamic wavelength adjustment capability to emit light within a series of wavelength ranges onto the food sample to obtain a three-dimensional dataset;

[0188] In this step, a tunable multi-wavelength light source system with dynamic wavelength adjustment capability refers to a light source system that can automatically adjust the output light wavelength as needed, and can perform continuous or discrete wavelength switching over a wide wavelength range.

[0189] A three-dimensional dataset refers to a collection of data consisting of three dimensions: time, wavelength, and response intensity, which records the spectral response characteristics of food samples under different wavelengths of light.

[0190] In this step, a tunable multi-wavelength light source system with dynamic wavelength adjustment capability is used to emit light within a series of wavelengths onto the food sample. The light source system automatically adjusts the wavelength of the output light at preset time intervals. After each adjustment, the absorption, reflection, or transmission characteristics of the food sample at that specific wavelength of light are recorded. These data are organized into a time-wavelength-response three-dimensional dataset, providing a basis for subsequent analysis.

[0191] Step 602: Record the spectral response characteristics of each wavelength adjustment in the three-dimensional dataset to form a spectral response record;

[0192] In this step, spectral response recording refers to recording in detail the spectral response characteristics after each wavelength adjustment, including information such as absorption, reflection, or transmission intensity;

[0193] Based on the three-dimensional dataset, the spectral response characteristics after each wavelength adjustment are recorded in detail to ensure that the spectral response of the food sample at each wavelength is accurately captured and saved, forming a complete spectral response record. These records not only contain spectral information but also retain the changes over time, providing detailed data support for subsequent processing.

[0194] Step 603: Combine the intelligent feedback control system to evaluate the environmentally compensated spectral response data in real time, automatically optimize the irradiation parameters, and obtain the optimized irradiation parameters;

[0195] In this step, the intelligent feedback control system refers to a technology that monitors and adjusts system parameters in real time to ensure the stability and accuracy of the detection process;

[0196] Built-in sensors refer to devices used to monitor factors such as temperature and humidity in the experimental environment in order to provide real-time environmental data;

[0197] Environmentally compensated spectral response data refers to data obtained by correcting the original spectral response data for environmental factors.

[0198] Built-in sensors are used to monitor the temperature and humidity in the experimental environment in real time, and this environmental data is input into the intelligent feedback control system. The system compensates for the performance of the light source based on the monitored environmental conditions, eliminates the influence of environmental factors on the spectral response, and obtains environmentally compensated spectral response data, ensuring that the basic data for subsequent analysis is more accurate and reliable.

[0199] Step 604: Combine the intelligent feedback control system to evaluate the environmentally compensated spectral response data in real time, automatically optimize the irradiation parameters, and obtain the optimized irradiation parameters;

[0200] In this step, the illumination parameters refer to the settings of parameters that affect the spectral response characteristics, such as the power and duration of the light source.

[0201] Optimized irradiation parameters refer to the best irradiation parameter settings after evaluation and adjustment by the intelligent feedback control system;

[0202] By combining an intelligent feedback control system, the quality of the environmentally compensated spectral response data is evaluated in real time. Based on the evaluation results, the system automatically optimizes the irradiation parameters (such as power and duration) to improve the signal-to-noise ratio and resolution of the spectral response, ultimately obtaining a set of optimized irradiation parameters, which provides guidance for the next irradiation experiment.

[0203] Step 605: Irradiate the food sample multiple times using the optimized irradiation parameters to fully analyze each key wavelength and generate the spectral response of the food sample.

[0204] In this step, multiple irradiation refers to irradiating the food sample multiple times using optimized irradiation parameters to ensure that all key wavelengths are fully analyzed.

[0205] The spectral response of a food sample refers to the comprehensive and accurate reflection of the spectral characteristics of a food sample at different wavelengths after multiple rounds of irradiation.

[0206] Food samples are irradiated multiple times using optimized irradiation parameters. New spectral response data are collected after each irradiation to ensure that every key wavelength that may affect contaminant identification is fully analyzed. In this way, a comprehensive and accurate spectral response of the food samples is generated, providing a solid data foundation for subsequent contaminant identification and food safety assessment.

[0207] Based on this, the present invention provides a specific embodiment. In step 105, the spectral response data is compared with a preset food safety standard database to generate a food safety assessment report. The food safety assessment report includes: a contaminant type and concentration distribution map, specifically including the following steps:

[0208] Step 701: Compare and analyze the spectral response data with the standard spectral data in the preset food safety standard database to obtain preliminary matching results of contaminant types;

[0209] In this step, spectral response data refers to the spectral characteristics of food samples at different wavelengths collected during multi-wavelength spectrophotometric detection.

[0210] A food safety standards database refers to a database containing information such as the standard spectral characteristics of known contaminants and their safety thresholds;

[0211] Preliminary matching results refer to information about the types of contaminants that may be present in food samples, obtained through comparative analysis;

[0212] In this step, the collected spectral response data is compared and analyzed in detail with standard spectral data in a pre-set food safety standard database. By calculating the similarity or difference between the two, the types of contaminants that may be present in the food sample are identified, and preliminary matching results are obtained. These results provide a basis for subsequent concentration estimation and risk assessment.

[0213] Step 702: Using statistical methods, estimate the pollutant concentrations in the preliminary matching results to generate a concentration distribution map;

[0214] In this step, statistical methods refer to a set of mathematical tools and techniques used to extract information from data, including but not limited to regression analysis, Bayesian estimation, etc.

[0215] A concentration distribution map is a map or chart that visually displays the spatial distribution of contaminant concentrations in a food sample.

[0216] Based on the preliminary matching results, statistical methods are used to estimate the concentration of pollutants. This step involves applying appropriate mathematical models to quantify the presence level of pollutants and generating a concentration distribution map based on spatial location information. The concentration distribution map not only shows the specific concentration of pollutants but also reflects their distribution patterns in food samples, providing a basis for further safety level assessment.

[0217] Step 703: Assess the safety level of the food sample by combining the contaminant type and concentration distribution map;

[0218] In this step, the safety level refers to the result of a comprehensive assessment based on the type, concentration, and degree of impact on human health of the contaminants, and is used to describe the safety status of the food sample.

[0219] By combining contaminant types and concentration distribution maps, the safety level of food samples is assessed. The assessment process considers the types and concentration levels of contaminants, as well as their potential impact on human health. Based on pre-set safety standards, it is determined whether the food samples meet safety requirements and they are classified into different safety levels. This assessment result is an important basis for formulating treatment recommendations.

[0220] Step 704: Based on the security level, formulate corresponding processing recommendations;

[0221] In this step, the treatment recommendations refer to specific measures proposed based on the assessment results regarding how to handle contaminated food, such as cleaning, disinfection, isolation, or destruction.

[0222] Based on the assessed safety level, corresponding handling recommendations are developed. If a food sample is deemed unsafe, specific handling measures need to be proposed to ensure that consumers' health is not threatened. Handling recommendations may include cleaning the contaminated area, taking disinfection measures, isolating the affected product batch, or even destroying severely contaminated food if necessary. These measures aim to minimize the potential harm of contaminants to public health.

[0223] Step 705: Integrate the pollutant types, concentration distribution maps, safety levels, and treatment recommendations to generate a food safety assessment report;

[0224] In this step, the food safety assessment report refers to a document that synthesizes all the analysis results, detailing the types of contaminants detected, their concentration distribution, safety levels, and treatment recommendations, providing a scientific basis for regulatory agencies and consumers.

[0225] By integrating all the information obtained, a comprehensive food safety assessment report is generated. This report not only includes the types and concentration distribution maps of contaminants, but also the safety level assessment results of food samples and corresponding treatment recommendations. The food safety assessment report provides important decision support for regulatory authorities, helping them to better understand and respond to food contamination issues, while also providing consumers with a transparent and reliable source of information.

[0226] Figure 2 This application provides a schematic diagram of a food contamination detection system based on multi-wavelength spectrophotometry, as shown in the embodiment. Figure 2 As shown, the system includes:

[0227] The emission module 21 is used to emit light within a series of wavelengths onto the food sample using a tunable multi-wavelength light source system, thereby generating the spectral response of the food sample.

[0228] The collection module 22 is used to collect the spectral response of the food sample using a high-resolution spectrometer to form a multi-dimensional spectral image;

[0229] Analysis module 23 is used to analyze the multi-dimensional spectral image using deep learning algorithms, identify and distinguish subtle spectral differences between natural components and potential contaminants in the food sample, and obtain preliminary identification results of contaminants.

[0230] The implementation module 24 is used to implement an adaptive wavelength selection mechanism based on the preliminary identification results of the pollutants, dynamically adjust the wavelength output of the light source, and obtain spectral response data;

[0231] The comparison module 25 is used to compare the spectral response data with a preset food safety standard database to generate a food safety assessment report, wherein the food safety assessment report includes: pollutant type and concentration distribution map.

[0232] Figure 2 The aforementioned food contamination detection system based on multi-wavelength spectrophotometry can perform... Figure 1 The implementation principle and technical effects of the food contamination detection method based on multi-wavelength spectrophotometry described in the illustrated embodiment will not be repeated here. The specific operation methods of each module and unit in the food contamination detection system based on multi-wavelength spectrophotometry in the above embodiments have been described in detail in the embodiments related to this method, and will not be elaborated upon here.

[0233] Figure 2 The food contamination detection system based on multi-wavelength spectrophotometry shown in the embodiment can be implemented as a computing device, such as... Figure 3 As shown, the computing device may include a storage component 31 and a processing component 32;

[0234] The storage component 31 stores one or more computer instructions, wherein the one or more computer instructions are invoked and executed by the processing component 32.

[0235] The processing component 32 is used to emit light within a series of wavelengths onto the food sample using a tunable multi-wavelength light source system to generate the spectral response of the food sample.

[0236] The spectral response of the food sample is collected using a high-resolution spectrometer to form a multi-dimensional spectral image;

[0237] The multi-dimensional spectral images are analyzed using deep learning algorithms to identify and distinguish subtle spectral differences between natural components and potential contaminants in food samples, thus obtaining preliminary contaminant identification results.

[0238] Based on the preliminary identification results of the pollutants, an adaptive wavelength selection mechanism is implemented to dynamically adjust the wavelength output of the light source and obtain spectral response data.

[0239] The spectral response data is compared with a preset food safety standard database to generate a food safety assessment report, which includes: a pollutant type and concentration distribution map.

[0240] The processing component 32 includes one or more processors to execute computer instructions to complete all or part of the steps in the above-described method. Alternatively, the processing component can be implemented as one or more application-specific integrated circuits (AICs), digital signal processors (DPs), digital signal processing devices (DPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above-described method.

[0241] Storage component 31 is configured to store various types of data to support operations at the terminal. The storage component can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (RAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0242] Computing devices also include other components such as input / output interfaces, display components, and communication components.

[0243] Input / output interfaces provide interfaces between processing components and peripheral interface modules, which can be output devices or input devices.

[0244] The communication components are configured to facilitate wired or wireless communication between computing devices and other devices.

[0245] The computing device can be a physical device or an elastic computing host provided by a cloud computing platform. In this case, the computing device can refer to a cloud server, and the aforementioned processing components, storage components, etc., can be basic server resources rented or purchased from the cloud computing platform.

[0246] This invention also provides a computer storage medium storing a computer program, which, when executed by a computer, can perform the above-described functions. Figure 1The illustrated embodiment is a food contamination detection method based on multi-wavelength spectrophotometry.

[0247] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0248] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0249] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0250] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. 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. A food contamination detection method based on multi-wavelength spectrophotometry, characterized in that, include: A tunable multi-wavelength light source system is used to emit light within a series of wavelengths onto a food sample, generating the spectral response of the food sample. The spectral response of the food sample is collected using a high-resolution spectrometer to form a multi-dimensional spectral image; The multi-dimensional spectral images are analyzed using deep learning algorithms to identify and distinguish subtle spectral differences between natural components and potential contaminants in food samples, thus obtaining preliminary contaminant identification results. Based on the preliminary identification results of the pollutants, an adaptive wavelength selection mechanism is implemented to dynamically adjust the wavelength output of the light source and obtain spectral response data. The spectral response data is compared with a preset food safety standard database to generate a food safety assessment report, which includes: a contaminant type and concentration distribution map; Based on the preliminary identification results of the pollutants, an adaptive wavelength selection mechanism is implemented to dynamically adjust the wavelength output of the light source and obtain spectral response data, including: Using the preliminary identification results of the pollutants, a multidimensional spectral feature library of the pollutants is constructed. The multidimensional spectral feature library of the pollutants includes: the absorption and reflection characteristics of the pollutants at different wavelengths and the variation law under different environmental conditions. Based on the multidimensional spectral feature library, an adaptive wavelength selection algorithm is designed and applied to automatically select the optimal wavelength combination to obtain an optimized light source. The food sample is irradiated a preset number of times using the optimized light source, and the spectral response data of the food sample under each irradiation is collected using a high-resolution spectrometer to form a multi-round spectral response sequence. The spectral response sequences from the multiple rounds are compared and analyzed with the data in the multidimensional spectral feature library. The parameters of the adaptive wavelength selection algorithm are adjusted by iterative updating until the predetermined detection accuracy requirement is met, and the final optimized spectral response data is obtained. The spectral response sequences from the multiple rounds are compared and analyzed with the data in the multidimensional spectral feature library. The parameters of the adaptive wavelength selection algorithm are adjusted iteratively until the predetermined detection accuracy requirement is met, resulting in the final optimized spectral response data, including: Based on the spectral response sequence of the multiple rounds, the standard spectral data in the multidimensional spectral feature library are compared and analyzed to obtain key feature points; The fitness value of the current wavelength combination is calculated based on the degree of matching between the key feature points and the standard spectral data in the multidimensional spectral feature library. Based on the fitness value of the current wavelength combination, the parameters of the adaptive wavelength selection algorithm are iteratively updated using an evolutionary computation method to obtain the updated adaptive wavelength selection algorithm parameters. The evolutionary computation method includes: genetic algorithm and particle swarm optimization algorithm. The food samples were irradiated again with the updated parameters, and new spectral response data were collected using a high-resolution spectrometer to form an updated spectral response sequence. The updated spectral response sequence is compared and analyzed again with the data in the multidimensional spectral feature library to calculate a new fitness value, and the parameters of the adaptive wavelength selection algorithm are adjusted based on the new fitness value. The process of obtaining spectral response data and adjusting the parameters of the adaptive wavelength selection algorithm is repeated until the performance indicators of the detection system meet the predetermined detection accuracy requirements, thereby obtaining optimized spectral response data. The predetermined detection accuracy requirements include the sensitivity, specificity, and accuracy of pollutant detection.

2. The method according to claim 1, characterized in that, The spectral response of the food sample is collected using a high-resolution spectrometer to form a multi-dimensional spectral image, including: High-resolution spectrometers were used to scan the spectral response of food samples under different wavelengths of light to obtain full-band spectral information; The full-band spectral information is organized according to three dimensions: wavelength, intensity, and spatial location to form a three-dimensional spectral dataset. The three-dimensional spectral dataset is subjected to noise removal and smoothing using digital signal processing techniques to obtain a high-quality three-dimensional spectral dataset. Based on the high-quality three-dimensional spectral dataset, a multi-dimensional spectral image is constructed, which reflects the spectral characteristics and spatial distribution information of the food sample at different wavelengths.

3. The method according to claim 1, characterized in that, Deep learning algorithms are used to analyze the multi-dimensional spectral images to identify and distinguish subtle spectral differences between natural components and potential contaminants in food samples, yielding preliminary contaminant identification results, including: Pre-trained deep transfer learning techniques are used to extract features from multi-dimensional spectral images to obtain basic feature representations; The basic feature representation is input into a multi-layer convolutional neural network model, and the basic features are deepened layer by layer using the multi-layer convolutional neural network model to obtain a multi-layer feature mapping map. Based on the multi-level feature map, spectral features at different scales are extracted through the multi-scale spatial pyramid pooling module to form a multi-scale feature representation. Based on the multi-scale feature representation, a bidirectional long short-term memory network is used to model the time-series characteristics of spectral data to generate dynamic feature representations; An adaptive attention mechanism is applied to weight the dynamic feature representation to highlight the features of suspected contaminant regions, resulting in an optimized feature map. Based on the optimized feature map, an ensemble learning strategy is used to classify suspected pollutants, resulting in preliminary pollutant identification results.

4. The method according to claim 1, characterized in that, A tunable multi-wavelength light source system is used to emit light across a range of wavelengths onto a food sample, generating the spectral response of the food sample, including: A three-dimensional dataset was obtained by emitting light from a food sample within a range of wavelengths using a tunable multi-wavelength light source system with dynamic wavelength adjustment capability. The spectral response characteristics after each wavelength adjustment in the three-dimensional dataset are recorded to form a spectral response record; Using built-in sensors, the temperature and humidity in the experimental environment are monitored, and the performance of the light source is compensated to obtain environmentally compensated spectral response data. By combining the intelligent feedback control system, the environmentally compensated spectral response data is evaluated in real time, and the irradiation parameters are automatically optimized to obtain the optimized irradiation parameters. The food sample was irradiated multiple times using the optimized irradiation parameters to ensure that each key wavelength was fully analyzed in order to generate the spectral response of the food sample.

5. The method according to claim 1, characterized in that, The spectral response data is compared with a preset food safety standard database to generate a food safety assessment report. The food safety assessment report includes: a contaminant type and concentration distribution map, including: The spectral response data is compared and analyzed with standard spectral data in a preset food safety standard database to obtain preliminary matching results of contaminant types; Statistical methods were used to estimate the pollutant concentrations in the preliminary matching results, resulting in a concentration distribution map. Based on the pollutant types and concentration distribution maps, assess the safety level of the food samples; Based on the aforementioned security level, corresponding handling recommendations will be formulated; By integrating the pollutant types, concentration distribution maps, safety levels, and treatment recommendations, a food safety assessment report is generated.

6. A food contamination detection system based on multi-wavelength spectrophotometry, used to execute the food contamination detection method based on multi-wavelength spectrophotometry as described in any one of claims 1 to 5, characterized in that, include: The emission module is used to emit light from a range of wavelengths onto a food sample using a tunable multi-wavelength light source system, thereby generating the spectral response of the food sample. The collection module is used to collect the spectral response of the food sample using a high-resolution spectrometer to form a multi-dimensional spectral image; The analysis module is used to analyze the multi-dimensional spectral image using deep learning algorithms, identify and distinguish subtle spectral differences between natural components and potential contaminants in the food sample, and obtain preliminary identification results of contaminants. The implementation module is used to implement an adaptive wavelength selection mechanism based on the preliminary identification results of the pollutants, dynamically adjust the wavelength output of the light source, and obtain spectral response data; The comparison module is used to compare the spectral response data with a preset food safety standard database to generate a food safety assessment report, wherein the food safety assessment report includes: pollutant type and concentration distribution map.

7. A computing device, characterized in that, It includes a processing component and a storage component; the storage component stores one or more computer instructions; the one or more computer instructions are invoked and executed by the processing component to implement a food contamination detection method based on multi-wavelength spectrophotometry as described in any one of claims 1 to 5.

8. A computer storage medium, characterized in that, The device contains a computer program that, when executed by a computer, implements a food contamination detection method based on multi-wavelength spectrophotometry as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Spectrum-based miniaturized substance detection system and method

    CN116718554A

  • Method and system for monitoring displacement of terminal head of aerial cable

    CN118960574A