Food additive detection system and method

By combining terahertz time domain spectroscopy technology with neural network models, a food additive detection system is built, which solves the problem of interpreting complex mixture spectroscopy, improves detection accuracy and efficiency, and achieves rapid feedback and user convenience.

CN120195129APending Publication Date: 2025-06-24INNER MONGOLIA UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510263463.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-06
Publication Date
2025-06-24

AI Technical Summary

Technical Problem

In the prior art, terahertz time domain spectroscopy technology has complex mixture spectroscopy interpretation problems in food additive detection, resulting in insufficient detection accuracy and efficiency.

Method used

By combining terahertz time domain spectroscopy technology with neural network models, a food additive detection system is built, including a terahertz spectroscopy database, a qualitative analysis module and a quantitative analysis module, and the composite neural network model CNN-LSTM-Attention and convolutional neural network model CNN are used to perform qualitative and quantitative analysis of spectral data.

Benefits of technology

It significantly improves the qualitative and quantitative analysis accuracy of food additive detection, achieves rapid feedback of test results, is suitable for real-time monitoring needs, and improves user convenience and experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120195129A_ABST
    Figure CN120195129A_ABST
Patent Text Reader

Abstract

The invention discloses a food additive detection system and method.The food additive detection system comprises a terahertz spectrum database, a qualitative analysis module and a quantitative analysis module, the qualitative analysis module and the quantitative analysis module are in communication connection with the terahertz spectrum database, and the terahertz spectrum database is used for storing and managing terahertz spectrum data; the qualitative analysis module is used for carrying out qualitative analysis on the terahertz spectrum data, and the quantitative analysis module is used for carrying out quantitative analysis on the terahertz spectrum data. According to the food additive detection system and method provided by the invention, the combination of a terahertz spectrum technology and a deep learning model is realized through the terahertz spectrum database, the qualitative analysis module and the quantitative analysis module, so that the precision of qualitative and quantitative analysis is remarkably improved, and meanwhile, rapid feedback of a detection result is realized; and real-time monitoring requirements are met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of food detection, and particularly relates to a food additive detection system and method. Background Art

[0002] Food additives are widely used in the food industry. With the development of modern food processing technologies, their types and uses are constantly increasing. However, the excessive use or abuse of some food additives may have adverse effects on human health. Therefore, rapid and accurate detection of food additives has become a key issue in the field of food safety. Currently, common detection methods such as chemical analysis, gas chromatography, high-performance liquid chromatography, and mass spectrometry, although having high accuracy and sensitivity, usually have complex operations, long detection cycles, high costs, and are not suitable for real-time and large-scale online detection. In addition, these methods often require chemical treatment of samples, which may cause sample damage and cannot meet the requirements of non-destructive detection in modern food production.

[0003] In the prior art, terahertz time-domain spectroscopy (THz-TDS) has shown great potential in food additive detection due to its fast, non-destructive, and efficient characteristics. The low energy and non-ionizing properties of terahertz waves make them highly sensitive to characteristic absorptions such as molecular vibrations and rotations. However, the spectral interpretation of complex mixtures remains the main challenge in its application. Summary of the Invention

[0004] The objective of the present invention is to propose a food additive detection system and method, which combines terahertz time-domain spectroscopy with a neural network model to solve the problem of difficult spectral interpretation of complex mixtures in the prior art.

[0005] To this end, the first aspect of the present invention provides a food additive detection system, including a terahertz spectral database, a qualitative analysis module, and a quantitative analysis module. The qualitative analysis module and the quantitative analysis module are communicatively connected to the terahertz spectral database. The terahertz spectral database is used for storing and managing terahertz spectral data. The qualitative analysis module is used for performing qualitative analysis on the terahertz spectral data. The quantitative analysis module is used for performing quantitative analysis on the terahertz spectral data.

[0006] Preferably, the qualitative analysis module includes a first data reading and loading module, a first data generating module, and a qualitative result analysis module. The first data reading and loading module is used for reading terahertz spectral data from the terahertz spectral database. The first data generating module is used for generating an absorption spectrum and a refractive index spectrum based on the terahertz spectral data. The qualitative result analysis module is used for identifying the component composition of the sample to be tested according to the absorption spectrum and the refractive index spectrum.

[0007] Preferably, in the qualitative result analysis module, a composite neural network model CNN-LSTM-Attention is used to identify the composition of the sample to be tested.

[0008] Preferably, the quantitative analysis module includes a second data reading and loading module, a second data generation module, and a quantitative result analysis module. The second data reading and loading module is used to read terahertz spectral data from the terahertz spectral database. The second data generation module is used to generate an absorption spectrum and a refractive index spectrum based on the terahertz spectral data. The quantitative result analysis module is used to identify the concentration of the target component in the sample to be tested based on the absorption spectrum and the refractive index spectrum.

[0009] Preferably, in the qualitative result analysis module, a convolutional neural network model CNN is used to identify the concentration of the target component in the sample to be tested.

[0010] Preferably, a data visualization module is further included. The data visualization module is communicatively connected to the terahertz spectral database and is used to graphically display the terahertz spectral data.

[0011] Preferably, a data online transmission module is further included. The data online transmission module is communicatively connected to the terahertz spectral database and is used to remotely share and real-time transmit data with the terahertz spectral database.

[0012] In a second aspect, a food additive detection method is provided, which is applied to the food additive detection system described above, and includes the following steps:

[0013] Obtain the terahertz spectral data of the sample to be tested, preprocess the terahertz spectral data to obtain preprocessed data; load the preprocessed data through the qualitative analysis module and perform qualitative analysis to identify the composition of the sample to be tested, and obtain a qualitative analysis result; load the preprocessed data through the quantitative analysis module and perform quantitative analysis to identify the concentration of the target component of the sample to be tested, and obtain a quantitative analysis result.

[0014] Preferably, the qualitative analysis result and the quantitative analysis result are displayed in a visual manner.

[0015] Preferably, the qualitative analysis result and the quantitative analysis result are remotely shared and real-time transmitted with the terahertz spectral database.

[0016] Beneficial effects:

[0017] 1. The present invention provides a food additive detection system and method, which combines terahertz spectroscopy technology with a deep learning model through a terahertz spectroscopy database, a qualitative analysis module, and a quantitative analysis module, significantly improving the accuracy of qualitative and quantitative analysis, and at the same time achieving rapid feedback of detection results, suitable for real-time monitoring requirements.

[0018] 2. The present invention adopts a modular design, organically integrating qualitative analysis, quantitative analysis, data visualization, and online transmission functions into the detection system. The system has a friendly interface, is easy to operate, and the detection results are presented intuitively, greatly improving the user's convenience and experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0020] Figure 1 It is a schematic structural diagram of a food additive detection system in the present invention.

[0021] Figure 2 It is a method flow chart of a food additive detection method in the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0022] The content of the present invention can be more easily understood by referring to the following detailed description of the preferred embodiments of the present invention and the included examples. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the art to which the present invention belongs. When there is a contradiction, the definition in this specification shall prevail.

[0023] Example 1:

[0024] As Figure 1 shown, in the first aspect of this embodiment, a food additive detection system is provided, including a terahertz spectroscopy database, a qualitative analysis module, and a quantitative analysis module. The qualitative analysis module and the quantitative analysis module are communicatively connected to the terahertz spectroscopy database. The terahertz spectroscopy database is used for storing and managing terahertz spectroscopy data. The qualitative analysis module is used for qualitative analysis of terahertz spectroscopy data, and the quantitative analysis module is used for quantitative analysis of terahertz spectroscopy data.

[0025] Among them, the main interface window provided in this embodiment has a title of "Terahertz Absorption Spectrum Data Processing and Analysis System", the window size is set to 800×600 pixels, and the interface consists of four function module buttons and an exit button. The function modules include quantitative analysis, qualitative analysis, data visualization, and data online transmission. Each module button uses a uniformly designed QPushButton component with a size of 600×75 pixels and a font size of 18px to highlight the module name and improve readability. The exit button is located in the lower right corner of the interface with a size of 120×60 pixels and a font size of 16px, which conforms to its functional positioning and visual characteristics.

[0026] The interface layout adopts a vertical arrangement method, with a 20-pixel spacing left at the top and a 50-pixel spacing between buttons, ensuring that the overall interface is simple, beautiful, and not crowded. All buttons are configured with corresponding click events, and clicking them can enter the corresponding function module window. This layout design is reasonable and the operation is intuitive, significantly improving the interactivity and user experience of the system.

[0027] The qualitative analysis module includes a first data reading and loading module, a first data generation module, and a qualitative result analysis module. The first data reading and loading module is used to read terahertz spectrum data from the terahertz spectrum database. The first data generation module is used to generate an absorption spectrum and a refractive index spectrum based on the terahertz spectrum data. The qualitative result analysis module is used to identify the component composition of the sample to be measured based on the absorption spectrum and the refractive index spectrum. Among them, in the qualitative result analysis module, the component composition of the sample to be measured is identified through a composite neural network model CNN-LSTM-Attention. The qualitative analysis module focuses on the classification and recognition of spectral data by introducing the CNN-LSTM-Attention network and encapsulates this model as an independent Python class DXModel. In the user interface, clicking the "Run Analysis" button can trigger the execution of the classification algorithm. Through CNN-LSTM-Attention, not only the accuracy of classification and recognition is significantly improved, but also the operation efficiency is increased, fully reflecting the advantages and practicality of this module in spectral data analysis.

[0028] The quantitative analysis module includes a second data reading and loading module, a second data generation module, and a quantitative result analysis module. The second data reading and loading module is used to read terahertz spectral data from the terahertz spectral database. The second data generation module is used to generate an absorption spectrum and a refractive index spectrum based on the terahertz spectral data. The quantitative result analysis module is used to identify the concentration of the target component in the sample to be tested based on the absorption spectrum and the refractive index spectrum. Among them, in the quantitative analysis module, the concentration of the target component in the sample to be tested is identified through a convolutional neural network model CNN. By introducing the convolutional neural network (CNN), the quantitative analysis module realizes the precise quantitative analysis of food additives based on spectral data. Its user interface is built based on PyQt5, combines Matplotlib to realize data visualization, and integrates an SQLite database for data management. The interface design includes three functional areas: file selection, record selection, and chart display. The QPushButton and QComboBox components are used to realize data loading and selection, and the absorption coefficient spectrum, refractive index spectrum, and substance concentration distribution map are drawn through Matplotlib.

[0029] The core algorithm of the quantitative analysis module is translated from MATLAB code to Python and encapsulated as a Python class named DLModel. After clicking the "Run Analysis" button, the system triggers the calculation and displays the analysis results on the interface. The module also designs a perfect exception handling mechanism. When the database connection fails or the file path is invalid, a prompt message will pop up to ensure a clear operation process and stable system operation, thus improving the user experience and system reliability.

[0030] It also includes a data visualization module. The data visualization module is communicatively connected to the terahertz spectral database and is used to graphically display the terahertz spectral data. The data visualization module is responsible for the intuitive display of the spectral data and has functions of data addition, deletion, and browsing. Through data visualization, the characteristics and changes of the spectral data can be intuitively understood and analyzed, thus providing support for subsequent analysis and decision-making.

[0031] The data visualization module includes a database loading module, a display module, a record addition and deletion module, and a spectral data plotting module. The database loading module is used to load the SQLite database. The display module is used to display data entries. The record addition and deletion module is used to add and delete records. The spectral data plotting module is used to plot spectral visualization data in the form of pictures, tables, etc. The data visualization module consists of three classes: DataVisualizer, EntryDialog, and SpectraPlotDialog. Among them, DataVisualizer is responsible for creating the main window and database operations, including functions such as loading the database, updating the table, adding and deleting records, etc. After the user inputs data through EntryDialog, the database is updated, or the corresponding entry is deleted by selecting a record in the table and the interface is refreshed. SpectraPlotDialog is used for spectral data display, supporting reading associated spectral files and plotting graphs of the relationships between frequency, absorption coefficient, and refractive index, with coordinate labels and grids for analysis. The module adopts an exception handling mechanism to ensure that a prompt message is displayed when an error occurs in file reading or database operation, guaranteeing the stable operation of the program and the intuitive and easy-to-use functions.

[0032] It also includes a data online transmission module. The data online transmission module is communicatively connected to the terahertz spectral database and is used to achieve remote data sharing and real-time transmission with the terahertz spectral database. The data online transmission module includes functions for inputting the receiving end, the sending end, IP addresses, and port numbers, as well as a function for displaying the transmission result. This module ensures that spectral data can be transmitted to the system in a timely manner for qualitative identification and quantitative analysis.

[0033] The data online transmission module is based on the TCP protocol and uses Python's socket library to implement data communication. It develops a graphical interface through PyQt5, supporting status monitoring, logging, and display of transmission progress. The module consists of a sending end and a receiving end. The receiving end is integrated into the online detection system and is responsible for listening on the specified IP and port to receive spectral data. The sending end is independently installed on the host computer for data transmission. The interface of the sending end includes input boxes for IP addresses and ports, a file selection button, a status display label, and a progress bar. The user completes connection establishment, data sending, and real-time update of the transmission status through the interface.

[0034] The receiving end starts listening and receiving data through the server_listen function. The interface provides functions for status display, a listening button, and logging. The status indicator dynamically reflects the operation of the system. The module has an exception handling mechanism that can capture problems such as network interruption and port conflict, record logs, and prompt the user through the interface to ensure the stable and reliable operation of the system.

[0035] In this embodiment, the Main Application integrates quantitative analysis, qualitative analysis, data visualization, and data online transmission modules. Users can perform comprehensive processing and analysis of spectral data under a unified interface. For easy distribution and operation, the PyInstaller tool is used to package the program. By using the command pyinstaller --onefile --windowed mainapp.py, all modules and dependencies are integrated into an executable file. The generated file after packaging is located in the dist folder, and running it can start the program.

[0036] In the second aspect, as Figure 2 shown, a food additive detection method is provided, which is applied to a food additive detection system and includes the following steps:

[0037] S1. Obtain the terahertz spectral data of the sample to be tested, preprocess the terahertz spectral data to obtain preprocessed data;

[0038] The terahertz spectral data of the sample to be tested is obtained through a transmission terahertz time-domain spectroscopy system, and the data is subjected to Savitzky-Golay (S-G) smoothing processing and principal component analysis (PCA) dimensionality reduction processing to remove noise and extract main features, thereby realizing the preprocessing of the terahertz spectral data.

[0039] S2. Load the preprocessed data through the qualitative analysis module and perform qualitative analysis to identify the component composition of the sample to be tested, obtaining a qualitative analysis result;

[0040] Construct a qualitative analysis composite neural network model CNN-LSTM-Attention, optimize the model structure and parameters, and integrate the trained model into the qualitative analysis module for accurate classification and identification of sample components.

[0041] S3. Load the preprocessed data through the quantitative analysis module and perform quantitative analysis to identify the concentration of the target component of the sample to be tested, obtaining a quantitative analysis result;

[0042] Construct a quantitative analysis convolutional neural network model CNN, perform model training and testing, optimize the parameters to achieve accurate determination of the concentration of food additives, and integrate the trained model into the quantitative analysis module for identifying the concentration of food additive components in the sample to be tested.

[0043] S4. The qualitative analysis result and the quantitative analysis result are visually displayed through the data visualization module;

[0044] The data visualization module uses intuitive methods such as charts and curves to display the qualitative analysis result and the quantitative analysis result, helping users quickly understand the component composition and concentration distribution of the sample. This intuitive presentation provides strong support for subsequent decision-making and at the same time improves the operation convenience and practicality of the system.

[0045] S5. The qualitative analysis results and quantitative analysis results are remotely shared and transmitted in real time with the terahertz spectroscopy database.

[0046] Through the data online transmission module, the terahertz spectroscopy data and analysis results are remotely shared and transmitted in real time to ensure timely update and rapid feedback of the data, thereby supporting the continuous monitoring and evaluation of food additives.

[0047] The above-described 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 foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A food additive detection system, characterized in that: It includes a terahertz spectrum database, a qualitative analysis module and a quantitative analysis module. The qualitative analysis module and the quantitative analysis module are communicatively connected with the terahertz spectrum database. The terahertz spectrum database is used to store and manage terahertz spectrum data. The qualitative analysis module is used to perform qualitative analysis on the terahertz spectrum data. The quantitative analysis module is used to perform quantitative analysis on the terahertz spectrum data.

2. A food additive detection system according to claim 1, characterized in that: The qualitative analysis module includes a first data reading and loading module, a first data generating module and a qualitative result analysis module. The first data reading and loading module is used to read terahertz spectrum data from the terahertz spectrum database. The first data generating module is used to generate an absorption spectrum and a refractive index spectrum according to the terahertz spectrum data. The qualitative result analysis module is used to identify the component composition of the sample to be tested according to the absorption spectrum and the refractive index spectrum.

3. A food additive detection system according to claim 2, characterized in that: In the qualitative result analysis module, the component composition of the sample to be tested is identified by using a composite neural network model CNN-LSTM-Attention.

4. A food additive detection system according to claim 1, characterized in that: The quantitative analysis module includes a second data reading and loading module, a second data generating module and a quantitative result analysis module, wherein the second data reading and loading module is used to read terahertz spectrum data from the terahertz spectrum database, the second data generating module is used to generate an absorption spectrum and a refractive index spectrum according to the terahertz spectrum data, and the quantitative result analysis module is used to identify the concentration of the target component in the sample to be tested according to the absorption spectrum and the refractive index spectrum.

5. A food additive detection system according to claim 4, characterized in that: In the qualitative result analysis module, the concentration of the target component in the sample to be tested is identified by using a convolutional neural network model CNN.

6. A food additive detection system according to claim 1, characterized in that: It also includes a data visualization module, which is communicatively connected to the terahertz spectrum database and is used to graphically display the terahertz spectrum data.

7. A food additive detection system according to claim 1, characterized in that: It also includes a data online transmission module, which is communicatively connected to the terahertz spectrum database and is used to realize remote data sharing and real-time transmission with the terahertz spectrum database.

8. A method for detecting food additives, characterized in that: A food additive detection system applied to any one of claims 1 to 6, comprising the following steps: Acquire terahertz spectrum data of the sample to be tested, pre-process the terahertz spectrum data to obtain pre-processed data; load the pre-processed data through the qualitative analysis module and perform qualitative analysis to identify the composition of the sample to be tested, and obtain a qualitative analysis result; The preprocessed data is loaded through the quantitative analysis module and quantitative analysis is performed to identify the concentration of the target component of the sample to be tested, and the quantitative analysis results are obtained.

9. A food additive detection method according to claim 8, characterized in that: The qualitative analysis results and the quantitative analysis results are displayed in a visual manner.

10. A food additive detection method according to claim 8, characterized in that: The qualitative analysis result and the quantitative analysis result can realize remote data sharing and real-time transmission with the terahertz spectrum database.