A method and system for detecting heavy metals in water based on terahertz wireless signals

By using terahertz wireless signal-based 3D point cloud data processing and deep learning models, the problems of insufficient equipment complexity and accuracy in water trace heavy metal detection have been solved, achieving portable and high-precision heavy metal detection.

CN121678587BActive Publication Date: 2026-07-07BEIJING UNIV OF POSTS & TELECOMM

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING UNIV OF POSTS & TELECOMM
Filing Date
2025-10-24
Publication Date
2026-07-07

AI Technical Summary

Technical Problem

Existing technologies for detecting trace heavy metals in water suffer from problems such as high equipment requirements, complex operation, limited detection scenarios, and low efficiency. They are difficult to make portable and real-time detection possible, and the detection accuracy of traditional methods is insufficient to meet the needs of trace heavy metals.

Method used

A detection method based on terahertz wireless signals is adopted. By acquiring terahertz three-dimensional point cloud data, the reflected signal is converted using a signal complexification algorithm and a geometric physical model. Combined with the 3D point cloud feature extraction module of Transformer and PointNet networks, and a deep learning model embedding physical information, the identification and quantification of heavy metal types and concentrations are realized.

Benefits of technology

It enables accurate identification of heavy metal types in water and quantitative detection of concentrations below trace levels, improving the versatility and accuracy of the detection, and is suitable for non-contact, rapid on-site detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121678587B_ABST
    Figure CN121678587B_ABST
Patent Text Reader

Abstract

The application provides a heavy metal detection method and system in water based on a terahertz wireless signal, and the method comprises the following steps: obtaining terahertz three-dimensional point cloud data corresponding to a water sample to be detected; wherein the terahertz three-dimensional point cloud data is obtained by converting a terahertz reflection signal corresponding to the water sample to be detected based on a signal complex algorithm and a geometric physical model; the terahertz three-dimensional point cloud data comprises real parts, imaginary parts and frequency information of the terahertz reflection signal converted by the signal complex algorithm; inputting the three-dimensional point cloud data into a pre-trained point cloud feature extraction module to output three-dimensional space features; and inputting the three-dimensional space features into a pre-trained type identification module and a pre-trained concentration quantification module respectively to output types and concentrations of heavy metals contained in the water sample to be detected. The application is based on a terahertz wireless sensing technology and combines a detection model embedded with physical knowledge, and can accurately sense the types and concentrations of heavy metals in water with concentrations below trace amounts.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] Cross-references to related applications

[0002] This application claims priority to Chinese Patent Application No. 202511507837X, filed on October 21, 2025, the disclosure of which is incorporated herein by reference in its entirety. Technical Field

[0003] This invention relates to the field of wireless signal technology, and in particular to a method and system for detecting heavy metals in water based on terahertz wireless signals. Background Technology

[0004] Trace heavy metals in water (such as lead, mercury, arsenic, or cadmium) accumulate through the food chain, posing a significant threat to ecosystems and human health. For example, for every 5 μg / dL increase in lead levels in a child's blood, their IQ score decreases by 1.61 points in adulthood; for every 1 μg / dL increase in cadmium levels in the blood, the risk of developing chronic kidney disease increases by 1.48 times. Furthermore, data from the World Health Organization shows that approximately 1.5 million people die globally each year due to lead exposure, and at least 140 million people in over 70 countries have drinking water with arsenic levels exceeding the safety standard of 10 μg / dL. Therefore, achieving accurate detection of trace heavy metals in water is crucial for ensuring drinking water safety and preventing health risks.

[0005] Currently, the detection of trace heavy metals in water mainly relies on laboratory-level analytical techniques, such as atomic absorption spectrometry (AAS), atomic emission spectrometry (AES), and inductively coupled plasma mass spectrometry (ICP-MS). For example, atomic absorption spectrometry (AAS) can quantify the amount of heavy metals by measuring the absorption of light at a specific wavelength by elemental atoms, while inductively coupled plasma mass spectrometry (ICP-MS) can distinguish element types and quantify their content by measuring the mass-to-charge ratio of ions. However, these techniques have the following key drawbacks:

[0006] ① High equipment and operational barriers: It relies on large-sized, expensive, precision laboratory equipment (such as ICP-MS instruments), and the operation process is cumbersome. For example, standard solutions need to be prepared for system calibration before ICP-MS detection, which must be operated by professional technicians. Ordinary users cannot use it independently. ② Limited detection scenarios: The equipment is not portable and can only be used in laboratory environments. It cannot achieve real-time on-site detection (such as immediate screening of water sources and household drinking water). ③ Low detection efficiency: It takes several hours to several days from sample pretreatment to result output, which is not suitable for rapid detection of batch samples or emergency detection needs.

[0007] Furthermore, even when some wireless sensing technologies (such as Radio Frequency Identification, RFID), WiFi, and Ultra-Wideband (UWB) are attempted to be applied to liquid detection, the detection limit can only reach 10 due to bandwidth and sensing capability limitations. 5 ~10 7 The μg / dL level is far from meeting the detection requirements for trace heavy metals (μg / dL level) in water, making it difficult to promote its use in actual environmental monitoring and daily drinking water safety screening.

[0008] Therefore, there is an urgent need for a novel method for detecting trace heavy metals in water that is versatile and has high detection accuracy. Summary of the Invention

[0009] Therefore, this invention provides a method and system for detecting heavy metals in water based on terahertz wireless signals, which can more comprehensively reflect the characteristics of the water sample to be tested and overcome the shortcomings of existing technologies in terms of professionalism, operability and real-time performance.

[0010] One aspect of the present invention provides a method for detecting heavy metals in water based on terahertz wireless signals, the method comprising the following steps:

[0011] The process involves acquiring terahertz three-dimensional point cloud data corresponding to the water sample to be tested. The terahertz three-dimensional point cloud data is obtained by converting the terahertz reflection signal corresponding to the water sample to be tested based on a signal complexification algorithm and a geometric physical model. The data includes the real part, imaginary part, and frequency information of the terahertz reflection signal. The terahertz reflection signal corresponding to the water sample to be tested is obtained based on the terahertz signal emitted to the water sample to be tested.

[0012] The terahertz 3D point cloud data is input into a pre-trained point cloud feature extraction module, and the output is the 3D spatial features.

[0013] The three-dimensional spatial features are input into the pre-trained type recognition module and the pre-trained concentration quantification module, respectively, and the output is the type and concentration of the heavy metal to be detected in the water sample.

[0014] In some embodiments of the present invention, a pre-trained type recognition module is used to extract features related to the type of heavy metal in the water sample to be detected.

[0015] The type recognition module includes a 3D type feature extractor and a 3D type recognizer, with the output of the 3D type feature extractor serving as the input of the 3D type recognizer; the pre-trained concentration quantization module includes a 3D concentration feature extractor and a 3D concentration quantizer, with the output of the 3D concentration feature extractor serving as the input of the 3D concentration quantizer;

[0016] Both the type 3D feature extractor and the 3D density feature extractor adopt an encoder-decoder structure, and both the 3D type recognizer and the 3D density quantizer contain fully connected layers.

[0017] In some embodiments of the present invention, the three-dimensional spatial features include the conductivity features of the water sample to be tested; the features extracted by the type identification module include the molar conductivity features of heavy metals in the water sample to be tested under limited dilution conditions.

[0018] The 3D concentration feature extractor in the pre-trained concentration quantization module was trained in the following way:

[0019] The three-dimensional spatial feature training samples are input into the 3D concentration feature extractor in the concentration quantization module to be trained, and the first concentration feature is output.

[0020] The 3D concentration feature extractor is iteratively trained based on the loss function formed by the first and second concentration features to obtain the pre-trained 3D concentration feature extractor. The second concentration feature is the ratio of the type feature corresponding to the 3D spatial feature training sample to the type feature corresponding to the 3D spatial feature training sample. The type feature corresponding to the 3D spatial feature training sample is extracted from the 3D spatial feature training sample by the 3D type feature extractor in the pre-trained type recognition module.

[0021] In some embodiments of the present invention, the encoder-decoder structure in the 3D type feature extractor includes a multilayer perceptron layer, a batch normalization layer, and a ReLU activation function layer;

[0022] The encoder-decoder structure of the 3D density feature extractor consists of multiple fully connected layers.

[0023] In some embodiments of the present invention, the pre-trained point cloud feature extraction module is a neural network composed of a Transformer model and a PointNet network, and the output of the Transformer model is used as the input of the PointNet network.

[0024] The Transformer model is used to add position encoding to each point corresponding to the terahertz 3D point cloud data, and the PointNet network is used to learn the dynamic characteristics of the terahertz 3D point cloud data as the frequency changes.

[0025] The PointNet network consists of a point cloud encoder composed of a multi-layer perceptron; the Transformer model consists of a multi-head self-attention layer, an encoder layer, and a feedforward neural network.

[0026] In some embodiments of the present invention, the signal complexification algorithm is a Fourier transform algorithm, the water sample to be detected contains heavy metals in a dissolved state, and the concentration of heavy metals in the water sample to be detected is below trace amounts.

[0027] In some embodiments of the present invention, the water sample to be tested is an aqueous solution containing the heavy metal to be tested, and the concentration of the heavy metal in the water sample to be tested is less than 0.001 mol / L;

[0028] The real and imaginary information in terahertz 3D point cloud data decreases spirally with increasing frequency, and the terahertz 3D point cloud data appears as a pine tree in 3D space.

[0029] Another aspect of the present invention provides a water heavy metal detection system based on terahertz wireless signals, including a processor, a memory, and a computer program / instructions stored in the memory. The processor is used to execute the computer program / instructions, and when the computer program / instructions are executed, the system implements the steps of the method described in any of the above embodiments.

[0030] Another aspect of the present invention provides a computer-readable storage medium having a computer program / instructions stored thereon, which, when executed by a processor, implement the steps of the method described in any of the above embodiments.

[0031] Another aspect of the present invention provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the method described in any of the above embodiments.

[0032] The present invention proposes a method and system for detecting heavy metals in water based on terahertz wireless signals. This method utilizes the different terahertz absorption characteristics of samples containing different types and concentrations of heavy metals. It uses the real and imaginary information corresponding to the terahertz reflection signal, which contains rich spectral information, to reflect the water sample to be tested. This allows for a direct presentation of the signal variation with frequency, revealing spectral features that are masked in traditional two-dimensional amplitude characterization. Furthermore, this application employs a point cloud feature extraction module, a type recognition module, and a concentration quantization module to comprehensively and specifically extract features, which can effectively reduce the difficulty of concentration quantization and improve detection accuracy.

[0033] Additional advantages, objects, and features of the invention will be set forth in part in the description which follows, and will also become apparent in part to those skilled in the art upon studying the description, or may be learned by practice of the invention. The objects and other advantages of the invention can be realized and obtained by means of the structures specifically pointed out in the description and drawings.

[0034] Those skilled in the art will understand that the objectives and advantages achievable with the present invention are not limited to those specifically described above, and that the above and other objectives achievable with the present invention will become clearer from the following detailed description. Attached Figure Description

[0035] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, are not intended to limit the scope of the invention. In the drawings:

[0036] Figure 1 This is a schematic diagram showing the differences in terahertz absorption spectra of different heavy metal types and concentrations in one embodiment of the present invention.

[0037] Figure 2 This is a schematic diagram of a terahertz schwann structure in one embodiment of the present invention.

[0038] Figure 3 This is a schematic diagram of the feature distribution of a traditional method for type identification and concentration quantification through clustering in one embodiment of the present invention.

[0039] Figure 4 This is a schematic diagram illustrating the principle of a method for detecting heavy metals in water based on terahertz wireless signals in one embodiment of the present invention.

[0040] Figure 5 This is a flowchart illustrating a method for detecting heavy metals in water based on terahertz wireless signals according to an embodiment of the present invention.

[0041] Figure 6 This is a schematic diagram of the point cloud feature extraction module in one embodiment of the present invention.

[0042] Figure 7 This is a schematic diagram of the structure of the category identification module and the concentration quantification module in one embodiment of the present invention. Detailed Implementation

[0043] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the embodiments and accompanying drawings. Here, the illustrative embodiments and descriptions of this invention are used to explain the invention, but are not intended to limit the invention.

[0044] It should also be noted that, in order to avoid obscuring the invention with unnecessary details, only the structures and / or processing steps closely related to the solution according to the invention are shown in the accompanying drawings, while other details that are not closely related to the invention are omitted.

[0045] It should be emphasized that the term "including / comprises" as used herein refers to the presence of a feature, element, step, or component, but does not exclude the presence or addition of one or more other features, elements, steps, or components.

[0046] It should also be noted that, unless otherwise specified, the term "connection" in this article can refer not only to a direct connection, but also to an indirect connection involving an intermediary.

[0047] In the following description, embodiments of the invention will be illustrated with reference to the accompanying drawings. In the drawings, the same reference numerals represent the same or similar parts, or the same or similar steps.

[0048] The core principle of current mainstream methods for detecting trace heavy metals in water is based on quantitative analysis using characteristic spectra or ion peak intensities of elements. However, these methods have significant limitations in trace detection scenarios. In the quantitative detection of trace water samples, the existing AAS (Automatic Aspect-Based Analyzer) has an accuracy rate of only 85.8% for type identification and only 77.9% for concentration quantification. Figure 1 As shown ( Figure 1 In the image, (a) and (b) represent the differences in terahertz absorption spectra between different types of heavy metals. Figure 1 In the diagram, (c) and (d) represent the differences in terahertz absorption spectra between different concentrations of heavy metals, and D1, D2, D3, and D4 represent different heavy metal concentrations (D1 < D2 < D3 < D4). The core reason for the low accuracy lies in the extremely high similarity of the signal spectra: the lowest differences in absorption spectral intensity between different heavy metal types and concentrations are 0.03 and 0.02, respectively, while the highest similarities reach 0.981 and 0.988, respectively. The fundamental problem is that existing detection methods rely on the two-dimensional physical quantity of "absorption intensity-frequency" to characterize heavy metals in water. This limited dimension makes it difficult to distinguish the characteristics of trace substances, thus limiting the ability to identify and quantify them.

[0049] To address this challenge, this application proposes to characterize different heavy metal types and concentrations based on the following findings:

[0050] ① "Terahertz Pine Phenomenon": The three-dimensional spectral characterization of water samples containing trace amounts of heavy metals exhibits a unique spiral pine-branch morphology, which is mainly influenced by the absorption of terahertz signals by water. This invention defines the unique three-dimensional pattern of the "real-imaginary spiral variation" (specifically, the real and imaginary information corresponding to the terahertz reflection signal spirally decreases with increasing frequency) in the complex plane as the "terahertz pine" structure.

[0051] ② Differences in terahertzson: such as Figure 2 As shown, compared with existing two-dimensional characterization, there are significant differences in terahertz spheroids formed by different types of heavy metals and different concentrations of the same heavy metal (for example, the similarity of terahertz spheroid structures of different types and concentrations of heavy metals can be 0.683 and 0.698, respectively). Figure 2 (a) in the text represents examples of terahertz-Son structures corresponding to water samples containing different types of heavy metals. Figure 2 (b) in the diagram represents an example of a terahertzian structure corresponding to water samples containing different heavy metal concentrations. Figure 2(c) in the diagram represents an example of a terahertzson structure in pure water. From Figure 2 It is known that the branch length and spiral ascent rate of the terahertz pine structure vary with the type of heavy metal (e.g., the branching difference between Zn and Hg) and concentration (e.g., the spiral rate difference between D1 and D5 concentrations of Hg). This difference mainly stems from the differences in the terahertz absorption characteristics (absorption frequency and phase response, etc.) and conductivity of the heavy metals, and these differences lead to significant differences in the sine and cosine components at different frequencies. Therefore, this application proposes using the terahertz pine structure corresponding to the water sample to be tested (the terahertz pine structure can be obtained by visualizing terahertz three-dimensional point cloud data in this application) as a distinguishing feature between trace and ultra-trace heavy metals, in order to solve the problem of high signal similarity (type similarity 0.981, concentration similarity 0.988) in the traditional two-dimensional (absorption intensity-frequency) method. Figure 2 It can be seen that the gap between the real and imaginary information in terahertz 3D point cloud data decreases as the frequency increases.

[0052] It should be noted that the water sample to be tested in this application contains the heavy metal to be detected; therefore, the water sample to be tested can also be referred to as a heavy metal sample to be detected. The water sample to be tested mentioned in this application can be an aqueous solution (or pure aqueous solution) containing the heavy metal to be detected, or it can be a suspension (such as wastewater) containing dissolved heavy metals. That is, the water sample to be tested is a water sample containing dissolved heavy metals, in which case the heavy metals can exist in ionic or complex form. Furthermore, the water sample to be tested may contain one or more types of heavy metals.

[0053] Specifically, this application converts the terahertz reflection signal of the water sample to be tested into a three-dimensional space of "real part-imaginary part-frequency" using a signal complexification algorithm. Combined with geometric and physical models, it obtains comprehensive terahertz three-dimensional point cloud data containing heavy metal characteristics. This allows for visualization of the corresponding terahertz pine structure of the water sample (i.e., the terahertz pine structure and terahertz three-dimensional point cloud data are mutually convertible, and the terahertz three-dimensional point cloud data appears as a pine tree in three-dimensional space). Furthermore, since the signal amplitude originates from the real part (cosine component) and imaginary part (sine component) of the complexified signal, and these two components contain rich spectral information that can be used to describe the amplitude, phase, and dynamic characteristics as a function of frequency, the method proposed in this application can intuitively present the signal's frequency variation, thereby revealing the spectral features masked in the amplitude characterization. The signal complexification algorithm can be any existing technology such as Fourier transform, orthogonal demodulation, and Hilbert transform; this invention is not limited to these.

[0054] Furthermore, regarding the quantification of heavy metal concentration, the terahertz reflection signal fluctuates due to the nonlinear effect of water on the terahertz signal; additionally, such as Figure 3As shown, the concentration differences between trace and ultra-trace heavy metals are subtle (e.g., at the μg / dL level). The terahertzian characteristic distributions obtained by traditional clustering methods for heavy metals at different concentration levels overlap, making concentration quantification extremely difficult.

[0055] To address this challenge, this invention designs a 3D point cloud neural network model embedding physical information (also known as a physical embedding deep learning model or an embedded physical knowledge module). Based on Debye-Hückel theory and the Kohlrausch function, this invention discovers that: when the heavy metal concentration is low ( <0.001 mol / L, Under the condition of a certain type of heavy metal concentration in the water sample to be tested, the concentration of heavy metal in the water sample has a linear relationship with the conductivity of the water sample. Therefore, this invention embeds this physical information into a neural network model to achieve accurate quantification of low-concentration heavy metals. That is, this application can detect the heavy metal of that type in the water when the concentration of a certain type of heavy metal in the water sample is less than 0.001 mol / L. The method proposed in this application is applicable to the detection of metal concentrations below trace levels.

[0056] More specifically, generally speaking, the conductivity of water samples containing trace amounts of heavy metals is subject to a physical constraint: the conductivity of the water sample equals the product of the heavy metal concentration and its molar conductivity. If the water sample contains only one type of heavy metal, when the heavy metal concentration is at a low level ( When the concentration of heavy metals in the water sample is less than 0.001 mol / L, the physical properties of the water sample will change significantly. At this point, the molar conductivity of the water sample is close to that of the heavy metals in the water sample under infinite dilution conditions. Therefore, the molar conductivity of heavy metals under infinite dilution conditions can be used to approximate the actual molar conductivity of the water sample. It is important to note that the molar conductivity of the same heavy metal (even with different valence states) under infinite dilution conditions is a constant value, while the molar conductivity of different types of heavy metals differs under infinite dilution conditions. Therefore, when the water sample contains only one type of heavy metal and the heavy metal concentration is at a low concentration (…),… At concentrations <0.001 mol / L, for this type of heavy metal, the physical constraint on the conductivity of the water sample can be expressed as the product of the heavy metal concentration in the water sample and the molar conductivity of the heavy metal under infinite dilution conditions. That is, when the heavy metal concentration in the water sample... Less than The conductivity of the water sample at mol / L It can be represented as:

[0057] ;

[0058] in, Let represent the molar conductivity of heavy metals contained in the water sample under infinite dilution (varying with the type of heavy metal). The above formula shows that the conductivity of the water sample is constrained by both the concentration and type of heavy metals in the water sample, and is linearly correlated with the concentration of heavy metals. Therefore, this application embeds this physical information constraint into the concentration quantification module through model training, thereby achieving accurate and effective concentration quantification.

[0059] This invention proposes a non-contact method for detecting heavy metals in water based on wireless terahertz signals (THz) to achieve universal and high-precision detection of low-concentration heavy metals. Specifically, this method captures the "terahertz loose" structure formed by the terahertz reflected signal in the three-dimensional space of "real part-imaginary part-frequency," and combines it with a deep learning model embedding physical information. This not only accurately identifies the types of heavy metals in water (such as zinc, copper, mercury, lead, arsenic, chromium, cadmium, and nickel), but also achieves quantitative detection of concentrations below trace levels. Figure 4 As shown, the basic principle of the terahertz wireless signal-based heavy metal detection method in water proposed in this application is as follows: using a terahertz device, a terahertz signal (any frequency band from 0.1 to 10 THz) is wirelessly transmitted vertically to the water sample to be tested, and the reflected signal (i.e., the terahertz reflected signal) is wirelessly received; since the transmitted and reflected terahertz signals are both two-dimensional signals, the terahertz reflected signal needs to be transformed into a three-dimensional space of "real part-imaginary part-frequency" through signal complexification algorithms such as Fourier transform and a geometric physical model (used for modeling the complex signal obtained based on the signal complexification algorithm), forming a pine tree-shaped 3D point cloud; a neural network model embedded with physical knowledge is used to realize the perception of the type and concentration of heavy metals (such as Zn, Cu, Pb, Hg, As, Cr, Cd and Ni) in the water at concentrations below trace levels.

[0060] like Figure 5 As shown, the novel non-contact method for heavy metal detection in water proposed in this application uses terahertz wireless signals as a sensing carrier and leverages the micro-characterization capabilities of terahertz loose structures to achieve detection. The heavy metal detection method can be mainly divided into a spatial feature extraction stage and a feature sensing stage.

[0061] In some embodiments of the present invention, the spatial feature extraction stage includes the following steps: acquiring terahertz three-dimensional point cloud data corresponding to the water sample to be detected; inputting the terahertz three-dimensional point cloud data into a pre-trained point cloud feature extraction module (also called a point cloud feature extractor or 3D point cloud feature extractor), and outputting three-dimensional spatial features. That is, this application characterizes the terahertz reflection signal corresponding to the water sample to be detected from three dimensions: real part, imaginary part, and frequency, and extracts three-dimensional spatial features. Here, three-dimensional spatial features indicate that the point cloud feature extraction model can extract features with spatiality; "three-dimensional" does not refer to the extracted spatial dimension, but rather to three-dimensional space.

[0062] More specifically, terahertz three-dimensional point cloud data can be obtained by: transmitting a terahertz signal to the water sample to be tested, receiving the terahertz reflected signal, and converting the reflected terahertz signal (i.e., the terahertz reflected signal) into terahertz three-dimensional point cloud data through signal complexification algorithms such as Fourier transform and geometric physical models; using a point cloud feature extractor to extract three-dimensional spatial features from the terahertz three-dimensional point cloud data (the three-dimensional spatial features can contain rich feature information such as branch length, spiral state (or spiral speed) and conductivity of the water sample to be tested, where the branch length can reflect the signal intensity / amplitude information corresponding to the terahertz reflected signal, and the spiral state can reflect the phase information corresponding to the terahertz reflected signal), so as to pass the three-dimensional spatial features to the embedded physical knowledge module for category feature extraction, type recognition, concentration feature extraction, and concentration quantization. The terahertz three-dimensional point cloud data may include the real part information, imaginary part information and frequency information obtained after the terahertz reflected signal is complexified (the real part information represents the in-phase component and the imaginary part information represents the quadrature component), and the real part information and the imaginary part information decrease spirally with increasing frequency.

[0063] In some embodiments of the present invention, such as Figure 6 As shown, this invention designs a 3D point cloud feature extractor with a "Transformer + PointNet" fusion architecture. Specifically, the pre-trained point cloud feature extraction module is a neural network composed of a Transformer model and a PointNet network, with the output of the Transformer model serving as the input to the PointNet network. The Transformer model adds positional encoding to each point corresponding to the terahertz 3D point cloud data, thereby preserving the dynamic features of the terahertz loose structure as a function of frequency. The PointNet network learns the dynamic features of the terahertz 3D point cloud data as a function of frequency.

[0064] Specifically, the reason for fusing the Transformer model and the PointNet network in the neural network structure of the 3D point cloud feature extractor is as follows: The PointNet network, as a classic neural network capable of directly processing 3D point cloud feature extraction, requires no spatial transformation or mesh processing, resulting in low computational complexity. This network can learn the features contained in 3D point clouds corresponding to different terahertz sparse structures through a Multilayer Perceptron (MLP). However, during feature extraction, the PointNet network, due to its unordered point cloud processing mechanism, is prone to losing the dynamic features of the terahertz sparse structure that vary with frequency. To solve this problem, this application introduces a Transformer model before the PointNet structure. By adding positional encoding to each point in the 3D point cloud, it ensures that PointNet can learn the dynamic features of the terahertz sparse structure that vary with frequency.

[0065] As an example, a Transformer model may include a multi-head self-attention layer, an encoder layer, and a feedforward neural network, while a PointNet network may include a point cloud encoder formed by a multilayer perceptron. The neural network parameters for the Transformer model are as follows:

[0066] ① Both the input and output sequence lengths are set to 800, ensuring that the input dimension of PointNet matches the dimension of the terahertz point cloud data; ② The multi-head self-attention layer employs an 8-head self-attention mechanism, mapping the input data to the self-attention layer to eight subspaces for independent attention computation, capturing multidimensional ordered dependencies; ③ Three identical encoder layers are stacked to progressively extract higher-order heavy metal features through hierarchical feature extraction; ④ The mapping dimension of the feedforward neural network (FNN) is set to 512, designed to enhance the ability to extract nonlinear features. This application does not specify the order of the multi-head self-attention layer, encoder layer, and feedforward neural network in the Transformer model; existing technologies can be referenced for design.

[0067] The parameters of the PointNet network are as follows:

[0068] The PointNet network extracts core features such as branch length and spiral rate from terahertz 3D point cloud data through a 4-layer MLP (64→128→256→1024 dimensions), thereby obtaining 3D spatial features containing information such as water sample conductivity. Moreover, through a layer-by-layer dimensionality increase strategy, the PointNet network can extract hidden features from terahertz 3D point cloud data.

[0069] The neural network structure and parameters of the 3D point cloud feature extractor mentioned above are merely examples and can be designed according to feature extraction requirements; this invention is not limited thereto. Furthermore, this application can employ feature upscaling technology in the 3D point cloud feature extraction module. For example, if the original features extracted from terahertz 3D point cloud data are 128-dimensional, feature upscaling technology can be used to enable the 3D point cloud feature extraction module to output 256-dimensional 3D spatial features, thereby enhancing feature representation.

[0070] In some embodiments of the present invention, the feature perception stage includes the following steps: inputting three-dimensional spatial features into a pre-trained type recognition module, and outputting the type of heavy metal contained in the water sample to be tested; inputting three-dimensional spatial features into a pre-trained concentration quantization module, and outputting the concentration of heavy metal contained in the water sample to be tested. It is worth noting that the heavy metal type and concentration perceived in the feature perception stage are the type and concentration of dissolved heavy metals in the water sample to be tested.

[0071] In this application, the category identification module and the concentration quantification module can together constitute an embedded physical knowledge module. For example... Figure 7 As shown in (a), the type recognition module includes a 3D type feature extractor and a 3D type recognizer, with the output of the 3D type feature extractor serving as the input of the 3D type recognizer. The 3D type feature extractor in the type recognition module can be used to extract features related to the type of heavy metal contained in the water sample to be tested from three-dimensional spatial features, and then type recognition can be achieved through the 3D type recognizer. Figure 7 As shown in (b), the pre-trained concentration quantization module includes a 3D concentration feature extractor and a 3D concentration quantizer, with the output of the 3D concentration feature extractor serving as the input to the 3D concentration quantizer. Features related to the heavy metal concentration in the water sample to be tested can be extracted from the three-dimensional spatial features using the 3D concentration feature extractor within the concentration quantization module, and then used by the 3D concentration quantizer to achieve concentration quantization. The features extracted by the 3D type feature extractor and the 3D concentration feature extractor will be referred to as type features and concentration features, respectively, in the following text.

[0072] More specifically, the type recognition unit mainly consists of two parts: a 3D type feature extractor and a 3D type detector. The 3D point cloud feature extractor employs feature upscaling technology to extract three-dimensional spatial features from terahertz 3D point cloud data. Given the diversity of information in the three-dimensional spatial features, further features related to the heavy metal type need to be extracted using the 3D type feature extractor. Subsequently, the 3D type detector is used to identify the heavy metal type. It is worth noting that the three-dimensional spatial features may include features indicating the conductivity of the water sample to be tested; therefore, this application is based on... A pre-trained type recognition module can be used to extract features related to the molar conductivity of heavy metals in the water sample under infinite dilution from the three-dimensional spatial features, which can be used as type features (if the water sample contains multiple types of heavy metals, type features related to each type of heavy metal can be output). The inclusion of molar conductivity information of heavy metals in the type features in this application is only an example, and may also include other information related to the type of heavy metal, such as dielectric constant, relaxation time, refractive index, and other physical information. This invention is not limited to this.

[0073] The neural network structure of the type recognition module: For the 3D type feature extractor, an encoder-decoder architecture can be adopted. The encoder is responsible for extracting and encoding key features for distinguishing types from the 3D spatial features; the decoder enhances and stabilizes these key type features, providing a more effective detection basis for the 3D type recognizer. The 3D type recognizer includes a fully connected layer (FC) to identify the types of heavy metals contained in the water sample to be tested (the water sample can be pure water or water containing heavy metals such as cadmium).

[0074] The neural network parameters for the type recognition unit can be as follows: For the 3D type feature extractor, a three-layer perceptron (MLP) structure is used to form an encoder-decoder architecture, encoding the dimensionality of the 3D point cloud features sequentially from 1024 to 512, then from 512 to 256, and finally decoding it back to 1024 dimensions. Each MLP layer is followed by a batch normalization (BN) layer and a ReLU activation function layer to enhance generalization ability and improve its ability to extract nonlinear features. That is, both the encoder and decoder structures in the 3D type feature extractor can include a multilayer perceptron layer, a batch normalization layer, and a ReLU activation function layer. For the 3D type recognizer, it contains multiple (e.g., nine) fully connected layers specifically designed to identify the types of metals present in the water sample being tested.

[0075] That is, the physical embedding model of the present invention includes a type recognition module, which consists of a "3D type feature extractor (Encoder-Decoder architecture, 3-layer MLP to realize feature dimension increase and decrease) and a 3D type recognizer (9 fully connected layers to identify heavy metal types and pure water samples)". Furthermore, the type recognition module can be optimized by cross-entropy loss to improve the type recognition accuracy, with an average accuracy of 95.4%.

[0076] Furthermore, the concentration quantization module mainly consists of two parts: a 3D concentration feature extractor and a 3D concentration quantizer. Similarly, given the diversity of information in three-dimensional spatial features, the 3D concentration feature extractor needs to extract features related to heavy metal concentration; subsequently, the 3D concentration quantizer uses these concentration features to complete the quantization of heavy metal concentration. The 3D concentration quantizer can quantify only the level of heavy metal concentration to reduce the computational cost of the 3D concentration quantizer, or it can quantify the specific numerical value of heavy metal concentration to achieve more accurate quantization. This application does not specifically limit the degree of quantization of heavy metal concentration by the 3D concentration quantizer; it can be designed according to requirements.

[0077] The neural network structure of the concentration quantization unit is as follows: Similar to the 3D type feature extractor, the 3D concentration feature extractor also uses an encoder-decoder architecture to extract concentration features. The difference lies in that the encoder here uses a fully connected layer to extract key features related to heavy metal concentration from the three-dimensional spatial features for encoding; the decoder also uses a fully connected layer to enhance and stabilize these key concentration features, providing a more effective quantization basis for the 3D concentration quantizer. Furthermore, the 3D concentration quantizer can also use fully connected layers to quantify multiple concentration levels of different heavy metals (for example, heavy metal concentration levels can be divided into five levels: D1, D2, D3, D4, and D5, where the concentration corresponding to D1 < the concentration corresponding to D2 < the concentration corresponding to D3 < the concentration corresponding to D4 < the concentration corresponding to D5). The neural network structures of the type recognition module and the concentration quantization module mentioned above are merely examples. For instance, the 3D type feature extractor and the 3D concentration feature extractor may not use an encoder-decoder structure; this invention is not limited to this and can be designed according to the detection requirements.

[0078] The neural network parameters for the concentration quantization module can be as follows: To reduce the complexity of the embedded physical knowledge module, the 3D concentration feature extractor can use the same neural network parameters as the 3D type feature extractor. The difference is that the 3D concentration quantizer contains 5 fully connected layers specifically used to quantify the concentration level of the water sample to be tested. The neural network parameters for the type recognition module and the concentration quantization module mentioned above are only examples and can be designed according to the detection requirements. This invention is not limited to these.

[0079] That is, the physical embedding deep learning model of the present invention includes a concentration quantization module, which consists of a "3D concentration feature extractor (with parameters consistent with a 3D type feature extractor) and a 3D concentration quantizer (e.g., including 5 fully connected layers, corresponding to the 5 concentration levels D1, D2, D3, D4, and D5)". It is worth noting that the ability of the 3D concentration feature extractor to extract concentration features is obtained through embedded physical knowledge constraints, and the second concentration feature vector generated through these physical constraints ( The first concentration feature extracted by the supervised 3D concentration feature extractor ( Through iterative optimization, the average accuracy of concentration quantification can reach 94.3%.

[0080] In some embodiments of the present invention, the present invention is based on the Debye-Hückel theory and the Kohlrausch function, to reduce the concentration of ( The conductivity of the water sample to be tested at <0.001 mol / L ( ) and the concentration of heavy metals in the water sample ( linear relationship () , This paper trains an embedding model for the molar conductivity at infinite dilution to achieve precise quantification of heavy metal concentrations below trace levels. Specifically, based on the aforementioned physical constraints, this application constructs a correlation constraint between heavy metal type and concentration to achieve comprehensive and targeted feature extraction. Since terahertz reflection signals are affected by the conductivity of the water sample, the terahertz 3D point cloud data obtained based on the terahertz reflection signal can contain information related to the conductivity of the water sample to be detected. The three-dimensional spatial features obtained through the 3D point cloud feature extractor can also contain information related to the conductivity of the water sample. According to... In this application, when a 3D type feature extractor is used to extract type features from water samples, a pre-trained concentration quantization module can be trained using the following method:

[0081] The 3D spatial feature training samples are input into the 3D concentration feature extractor in the concentration quantization module to be trained, and the first concentration feature is output. Based on the first concentration characteristic Second concentration characteristics The resulting loss function is used to iteratively train the 3D concentration feature extractor, resulting in a pre-trained 3D concentration feature extractor; among which, the second concentration feature... This is the ratio of the type features corresponding to the 3D spatial feature training samples to the type features corresponding to the 3D spatial feature training samples. The type features corresponding to the 3D spatial feature training samples are extracted from the 3D spatial feature training samples by the 3D type feature extractor in the pre-trained type recognition module.

[0082] That is, physical information can be embedded through feature supervision during the training of the concentration quantization module. Specifically, during the physical knowledge embedding process, the ratio of three-dimensional spatial features to type features extracted from the three-dimensional spatial feature training samples can be used to represent the second concentration feature vector. This vector is derived from physical information constraints; and by minimizing the second concentration feature. Extracted by the 3D concentration feature extractor to be trained The resulting loss function ,use right This method allows the 3D concentration feature extractor to extract concentration features that conform to physical principles, thereby enabling the perception of heavy metal concentrations below the trace level.

[0083] As an example, if the water sample to be tested contains multiple types of heavy metals, the 3D concentration feature extractor can be updated and trained by combining the above training method with methods such as domain adaptation, so that the concentration quantification module can output the concentration of each type of heavy metal contained in the water sample.

[0084] This application does not address the basis for and The resulting loss function is specifically defined; for example, the loss function could be: =0.5 +0.5 ,in, This indicates the feature extracted by the 3D concentration feature extractor. The first loss function is formed by the label values ​​in the 3D concentration feature extractor. express and The second loss function is compared. Furthermore, this application does not specifically limit the training method of the 3D density quantizer in the point cloud feature extraction module, type recognition module, and density quantization module; users can design their own methods. For example, the point cloud feature extraction module and type recognition module can be trained separately first, and then based on… and The resulting loss function is used to jointly train the 3D concentration quantizer and 3D concentration feature extractor in the concentration quantization module.

[0085] As an example, in a type identification task, given that changes in heavy metal type significantly affect the conductivity of water samples (e.g., the molar conductivity differences of various heavy metals at infinite dilution in standard units reach [percentage missing]), [the following is a continuation of the previous sentence, but the context is unclear]. The magnitude difference, while the concentration difference is only... (mol / L level), extracting features related to heavy metal type from three-dimensional spatial features that characterize the conductivity of water samples ( It is easier to identify than concentration characteristics.

[0086] The core of the method proposed in this application is to convert terahertz reflection signals into terahertz loose structures and use a deep learning model embedded with physical knowledge to extract concentration and type features. This provides a novel approach to trace detection, overcoming the bottlenecks of existing detection methods in terms of trace identification accuracy and detection scenario limitations. It enables the type identification and concentration quantification of heavy metals (Zn, Cu, Hg, Pb, As, Cr, Cd, Ni) in water at concentrations below trace levels. Furthermore, the method proposed in this invention can be widely applied to portable water quality monitoring equipment, mobile terminal integration, real-time environmental monitoring, and food safety traceability, providing a low-cost and easily deployable solution for trace heavy metal detection.

[0087] This invention utilizes the molecular-level sensing characteristics of terahertz signals and the innovative three-dimensional characterization of "THz-Pine," combined with a deep learning model embedding physical information, to provide a novel approach to heavy metal detection. This effectively overcomes the limitations of traditional laboratory-level analytical techniques (such as ICP-MS), which are cumbersome, expensive, require specialized operation, and cannot be used for on-site testing. Furthermore, wireless sensing technologies (such as RFID and WiFi) have detection limits far exceeding trace requirements (≥7.9 × 10⁻⁶). 5 μg / dL), and the shortcomings of early terahertz two-dimensional sensing methods, such as high signal similarity (type / concentration similarity of 0.981 / 0.988) and low accuracy (type recognition 85.8%, concentration quantization 77.9%).

[0088] Corresponding to the above method, the present invention also provides a heavy metal detection system in water based on terahertz wireless signals. The system includes a computer device, which includes a processor and a memory. The memory stores computer programs / instructions, and the processor is used to execute the computer programs / instructions stored in the memory. When the computer programs / instructions are executed by the processor, the system implements the steps of the method described above.

[0089] Those skilled in the art will understand that the exemplary components, systems, and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software, or a combination of both. Whether implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this invention. When implemented in hardware, it can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this invention are programs or code segments used to perform the desired tasks. The programs or code segments can be stored in a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried in a carrier wave.

[0090] It should be clarified that the present invention is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of the present invention.

[0091] In this invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with or in place of features of other embodiments.

[0092] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, various modifications and variations of the embodiments of the present invention are possible. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for detecting heavy metals in water based on terahertz wireless signals, characterized in that, The method includes the following steps: The method involves acquiring terahertz three-dimensional point cloud data corresponding to a water sample to be tested. This terahertz three-dimensional point cloud data is obtained by converting the terahertz reflection signal of the water sample to be tested based on a signal complexification algorithm and a geometric physical model. The data includes the real part, imaginary part, and frequency information of the terahertz reflection signal. The terahertz reflection signal is obtained based on a terahertz signal emitted towards the water sample. The water sample contains dissolved heavy metals, and the concentration of these heavy metals is below trace amounts. The real and imaginary parts of the terahertz three-dimensional point cloud data decrease spirally with increasing frequency, and the terahertz three-dimensional point cloud data exhibits a pine tree-like structure in three-dimensional space. The terahertz three-dimensional point cloud data is input into a pre-trained point cloud feature extraction module, and three-dimensional spatial features are output; the three-dimensional spatial features contain information related to the conductivity of the water sample. The three-dimensional spatial features are input into the pre-trained type recognition module and the pre-trained concentration quantization module, respectively, and the type and concentration of the heavy metal to be detected in the water sample are output.

2. The method according to claim 1, characterized in that, The pre-trained type recognition module is used to extract features related to the type of heavy metal in the water sample to be tested. The type recognition module includes a 3D type feature extractor and a 3D type recognizer, and the output of the 3D type feature extractor is used as the input of the 3D type recognizer; the pre-trained concentration quantization module includes a 3D concentration feature extractor and a 3D concentration quantizer, and the output of the 3D concentration feature extractor is used as the input of the 3D concentration quantizer; Both the type 3D feature extractor and the 3D density feature extractor adopt an encoder-decoder structure, and both the 3D type recognizer and the 3D density quantizer contain fully connected layers.

3. The method according to claim 2, characterized in that, The three-dimensional spatial features include the conductivity features of the water sample to be tested; the features extracted by the type identification module include the molar conductivity features of heavy metals in the water sample to be tested under limited dilution conditions. The 3D concentration feature extractor in the pre-trained concentration quantization module is trained in the following way: The three-dimensional spatial feature training samples are input into the 3D concentration feature extractor in the concentration quantization module to be trained, and the first concentration feature is output. The 3D concentration feature extractor is iteratively trained based on the loss function formed by the first concentration feature and the second concentration feature to obtain a pre-trained 3D concentration feature extractor; wherein, the second concentration feature is the ratio of the type feature corresponding to the three-dimensional spatial feature training sample to the type feature corresponding to the three-dimensional spatial feature training sample, and the type feature corresponding to the three-dimensional spatial feature training sample is extracted from the three-dimensional spatial feature training sample by the 3D type feature extractor in the pre-trained type recognition module.

4. The method according to claim 2, characterized in that, The encoder-decoder structure in the 3D type feature extractor includes a multilayer perceptron layer, a batch normalization layer, and a ReLU activation function layer; The encoder-decoder structure of the 3D density feature extractor consists of multiple fully connected layers.

5. The method according to claim 1, characterized in that, The pre-trained point cloud feature extraction module is a neural network composed of a Transformer model and a PointNet network, and the output of the Transformer model is used as the input of the PointNet network. The Transformer model is used to add position encoding to each point corresponding to the terahertz three-dimensional point cloud data, and the PointNet network is used to learn the dynamic features of the terahertz three-dimensional point cloud data as the frequency changes. The PointNet network includes a point cloud encoder composed of a multilayer perceptron; the Transformer model includes a multi-head self-attention layer, an encoder layer, and a feedforward neural network.

6. The method according to claim 1, characterized in that, The signal complexification algorithm is a Fourier transform algorithm.

7. The method according to claim 1, characterized in that, The water sample to be tested is an aqueous solution containing the heavy metal to be tested, and the concentration of the heavy metal in the water sample is less than 0.001 mol / L.

8. A water heavy metal detection system based on terahertz wireless signals, comprising a processor, a memory, and a computer program / instructions stored in the memory, characterized in that, The processor is configured to execute the computer program / instructions, and when the computer program / instructions are executed, the system implements the steps of the method as described in any one of claims 1 to 7.

9. A computer-readable storage medium having a computer program / instructions stored thereon, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method as described in any one of claims 1 to 7.

10. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 7.