Intelligent biochemical substance identification method based on cooperation of terahertz time-domain spectroscopy system and FPGA
By combining the terahertz time domain spectroscopy system and FPGA, the CNN model is used to identify and classify biochemical substances, which solves the problem that traditional technology is difficult to efficiently process and analyze terahertz spectral data, and achieves rapid and accurate biochemical substance recognition and reduces detection costs.
Patent Information
- Application Number
- CN202411588358.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2025-03-04
AI Technical Summary
The existing technology is difficult to efficiently process and analyze terahertz spectral data to achieve intelligent and accurate identification of biochemical substances, and traditional computing platforms are difficult to meet the detection needs of fast and low power consumption.
The terahertz time domain spectroscopy system and field programmable gate array (FPGA) are used to obtain THz spectral data of biochemical substances through THz-TDS, train them using convolutional neural network (CNN) model, and deploy the trained CNN model to FPGA, and use the parallel processing capabilities of FPGA to achieve inference acceleration.
It realizes accurate, fast and intelligent identification of biochemical substances, meets the fast and low-power detection needs, and reduces detection costs, and has a wide range of application prospects.
Smart Images

Figure CN119560042A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of biochemical detection, and in particular to an intelligent identification method for biochemical substances by combining a terahertz time domain spectroscopy system (THz-TDS) with a field programmable gate array (FPGA). Background Art
[0002] Biochemical detection plays a vital role in many fields such as medical diagnosis, food safety monitoring and drug development. Although traditional biochemical detection methods, such as chromatography, mass spectrometry and electrochemical methods, can meet the detection needs to a certain extent, they generally have problems such as long detection cycle, complex operation and high cost. In recent years, with the rapid development of spectroscopy technology, terahertz (THz) spectroscopy has shown great application potential in the field of biochemical detection due to its unique penetration, fingerprint characteristics and sensitivity to material structure. However, how to efficiently process and analyze a large amount of THz spectral data and realize intelligent and accurate identification of biochemical substances is still a technical challenge currently faced.
[0003] In order to overcome this problem, researchers began to explore the application of machine learning algorithms to the processing and analysis of THz spectral data. Among them, convolutional neural network (CNN), as a deep learning algorithm, has achieved remarkable success in image recognition, speech recognition and other fields due to its powerful feature extraction and classification capabilities. Applying CNN to the processing and analysis of THz spectral data is expected to achieve accurate identification of biochemical substances. However, the training and reasoning process of the CNN model requires a lot of computing resources, and traditional computing platforms are difficult to meet the needs of fast and low-power detection.
[0004] Therefore, how to efficiently process and analyze THz spectral data, realize intelligent and accurate identification of biochemical substances, and meet the needs of fast and low-power detection is a technical problem that needs to be solved urgently in the current field of biochemical detection. Summary of the invention
[0005] In response to the problems existing in the prior art, the present invention proposes an intelligent identification method for biochemical substances based on the collaboration of a terahertz time-domain spectroscopy system and FPGA. This method achieves accurate identification and deploys the trained CNN model to the FPGA. The parallel processing capability of the FPGA is used to accelerate reasoning and meet the needs of fast, low-power intelligent identification of biochemical substances.
[0006] The technical solution provided by the present invention is as follows:
[0007] The intelligent identification method of biochemical substances based on the collaboration of terahertz time-domain spectroscopy system and FPGA is characterized by comprising the following steps:
[0008] Step S1: mixing a powdered or granular biochemical substance with polyethylene to obtain a solid tablet, placing the solid tablet in a THz-TDS, and obtaining THz time-domain spectral data using the THz-TDS;
[0009] Step S2: Perform Fourier transform on the reference signal and the sample time domain signal in the THz time domain spectrum data at the same time to obtain frequency domain signals R(ω) and S(ω), and use the frequency domain signals R(ω) and S(ω) to calculate the refractive index n(ω) and absorption coefficient α(ω) optical parameters; use the refractive index n(ω) as the horizontal coordinate and the absorption coefficient α(ω) as the vertical coordinate to reconstruct new THz spectrum data;
[0010] Step S3: Using the THz spectrum data obtained in step S2 as a data set, and training it using a CNN model;
[0011] Step S4: Export the trained CNN model weight parameters, deploy the CNN model to the FPGA, input the THz spectrum of the biochemical substance to be tested into the FPGA, and identify the type of biochemical substance.
[0012] Further, step S1 comprises:
[0013] Step S11: mixing the powdered or granular biochemical substance with polyethylene in a ratio of 1:1, 1:2, 1:3, 1:4, and 1:5, respectively, and grinding them thoroughly in an agate mortar;
[0014] Step S12: pouring the ground powder into a tablet press and applying a pressure of about 10 MPa to obtain a biochemical solid tablet;
[0015] Step S13: filling the THz-TDS with nitrogen, and when the water vapor content in the THz-TDS is less than 8%, measuring the THz time domain spectrum data in the no-load state as a reference signal;
[0016] Step S14: placing the solid tablet into a THz-TDS and filling it with nitrogen. When the water vapor content in the THz-TDS is less than 8%, THz time-domain spectrum data of the biochemical substance is obtained by rapid scanning of the THz-TDS.
[0017] Step S15: Repeat step S14 to obtain THz time-domain spectrum data of biochemical substances and polyethylene solid tablets in different ratios.
[0018] Furthermore, in step S2, the formulas of the frequency domain signals R(ω) and S(ω), the refractive index n(ω) and the absorption coefficient α(ω) optical parameters are as follows:
[0019]
[0020] Where c is the speed of light in vacuum, d is the thickness of the sample, ρ(ω) is the amplitude, ω is the angular frequency, is the phase difference between the sample signal and the reference signal.
[0021] Furthermore, in step S2, a one-dimensional data to two-dimensional image algorithm is used to convert the THz spectrum data into a two-dimensional image.
[0022] Further, step S3 includes the following steps:
[0023] Step S31: Divide the preprocessed biochemical substance THz spectrum data into a training set of 80% and a test set of 20%;
[0024] Step S32: construct a CNN model; it includes three convolutional layers, two fully connected layers, Relu as the activation function, and selects maximum pooling;
[0025] Step S33: Use the CNN model to train the THz data.
[0026] Further, step S4 includes the following steps:
[0027] Step S41: quantize the weight parameters of the trained CNN model and save them to the SD card after quantization;
[0028] Step S42: deploy the CNN model to FPGA.
[0029] The beneficial effects of the present invention are:
[0030] The present invention uses THz-TDS to collect THz spectrum data of biochemical substances; processes the THz spectrum data; uses the processed THz spectrum data as a data set, trains it using CNN, and realizes accurate recognition of biochemical substances by the CNN model; exports the trained CNN model weight parameters, and deploys the CNN model to FPGA, uses the powerful parallel processing capability of FPGA to realize reasoning acceleration, and can intelligently identify biochemical substances.
[0031] The present invention realizes accurate and rapid intelligent identification of biochemical substances, and because FPGA has the characteristic of low power consumption, the present invention can save energy during long-term operation and reduce the detection cost. Therefore, the present invention has broad application prospects in many fields such as medical diagnosis, food safety monitoring and drug research and development. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 It is a flow chart of the intelligent identification method of biochemical substances based on the collaboration of the terahertz time-domain spectroscopy system and FPGA of the present invention. DETAILED DESCRIPTION
[0033] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0034] like Figure 1 As shown in FIG. 1 , it is a flow chart of the intelligent identification method of biochemical substances based on the collaboration of the terahertz time-domain spectroscopy system and FPGA of the present invention, which specifically includes the following steps:
[0035] Step S1: using THz-TDS to collect THz spectrum data of biochemical substances; specifically including the following sub-steps:
[0036] Step S11: Powders or granular biochemical substances of ten kinds of biochemical substances, including phenylalanine, tyrosine, lactose monohydrate, glucose, sucrose, fructose, dextran, guanine, cytosine, and thymine, are mixed with polyethylene in a ratio of 1:1, 1:2, 1:3, 1:4, and 1:5, respectively, and fully ground in an agate mortar to reduce Mie scattering;
[0037] Step S12: pour the ground powder into a tablet press and apply a pressure of about 10 MPa to obtain ten kinds of biochemical solid tablets. Five solid tablets are pressed for each biochemical substance in each ratio, so 25 solid tablets are obtained for each biochemical substance, with a tablet diameter of 15 mm and a thickness of about 1 mm;
[0038] Step S13: filling the THz-TDS with nitrogen, and when the water vapor content in the THz-TDS is less than 8%, measuring the THz time domain spectrum data in the no-load state as a reference signal;
[0039] Step S14: Put the solid tablets into the THz-TDS and fill it with nitrogen. When the water vapor content in the THz-TDS is less than 8%, start the measurement. Through the fast scanning module of the THz-TDS, 40 THz time domain spectrum data are obtained for each solid tablet;
[0040] Step S15: Repeat step S14 to obtain 1000 THz time-domain spectrum data for each biochemical substance.
[0041] Step S2: Processing the THz spectrum data; specifically including the following sub-steps:
[0042] Step S21: Perform Fourier transform on the reference signal and sample time domain signal in the THz time domain spectrum data at the same time, and obtain frequency domain signals R(ω) and S(ω), and calculate the optical parameters of the refractive index n(ω) and the absorption coefficient α(ω), and the formula is as follows:
[0043]
[0044] Where c is the speed of light in vacuum, d is the thickness of the sample, ρ(ω) is the amplitude, ω is the angular frequency, is the phase difference between the sample signal and the reference signal.
[0045] Step S22: reconstructing a new THz spectrum by taking the refractive index n(ω) as the abscissa and the absorption coefficient α(ω) as the ordinate;
[0046] Step S23: Using the Gram Angular Field (GAF) algorithm, the new THz spectrum is converted into a two-dimensional image that meets the input requirements of the CNN model. The size of the two-dimensional image that meets the input requirements of the CNN model is: 224×224×3.
[0047] Step S3: The processed THz spectrum data is used as a data set, and a convolutional neural network (CNN) is used to train the data to achieve accurate recognition of biochemical substances by the CNN model; specifically, the following sub-steps are included:
[0048] Step S31: Divide the processed biochemical substance THz spectrum data into a training set (80%) and a test set (20%);
[0049] Step S32: construct a CNN model; specifically, the constructed CNN model includes three convolutional layers, two fully connected layers, Relu as the activation function, and selects maximum pooling;
[0050] Step S33: Using the CNN model to train the THz data set, after 100 rounds of training, the recognition accuracy of the CNN model for the ten biochemical substances reaches 99.2%, and the model has a good recognition result. At this time, the weights are saved in bin format;
[0051] Step S4: Export the trained CNN model weight parameters and deploy the CNN model to FPGA, using the powerful parallel processing capability of FPGA to accelerate reasoning. Specifically, it includes the following sub-steps:
[0052] Step S41: quantize the weight parameters of the trained CNN model to int8 and save them to the SD card;
[0053] Step S42: Deploy the CNN model to the FPGA. The FPGA-based neural network accelerator is implemented on the ZYNQ-7020, which consists of a software processing unit (PS) and a programmable hardware logic unit (PL). The PS side is responsible for scheduling the image data and weight parameters required by the CNN model, and transferring these data from the SD card to the PL side for further processing. The PL uses hardware acceleration to execute the parallel computing tasks of the network to improve the processing speed and efficiency of the CNN model. It can be divided into the following steps:
[0054] Step S421: Use the Vivado HLS tool to write the implementation of the CNN model in C++, including convolution, ReLU, pooling, and fully connected layers;
[0055] Step S422: Perform high-level synthesis in Vivado HLS, check the synthesis report to confirm resource utilization and timing information, and simulate to verify the functionality of the CNN model to ensure that the output is consistent with expectations;
[0056] Step S423: In Vivado HLS, select “Export RTL” to generate the IP core of the CNN model;
[0057] Step S424: import the designed IP core into Vivado, set the FPGA constraint file (XDC), define the I / O pins and clock constraints, and generate a bitstream file through project synthesis;
[0058] Step S425: Download the generated bitstream file to the ZYNQ-7020 development board through the JTAC interface.
[0059] Step S43: Input the THz spectrum of the biochemical substance to be tested into the FPGA, and after accelerated reasoning, intelligently identify the type of biochemical substance. Save the THz spectrum of the biochemical substance to be tested into an SD card that already has weight parameters, insert the SD card into the ZYNQ-7020 development board, connect to the ZYNQ-7020 through the serial port monitoring tool of the Xilinx Vitis software, and you can see the reasoning results of the THz spectrum on the FPGA through the console.
[0060] The present invention is described in detail above in conjunction with the embodiments. The above embodiments are a preferred technical solution of the present invention, but the present invention is not limited to the above embodiments. Various changes can be made within the knowledge of ordinary technicians in the field without departing from the purpose of the present invention. The contents not described in detail in the present invention can adopt the existing technology.
Claims
1. A biochemical substance intelligent identification method based on the collaboration of terahertz time-domain spectroscopy system and FPGA, characterized in that: The following steps are involved: Step S1: mixing a powdered or granular biochemical substance with polyethylene to obtain a solid tablet, placing the solid tablet in a THz-TDS, and using the THz-TDS to obtain THz time-domain spectrum data of the biochemical substance; Step S2: Perform Fourier transform on the reference signal and the sample time domain signal in the THz time domain spectrum data at the same time to obtain frequency domain signals R(ω) and S(ω), and use the frequency domain signals R(ω) and S(ω) to calculate the refractive index n(ω) and absorption coefficient α(ω) optical parameters; use the refractive index n(ω) as the horizontal coordinate and the absorption coefficient α(ω) as the vertical coordinate to form new THz spectrum data; Step S3: using the THz spectrum data obtained in step S2 as a data set and training it using a CNN model; Step S4: Export the trained CNN model weight parameters, deploy the CNN model to the FPGA, input the THz spectrum of the biochemical substance to be tested into the FPGA, and identify the type of biochemical substance.
2. The intelligent identification method of biochemical substances based on the collaboration of terahertz time-domain spectroscopy system and FPGA as claimed in claim 1 is characterized in that: Step S1 includes: Step S11: mixing the powdered or granular biochemical substance with polyethylene in a ratio of 1:1, 1:2, 1:3, 1:4, and 1:5, respectively, and grinding them thoroughly in an agate mortar; Step S12: pouring the ground powder into a tablet press and applying a pressure of about 10 MPa to obtain a biochemical solid tablet; Step S13: filling the THz-TDS with nitrogen, and when the water vapor content in the THz-TDS is less than 8%, measuring the THz time domain spectrum data in the no-load state as a reference signal; Step S14: placing the solid tablet into a THz-TDS and filling it with nitrogen. When the water vapor content in the THz-TDS is less than 8%, THz time-domain spectrum data of the biochemical substance is obtained by rapid scanning of the THz-TDS. Step S15: Repeat step S14 to obtain THz time-domain spectrum data of biochemical substances and polyethylene solid tablets in different ratios.
3. The intelligent identification method of biochemical substances based on the collaboration of terahertz time-domain spectroscopy system and FPGA as claimed in claim 1 is characterized in that: In step S2, the formula for obtaining the optical parameters of the refractive index n(ω) and the absorption coefficient α(ω) using the frequency domain signals R(ω) and S(ω) is as follows: Where c is the speed of light in vacuum, d is the thickness of the sample, ρ(ω) is the amplitude, ω is the angular frequency, is the phase difference between the sample signal and the reference signal.
4. The intelligent identification method of biochemical substances based on the collaboration of terahertz time-domain spectroscopy system and FPGA as claimed in claim 1, characterized in that: In step S2, the Gram angular field (GAF) algorithm is used to convert the THz spectrum data into a two-dimensional image.
5. The intelligent identification method of biochemical substances based on the collaboration of terahertz time-domain spectroscopy system and FPGA as claimed in claim 1, characterized in that: Step S3 includes the following steps: Step S31: Divide the preprocessed biochemical substance THz spectrum data into a training set of 80% and a test set of 20%; Step S32: construct a CNN model; it includes three convolutional layers, two fully connected layers, Relu as the activation function, and selects maximum pooling; Step S33: Use the CNN model to train the THz data.
6. The intelligent identification method of biochemical substances based on the collaboration of terahertz time-domain spectroscopy system and FPGA as claimed in claim 1, characterized in that: Step S4 includes the following steps: Step S41: quantize the weight parameters of the trained CNN model and save them to the SD card after quantization; Step S42: deploy the CNN model to FPGA.
Citation Information
Patent Citations
Method for quantitative detection of amino acid content in grain by THz-TDS technology
CN104406923A
Terahertz time domain spectroscopy-based coal and rock discrimination method
CN108279217A
Metamaterial terahertz spectroscopy identification method based on deep learning
CN111428585A
Substance identification method based on capsule network and terahertz spectral image
CN111931761A
Substance terahertz characteristic peak identification method based on second derivative spectrum
CN115144361A