A method for predicting the risk of scale formation in circulating cooling water based on PINN-Transformer

By using a PINN-Transformer-based method, combined with water chemical equilibrium theory and multi-head self-attention mechanism, the problems of insufficient dynamic trend capture and feature utilization in the prediction of scaling risk in circulating cooling water are solved. This method achieves scaling risk prediction with strong physical interpretability and reliable prediction results, and is adaptable to different operating conditions and extreme conditions.

CN122367175APending Publication Date: 2026-07-10XI AN JIAOTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610598232.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-30
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

Existing technologies for predicting scaling risks in circulating cooling water suffer from problems such as static calculations failing to reflect dynamic trends, insufficient utilization of features, lack of physical constraints in purely data-driven methods, and insufficient generalization ability of data-driven methods. These issues lead to inaccurate prediction results and make it difficult to apply the technology under different operating conditions.

Method used

The PSI chemical risk score was calculated using a PINN-Transformer-based method combined with hydrochemical equilibrium theory. Auxiliary water quality characteristics were extracted through principal component analysis, and the dependence of water quality parameters was captured using a multi-head self-attention mechanism. Finally, a seven-fold physical constraint loss function was used to ensure that the prediction results conformed to the basic laws of hydrochemistry.

Benefits of technology

It achieves strong physical interpretability and reliable prediction results for circulating cooling water scaling risk prediction. It can automatically construct quantitative risk indicators, capture dynamic trends, adapt to extreme operating conditions, and make full use of features to support real-time prediction and modular design.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122367175A_ABST
    Figure CN122367175A_ABST
Patent Text Reader

Abstract

This invention belongs to the field of circulating water treatment technology and relates to a method for predicting scaling risk in circulating cooling water based on PINN-Transformer. The method includes: 1. Data preprocessing; 2. Unsupervised risk proxy label construction; 3. PINN-Transformer fusion model construction; 4. Construction of a seven-fold physical constraint loss function system; 5. Model training and inference deployment. This invention combines traditional scaling chemical analysis principles with a deep learning model to construct a seven-fold physical constraint loss function system. This ensures that the model's learning process strictly conforms to fundamental thermodynamic laws and professional knowledge in the field of scaling, solving the problems of physical inconsistencies and poor generalization that easily occur in purely data-driven models. Compared with traditional fixed-formula scaling prediction methods, this invention has stronger adaptability to different operating conditions and higher prediction accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of circulating water treatment technology, specifically relating to a method for predicting the risk of scaling in circulating cooling water based on PINN-Transformer. Background Technology

[0002] Circulating cooling water systems are widely used in industries such as power, petrochemicals, and metallurgy, undertaking the critical functions of equipment heat dissipation and process cooling. During circulation, the circulating cooling water, due to its increased concentration and calcium and magnesium ion concentration, forms scale on the surface of heat exchanger tubes. Scale formation leads to decreased heat exchange efficiency, reduced pipe cross-section, and accelerated equipment corrosion, and in severe cases, can cause unplanned downtime and significant economic losses. Currently, the industry primarily assesses the scaling risk of circulating cooling water using three water stability indices: the Langelinie saturation index, the Rezsner stability index, and the Pacoraz index.

[0003] With the improvement of online sensing and data acquisition capabilities, recent studies have used statistical and data analysis methods to construct new water chemistry indicators and risk scoring systems, aiming to better characterize the coupling relationship between complex water quality and operational behavior. Common approaches include correlation analysis, principal component analysis, factor analysis, and weighted aggregation, combining time-series statistics (mean, variance, slope of change, etc.) to generate composite features, and validating them with historical scaling or cleaning events. While data-driven indicators can significantly improve discriminative ability, their stability depends on sample size, data quality, and cross-scenario generalization ability.

[0004] Meanwhile, machine learning and deep learning have made rapid progress in scaling prediction and water quality early warning. Tree models, with their efficient data processing capabilities, are widely used in water quality classification and regression tasks; time series models, due to their ability to automatically extract complex nonlinear time series features, have shown significant advantages in high-frequency water quality monitoring data modeling. Overall, circulating cooling water scaling prediction technology is shifting from single empirical formulas to engineering solutions that combine water chemistry mechanisms with advanced data methods.

[0005] However, the aforementioned existing technologies have the following defects and shortcomings in practical industrial applications: Static calculations cannot reflect dynamic trends: Indices such as LSI, RSI, and PSI are all calculated statically based on the water chemical equilibrium state at a single point in time, failing to capture the dynamic changes in water quality parameters over time. However, in real-world industrial scenarios, the accumulation of scaling risk is a gradual and dynamic process, and the index value at a single point in time may not accurately reflect the future evolution of scaling risk. For example, short-term fluctuations in pH and calcium hardness may lead to misjudgments in the LSI index at certain times, while long-term trend analysis can more accurately identify the accumulation process of scaling risk.

[0006] Insufficient utilization of features: Traditional indices only use limited parameters such as pH, calcium hardness, total alkalinity, and conductivity, failing to utilize the risk information contained in auxiliary water quality indicators such as chloride ion concentration and turbidity. For example, although chloride ions themselves do not directly form insoluble scale, they are highly corrosive ions. Their small radius and strong penetrating power easily damage metal passivation films, causing pitting corrosion, or generate strong acidic substances under scale, accelerating metal corrosion. These metal corrosion products, intertwined with suspended solids and scale in the water, deposit to form a severe fouling layer, further hindering heat transfer and inducing more scaling. Simultaneously, increased turbidity reflects an increase in suspended particles, which can act as crystal nuclei, promoting scaling—information completely ignored in traditional indices.

[0007] Purely data-driven methods lack physical constraints: While recent data-driven scaling prediction methods based on random forests, support vector machines, and ordinary neural networks can learn nonlinear mapping relationships from data, their predictions may violate fundamental water chemistry and physics laws. For example, a purely data-driven model might predict a decrease in scaling risk when pH increases, contradicting the basic principle of calcium carbonate dissolution equilibrium.

[0008] Data-driven methods suffer from insufficient generalization ability: Existing machine learning methods often achieve good fitting results on single-condition datasets, but their performance deteriorates significantly when migrating between different equipment, operating conditions, and seasons. The water quality, operating parameters, and dosing schemes of different circulating cooling water systems vary considerably, making it difficult to directly transfer models trained on one system to another. Furthermore, industrial field data generally suffers from sample imbalance—data on normal operating conditions far exceeds data on high-risk conditions, resulting in insufficient model recognition of high-risk states.

[0009] Lack of real-world labeled data: It is difficult to obtain accurate labeled data on the degree of fouling in industrial sites, and traditional supervised learning methods cannot be directly applied due to the lack of labels. Existing methods either rely on human experience (highly subjective) or on periodic shutdown inspections (significant lag), neither of which can meet the needs of real-time prediction.

[0010] Therefore, a method for predicting the risk of scaling in circulating cooling water with strong physical interpretability and reliable prediction results is needed to solve the above-mentioned technical problems. Summary of the Invention

[0011] This invention provides the following technical solution: a method for predicting scaling risk in circulating cooling water based on PINN-Transformer, comprising the following steps: Step S1: Data preprocessing. The raw time-series data collected by the circulating cooling water online monitoring system is preprocessed. The data preprocessing includes: column name standardization, data type conversion, missing value interpolation and imputation, and feature standardization. Step S2: Construction of unsupervised risk proxy tags. Based on the water chemical equilibrium theory, the PSI chemical risk score is calculated as the physical main signal. The comprehensive risk information of auxiliary water quality characteristics is extracted by principal component analysis as a data-driven supplementary signal. The two are weighted and fused to generate a continuous risk proxy tag from 0 to 100. Step S3: PINN-Transformer fusion model construction. The input sequence is constructed from the standardized time series data according to the preset window length. A time series prediction model is designed, which includes an input embedding layer, a sine and cosine position encoder, a multi-layer Transformer encoder and a risk prediction head. The multi-head self-attention mechanism is used to capture the dependence of water quality parameters on different time scales. Step S4: Construction of a seven-fold physical constraint loss function system. The physical laws of water chemistry are embedded into the loss function of the model training in the form of soft constraints to ensure that the prediction results do not violate the basic physical principles under any working conditions. The physical laws include: monotonicity, LSI consistency, RSI consistency, ion balance, solubility product, interaction constraints and boundary constraints. Step S5, Model Training and Inference Deployment: Model training is completed by simultaneously optimizing data fitting loss and physical constraint loss. After training, forward propagation is performed in gradient-free calculation mode to output a real-time risk score in the range of [0, 100].

[0012] The beneficial effects of this invention are: 1. This invention boasts strong physical interpretability and reliable prediction results: Through a seven-fold physical constraint loss function system, this invention ensures that the model's prediction results do not violate fundamental water chemistry principles under any operating conditions. Specifically, this manifests as follows: the risk score does not decrease with increasing pH (monotonicity constraint); the risk score is necessarily high when the ion product exceeds the solubility product (solubility product constraint); and the LSI and RSI indices align with the risk score direction (consistency constraint). These verifiable physical consistency measures enable engineers to understand and trust the model's prediction results, reducing the obstacles to the widespread application of artificial intelligence technology in industrial settings.

[0013] 2. This invention automatically constructs quantitative risk indicators, overcoming the limitations of empirical formulas: For a long time, industry has lacked continuous indicators that can accurately quantify the degree of scaling in circulating cooling water. Existing criteria such as LSI, RSI, and PSI are mostly derived from empirical formulas based on data fitting, providing only qualitative judgments of scaling / corrosion tendency, and failing to offer refined risk quantification scores. This invention, through a physical-data fusion method, combines water chemical equilibrium theory with principal component analysis to automatically construct continuous risk proxy labels from 0 to 100. This eliminates the need for costly methods such as downtime disassembly and inspection to obtain scaling degree data, allowing the system to be directly trained and deployed using online monitoring data. Simultaneously, parameters such as turbidity and conductivity, which are not directly used in the PSI formula, are fully utilized through the PCA-assisted scoring mechanism, avoiding information waste.

[0014] 3. This invention possesses strong temporal modeling capabilities and captures dynamic trends: The multi-head self-attention mechanism of the Transformer encoder in this invention can effectively capture the dependencies and changing trends of water quality parameters at different time scales. Compared with traditional static assessment methods based on single-time-point water quality snapshots, the algorithm can identify gradual trends (such as a slow increase in pH value) and abrupt change patterns (such as rapid changes after chemical dosing) of water quality parameters, providing more accurate and timely risk warnings.

[0015] 4. Reliable Prediction Under Extreme Conditions: The multi-level physical constraints of this invention can still provide reasonable prediction results in extreme condition regions where training data is sparse (such as pH values ​​exceeding 8.5, calcium hardness exceeding 400 mg / L, etc.). Pure data-driven methods are prone to producing unreliable extrapolation results in these regions due to the lack of training samples, while the physical constraint mechanism of the algorithm provides a "safety barrier" for the model's behavior under extreme conditions.

[0016] 5. The invention fully utilizes the features and integrates information comprehensively: The invention not only utilizes the core parameters such as pH value, calcium hardness, total alkalinity and conductivity used in traditional water stability indices, but also incorporates the risk information of auxiliary indicators such as chloride ion concentration and turbidity into the prediction model through the PCA auxiliary scoring mechanism, thus realizing the comprehensive integration of multi-dimensional water quality information.

[0017] 6. This invention features a modular design and excellent scalability: It employs a five-module collaborative architecture (data processing module, tag construction module, time-series modeling module, physical constraint module, and inference deployment module), with each module interacting through standardized interfaces. When it needs to be extended to other water quality parameters, other types of physical constraints, or other industrial water treatment scenarios, only the corresponding modules need to be modified without reconstructing the entire system.

[0018] 7. This invention is industrially deployable and supports real-time prediction: After the model training is complete, deployment can be completed simply by saving the model weight file and the StandardScaler parameter file. The inference phase performs forward propagation in a gradient-free computation mode, supporting GPU acceleration and meeting the real-time requirements of industrial environments. Attached Figure Description

[0019] Figure 1 This is a schematic diagram of the model architecture of a circulating cooling water scaling risk prediction method based on PINN-Transformer according to the present invention. Figure 2 This is a diagram of the overall algorithm architecture of the present invention. Detailed Implementation

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

[0021] like Figures 1-2 As shown, the circulating cooling water scaling risk prediction method based on PINN-Transformer in this embodiment consists of the following five core components, which are progressive and synergistic with each other: Data preprocessing: The raw time-series data collected by the circulating cooling water online monitoring system is subjected to column name standardization, data type conversion, missing value interpolation and imputation, and feature standardization to provide high-quality input data for subsequent calculations.

[0022] Unsupervised risk proxy label construction: Without the need for manual labeling, the PSI chemical risk score is calculated based on the water chemical equilibrium theory as the main physical signal, and the comprehensive risk information of auxiliary water quality characteristics is extracted by principal component analysis (PCA) as a data-driven supplementary signal. The two are weighted and fused to generate a continuous risk proxy label from 0 to 100.

[0023] PINN-Transformer fusion model architecture: The design includes an input embedding layer, a sine and cosine position encoder, a multi-layer Transformer encoder and a risk prediction head, and utilizes a multi-head self-attention mechanism to capture the dependence of water quality parameters on different time scales.

[0024] The seven-fold physical constraint loss function system embeds physical laws in the field of water chemistry (including monotonicity, LSI consistency, RSI consistency, ion balance, solubility product, interaction constraints, and boundary constraints) into the loss function of model training in the form of soft constraints, ensuring that the prediction results do not violate the basic physical principles under any operating conditions.

[0025] Model training and inference deployment: Model training is completed by simultaneously optimizing data fitting loss and physical constraint loss. After training, forward propagation is performed in gradient-free calculation mode to output a real-time risk score in the range of [0, 100].

[0026] The logical relationship between the five parts mentioned above is as follows: data preprocessing provides clean input data for label construction and model training; the label construction module generates training objectives under unsupervised conditions; the PINN-Transformer model learns using time-series water quality data as input and risk labels as objectives; seven physical constraints serve as additional optimization objectives during training, guiding the model to follow water chemistry principles; and the finally trained model performs real-time risk prediction on new data during the inference phase. The overall technical roadmap is as follows: Figure 1 and Figure 2 As shown.

[0027] The five components mentioned above are explained in detail below.

[0028] Step S1, Data Preprocessing: The purpose of this step is to transform the raw time-series data collected by the circulating cooling water online monitoring system into a high-quality dataset that can be used for subsequent label construction and model training. This specifically includes the following four processing steps: Column name standardization: Since the column name formats of different monitoring devices and data acquisition systems may differ (such as containing interfering characters such as spaces, newlines, and tabs), the system performs standardization processing on all column names—removing leading and trailing whitespace characters, uniformly replacing internal spaces, newlines, and tabs with empty strings, and then mapping all possible column name variants to standard column names according to a predefined mapping table.

[0029] Data type conversion: The time column is kept as a string to preserve the original timestamp information, while the remaining six water quality parameter columns (pH, conductivity, total alkalinity, calcium hardness, chloride ion concentration, and turbidity) are forcibly converted to floating-point numbers. Outliers that cannot be converted are marked as missing values ​​(NaN).

[0030] Missing value imputation: A three-stage strategy was employed—first, linear interpolation was used to imput missing values ​​in the middle to maintain the temporal continuity of water quality parameters; then, forward imputation was used to handle missing values ​​at the end of the sequence; and finally, backward imputation was used to handle missing values ​​at the beginning of the sequence. After three stages of imputation, no residual missing values ​​remained in the data.

[0031] Feature standardization: StandardScaler was used to standardize the six water quality features to zero mean and unit variance. The standardization parameters (mean vector and standard deviation vector) were jointly fitted on all training datasets to ensure that data from different monitoring points were trained at the same scale. The standardization parameters were saved and injected into the model for inverse standardization calculation by the physical constraint module.

[0032] Step S2, PSI Chemical Risk Score Calculation Method: The purpose of this step is to transform the water chemical equilibrium theory into a calculable risk quantification index, corresponding to the "PSI Water Stability Index" and "Chem_Risk Chemical Risk Score" modules in the architecture diagram. The specific calculation process is as follows.

[0033] In the above process, the calculation of the chemical risk score mainly relies on two parameters: calcium hardness and total alkalinity, and does not involve electrical conductivity. The calculations are based on the principle of calcium carbonate dissolution equilibrium. The dissolution equilibrium of calcium carbonate in water can be expressed as: (1) in This is the solubility product constant of calcium carbonate at 25°C. The carbonate ion concentration is related to the total alkalinity through the second-order ionization equilibrium of carbonic acid. (2) By combining the two equilibrium equations above, the calcium hardness and total alkalinity can be expressed from the engineering units ( Convert to molar concentration (divided by) (The molar mass × 1000, i.e., 100090 mg / mol), taking the negative logarithm, yields... : (3) The normalized mapping formula for the chemical risk score is: (4) in An effective range for PSI is defined based on experience. This mapping relationship ensures that the smaller the PSI value (i.e., the stronger the tendency to scale), the higher the chemical risk score. Finally, the score is cropped to the range of [0, 100], with extreme values ​​outside the effective range mapped to 0 or 100 points respectively.

[0034] The externally observable characteristics of this step are: the system receives real-time monitoring values ​​of two water quality parameters, calcium hardness and total alkalinity, and outputs a continuous chemical risk score from 0 to 100. Changes in the score directly reflect changes in the water's chemical equilibrium state—a continuously rising score indicates that the water quality is evolving towards scaling.

[0035] PCA-assisted risk scoring and label fusion method: The PSI formula directly uses calcium hardness and total alkalinity, but there are other auxiliary water quality indicators in circulating cooling water systems that significantly influence the scaling process. Specifically, an increase in pH shifts the carbonate equilibrium towards carbonate, increasing calcium carbonate supersaturation; conductivity reflects the total dissolved solids concentration, indirectly affecting ionic strength and scaling kinetics; increased chloride ion concentration accelerates under-deposit corrosion and destroys existing protective scale, indirectly altering scaling kinetics; and increased turbidity reflects an increase in suspended particles in the water, which can act as seeds for heterogeneous nucleation, promoting calcium carbonate crystallization and deposition. To fully utilize this auxiliary information, the algorithm employs principal component analysis (PCA) to extract a comprehensive risk signal from these auxiliary features.

[0036] This step corresponds to the "Proxy Label Construction" area in the architecture diagram, which includes three modules: "PCA Supplementary Feature Dimensionality Reduction", "PCA_Norm Normalized Score", and "Weighted Fusion Generation of Risk_Label". The specific process is as follows.

[0037] In the above process, the direction correction step is one of the design elements of the algorithm. Since the direction of the first principal component extracted by PCA is determined by the direction of maximum data variance, its positive or negative direction is arbitrary—it may be positively correlated with scaling risk or negatively correlated. The algorithm determines the direction by calculating the Pearson correlation coefficient ρ between the PC1 score and the existing physical basis chemical risk score: if ρ < 0, it indicates that the PCA direction is opposite to the physical risk direction. In this case, the PCA load vector is reversed to ensure that the auxiliary risk signal is consistent with the direction of the physical principal signal.

[0038] In the weighted fusion, the weight of the physical primary signal (PSI chemical risk score) is set to 0.7, and the weight of the data-driven supplementary signal (PCA auxiliary score) is set to 0.3. The design principle of this weight allocation is: to use the PSI, with its clear physical basis, as the dominant signal to ensure the physical interpretability of the tags; and to use the data-driven PCA as a supplementary signal to compensate for the feature information not covered by the PSI formula. The fused tags are then subjected to sliding window averaging (window size of 5 time steps) to eliminate short-term fluctuation noise and make the tag sequence more stable.

[0039] The externally observable characteristic of this step is that, based on the chemical risk score, the system outputs an additional comprehensive risk label that incorporates auxiliary water quality information. When the chloride ion concentration or turbidity increases abnormally, even if the PSI chemical risk score does not change significantly, the integrated label will increase accordingly, thus providing an early warning of potential scaling risks.

[0040] Step S3, PINN-Transformer fusion model architecture: The PINN-Transformer model proposed in this invention integrates the Transformer temporal encoder with the PINN physical constraint mechanism, corresponding to the "model backbone" and "physical constraints" regions in the architecture diagram. Its architecture consists of five core components, as shown in Table 1.

[0041]

[0042] The following provides a detailed explanation of the technical aspects of each component. The forward propagation process corresponds to the complete data flow path in the architecture diagram from the "sliding window construction" to the "Sigmoid prediction head".

[0043] Input embedding layer: Six monitoring parameters of circulating cooling water (pH, conductivity, total alkalinity, calcium hardness, chloride ion concentration, and turbidity) are normalized by StandardScaler and then transformed through a learnable linear transformation matrix. (in This mapping extends the low-dimensional original features to a higher-dimensional hidden space. This mapping allows the low-dimensional original features to gain richer representation capabilities in the higher-dimensional space, providing sufficient feature dimensions for subsequent attention computation.

[0044] Position encoder: Employs the classic sine-cosine position encoding scheme. For the t-th time step in the sequence and the i-th component in the hidden dimension, the position encoding value is: (5) The position encoding matrix and the embedding vector are added element-wise and then input into the Transformer encoder. Sine / cosine functions of different frequencies enable the model to distinguish the relative positional relationships between different time steps, thereby perceiving the temporal order of water quality parameters.

[0045] Transformer encoder: Adopts the standard Transformer encoder architecture, stacked together. Layers. Each encoder layer contains two sub-layers: (1) Multi-head self-attention quantum layer, using There are 3 parallel attention heads, each with a dimension of 1. The formula for calculating attention is: (6) Q, K, and V are the query, key, and value matrices, respectively, generated from the input features through linear transformation. The multi-head mechanism enables the model to simultaneously focus on water quality change patterns at different time scales.

[0046] (2) The feedforward sublayer contains two linear transformations and a ReLU activation function, with a hidden dimension of Each sublayer is equipped with residual connections, layer normalization, and... The multi-head self-attention mechanism enables the model to simultaneously focus on water quality change patterns at different time scales—for example, one attention head may focus on short-term fluctuations between adjacent time steps, while another attention head may focus on long-term trends between the beginning and end of a window.

[0047] Time step aggregation: The encoder outputs a hidden state sequence of the same length as the input. Take the hidden state of the last time step in the sequence. This serves as a predictive feature representation for the next time step. The reason for choosing the last time step is that, through the layer-by-layer information propagation of the self-attention mechanism, the hidden state of the last time step has fully incorporated the entire historical window. Water quality evolution information at all time steps within the timeframe, simultaneously serving as a temporal distance prediction target. The most recent observation point retains the water quality characteristics at the most recent moment, making it the most suitable information carrier for predicting future scaling risks.

[0048] Risk prediction head: aggregate features This is mapped to the predicted scaling risk value for the next time step using a two-layer fully connected network. (7) in For the model pair Predicted value of constant scaling risk. The Sigmoid activation function ensures that the predicted output value is strictly limited to the range [0, 1]. The LeakyReLU activation function (with a negative half-axis slope of 0.01) introduces non-linear mapping capability while ensuring that the negative input region still has a non-zero gradient, preventing some neurons from permanently inactivating during training due to persistently zero gradients. This prediction head design enables the model to proactively predict the scaling risk at the next time step based on the water quality change patterns over the past L time steps. This represents the hidden state at the last time step in the sequence. The weight matrix for the first-level linear transformation is the input... from 1st dimension is mapped to the intermediate hidden dimension; The bias vector of the first layer has dimensions and The output dimension is consistent, providing translation capability for linear transformation; The weight matrix for the second-level linear transformation maps the intermediate representation after LeakyReLU activation to a 1-dimensional scalar output. This is the bias scalar for the second layer.

[0049] Step S4: Construction of the seven-fold physical constraint loss function system: One of the core innovations of the algorithm is the design of a comprehensive loss function system containing seven physical constraint sub-items, embedding the physical laws of water chemistry into the training process of the deep learning model as soft constraints. The total loss function for model training is defined as: (8) (9) in This represents the data fitting loss (mean squared error). This represents the total weight coefficient of the physical constraints. These are the independent weighting coefficients for each physical constraint sub-item. The overall calculation of physical constraints corresponds to the "Physical Constraints" area in the architecture diagram (containing seven sub-modules: monotonicity, LSI, RSI, ion equilibrium, solubility product, interaction, and boundary), and is merged into the "Total Loss = MSE + Physical Loss" node.

[0050] The design principles, physical basis, and mathematical expression of each physical constraint are described in detail below.

[0051] Constraint 1: Monotonicity Constraint Physical basis: In the calcium carbonate dissolution equilibrium system, an increase in pH shifts the carbonate equilibrium towards the carbonate ion, reflecting an increase in calcium carbonate supersaturation; increased calcium hardness directly reflects an increase in calcium ion concentration, and the ion product increases accordingly; an increase in total alkalinity also reflects an increase in carbonate concentration; increased conductivity reflects an increase in total dissolved solids, which can indirectly reflect an increase in ionic strength. Therefore, the scale risk value predicted by the model should maintain a monotonically increasing relationship with the above four parameters.

[0052] Constraint Implementation: The model outputs partial derivatives with respect to each input feature through automatic differentiation. This applies to a feature set that should monotonically increase. A penalty is applied when the partial derivative is negative: (10) in, For feature set The Middle The values ​​of each input feature, This represents the scaling risk value predicted by the model. For the model output obtained through automatic differentiation calculation, the first... The partial derivatives of each feature, The number of elements in the feature set (in this method) = 4), This means taking the mean of all samples in the current batch. The ReLU() function only retains the negative part of the partial derivative (i.e., the part that violates monotonicity), and outputs zero when the partial derivative is positive or zero, without generating a penalty; the tanh() function compresses the penalty value to the [0,1) interval to avoid gradient explosion caused by a few extreme negative gradients; the outer squaring operation makes the penalty grow faster as the degree of violation increases, thus strengthening the penalty of the constraint.

[0053] Results: The model trained with monotonic constraints does not decrease its output risk score when pH, calcium hardness, total alkalinity, or conductivity increases, which is consistent with the intuitive judgment of engineers.

[0054] Constraint 2: LSI Consistency Constraint Physical Basis: The Langerile Saturation Index (LSI) is a recognized criterion for scaling / corrosion in the water treatment industry. When LSI > 0.5, the water quality has a significant tendency to scale, and the model should predict a high risk; when LSI < At a value of 0.5, the water quality shows a tendency to corrode, and the model should predict a low risk.

[0055] Constraint Implementation: Calculate the LSI value within the model after recovering the original dimensions through inverse normalization. (11) in ( (Kelvin value of water temperature). The constraint loss is implemented through a masking mechanism: for samples with a significantly greater than 0 LSI, the model is penalized for predicting low-risk behavior; for samples with a significantly less than 0 LSI, the model is penalized for predicting high-risk behavior.

[0056] Constraint 3: RSI Consistency Constraint Physical basis: The Rezner Stability Index (RSI) provides a more detailed scaling / corrosion classification than the LSI. RSI < 6.5 indicates a severe tendency to scale, and RSI > 7.5 indicates a tendency to corrode.

[0057] Constraint Implementation: Calculation Subsequently, samples with RSI < 6.5 are penalized for low-risk predictions, and samples with RSI > 7.5 are penalized for high-risk predictions. The mask strength increases linearly with the degree of deviation from the threshold, with a maximum value limited to within 1.0.

[0058] Constraint 4: Ion Equilibrium Constraint Physical Basis: In natural water bodies and circulating cooling water, the ratio of calcium hardness to total alkalinity (Ca / Alk) typically remains within the range of 0.5 to 2.5. A significant deviation from this normal range often indicates abnormal monitoring, abnormal operating conditions, or abnormal water quality combinations. Therefore, a penalty is applied to Ca / Alk ratios exceeding the range of [0.5, 2.5] to improve the model's robustness to abnormal samples.

[0059] Constraint Implementation: After calculating the Ca / Alk ratio, a secondary penalty is applied to deviations exceeding the range [0.5, 2.5]. This constraint does not directly constrain the model's predicted values, but rather indirectly improves the model's robustness to outliers by penalizing unreasonable combinations of input features.

[0060] Constraint 5: Solubility Product Constraint Physical basis: The precipitation-dissolution equilibrium of calcium carbonate is determined by the solubility product constant. (25°C) Control. Define ion product. ,when When the solution is supersaturated, calcium carbonate has a thermodynamic driving force for precipitation; when When the solution is undersaturated, scaling does not meet thermodynamic conditions. This constraint directly embeds this criterion into the loss function, ensuring that the risk direction predicted by the model is strictly consistent with the saturated state.

[0061] Constraint Implementation: Step 1: Estimation of carbonate concentration. Convert calcium hardness and total alkalinity from mg / L (as CaCO3) to mol / L by dividing by 100,000. This is based on the first-order ionization constant of the carbonic acid equilibrium system. and second-order ionization constant Calculate the mole fraction of carbonate in the total carbonate system. : (12) This leads to the carbonate concentration. ,in This represents the molar concentration of total alkalinity.

[0062] Step 2: Calculate the logarithmic saturation ratio. Define the logarithmic saturation ratio. Quantifying the degree and direction of deviation from equilibrium: (13) Corresponding to oversaturation, Corresponding to undersaturation, This is the saturation equilibrium point.

[0063] Step 3: Two-way punishment. Cut off to [ [2, 2] and normalized to [0, 1] as the confidence mask m, respectively constructing oversaturation penalty terms and undersaturation penalty terms: (14) in , This represents the risk value predicted by the model. The higher the degree of oversaturation, the stronger the penalty for low-risk predictions; the deeper the degree of undersaturation, the stronger the penalty for high-risk predictions; as the model approaches the saturation equilibrium point, the mask approaches zero, the constraints are automatically relaxed, and the model is allowed to learn freely based on the data.

[0064] Results: When online monitoring data shows that the ion product significantly exceeds the solubility product, the risk score output by the model tends to be higher under the constraint of the solubility product; when the ion product is much lower than the solubility product, the risk score tends to be lower. The risk direction predicted by the model is always consistent with the thermodynamic criterion of calcium carbonate precipitation-dissolution equilibrium.

[0065] Constraint 6: Interaction Constraints Physical basis: pH and calcium hardness have a synergistic enhancing effect on the risk of calcium carbonate scaling. When pH increases, the carbonate equilibrium shifts towards carbonate; when calcium hardness increases simultaneously, the calcium ion concentration increases. The simultaneous increase of both leads to a sharp increase in the ion product, far exceeding the sum of the effects of their individual changes. Therefore, the model's gradient response to pH and calcium hardness should maintain a consistent direction (same sign).

[0066] Constraint Implementation: (15) When two partial derivatives have opposite signs (i.e., one is positive and the other is negative), their product is negative. A positive penalty is then applied. This constraint ensures that the model learns the physical synergistic relationship between pH and calcium hardness.

[0067] Constraint 7: Boundary Constraints Physical basis: When water quality parameters reach extreme values, the risk of scaling should tend towards a deterministic judgment and should not be affected by model learning bias. Specifically: when pH exceeds 8.5, the carbonic acid balance strongly favors carbonate, and the risk of scaling should increase significantly; when calcium hardness exceeds 400 mg / L, the calcium ion concentration is extremely high, and the risk of scaling should increase significantly; when conductivity exceeds... When the pH value is high, the total dissolved solids are extremely high, and the risk of scaling should increase significantly. Conversely, when the pH value is below 7.0, the water quality is acidic, calcium carbonate tends to dissolve, and the risk of scaling should be lower.

[0068] Constraint Implementation: Taking pH value as an example, when pH > 8.5, construct a mask. The penalty model predicts low-risk behavior; when pH < 7.0, a mask is constructed. The penalty model predicts high-risk behavior; when calcium hardness > 400 mg / L or conductivity > 2000 μS / cm, a mask is constructed, and the penalty model predicts low-risk behavior. The boundary constraints for calcium hardness and conductivity are similar, with values ​​of 400 mg / L and 2000 μS / cm respectively. The threshold is used. The final boundary constraint loss is the average of the boundary losses of the three parameters.

[0069] Externally observable effects: When the water quality monitoring system reports a pH value exceeding 8.5, a calcium hardness exceeding 400 mg / L, or a conductivity exceeding [a certain value], [the following conditions apply]. At that time, the risk score output by the model will inevitably be high (close to 100 points), providing clear high-risk warning signals for operation and maintenance personnel.

[0070] Step S5, Model Training Method: The model training process corresponds to the complete training loop path in the architecture diagram, from "Total Loss = MSE + Physical Loss" through "Adam Optimization" to the judgment of "Loss Function Stable Convergence" and then to "Training Complete".

[0071] The key technical details of the training process are as follows: StandardScaler parameter injection: During model initialization, the mean and standard deviation vectors of the StandardScaler fitted during data preprocessing are injected into the model as non-trainable buffer parameters. This allows the physics constraint module to inversely transform the standardized features back to the original physical dimensions during forward propagation, ensuring that all physical formulas (such as solubility product calculation, LSI calculation, etc.) are executed under the correct dimensions.

[0072] Physical constraint weighting coefficient: total weight and the weights of each sub-item The settings have been experimentally verified, achieving a good balance between data fitting accuracy and physical constraint satisfaction. In this embodiment, the default value of the weight of each sub-item is set to 1.0, that is, in the total weight... Under the control of the system, all constraints participate with equal weight. Engineers can adjust the weight of each sub-item according to the specific working conditions: too large a weight will cause the model to sacrifice data fitting accuracy in order to meet physical constraints, while too small a weight will prevent the corresponding physical constraints from playing an effective role.

[0073] Training output: After training is complete, the system saves two files—the model weight file (containing all learnable parameters) and the StandardScaler parameter file (containing the mean vector and variance vector). These two files constitute the complete model package required for deployment.

[0074] Example This embodiment uses the atmospheric pressure south zone circulating cooling water system of a power plant as an application scenario.

[0075] Software environment: Python 3.8 or above, PyTorch 1.10 or above (providing tensor computation and automatic differentiation support), scikit-learn library (providing StandardScaler and PCA implementations), pandas library (providing data reading and processing functions).

[0076] Data source: Time-series data collected by the circulating cooling water online monitoring system, stored in CSV format. Each record contains a sampling timestamp and measured values ​​of six water quality parameters (pH, conductivity, total alkalinity, calcium hardness, chloride ion concentration, and turbidity). This embodiment uses historical data from three monitoring points—at atmospheric pressure, the southern area, and the power plant—for training, with each monitoring point containing approximately one thousand sampling time points. This data scale is sufficient to verify the effectiveness of the method of this invention; in actual industrial deployment, as the online monitoring system continues to operate, a larger scale of training data can be accumulated to further improve the model's prediction accuracy and generalization ability.

[0077] Data preprocessing and cleaning: The system first reads the raw monitoring data file in CSV format. Since column name formats may differ between different monitoring devices and data acquisition systems (e.g., containing spaces, newlines, tabs, etc.), the system performs standardization processing on all column names: removing leading and trailing whitespace, replacing internal spaces, newlines, and tabs with empty strings, and then mapping various possible column name variations (such as "pH value", "pH", "ph", etc.) to standard column names according to a predefined mapping table.

[0078] During the data type conversion phase, the system preserves the time column as a string to retain the original timestamp information, and forcibly converts the remaining six water quality parameter columns to floating-point numbers. Outliers that cannot be converted (such as records containing non-numeric characters) are marked as missing values ​​(NaN).

[0079] Missing value imputation employs a three-stage strategy: first, linear interpolation (based on linear interpolation of preceding and following valid values) is used to imput missing values ​​in the middle, maintaining the temporal continuity of water quality parameters; then, forward imputation (filling with the previous valid value) is used to handle missing values ​​at the end of the sequence; finally, backward imputation (filling with the next valid value) is used to handle missing values ​​at the beginning of the sequence. After three stages of imputation, no residual missing values ​​remain in the data.

[0080] PSI Chemical Risk Score Calculation: For each preprocessed data record, a PSI chemical risk score is calculated. Specifically: First, convert the calcium hardness and total alkalinity from engineering units (mg / L as CaCO3) to molar concentration, and substitute them into equation (3) to calculate the saturated pH value of calcium carbonate. .

[0081] Then, the equilibrium pH value is calculated from the total alkalinity. And calculate the practical saturation index. .

[0082] Finally, the PSI is linearly mapped to a chemical risk score of 0 to 100 and then cropped to the range of [0, 100].

[0083] In this embodiment, the typical PSI value range of the circulating cooling water in the south zone of a power plant under normal pressure is 6.0 to 8.5, corresponding to a chemical risk score of approximately 12.5 to 75.0.

[0084] PCA-assisted risk score extraction: Principal component analysis was performed on auxiliary features (pH, conductivity, chloride ion concentration, turbidity) that were not directly used in the PSI formula.

[0085] First, merge the auxiliary features of all training datasets and standardize them using StandardScaler (zero mean, unit variance) to ensure that features of different scales have equal weight in PCA.

[0086] Then, PCA dimensionality reduction is performed on the standardized auxiliary feature matrix to extract the first principal component (PC1) with the largest explained variance. In this embodiment, PC1 explains approximately 45% to 55% of the variance, indicating that the first principal component can capture nearly half of the information in the auxiliary features.

[0087] Next, the Pearson correlation coefficient ρ between the PC1 score and the chemical risk score is calculated. In this embodiment, a typical value for ρ is positive (approximately 0.3 to 0.6), indicating that the PCA direction is consistent with the physical risk direction and no inversion is required. If ρ is negative, the PCA load vector is inverted and the score is recalculated.

[0088] Finally, the PCA score is normalized to the range of [0, 100], fused with the chemical risk score at a weight of 7:3, and smoothed by a moving average with a window size of 5 to generate the final fusion risk label.

[0089] Construction of time-series training samples: A sliding window method is used to convert continuous time-series data into training samples acceptable to the model. Let the window length L = 10, and for time t, take the range [t, t+1, ..., t+L]. [1] A total of 10 consecutive time steps of six-dimensional water quality feature vectors are used as the input sequence. Fusion risk label at time t+L As the prediction target, the window slides incrementally with a step size of 1, generating N from each dataset. L training samples (N is the total number of time steps in the dataset).

[0090] Before constructing the samples, StandardScaler was used to standardize the six water quality features (zero mean, unit variance). The standardization parameters (mean vector and variance vector) were jointly fitted on all training datasets to ensure that data from different monitoring points were trained at the same scale. The standardization parameters were saved and injected into the model for inverse standardization calculation by the physical constraint module.

[0091] PINN-Transformer Model Training: Construct the PINN-Transformer model and perform training. The model hyperparameter configuration in this embodiment is shown in Table 2.

[0092]

[0093] During training, the system iterates through all training samples in each epoch, performing mini-batch gradient descent with a batch size of 16. For each batch, forward propagation is first performed to obtain the risk prediction value. Then calculate the data fitting loss. (where r is a risk label from 0 to 100, normalized to [0, 1] by dividing by 100) and seven-fold physical constraint loss. Total loss The gradient is calculated through backpropagation, and the model parameters are updated by the Adam optimizer.

[0094] In this embodiment, after training for 200 epochs, the total loss converged to approximately 0.01, indicating that the model simultaneously achieved good data fitting and physical constraint satisfaction.

[0095] Model inference and risk scoring output: After training is completed, the system enters the inference deployment phase, which corresponds to the final output path from "training completed" to "testing prediction results" in the architecture diagram.

[0096] The specific operations of the reasoning phase are as follows: When the online monitoring system collects new water quality data, it standardizes the six water quality features using the StandardScaler parameters saved during the training phase to ensure that the distribution of the input data is consistent with the training data. Then, it constructs an input sequence using the standardized data from the most recent 10 time steps and feeds it into the trained PINN-Transformer model for forward propagation. Forward propagation is performed in gradient-free computation mode (without calculating physical constraint loss), resulting in high computational efficiency. The model outputs a predicted value in the range [0, 1], which, when multiplied by 100, yields a risk score in the range [0, 100].

[0097] In summary, this invention discloses a scaling risk prediction method for circulating cooling water based on PINN-Transformer. By combining traditional scaling chemical analysis principles with a deep learning model, a seven-fold physical constraint loss function system is constructed. This ensures that the model's learning process strictly conforms to fundamental thermodynamic laws and professional knowledge in the field of scaling, solving the problems of physical inconsistencies and poor generalization that easily arise in purely data-driven models. This method generates training labels by fusing PSI chemical risk scores with PCA of auxiliary features, combining the physical reliability of traditional chemical methods with the adaptability of data-driven methods to actual operating conditions. The final output scaling risk score of 0-100 points has clear physical meaning and can provide clear and accurate decision-making basis for the operation and maintenance and scaling prevention treatment of circulating cooling water systems. Compared with traditional scaling prediction methods with fixed formulas, it has stronger adaptability to different operating conditions and higher prediction accuracy.

[0098] It should be emphasized that the above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any way. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention shall still fall within the scope of the technical solution of the present invention.

Claims

1. A method for predicting scaling risk in circulating cooling water based on PINN-Transformer, characterized in that, Includes the following steps: Step S1: Data preprocessing. The raw time-series data collected by the circulating cooling water online monitoring system is preprocessed. The data preprocessing includes: column name standardization, data type conversion, missing value interpolation and imputation, and feature standardization. Step S2: Construction of unsupervised risk proxy tags. Based on the water chemical equilibrium theory, the PSI chemical risk score is calculated as the physical main signal. The comprehensive risk information of auxiliary water quality characteristics is extracted by principal component analysis as a data-driven supplementary signal. The two are weighted and fused to generate a continuous risk proxy tag from 0 to 100. Step S3: PINN-Transformer fusion model construction. The input sequence is constructed from the standardized time series data according to the preset window length. A time series prediction model is designed, which includes an input embedding layer, a sine and cosine position encoder, a multi-layer Transformer encoder and a risk prediction head. The multi-head self-attention mechanism is used to capture the dependence of water quality parameters on different time scales. Step S4: Construction of a seven-fold physical constraint loss function system. The physical laws of water chemistry are embedded into the loss function of the model training in the form of soft constraints to ensure that the prediction results do not violate the basic physical principles under any working conditions. The physical laws include: monotonicity, LSI consistency, RSI consistency, ion balance, solubility product, interaction constraints and boundary constraints. Step S5, Model Training and Inference Deployment: Model training is completed by simultaneously optimizing data fitting loss and physical constraint loss. After training, forward propagation is performed in gradient-free calculation mode to output a real-time risk score in the range of [0, 100].

2. The method for predicting scaling risk in circulating cooling water based on PINN-Transformer according to claim 1, characterized in that, In step S2, a chemical risk score is constructed based on the water chemical equilibrium theory. The chemical risk score is calculated using calcium hardness and total alkalinity as core input parameters, and a continuous score from 0 to 100 is obtained through normalization mapping. (4) In the formula, PSI and PSI max PSI min These represent the PSI water stability index, the maximum PSI water stability index, and the minimum PSI water stability index, respectively. Finally, the score is cropped to the range of [0, 100], and extreme values ​​outside the valid range are mapped to 0 or 100 points, respectively.

3. The method for predicting scaling risk in circulating cooling water based on PINN-Transformer according to claim 1, characterized in that, In step S2, the extraction of comprehensive risk information of auxiliary water quality characteristics by principal component analysis specifically includes: determining the direction by calculating the Pearson correlation coefficient ρ between the PC1 score and the existing physical basis chemical risk score; if ρ < 0, it means that the PCA direction is opposite to the physical risk direction, and at this time the PCA load vector is reversed to ensure that the auxiliary risk signal is consistent with the physical main signal direction.

4. The method for predicting scaling risk in circulating cooling water based on PINN-Transformer according to claim 1, characterized in that, In step S2, the risk proxy label is weighted and fused according to the PSI chemical risk score and the PCA auxiliary score, wherein the weight of the PSI chemical risk score is 0.7 and the weight of the PCA auxiliary score is 0.

3. The fused risk proxy label is then processed by a moving average with a window size of 5 time steps.

5. The method for predicting scaling risk in circulating cooling water based on PINN-Transformer according to claim 1, characterized in that, In step S3: The input embedding layer includes: a learnable linear transformation matrix of the monitoring parameters of the circulating cooling water after standard scaler normalization. ; The sine-cosine position encoder is: (5) The multi-layer Transformer encoder adopts a standard Transformer encoder architecture and is stacked together. layer; The scaling risk prediction value of the risk prediction head is: (7) in, For the model pair Predicted value of constant scaling risk. The Sigmoid activation function is used, and the LeakyReLU activation function is used. This represents the hidden state at the last time step in the sequence. , These are the weight matrices for the first and second layer linear transformations, respectively. These are the bias vectors for the first and second layers, respectively.

6. The method for predicting scaling risk in circulating cooling water based on PINN-Transformer according to claim 1, characterized in that, In step S4, the total loss function is: (8) (9) in For data fitting loss, , These are the predicted value and the actual value, respectively. This represents the total weight coefficient of the physical constraints. These are the independent weighting coefficients for each physical constraint sub-item. , , , , , , These represent monotonicity loss, LSI loss, RSI loss, ion equilibrium loss, solubility product loss, interaction loss, and boundary loss, respectively.

7. The method for predicting scaling risk in circulating cooling water based on PINN-Transformer according to claim 6, characterized in that, In step S4: The monotonicity constraint is: (10) in, For feature set The Middle The values ​​of each input feature, This represents the scaling risk value predicted by the model. For the model output obtained through automatic differentiation calculation, the first... The partial derivatives of each feature, The number of elements in the feature set. This means taking the mean of all samples in the current batch. The ReLU() function only retains the part of the partial derivative that is negative, and the tanh() function compresses the penalty value to the interval [0,1). The LSI consistency constraint is: (11) in, , TDS, Tk, Ca, and Alk represent total dissolved solids, Kelvin temperature, calcium hardness, and total alkalinity, respectively. The RSI consistency constraint is as follows: samples with RSI < 6.5 are penalized for low-risk predictions, samples with RSI > 7.5 are penalized for high-risk predictions, and the mask strength increases linearly with the degree of deviation from the threshold, with the maximum value limited to within 1.

0. The ion balance constraint is as follows: after calculating the Ca / Alk ratio, a secondary penalty is applied to deviations exceeding the range of [0.5, 2.5]. The solubility product constraint is: (14) in , The risk value predicted by the model; The interaction constraints are: (15) When two partial derivatives have opposite signs, their product is negative. A positive penalty is then applied. The boundary constraint is as follows: when pH > 8.5, construct a mask. The penalty model predicts low-risk behavior; when pH < 7.0, a mask is constructed. The penalty model predicts high-risk behaviors; when calcium hardness > 400 mg / L or conductivity > 2000 μS / cm, a mask is constructed and the penalty model predicts low-risk behaviors.

8. The method for predicting scaling risk in circulating cooling water based on PINN-Transformer according to claim 1, characterized in that, In step S5, the training process includes: StandardScaler parameter injection: During model initialization, the StandardScaler mean vector and variance vector fitted during the data preprocessing stage are injected into the model as non-trainable buffer parameters. Training output: After training is completed, the system saves the model weight file and the StandardScaler parameter file, which includes the mean vector and the standard deviation vector.