A deep learning-based method and system for resource utilization of waste acid

CN120833516BActive Publication Date: 2026-09-22HANGZHOU HUISHUI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510938208.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-08
Publication Date
2026-09-22
Estimated Expiration
2045-07-08

AI Technical Summary

Technical Problem

[0004]针对现有技术的不足,本发明提出一种基于深度学习的污酸资源化利用方法及系统,用于解决现有技术工业污酸成分复杂、来源多样、处理效率低下的问题

Benefits of technology

[0049]1、本发明提出了基于简单性偏差的伪域标签聚类思想:针对污酸样本在采集设备、光谱特性等方面存在的非结构化偏差,采用Vision Transformer(ViT)模型浅层CLSToken提取风格特征,通过K-means无监督聚类生成伪域标签,规避人工标注成本和错误,显著提升了模型对多源数据的泛化能力。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120833516B_ABST
    Figure CN120833516B_ABST
Patent Text Reader

Abstract

The application provides a kind of based on deep learning's waste acid resource utilization method and system.Resource utilization and artificial intelligence field are involved in waste acid, the method comprises the following steps: step S1, construct target resource processing system;Step S2, through near infrared spectroscopy and X-ray fluorescence spectrum, the spectral image data of the molecular structure information and element composition contained in waste acid sample are collected;Step S3, the spectral image data is preprocessed, and the AI network identification model is trained based on the sample data after preprocessing;Step S4, the spectral image data of industrial waste acid solution is collected in real time, and the trained model is used for waste acid component analysis and identification;Step S5, for the component of predicted waste acid and its corresponding concentration, based on reinforcement learning, the prescription of medicament is optimized, the accurate proportion of 10% calcium chloride solution and 5% ferrous sulfate solution is output, heavy metal ion control and resource recovery are realized.The application can accurately identify waste acid components and improve resource utilization efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of waste acid resource utilization and artificial intelligence technology, and in particular to a method and system for waste acid resource utilization based on deep learning. Background Technology

[0002] Industrial waste acid is a byproduct of various industrial manufacturing processes. Its main components are hydrochloric acid, sulfuric acid, or phosphoric acid, and it is also rich in calcium (Ca). 2+ ), sodium (Na + ), iron (Fe) 2+ Metal ions such as [missing information]. Currently, the mainstream treatment method is still neutralization. This method not only fails to achieve the reuse of acidic resources but also generates a large amount of hazardous waste, increasing the environmental burden and treatment costs, ultimately resulting in a huge waste of acidic resources.

[0003] Therefore, there is an urgent need to explore a new waste acid treatment pathway that integrates artificial intelligence technology, which can not only accurately identify the components of waste acid and improve utilization efficiency, but also dynamically adapt to the complexity of different waste acid sources and achieve intelligent resource utilization. Summary of the Invention

[0004] To address the shortcomings of existing technologies, this invention proposes a method and system for the resource utilization of industrial waste acid based on deep learning, which solves the problems of complex composition, diverse sources, and low treatment efficiency of industrial waste acid in existing technologies.

[0005] To achieve the above objectives, the following technical solution is adopted:

[0006] According to one aspect of the present invention, a method for the resource utilization of waste acid based on deep learning is provided, comprising:

[0007] Step S1: Construct a target resource recovery system by adding 10% calcium chloride solution and 5% ferrous sulfate solution to waste acid;

[0008] Step S2: Acquire spectral image data containing molecular structure information and elemental composition of the waste acid sample using near-infrared spectroscopy and X-ray fluorescence spectroscopy;

[0009] Step S3: Preprocess the spectral image data, train an AI network recognition model based on the preprocessed sample data, adopt a classifier structure that combines local neighborhood attention (NA) and extended neighborhood attention (DNAT), and optimize the model by mixing cross-entropy loss and weight supervision loss.

[0010] Step S4: Real-time acquisition of spectral image data of industrial waste acid solution and preprocessing, input into the trained model for waste acid component analysis and identification, outputting the key components of waste acid and their concentration prediction results;

[0011] Step S5: Based on the predicted results of the key components and concentrations of the waste acid, the reagent formulation is optimized using reinforcement learning, and the precise ratio of 10% calcium chloride solution and 5% ferrous sulfate solution is output to achieve heavy metal ion control and resource recovery.

[0012] Furthermore, the preprocessing of the spectral image data includes:

[0013] For the original spectral image data, the style features of the image are extracted by the shallow CLS Token of the Vision Transformer model, and pseudo-domain labels are generated by K-means clustering.

[0014] Construct a low-rank decomposition domain cue vector, and generate a domain-adaptive cue matrix by using the Hadamard product of a shared cue matrix and a domain-specific low-rank matrix;

[0015] Cross-domain sample fusion enhancement and lightweight adapter weighted combination are applied to samples with pseudo-domain labels from different pseudo-domains and the domain adaptation cue matrices of all domains to obtain fused samples and weighted cue.

[0016] Furthermore, the pseudo-domain tag generation method specifically includes:

[0017] The CLS Token output from the first layer of the Vision Transformer is extracted as a style feature vector, including but not limited to instrument imaging artifacts, background chromatic aberration, and noise patterns, to measure the domain differences between samples.

[0018] The K-means algorithm is used to perform unsupervised clustering on the style feature vectors. Based on the clustering results, the samples are divided into several pseudo-domains. A pseudo-domain label is assigned to each polluted acid sample, and each pseudo-domain represents a set of samples with similar styles.

[0019] Furthermore, the specific generation process of the domain adaptation cue matrix includes:

[0020] For each pseudo-domain, a domain-specific hint matrix is ​​generated through low-rank decomposition;

[0021] The shared hint matrix and the domain-specific hint matrix are multiplied element-wise by the Hadamard product to obtain the domain-adaptive hint matrix that integrates shared knowledge and domain-specific information;

[0022] The domain adaptation cue matrix is ​​embedded into the token embedding of the first layer of the Vision Transformer model to guide the model to learn the feature representation related to the pseudo-domain.

[0023] Furthermore, the specific process of obtaining the mixed sample and weighted hints includes:

[0024] The feature vectors of samples with pseudo-domain labels from different pseudo-domains are mixed across domains to obtain mixed samples;

[0025] For the domain-adaptive cue matrices of all domains, a two-layer MLP structure is used to perform a weighted combination to obtain a weighted cue representation. The weights are learned under supervision through a loss function, so that the model pays more attention to cue that is close to the target domain.

[0026] Furthermore, the AI ​​network recognition model adopts the Vision Transformer backbone network, which includes: an input layer, a feature extraction layer, a feature fusion layer, a fully connected layer, and a loss function;

[0027] The input layer is used to receive spectral image data of the polluted acid;

[0028] The preprocessing layer is used to preprocess the spectral image data;

[0029] The feature extraction layer is used to extract local and global features based on local neighborhood attention mechanism and extended neighborhood attention mechanism, respectively.

[0030] The feature fusion layer is used to perform deep fusion of local and global features obtained by the two attention mechanisms through a multi-layer Transformer encoder to obtain a fused feature vector.

[0031] The output layer is used to perform a nonlinear mapping on the fused feature vector, outputting the Ca in the polluted acid. 2+ Fe 2+ Na + Predicted concentrations of metal ions;

[0032] The loss function includes hybrid loss and weighted supervised loss.

[0033] Furthermore, the local neighborhood attention mechanism includes: restricting self-attention computation to the neighborhood region of each token, selecting a fixed number of nearest neighbor tokens based on spatial location or feature similarity, introducing positional bias encoding to preserve spatial correlation, and generating local feature representations by aggregating the value vectors of neighborhood tokens;

[0034] The expanded neighborhood attention mechanism includes: sampling neighborhood tokens at preset expansion rate intervals to expand the receptive field; ensuring spatial uniformity by satisfying the condition of equal index modulus during sampling; setting a maximum expansion rate upper limit to ensure effective neighborhood coverage; and fusing multi-scale contextual features to generate expanded feature representations.

[0035] Furthermore, the calculation of the hybrid loss includes: calculating the cross-entropy loss of the hybrid sample from two samples from different pseudo-domains with the labels of the two original samples, and weighting and summing the two losses according to the hybrid weight;

[0036] The calculation of the weighted loss includes: calculating the cross-entropy loss of the fused feature vector and the true label; applying supervisory constraints to the domain adapter weights: forcing the current domain weights to be close to 1 and the non-current domain weights to be close to 0; and multiplying the weight supervisory loss by an adjustment coefficient and adding it to the prediction loss.

[0037] Furthermore, the reinforcement learning-based recipe optimization includes:

[0038] A dual robust advantage estimator is constructed, which calculates the step-level advantage function by weighted fusion of the final Monte Carlo reward and the temporal difference estimate, where the weight of the final reward is higher as the task ends;

[0039] Design an instruction-level value function to calculate the instruction advantage value based on the difference between the task completion result and the historical average success rate, which is used to quantify the task difficulty;

[0040] By implementing advantage-weighted regression, only state-action pairs with advantage values ​​above a preset threshold are selected for policy training, maximizing the effectiveness of key decisions.

[0041] The optimal drug ratio is selected from the ratio scheme with the highest probability in the policy network.

[0042] According to a second aspect of the present invention, a deep learning-based waste acid resource utilization system is provided, comprising:

[0043] The spectral data acquisition module is used to acquire spectral image data containing molecular structure information and elemental composition of waste acid samples through near-infrared spectroscopy and X-ray fluorescence spectroscopy.

[0044] The data preprocessing module is used to preprocess the spectral image data;

[0045] The AI ​​network training module trains the AI ​​network recognition model using preprocessed sample data. It adopts a classifier structure that combines local neighborhood attention (NA) and extended neighborhood attention (DNAT), and optimizes the model by using a hybrid cross-entropy loss and weighted supervision loss.

[0046] The component concentration prediction module collects spectral image data of industrial waste acid solution in real time, preprocesses it, and then inputs it into the trained model to analyze and identify the waste acid components, and outputs the key components of waste acid and their concentration prediction results.

[0047] The drug formulation optimization module is used to optimize the drug formulation based on the predicted results of key components and their concentrations, and outputs the precise ratio of 10% calcium chloride solution and 5% ferrous sulfate solution to achieve heavy metal ion control and resource recovery.

[0048] Compared with the prior art, the present invention achieves the following beneficial effects:

[0049] 1. This invention proposes a pseudo-domain label clustering idea based on simplicity bias: In view of the unstructured bias of the acid samples in terms of collection equipment and spectral characteristics, the Vision Transformer (ViT) model is used to extract style features in shallow CLSToken, and pseudo-domain labels are generated by K-means unsupervised clustering, which avoids the cost and error of manual labeling and significantly improves the model's generalization ability to multi-source data.

[0050] 2. This invention proposes a method for generating domain hints through low-rank decomposition: To achieve knowledge transfer in cross-domain recognition, this invention introduces a domain hint learning mechanism. By decomposing the hint vector into shared hints and domain-specific low-rank matrices, and using the Hadamard product to fuse them to generate the final hint vector, this not only reduces the complexity of model parameters but also enhances the information interaction capability between different domains.

[0051] 3. This invention proposes a classifier structure that combines Local Neighborhood Attention (NA) and Extended Neighborhood Attention (DNAT): Two types of attention mechanisms are introduced to address the local correlation and cross-scale structural features of spectral images: NA restricts attention to the local token neighborhood, effectively compressing computational overhead; DNAT expands the receptive field through an extended sampling strategy, thereby capturing multi-scale contamination features and achieving accurate component identification.

[0052] 4. This invention proposes an improved loss function that combines hybrid loss and weighted supervised loss: by designing a multi-source domain training objective composed of hybrid cross-entropy loss and weighted supervised loss. The former improves the model's robustness to sample perturbations, while the latter enhances the model's ability to focus on the target domain through supervision of the domain adapter weights, thereby optimizing the overall recognition performance.

[0053] 5. This invention proposes a reinforcement learning method based on a dual robust advantage estimator: In the process of formula optimization, an advantage estimation method that integrates final reward and temporal difference (TD) error is introduced to reduce the high variance or high bias problem caused by environmental noise during policy training, thereby improving policy stability and optimization effect.

[0054] 6. This invention constructs a training value function for matching strategy optimization: the traditional mean square error is replaced by trajectory-level and step-level value function loss based on cross-entropy, and the instruction advantage calculation and course learning mechanism are combined to select high-value tasks for priority training, and the ineffective policy update is suppressed through the advantage weighting mechanism, thereby achieving a highly efficient and interpretable personalized processing scheme recommendation.

[0055] 7. This invention achieves waste-to-waste treatment by reusing industrial waste acid, saving costs and improving the resource utilization rate of waste acid.

[0056] It should be understood that the description in the Summary of the Invention is not intended to limit the key or essential features of the embodiments of the present invention, nor is it intended to restrict the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0057] The above and other features, advantages, and aspects of the various embodiments of the present invention will become more apparent from the accompanying drawings and the following detailed description. The drawings are provided for a better understanding of the invention and are not intended to limit the invention. In the drawings, the same or similar reference numerals denote the same or similar elements, wherein:

[0058] Figure 1 This is a schematic diagram of the main steps of a deep learning-based method for the resource utilization of waste acid according to an embodiment of the present invention.

[0059] Figure 2 This is a flowchart illustrating a deep learning-based method for the resource utilization of waste acid according to an embodiment of the present invention.

[0060] Figure 3 This is a schematic diagram of a waste acid target resource utilization system constructed in a waste acid resource utilization method based on deep learning according to an embodiment of the present invention;

[0061] Figure 4 This is a schematic diagram of the structure of an AI network recognition model for a deep learning-based waste acid resource utilization method according to an embodiment of the present invention.

[0062] Figure 5 This is a schematic diagram of the architecture of a water treatment system based on deep learning and modified carrier carbon filter element according to an embodiment of the present invention. Detailed Implementation

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

[0064] Furthermore, the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0065] Figure 1 This is a schematic diagram of the main steps of a deep learning-based method for the resource utilization of waste acid according to an embodiment of the present invention. Figure 2 This is a schematic flowchart of a deep learning-based method for the resource utilization of waste acid, according to an embodiment of the present invention. Figure 1 and Figure 2 As shown, a deep learning-based method 100 for the resource utilization of waste acid includes:

[0066] Step S1: Construct a target resource recovery system by adding 10% calcium chloride solution and 5% ferrous sulfate solution to waste acid;

[0067] The main components of acidic wastewater generated during industrial production are hydrochloric acid, sulfuric acid, or phosphoric acid, and it is often accompanied by a large amount of metal ions, such as chromium ions (Cr). 6+ ), copper ions (Cu) 2+ ), calcium ions (Ca 2+ ), ferrous ions (Fe) 2+ Sodium ions (Na) + The presence of these metal ions not only increases the difficulty of treating waste acid, but also provides potential value for resource utilization. This is particularly true for fluorine-containing (F-) and / or hexavalent chromium (Cr) ions. 6+ The present invention addresses industrial waste acid containing (e.g., from metallurgical pickling, stainless steel pickling, electroplating, etc.) and / or complexed heavy metal ions (such as Cu-EDTA). The purpose of this invention is to use a precise proportioning method to rationally add 10% calcium chloride solution and 5% ferrous sulfate solution to the waste acid, thereby achieving effective control and resource recovery of heavy metal ions in wastewater.

[0068] This invention transforms traditional "neutralization treatment" (waste landfill) into targeted recycling: by adding specific agents (10% CaCl2 + 5% FeSO4), heavy metal ions in the waste acid are converted into recyclable precipitates (such as FeF3, CaCO3, CaF2, CaSO4 precipitates, etc.) and highly toxic Cr... 6+ Reduced to low-toxicity Cr 3+ Precipitation, utilizing metal ions (such as Fe) in waste acid 2+ / Ca 2+ This generates high-value byproducts (such as ferric fluoride, which can be used in the ceramics industry). Essentially, resource recovery primarily involves calcium chloride unlocking the complexation of heavy metals to recover high-purity metals, and ferrous sulfate undergoing directional conversion of F- / Cr. 6+ It can generate commercially viable compounds.

[0069] Among them, 10% calcium chloride is mainly used as a complex-breaking agent, which can effectively destroy the metal complex structure (such as Cu-EDTA) in electroplating wastewater, allowing heavy metal ions to be released from the complexed state, facilitating subsequent precipitation and recycling. At the same time, calcium chloride also has good flocculation properties, promoting the coagulation and sedimentation of suspended solids in wastewater and improving the purification efficiency of wastewater.

[0070] 5% ferrous sulfate is primarily used as a defluorinating agent in the treatment of fluoride-containing wastewater. Ferrous sulfate reacts with fluoride ions in the wastewater to form insoluble ferric fluoride precipitates, effectively removing fluoride ions. Furthermore, ferrous sulfate can also act as a reducing agent, helping to control the chemical form of iron in wastewater and optimizing subsequent treatment processes.

[0071] Figure 3 This is a schematic diagram of a waste acid target resource utilization system constructed in a waste acid resource utilization method based on deep learning according to an embodiment of the present invention, as shown below. Figure 3 As shown, the target resource recovery system constructed through step S1 above, which involves adding 10% calcium chloride solution and 5% ferrous sulfate solution to waste acid, aims to achieve efficient removal of harmful substances from waste acid wastewater and to recover and reuse effective resources from the wastewater, thus constructing an economical and environmentally friendly waste acid resource recovery system and providing a practical and feasible technical path for industrial wastewater treatment. More specifically, this target resource recovery system is suitable for fluoride / chromium-containing waste acid: ferrous sulfate will convert F- into FeF3 precipitate, and Cr- will be removed from the fluoride / chromium-containing waste acid. 6+ Reduced to Cr 3+ Precipitation; calcium chloride disrupts the structure of heavy metal complexes, forming CaSO4 / CaF2 precipitate.

[0072] Step S2: Acquire spectral image data containing molecular structure information and elemental composition of the waste acid sample using near-infrared spectroscopy and X-ray fluorescence spectroscopy;

[0073] To ensure that the artificial intelligence (AI) model can accurately identify and process various types of pollutant acid samples, the first step is to construct a high-quality, representative training dataset. To this end, non-contact spectral detection technology is used for precise sampling of pollutant acid, balancing safety, efficiency, and data richness. Step S2 mainly employs the following two types of advanced sensing methods to achieve pollutant acid data sampling:

[0074] Step S2.1: Near-infrared spectral acquisition

[0075] By irradiating the sample surface with near-infrared light and measuring the reflectance as a function of wavelength, a spectral image containing molecular structural information is obtained. NIR spectroscopy has excellent ability to identify organic matter (such as oil stains and acidic lipid contaminants) and can reflect the vibrational absorption characteristics of functional groups such as CH, OH, and NH. The output is a two-dimensional continuous spectrum, typically ranging from 780 nm to 2500 nm; each sample corresponds to a multidimensional spectral vector.

[0076] Step S2.2: X-ray fluorescence spectroscopy acquisition

[0077] When a contaminated acid sample is excited by high-energy X-rays, its internal elements emit characteristic fluorescence. The system detects these secondary X-rays to obtain information on the types and concentrations of elements in the sample. X-ray fluorescence spectroscopy has high sensitivity and accuracy for inorganic components such as metal ions (e.g., Fe, Cu, Pb, Cr). The output is a two-dimensional spectrum of elemental composition, showing the characteristic peaks and intensities of each element.

[0078] Step S3: Preprocess the spectral image data, train an AI network recognition model based on the preprocessed sample data, adopt a classifier structure that combines local neighborhood attention (NA) and extended neighborhood attention (DNAT), and optimize the model by mixing cross-entropy loss and weight supervision loss.

[0079] Figure 4 This is a schematic diagram of the structure of an AI network recognition model for a deep learning-based method for the resource utilization of waste acid, according to an embodiment of the present invention; as shown below. Figure 4As shown, the AI ​​network recognition model uses a Vision Transformer backbone network, including: an input layer, a preprocessing layer, a feature extraction layer, a feature fusion layer, a fully connected layer, and a loss function. The input layer receives spectral image data of the polluted acid. The preprocessing layer preprocesses the spectral image data. The feature extraction layer extracts local and global features based on local and extended neighborhood attention mechanisms, respectively. The feature fusion layer deeply fuses the local and global features obtained by the two attention mechanisms through a multi-layer Transformer encoder to obtain a fused feature vector. The output layer performs a non-linear mapping on the fused feature vector to output the key components of the polluted acid (including F-, Cr-, etc.). 6+ Target complexation of heavy metal ions (such as Cu) 2+ Background Ca 2+ Background Fe 2+ The concentration of the sample and its concentration prediction results; the loss function includes mixed loss and weighted loss.

[0080] Furthermore, step S3 specifically includes the following steps:

[0081] Step S3.1: Preprocessing of waste acid data

[0082] To address the differences in imaging characteristics of acid samples from different sources, this invention proposes pseudo-domain label clustering based on simplicity bias to improve the model's generalization ability to multi-source data.

[0083] Step S3.1.1: Pseudo-domain label generation: For the original spectral image data, the style features of the image are extracted by the shallow CLS Token of the Vision Transformer model, and pseudo-domain labels are generated by K-means clustering.

[0084] Because the sources of polluted acid samples are diverse, their imaging styles or data acquisition conditions (such as instrument model, operating environment, etc.) may introduce certain biases, leading to stylistic heterogeneity among samples. To reduce this impact, this invention introduces a pseudo-domain label clustering strategy based on simplicity bias. Specifically, the shallow CLS Tokens of the Vision Transformer (ViT) network are used to extract image style features, including but not limited to information such as instrument imaging artifacts, background chromatic aberration, and noise patterns. The first layer CLS Tokens of ViT can capture the differences in the spectral response curves of imaging devices and use them as style features. These style features are used to measure the domain differences between samples, and unsupervised clustering is performed using the K-means algorithm to assign pseudo-domain labels to each sample, thereby avoiding dependence on explicit manual domain labels.

[0085] More specifically, step S3.1.1, for the original spectral image data, includes the following pseudo-domain label generation method: extracting the CLS Token output from the first layer of the Vision Transformer as a style feature vector, including but not limited to instrument imaging artifacts, background color difference, and noise patterns, to measure the domain differences between samples; using the K-means algorithm to perform unsupervised clustering on the style feature vector; dividing the samples into several pseudo-domains based on the clustering results; assigning a pseudo-domain label to each polluted acid sample; and having each pseudo-domain represent a set of samples with similar styles.

[0086] Step S3.1.2: Construct domain-specific cue vectors (i.e., low-rank decomposed domain cue vectors): Generate domain-adapted cue matrix by using the Hadamard product of the shared cue matrix and the domain-specific low-rank matrix.

[0087] To enhance the model's recognition capability across different "pseudo-domains," this invention introduces a domain cue learning mechanism. A learnable cue vector is assigned to each pseudo-domain and embedded into the input layer of the ViT model (in the first-layer token embedding), guiding the model to learn feature representations related to that pseudo-domain. The construction of domain-specific cue vectors employs low-rank decomposition to generate domain cues, decomposing them into shared knowledge representations and domain-specific knowledge representations, thereby controlling the model parameter scale and promoting inter-domain collaborative learning.

[0088] Furthermore, the specific generation process of the domain-specific cue vector (i.e., the domain-adaptive cue matrix) includes: generating a domain-specific cue matrix for each pseudo-domain through low-rank decomposition; multiplying the shared cue matrix and the domain-specific cue matrix element-wise through the Hadamard product to obtain a domain-adaptive cue matrix that integrates shared knowledge and domain-specific information; and embedding the domain-adaptive cue matrix into the token embedding of the first layer of the Vision Transformer model to guide the model to learn the feature representation related to the pseudo-domain.

[0089] Specifically, the generation method of the domain adaptation hint matrix is ​​expressed as follows:

[0090]

[0091] Among them, P m The final generated m-th domain adaptation cue matrix integrates shared cue and domain-specific information and is used for downstream model input or feature modulation. Shared prompt matrix, learn task-independent cross-domain general knowledge (such as H2O absorption peak characteristics), applicable to all domains (pseudo-domain); The learnable row vector (spatial weight vector) of the k-th domain is used to control the weight of the domain-specific cue at each "position". The pseudo-domain label number is k∈{1,2,...,K}, where K is the total number of domains. The learnable column vector (feature modulation vector) of the k-th domain is used to control the weight of domain-specific cues in each "dimension"; A domain-specific low-rank matrix, generated from two learnable vectors, is used for fine-grained modulation of shared cues; ⊙: Hadamard product, i.e., element-wise multiplication, is used to implement bit-weighted adjustments to shared cues.

[0092] Step S3.1.3: Domain Hybrid Enhancement and Adapter Design: Perform cross-domain sample hybrid enhancement and lightweight adapter weighted combination on samples with pseudo-domain labels of different pseudo-domains and domain adaptation cue matrices of all domains respectively to obtain hybrid samples and weighted cue.

[0093] The specific process of obtaining the mixed samples and weighted prompts through step S3.1.3 includes: performing cross-domain mixing of sample feature vectors with pseudo-domain labels from different pseudo-domains to obtain mixed samples; and using a two-layer MLP structure to perform weighted combination of the domain-adapted prompt matrices of all domains to obtain weighted prompt representations, wherein the weights are learned under supervision through a loss function, so that the model pays more attention to prompts that are close to the target domain.

[0094] Step S3.1.3.1: Domain Hybridization Enhancement Design (Cross-Domain Sample Hybridization)

[0095] To improve the model's generalization ability across different pseudodomains, this invention introduces a cross-domain sample mixing strategy. This involves mixing two samples from different pseudodomains... and Mix in proportion:

[0096]

[0097] Sample i comes from the input feature vector of the k-th domain; Sample j comes from the input feature vector of the q-th domain; μ∈[0,1]: mixing weight coefficient, used to control the proportion of the two samples in the mixed sample, usually μ~Uniform(0.2,0.8); x mix The mixed samples are used for data augmentation or to improve cross-domain generalization ability. Cross-domain mixing (k≠q) can be used to simulate device switching scenarios, for example; the weight μ controls the mixing ratio.

[0098] This operation not only enriches the distribution of training samples, but also effectively alleviates the noise problem that may exist in pseudo-domain labels, thereby improving the robustness of the model.

[0099] Step S3.1.3.2: Adapter Design

[0100] To further improve the model's adaptability to the target domain, a lightweight adapter module was set up, providing hints to the matrix {P} for all domains. 1 ,P2 ,...,P M This paper employs a two-layer MLP structure to weightedly combine multiple domain cues. The goal of this combination is to assign weights based on the similarity between different cues and the target sample, thereby achieving more effective cue selection and information utilization. The weighted cues are represented as follows:

[0101]

[0102] Where M: the total number of cue matrices, representing the number of sources of cue (e.g., multiple domains or tasks) incorporated; w m The weight coefficient of the m-th cue represents its contribution to the final representation. Subsequent supervised learning using a loss function will make the model focus more on cue information close to the current target domain, satisfying... P m : The domain adaptation cue matrix obtained from step S3.1.2; P weighted The fused weighted hints represent the final input that guides the model to complete the task, and can dynamically integrate knowledge from multiple domains.

[0103] weight w m Learning through a two-layer MLP: w m =Softmax(MLP([x;P)) m ])).

[0104] Through the preprocessing and domain cue learning in step S3 above, the standardization, structuring, and domain difference modeling of the polluted acid spectral data were effectively completed, laying a solid foundation for subsequent efficient identification and classification.

[0105] In one embodiment of the present invention, assuming the acid samples collected by three spectrometers (domains A / B / C), pseudo-domains are generated as follows: For sample from device A, k=1 (characteristic: significant high-frequency noise); for sample from device B, k=2 (characteristic: bluish background); for sample from device C, k=3 (characteristic: fluorescence intensity drift). Hint: Construction: This is a special prompt for noise reduction; This refers to color correction tips; This indicates an intensity calibration prompt. Hybrid enhancement: x mix = 0.6 × Device A sample + 0.4 × Device C sample (k=1 and k=3 mixed). Adapter weighting: When inputting Device B sample, w2 = 0.92, w1 = 0.05, w3 = 0.03. Final result: When the model processes new data from Device B, it automatically activates 92% of the "color correction hints," accurately identifying Ca after removing device bias. 2+ concentration.

[0106] Step S3.2: Training the AI ​​network recognition model

[0107] To address the issue of complex composition and diverse sources of industrial waste acid, an AI model was trained to identify its spectral characteristics, enabling the identification of major metal ions (Ca). 2+ Fe 2+ Na + Rapid prediction of concentrations of substances such as (etc.) can replace traditional manual testing methods, improving identification efficiency and accuracy.

[0108] The AI ​​network recognition model in this invention adopts a classifier structure that combines local neighborhood attention (NA) and extended neighborhood attention (DNAT) to capture both local details and global structural features.

[0109] Step S3.2.1: Local Neighborhood Attention (NA)

[0110] Local neighborhood attention restricts self-attention to the neighborhood of each token, reducing computation while preserving spatial relevance. Specifically, the local neighborhood attention mechanism includes: limiting self-attention computation to the neighborhood of each token; selecting a fixed number of nearest neighbor tokens based on spatial location or feature similarity; introducing positional bias encoding to preserve spatial relevance; and generating local feature representations by aggregating the value vectors of neighborhood tokens.

[0111]

[0112] in, The query, key, and value matrices are all obtained by linear transformation of the input X, where n represents the number of tokens and d represents the feature dimension of each token. The query vector corresponding to the i-th token; The key vector of the j-th neighbor of the i-th token; The value vector of the j-th neighbor of the i-th token; p j (i): The index of the j-th nearest neighbor of the i-th token (selected based on spatial adjacency or feature similarity); k': Neighborhood size, i.e., the number of nearest neighbor tokens considered for each token. The neighborhood size k' is dynamically adjusted according to the resolution of the pollutant spectral image, and the typical range is 8-16; nearest neighbor tokens; Attention scoring vector between the i-th token and its k' neighbors; Position offset is used to encode the relative position information between the i-th token and its j-th neighbor; A matrix formed by concatenating the value vectors of the k' neighbors of the i-th token; The attention scores are normalized to obtain the attention weights. This is a scaling factor used to avoid gradient vanishing or numerical instability; The representation of the i-th token after aggregating its neighbor information.

[0113] Preferably, the neighborhood selection strategy of local neighborhood attention (NA) adopts a dynamic threshold mechanism. When the feature similarity between tokens exceeds a preset threshold, the nearest neighbor is selected based on feature similarity. When the feature similarity is lower than the threshold, it degenerates into fixed neighborhood selection based on spatial adjacency.

[0114] Step S3.2.1 reduces computational cost by using local neighborhood attention (NA) (processing only neighborhood tokens), for example, capturing Ca. 2+ / Fe 2+ Local aggregation characteristics of plasma.

[0115] Step S3.2.2: Expand Neighborhood Attention (DNAT)

[0116] Expanding neighborhood attention expands the receptive field by setting an expansion rate δ and selecting neighborhood tokens at intervals to capture multi-scale information. Specifically, the expanded neighborhood attention mechanism includes: sampling neighborhood tokens at preset expansion rate intervals to expand the receptive field; ensuring spatial uniformity by satisfying the condition of equal index modulo during sampling; setting a maximum expansion rate upper limit to ensure effective neighborhood coverage; and fusing multi-scale contextual features to generate expanded feature representations.

[0117]

[0118] in, The index of the j-th expanded neighbor of the i-th token satisfies j mod δ = i mod δ, which is used to control the sparsity and spatial uniformity of neighborhood sampling; δ: expansion interval factor, which controls the sampling step size of neighborhood tokens; The key vector of the j-th expanded neighbor of the i-th token; The value vector of the j-th expanded neighbor of the i-th token; d k’ The feature dimension in the extended neighborhood is usually the same as the original feature dimension d, or obtained through projection transformation; Attention score between the i-th token and its k' extended neighbors; Position offset is used to encode the relative position information between the i-th token and its j-th extended neighbor; A matrix formed by concatenating the value vectors of the k' expanded neighbors of the i-th token; Normalized attention weights, scaling factor Used to avoid gradient vanishing or numerical instability; The output of the i-th token after aggregating and expanding neighborhood information is fused with multi-scale contextual features.

[0119] Preferably, the expansion interval factor δ of the expanded neighborhood attention (DNAT) adopts an adaptive adjustment strategy, and its value range satisfies δ∈[2,δ max If δ = 2, it means that the neighbors are sampled once every other token; The maximum expansion rate limit ensures that each token has at least k' effective neighborhood points; α is a preset neighborhood density coefficient (1≤α≤2) used to control the maximum perception range of a single-layer attention module. α can be set to 1.5 to ensure effective coverage.

[0120] Step S3.2.2 captures cross-scale pollution associations (such as complex distribution) and identifies cross-scale structures such as complexes by expanding neighborhood attention (DNAT) through δ-controlled receptive fields.

[0121] The output NA of the local neighborhood attention branch out and the output DNAT of the expanded neighborhood attention branch out By performing channel splicing or weighted summation, the primary fusion feature F is obtained. fused :

[0122] F fused =Concat(NA) out DNAT out )

[0123] Preferably, the output features of NA and DNAT interact through a gated fusion unit, and the fusion weights are controlled by a learnable temperature coefficient τ, expressed as:

[0124]

[0125] Where τ∈[0,1], it is automatically optimized by gradient descent.

[0126] Primary fusion feature F output by the feature extraction layers (NA and DNAT) fused As input, it is fed into a subsequent multi-layer standard Transformer encoder (e.g., N=6 layers) for deep fusion and feature abstraction. The output of the last layer of the encoder (usually the CLS token) serves as the final fused feature vector. For prediction, specifically, the feature fusion layer uses a standard Transformer encoder × N to fuse the primary fusion features F. fused Deep encoding is performed as follows:

[0127] ZL = TransformerLayers(F) fused )

[0128] Using the CLS Token as a sample representation, output the global fusion features.

[0129] Step S3.3: Improved Loss Function Design

[0130] The overall model's optimization objective consists of two loss functions, designed to improve cross-domain robustness and enhance focus on the target domain. Loss Function Including mixed loss and weighted monitoring losses

[0131]

[0132] in, Hybrid loss utilizes hybrid enhancement techniques to improve the model's robustness to cross-domain samples and forces the model to learn domain-invariant features; The weighted supervision loss consists of two parts: the prediction loss and the adapter weight supervision loss. Adjusting the adapter weight w m Strengthen the focus on the target domain.

[0133] Furthermore, among them, mixed loss The calculation includes: calculating the cross-entropy loss of the mixed sample of two samples from different pseudo-domains with the labels of the two original samples, and then weighting and summing the two losses according to the mixing weight;

[0134]

[0135] Where, x mix : The mixed sample image obtained from step S3.1.3.1; y i ,y j : Corresponding to the original image x i x j The true label; ρ: mixing coefficient, which controls the weight ratio of the two samples in the mixed image, with a value ranging from 0 to 1; F m (·): The feature representation function extracted by the m-th domain adapter; H(·): The classifier or head network used to map features to the class probability space.

[0136] Weighted loss The calculation includes: calculating the cross-entropy loss between the fused feature vector and the true label; applying supervisory constraints to the domain adapter weights: forcing the current domain weights to be close to 1 and the non-current domain weights to be close to 0; and multiplying the weight supervision loss by an adjustment coefficient and adding it to the prediction loss, specifically expressed as:

[0137]

[0138] in, Cross-entropy loss function measures the difference between prediction p and label q; The fusion feature after using weighted prompts (e.g., a weighted combination of outputs from multiple domain adapters); x: input sample; y: the true label corresponding to the input sample; M: the total number of domain adapters, i.e., the number of sub-models or prompt modules (meaning the same as step S3.1.3.2); w m The weight of the m-th adapter is used to control its contribution to the prediction (meaning is the same as in step 2.2.4). The adjustment coefficient of the weight regularization term controls the proportion of the adapter weight supervision term in the total loss; The weight supervision regularization term is used to encourage the weight w corresponding to the current domain. m The weights of other domains are closer to 1, while the weights of the other domains are closer to 0, thus achieving sparsity and interpretability in domain selection.

[0139] Step S4: Real-time acquisition of spectral image data of industrial waste acid solution and preprocessing, input into the trained model for waste acid component analysis and identification, outputting the key components of waste acid and their concentration prediction results;

[0140] In step S4, spectral image data of industrial waste acid solution is acquired in real time, preprocessed, and then input into the trained model for waste acid component analysis and identification. The final identification result is embedded and represented by the output layer. The nonlinear mapping yields the component prediction vector.

[0141]

[0142] The feature vectors extracted from the backbone model; Here are the weights and bias parameters for the output layer; C represents the number of acidic components to be identified; σ(·) is the activation function. The component prediction result is a component probability vector. For example, by taking the maximum probability or filtering by a threshold, the predicted ion concentration is output.

[0143] This step S4 can detect and identify key components in the waste acid (such as F-, Cr-). 6+ (such as complexed heavy metals) and background Ca 2+ Fe 2+ Na + Plasma and its concentration, background ion Ca 2+ Fe 2+ If the concentration is too high, the dosage of the reagent should be reduced (to prevent excessive precipitation). Na + Excessive Cl- concentrations affect crystallization purity. The core of the detection process is to first measure harmful substances (Cr). 6+The dosage baseline is determined by ( / Cu / F-), and then based on the detected background ions (Ca...). 2+ / Fe 2+ The concentration of the reagent was further optimized to determine the dosage (the polluted acid contains Ca). 2+ (Can replace part of CaCl2).

[0144] Based on Cu in the raw acidic water 2+ Concentration calculation of the dosage of 10% CaCl2, based on F- / Cr 6+ The concentration calculation shows that adding 5% FeSO4 will generate stable copper ferrite (CuFe2O4), FeF2, FeF3, CaSO4 and other precipitates. Finally, through solid-liquid separation, sludge and purified water are separated to obtain resource-based products and reclaimed water.

[0145] Therefore, formula optimization needs to consider the concentrations of harmful substances (F-, Cr) simultaneously. 6+ (complexed heavy metals) and background ion concentration (Ca) 2+ ,Fe 2+ Because excessively high background ion levels can affect the actual amount of reagent required (e.g., background Ca2+). 2+ (Higher dosage can reduce CaCl2 addition).

[0146] Step S5: Based on the predicted results of the key components and concentrations of the waste acid, the reagent formulation is optimized using reinforcement learning, and the precise ratio of 10% calcium chloride solution and 5% ferrous sulfate solution is output to achieve heavy metal ion control and resource recovery.

[0147] Because waste acid has a complex composition and diverse sources, using a uniform treatment scheme often fails to achieve optimal reaction results and may even lead to waste of treatment agents or side reactions. Therefore, this invention introduces a reinforcement learning mechanism to simulate multiple rounds of agent formulation experiments. Through interactive feedback, the treatment strategy is continuously optimized, thereby achieving personalized customization and efficient purification treatment for different waste acid samples. The goal of this step is to construct an intelligent agent capable of autonomously learning the optimal agent combination scheme under different waste acid formulation conditions.

[0148] Step S5.1: Construct a dual robust advantage estimator

[0149] Step S5.1 is used to construct a dual robust advantage estimator: the step-level advantage function is calculated by weighted fusion of the final Monte Carlo reward and the temporal difference estimate, where the weight of the final reward is higher as the task ends.

[0150] In reinforcement learning, policy optimization relies on accurate estimation of action advantage. Traditional methods are susceptible to environmental stochasticity, leading to unstable training. To address this, we propose a "dual robust advantage estimator" that integrates final Monte Carlo reward and temporal difference (TD) estimation to achieve a balance between high variance and high bias. The advantage calculation formula is as follows:

[0151] A step (s h ,a h c)=λ H-h r(s H ,c)+(1-λ H-h (V) step (s h+1 ,c)+r(s h ,a h ,c)-V step (s h ,c))

[0152] Among them, A step (s h ,a h c): Step-level advantage function, which measures the advantage in state s. h Next, execute action a h The relative performance of the average strategy is used to guide strategy optimization; s h : The state at step h; a h : The action to be performed in step h; c: Task instructions (context information or target description); r(s) H c): In the terminated state s H The final reward obtained is usually an indication of whether the task is completed (e.g., 1 for success, 0 for failure); r(s) h ,a h c): Execute action a in step h. h The immediate reward received reflects the local quality of the current action; V step (s h c): Current state s h The value estimate of V is the total expected return that can be obtained under the current strategy, starting from the current state; step (s h+1 c): Next state s h+1 Value estimation; λ: balance factor (0≤λ≤1), λ adopts a dynamic decay strategy, the initial value is set to 0.9, and it decays by 0.05 to the minimum value of 0.3 in each training round; H: the maximum number of steps allowed for the task, H∈[8,15], which ensures that the complex acid pollution reacts fully and avoids ineffective exploration (reward increase <0.5% / step), and H=10 is preferred; Hh: the number of steps remaining to the end point, used to control λ H-hThe degree of decay reflects the increasing dependence on the actual reward r(s) as the game nears its end. H c), the closer to the task endpoint (the smaller Hh), the higher λ becomes. H-h The closer to 1, the higher the weight of the final reward; s H This represents the final state (i.e., the termination state) during task execution, such as the solution state after the treatment of waste acid; λ H-h ·r(s H c): Final reward weighted term, approximate Monte Carlo method for reward estimation; (1-λ) H-h (V) step (s h+1 ,c)+r(s h ,a h ,c)-V step (s h c): The guiding term is a time-series difference adjustment based on the value functions of the current and next states and the immediate reward.

[0153] Successful determination: If the concentration of heavy metal ions after waste acid treatment meets the standard and the resource recovery rate meets expectations, then r(s) H ,c)=1; Failure judgment: If the treated water quality does not meet the standard or the excessive amount of reagent causes secondary pollution, then r(s) H ,c)=0.

[0154] By weighted fusion of final effects and local state assessments, dependence on a single path is effectively reduced, and the robustness and generalization ability of policy evaluation are improved.

[0155] Step S5.2: Constructing instruction-level value functions and automatic curriculum learning

[0156] Because different acid samples exhibit significant differences in the learning difficulty of treatment strategies, direct training can easily lead to the model falling into the problem of "overfitting on simple tasks and failing to converge on difficult tasks." Therefore, this invention introduces an automatic course learning mechanism to dynamically evaluate and prioritize training on high-value, moderately difficult tasks, thereby improving sample utilization. An instruction-level value function is designed to calculate the instruction advantage value based on the difference between the task completion result and the historical average success rate, used to quantify task difficulty. Specifically, the instruction advantage is calculated as follows:

[0157] A instruct (s h ,a h c) = r(s) H ,c)-V instruct (c)

[0158] A instruct (s h ,a hc): Instruction-level advantage function, which measures the advantage of the actual performance of task c relative to the average performance of the task; r(s) H c): Final reward (1 for success, 0 for failure), representing the final state s H Does it satisfy the objective of instruction c? V instruct (c): Instruction-level value function, which estimates the average probability of success of task c across all trajectories.

[0159] This step S5.2 is done via A instruct The task difficulty is measured (a higher value indicates a more difficult task and more valuable successful samples); high-A scores are prioritized. instruct The system trains on the trajectories of high-value / high-difficulty samples, similar to prioritizing experience replay, which accelerates convergence. The system prioritizes extracting high-advantage task trajectories for training, which is equivalent to building an "adaptive learning curriculum" that gradually transitions from simple samples to complex samples, improving learning speed and generalization ability.

[0160] Step S5.3: Construct the training value function

[0161] To improve the stability and accuracy during training, this invention designs a training value function loss form based on binary cross-entropy to replace the traditional MSE (mean squared error) regression method, making the model more likely to converge during optimization. The definition is as follows:

[0162]

[0163] in, The training loss of the trajectory-level value function uses binary cross-tab loss to measure the error between the predicted success probability and the actual result; The training loss of the step-level value function also uses binary cross-entropy to evaluate the success prediction accuracy of each step's state-action; V traj (c): Trajectory-level value function, predicting the overall success probability of completing task c; V step (s h ,a h c): Step-level value function, predicting the value at the current state s. h Perform action a h The probability of success for task c; r(s) H c): Final reward, indicating whether the task was successfully completed; v: Trajectory distribution, i.e., the set of trajectories sampled from the environment or policy; logV(·) and log(1-V(·)): represent the logarithmic loss terms for success and failure probabilities, respectively; c: Task instruction, indicating the objective of recipe optimization.

[0164] Step S5.3 treats value prediction as a classification problem, mitigating the gradient instability problem in regression problems.

[0165] Step S5.4: Construct the advantage-weighted regression loss

[0166] During the policy network training phase, this invention introduces an advantage value gating mechanism to perform a "hard screening" of training samples, retaining only state-action pairs that make a crucial contribution to success, thus suppressing noise interference and negative transfer caused by random exploration. By implementing advantage-weighted regression, only state-action pairs with advantage values ​​higher than a preset threshold are selected for policy training, maximizing the effectiveness of key decisions. The policy loss is defined as:

[0167]

[0168] The loss function of the policy network is used to maximize the probability of choosing action a in state s according to task instruction c, with the goal of increasing the probability of high-quality actions; π(a|s,c): the policy network, representing the probability of choosing action a in state s and task c; logπ(a|s,c): the log probability, used to calculate the negative log-likelihood loss, encouraging the policy to favor the correct action; filter(v) is the set of high-quality samples (e.g., trajectories of successfully executed tasks) selected from the trajectory distribution v; a: action, describing possible drug formulation schemes; s: the current state characteristics of the polluted acid sample, including features such as Ca 2+ Concentration, pH value, precipitation amount; logπ(a|s,c): loss term, penalizing the low probability of the strategy choosing the correct action in a good trajectory.

[0169] Furthermore, in the filter(v) mechanism, only the step-level dominance estimate A is selected. step (s h ,a h c) State-action pairs (s) that are higher than the preset threshold η h ,a h This mechanism is used for training policy networks. The threshold η can be set to 1 / H (where H is the maximum number of steps) or other empirical values. This mechanism aims to focus on key decision points that significantly contribute to task success, maximizing training effectiveness and suppressing noise interference. By retaining only action-state pairs with an advantage value higher than the threshold (e.g., 1 / H), it maximizes the probability of effective actions and optimizes the policy formulation. This mechanism focuses on "key decision points," improving learning efficiency and significantly enhancing the interpretability and practicality of the final policy formulation while suppressing noise interference.

[0170] The final output expression for the optimal drug combination scheme is:

[0171]

[0172] a *The final output is the optimal combination of reagents (such as the specific proportions of calcium chloride, ferrous sulfate, etc.); Action space represents the set of all possible drug formulation schemes; arg max: maximization operation, representing the selection of action 'a' that maximizes the probability of the strategy.

[0173] In step S5.4, the ratio scheme with the highest probability in the strategy network is selected as the optimal drug ratio scheme.

[0174] Step S5 involves RL generating a formulation scheme a* based on the ion concentration output by the AI ​​network recognition model. This scheme includes the precise ratio of 10% calcium chloride solution and 5% ferrous sulfate solution. For example, assuming the model identifies a certain acidic waste sample containing a high concentration of F... - (e.g., 500 mg / L) and moderate background Ca 2+ (For example, 200 mg / L), after multiple rounds of simulation and advantage screening, the RL strategy network finally outputs the optimal ratio as 10% CaCl2: Y = 50 ml / L, 5% FeSO4: Z = 120 ml / L, where Y is lower than the background Ca2+ concentration. 2+ The theoretical value for Z is calculated based on the F- concentration. By using 10% CaCl2 to disrupt the metal complex structure and promote flocculation and sedimentation, and by using 5% FeSO4 to remove fluoride precipitation and a reducing agent to regulate iron speciation, the system automatically adds reagents to achieve heavy metal ion control and resource recovery, and then feeds the treatment results back to the sensing layer.

[0175] According to the above embodiments of the present invention, by adding a specific reagent (10% CaCl2 + 5% FeSO4), heavy metal ions in the waste acid are converted into recyclable precipitates or non-toxic substances. Ion-directed conversion: This process converts harmful ions (F...) into... - Cr 6+ ) is converted into stable, non-toxic compounds (FeF2, Cr) 3+ ), utilizing Fe in waste acid 2+ / Ca 2+ As a reaction medium, it reduces the need for external reagents.

[0176] Figure 5 A schematic diagram of a deep learning-based waste acid resource utilization system is shown.

[0177] like Figure 5 As shown, a deep learning-based waste acid resource utilization system 200 includes:

[0178] The spectral data acquisition module 210 is used to acquire spectral image data containing molecular structure information and elemental composition of the waste acid sample through near-infrared spectroscopy and X-ray fluorescence spectroscopy.

[0179] Data preprocessing module 220 is used to preprocess the spectral image data;

[0180] AI network training module 230 uses preprocessed sample data to train an AI network recognition model. It adopts a classifier structure that combines local neighborhood attention (NA) and extended neighborhood attention (DNAT), and optimizes the model by mixing cross-entropy loss and weighted supervision loss.

[0181] The component concentration prediction module 240 collects spectral image data of industrial waste acid solution in real time, performs preprocessing, and inputs it into the trained model for waste acid component analysis and identification, and outputs the key components of waste acid and their concentration prediction results.

[0182] The reagent formulation optimization module 250 is used to optimize the reagent formulation based on the prediction results of the key components and concentrations of the waste acid and the reinforcement learning, and outputs the precise ratio of 10% calcium chloride solution and 5% ferrous sulfate solution to achieve heavy metal ion control and resource recovery.

[0183] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of each step described can be referred to the corresponding process in the foregoing system embodiments, and will not be repeated here.

[0184] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.

[0185] It should also be noted that, in the embodiments of this application, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0186] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined in the embodiments of this application may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown in this application, but is to be accorded the widest scope consistent with the principles and novel features disclosed in the embodiments of this application.

Claims

1. A method for the resource utilization of waste acid based on deep learning, characterized in that, include: Step S1: Construct a target resource recovery system by adding 10% calcium chloride solution and 5% ferrous sulfate solution to the waste acid; Step S2: Acquire spectral image data containing molecular structure information and elemental composition of the waste acid sample using near-infrared spectroscopy and X-ray fluorescence spectroscopy; Step S3: Preprocess the spectral image data, train an AI network recognition model based on the preprocessed sample data, adopt a classifier structure that combines local neighborhood attention (NA) and extended neighborhood attention (DNAT), and optimize the model by mixing cross-entropy loss and weight supervision loss. The preprocessing of the spectral image data includes: For the original spectral image data, the style features of the image are extracted by the shallow CLS Token of the Vision Transformer model, and pseudo-domain labels are generated by K-means clustering. Construct a low-rank decomposition domain cue vector, and generate a domain-adaptive cue matrix by using the Hadamard product of a shared cue matrix and a domain-specific low-rank matrix; Cross-domain sample fusion enhancement and lightweight adapter weighted combination are applied to samples with pseudo-domain labels from different pseudo-domains and the domain adaptation cue matrices of all domains to obtain fused samples and weighted cue. Step S4: Real-time acquisition of spectral image data of industrial waste acid solution and preprocessing, input into the trained model for waste acid component analysis and identification, outputting the key components of waste acid and their concentration prediction results; Step S5: Based on the predicted results of the key components and concentrations of the waste acid, the reagent formulation is optimized using reinforcement learning, and the precise ratio of 10% calcium chloride solution and 5% ferrous sulfate solution is output to achieve heavy metal ion control and resource recovery.

2. The method for resource utilization of waste acid according to claim 1, characterized in that, in, The specific methods for generating pseudo-domain tags include: The CLS Token output from the first layer of the Vision Transformer is extracted as a style feature vector, including instrument imaging artifacts, background chromatic aberration, and noise patterns, to measure the domain differences between samples. The K-means algorithm is used to perform unsupervised clustering on the style feature vectors. Based on the clustering results, the samples are divided into several pseudo-domains. A pseudo-domain label is assigned to each polluted acid sample, and each pseudo-domain represents a set of samples with similar styles.

3. The method for resource utilization of waste acid according to claim 2, characterized in that, The specific generation process of the domain adaptation cue matrix includes: For each pseudo-domain, a domain-specific hint matrix is ​​generated through low-rank decomposition; The shared hint matrix and the domain-specific hint matrix are multiplied element-wise by the Hadamard product to obtain the domain-adaptive hint matrix that integrates shared knowledge and domain-specific information; The domain adaptation cue matrix is ​​embedded into the token embedding of the first layer of the Vision Transformer model to guide the model to learn the feature representation related to the pseudo-domain.

4. The method for resource utilization of waste acid according to claim 3, characterized in that, in, The specific process of obtaining the mixed sample and weighted hints includes: The feature vectors of samples with pseudo-domain labels from different pseudo-domains are mixed across domains to obtain mixed samples; For the domain-adaptive cue matrices of all domains, a two-layer MLP structure is used to perform a weighted combination to obtain a weighted cue representation. The weights are learned under supervision through a loss function, so that the model pays more attention to cue that is close to the target domain.

5. The method for resource utilization of waste acid according to claim 4, characterized in that, in, The AI ​​network recognition model adopts the Vision Transformer backbone network, which includes: input layer, preprocessing layer, feature extraction layer, feature fusion layer, output layer and loss function; The input layer is used to receive spectral image data of the polluted acid; The preprocessing layer is used to preprocess the spectral image data; The feature extraction layer is used to extract local and global features based on local neighborhood attention mechanism and extended neighborhood attention mechanism, respectively. The feature fusion layer is used to perform deep fusion of local and global features obtained by the two attention mechanisms through a multi-layer Transformer encoder to obtain a fused feature vector. The output layer is used to perform a nonlinear mapping on the fused feature vector, outputting the Ca in the polluted acid. 2+ Fe 2+ Na + Predicted concentrations of metal ions; The loss function includes hybrid loss and weighted supervised loss.

6. The method for resource utilization of waste acid according to claim 5, characterized in that, in, The local neighborhood attention mechanism includes: limiting self-attention computation to the neighborhood region of each token, selecting a fixed number of nearest neighbor tokens based on spatial location or feature similarity, introducing positional bias encoding to preserve spatial correlation, and generating local feature representations by aggregating the value vectors of neighborhood tokens; The expanded neighborhood attention mechanism includes: sampling neighborhood tokens at preset expansion rate intervals to expand the receptive field; ensuring spatial uniformity by satisfying the condition of equal index modulus during sampling; setting a maximum expansion rate upper limit to ensure effective neighborhood coverage; and fusing multi-scale contextual features to generate expanded feature representations.

7. The method for resource utilization of waste acid according to claim 5, characterized in that, in, The calculation of the hybrid loss includes: calculating the cross-entropy loss of the hybrid sample from two samples from different pseudo-domains with the labels of the two original samples, and then weighting and summing the two losses according to the hybrid weight; The calculation of the weighted supervision loss includes: calculating the cross-entropy loss of the fused feature vector and the true label; applying supervision constraints to the domain adapter weights: forcing the current domain weights to be close to 1 and the non-current domain weights to be close to 0; and multiplying the weight supervision loss by an adjustment coefficient and adding it to the prediction loss.

8. The method for resource utilization of waste acid according to claim 6, characterized in that, in, Reinforcement learning-based recipe optimization includes: A dual robust advantage estimator is constructed, which calculates the step-level advantage function by weighted fusion of the final Monte Carlo reward and the temporal difference estimate, where the weight of the final reward is higher as the task ends; Design an instruction-level value function to calculate the instruction advantage value based on the difference between the task completion result and the historical average success rate, which is used to quantify the task difficulty; By implementing advantage-weighted regression, only state-action pairs with advantage values ​​above a preset threshold are selected for policy training, maximizing the effectiveness of key decisions. The optimal drug ratio is selected from the ratio scheme with the highest probability in the policy network.

9. A deep learning-based system for the resource utilization of waste acid, used to implement the waste acid resource utilization method as described in any one of claims 1-8, characterized in that, include: The spectral data acquisition module is used to acquire spectral image data containing molecular structure information and elemental composition of waste acid samples through near-infrared spectroscopy and X-ray fluorescence spectroscopy. The data preprocessing module is used to preprocess the spectral image data; The AI ​​network training module uses preprocessed sample data to train the AI ​​network recognition model. It adopts a classifier structure that combines local neighborhood attention (NA) and extended neighborhood attention (DNAT), and optimizes the model by using hybrid cross-entropy loss and weighted supervision loss. The component concentration prediction module collects spectral image data of industrial waste acid solution in real time, preprocesses it, and then inputs it into the trained model to analyze and identify the waste acid components, and outputs the key components of waste acid and their concentration prediction results. The reagent formulation optimization module is used to optimize the reagent formulation based on the predicted results of the key components and concentrations of the waste acid, and outputs the precise ratio of 10% calcium chloride solution and 5% ferrous sulfate solution to achieve heavy metal ion control and resource recovery.

Citation Information

Patent Citations

  • Pickling waste liquid recycling system and recycling method

    CN119285041A