Urban water supply amount short-term prediction method based on KAN-PINN cooperative driving under multi-factor coupling
By constructing a KAN-PINN collaborative prediction model, extracting nonlinear features using the KAN network structure and introducing physical constraints, the problem of insufficient multi-factor coupling modeling in short-term urban water supply prediction is solved, improving prediction accuracy and robustness, and achieving more efficient water supply prediction.
Patent Information
- Application Number
- CN202511993576.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-26
- Publication Date
- 2026-05-12
AI Technical Summary
Existing technologies for short-term urban water supply forecasting suffer from problems such as insufficient multi-factor nonlinear coupling modeling, inadequate integration of data characteristics and physical mechanisms, and difficulty in balancing model robustness and interpretability, making it difficult to meet the needs of smart water management for refined scheduling.
A KAN-PINN collaborative prediction model is constructed. The nonlinear features of key influencing factors are extracted through the KAN network structure, and physical constraints reflecting monotonicity are introduced into the loss function to optimize the model parameters to improve prediction accuracy and robustness.
It improves the accuracy and robustness of short-term water supply forecasting, and can more accurately capture the complex nonlinear relationships between multiple factors, thus enhancing the stability and interpretability of the forecast.
Smart Images

Figure CN122021253A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of smart water management and artificial intelligence, and in particular to a short-term urban water supply prediction method driven by KAN-PINN synergy under multi-factor coupling. Background Technology
[0002] With the deepening of urbanization and the intensification of climate change, urban water supply systems, as core infrastructure for maintaining the operation of urban economy and society, are directly related to the guarantee of residents' quality of life, the stable operation of industrial production, and the sustainable development of the ecological environment through their scheduling optimization and efficient allocation of water resources. Short-term water supply forecasting, as a key technical link in the construction of smart water management, provides a basis for decision-making regarding precise control of water supply pumping stations, dynamic balance of pipeline pressure, and scientific formulation of emergency water supply plans, and is an important prerequisite for achieving the "safe, economical, and efficient" operation of the water supply system. However, in the current context of urban development, short-term water supply is affected by a complex interplay of factors, including dynamic changes in meteorological conditions, shifts in user water usage patterns, cyclical fluctuations due to holidays, and industrial restructuring, exhibiting significant nonlinear, time-varying, and uncertain characteristics, which places higher demands on the accuracy and robustness of forecasting models.
[0003] Traditional forecasting methods are mainly based on statistical models or single machine learning algorithms. While time series analysis methods such as Autoregressive Integral Moving Average (ARIMA) can depict the linear trend of data, they struggle to capture complex nonlinear relationships under the coupling of multiple factors, leading to significantly increased prediction bias during sudden changes in operating conditions. In recent years, recurrent neural networks (RNNs) and their variants, Long Short-Term Memory (LSTM) and Gated Recurrent Units (GRUs), have been widely applied in water supply forecasting due to their powerful sequence modeling capabilities. Existing technologies include studies using LSTM models to capture the long-term and short-term dependencies in water supply time series, achieving high-precision prediction of ultra-short-term water demand; studies using the Transformer architecture and self-attention mechanisms to learn the dynamic change patterns of water supply sequences; and studies integrating LSTM, GRU, and attention mechanisms to construct hybrid models, or proposing CNN-BiLSTM-Attention superposition models to enhance local feature extraction and temporal modeling capabilities. However, the aforementioned data-driven models generally have three limitations: First, they rely excessively on the quality and scale of training samples, are susceptible to outliers, and lack inherent constraints on physical laws such as water conservation and supply-demand balance, resulting in insufficient model interpretability; second, they fail to effectively quantify the coupling strength between multiple factors, making it difficult to accurately characterize the implicit relationships between meteorological, social, and economic variables; and third, their generalization ability significantly decreases under data scarcity or extreme operating conditions, making it difficult to guarantee prediction stability.
[0004] Physics-Informed Neural Networks (PINNs) achieve an organic integration of data-driven approaches and mechanistic models by embedding physical equations as constraints into the loss function. They have been successfully applied in fields such as fluid mechanics and energy scheduling, effectively improving model interpretability and extrapolation capabilities. However, in water supply prediction scenarios, a single PINN suffers from insufficient structural flexibility. Its fixed network architecture has limited ability to fit high-dimensional, complex, and nonlinear features generated by strong coupling of multiple factors, making it difficult to fully explore the deep interaction relationships between heterogeneous data from multiple sources, such as meteorological data and user behavior data.
[0005] Kolmogorov-Arnold Networks (KANs), as an emerging neural network architecture, are built upon Kolmogorov's representation theorem. They employ learnable activation functions instead of traditional fixed activation functions, theoretically demonstrating superior accuracy and parameter efficiency in high-dimensional function approximation tasks. Their unique network topology enables adaptive learning of nonlinear mappings between multiple variables, exhibiting superior performance to multi-layer perceptrons in capturing the coupling characteristics of multiple factors, providing a new approach for modeling complex influencing factors in water supply forecasting. However, KAN models also lack explicit constraints on physical laws, making them prone to overfitting during training, leading to predictions that deviate from actual physical processes. Furthermore, they do not consider the causal logic constraints of water supply changes, such as the monotonicity of water demand changes with temperature.
[0006] In summary, existing technologies for short-term water supply forecasting still suffer from several core problems, including insufficient modeling of multi-factor nonlinear coupling, inadequate integration of data features and physical mechanisms, and difficulty in balancing model robustness and interpretability. These limitations prevent them from fully meeting the demands of smart water management for refined scheduling. Therefore, a technical solution is urgently needed to address these issues. Summary of the Invention
[0007] To address the aforementioned technical problems, this invention provides a short-term urban water supply prediction method driven by KAN-PINN synergy under multi-factor coupling. The technical solution of this method is as follows:
[0008] A historical data sequence containing historical water supply and multiple influencing factors is obtained, and the historical data sequence is preprocessed to obtain a regularized data sequence.
[0009] Key influencing factors associated with water supply prediction are screened from the regularized data sequence, and a training set and a test set containing the key influencing factors are constructed.
[0010] A KAN-PINN collaborative prediction model is constructed. The nonlinear features of the key influencing factors are extracted through the KAN network structure of the KAN-PINN collaborative prediction model. Physical constraints are introduced into the loss function of the model training. The physical constraints reflect the monotonic relationship between the key influencing factors and the water supply.
[0011] The KAN-PINN collaborative prediction model is trained using the training set, and the model parameters are updated by optimizing the loss function containing the physical constraints.
[0012] The test set is input into the trained KAN-PINN collaborative prediction model to obtain short-term water supply prediction results.
[0013] The technical solution of this invention solves the problems of insufficient modeling of strong coupling of multiple factors and insufficient integration of data mechanisms by constructing a KAN-PINN collaborative prediction model, extracting the nonlinear features of key influencing factors using the KAN network structure, and introducing physical constraints reflecting monotonicity in the loss function. This improves the accuracy of short-term water supply prediction and the robustness of the model.
[0014] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.
[0016] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0017] Figure 1 This is a flowchart illustrating an embodiment of a short-term urban water supply prediction method driven by KAN-PINN synergy under multi-factor coupling according to the present invention.
[0018] Figure 2 This is a schematic diagram of the KAN network architecture;
[0019] Figure 3 Overall framework diagram for KAN-PINN water supply forecast;
[0020] Figure 4 A graph showing untreated water supply data;
[0021] Figure 5 A graph showing the processed water supply data;
[0022] Figure 6 A heatmap showing the correlation between various influencing factors;
[0023] Figure 7 A scatter plot of water supply and various influencing factors;
[0024] Figure 8 A time-series evolution diagram of the coupling strength of factors affecting water supply;
[0025] Figure 9 A time-series evolution diagram of the coupling coordination degree of factors affecting water supply;
[0026] Figure 10 For comparison of the experimental prediction results;
[0027] Figure 11 To compare the experimental error evaluation index chart;
[0028] Figure 12 A graph showing water supply data for another city;
[0029] Figure 13 The graph shows the prediction results of the generalization experiment; Detailed Implementation
[0030] Exemplary embodiments of the invention will now be described in more detail with reference to the accompanying drawings. Although exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention may be implemented in various forms and should not be limited to the embodiments set forth herein.
[0031] Figure 1 This diagram illustrates a flowchart of an embodiment of a short-term urban water supply forecasting method driven by KAN-PINN synergy under multi-factor coupling, provided by the present invention, executed by a control terminal. Figure 1 As shown, it includes the following steps:
[0032] S1. Obtain a historical data sequence containing historical water supply and multiple influencing factors, and preprocess the historical data sequence to obtain a regular data sequence.
[0033] Water supply volume refers to the total volume of water delivered to users by the urban water supply system within a specific time period; for example, the total water supply to all users in a city in a slope area during the hour from 8:00 AM to 9:00 AM on May 1, 2024, is 15,000 cubic meters. Influencing factors refer to external conditions or variables that can affect the urban water supply volume; for example, factors affecting the water supply volume of a city in a slope area include date type (whether it is a holiday), average daily temperature, average humidity, and daily rainfall. Historical data sequence refers to a set of values recorded continuously in chronological order, containing historical water supply volume and its corresponding influencing factors; for example, a sequence formed by chronologically arranging hourly water supply volume, holiday indicators, temperature, humidity, and rainfall data recorded in a city in a slope area from January 2020 to May 2024. A well-ordered data sequence refers to a complete data sequence that meets the modeling requirements after cleaning operations such as outlier removal and missing value imputation are performed on the original historical data sequence; for example, a continuous and complete data sequence of water supply and related factors obtained after cleaning the original urban data of a slope area.
[0034] S2. Select key influencing factors related to water supply prediction from the regularized data sequence, and construct a training set and a test set containing the key influencing factors.
[0035] Key influencing factors refer to the core factors that, after screening and analysis, are confirmed to have a significant correlation with water supply prediction. For example, analysis revealed that the key influencing factors for water supply in a city in a slope area are holiday factors and temperature factors. The training set refers to a subset of data extracted from the regularized data sequence, used by the machine learning model to learn data patterns and adjust internal parameters. For example, regularized data from a city in a slope area from January 2020 to June 2023 could be used as the training set. The test set refers to a subset of data extracted from the regularized data sequence, specifically used to objectively evaluate the predictive performance of the trained model, and not used during the training process. For example, regularized data from a city in a slope area from July 2023 to May 2024 could be used as the test set.
[0036] S3. Construct a KAN-PINN collaborative prediction model. Extract the nonlinear features of the key influencing factors through the KAN network structure of the KAN-PINN collaborative prediction model. Introduce physical constraints into the loss function of the model training. The physical constraints reflect the monotonic relationship between the key influencing factors and the water supply.
[0037] The KAN-PINN collaborative prediction model refers to a hybrid prediction model that integrates the nonlinear approximation capability of Kolmogorov-Arnold networks with the physical constraint capability of physical information neural networks. For example, it involves constructing a model that uses a Kolmogorov-Arnold Network structure to learn complex mappings between input features, while incorporating domain-knowledge-based physical constraints into the training loss. Nonlinear features refer to complex interactions and mapping patterns between input and output variables that cannot be described by a linear relationship. For example, the impact of temperature on water supply varies under different holidays; this interaction effect is a nonlinear feature. The loss function is a mathematical function used to calculate the difference between the model's predicted output value and the true target value during machine learning model training; it is the direct objective of model parameter optimization. For example, the objective function minimized when training the KAN-PINN model includes data fitting error and penalties for violating physical laws. Physical constraints refer to the prior conditions or relationships that the model's prediction results should satisfy, summarized from domain knowledge or physical laws. For example, a physical constraint in water supply prediction is that "under similar conditions, ambient temperature is positively correlated with residents' water demand." Monotonicity refers to a relationship between two variables that remains constant in direction (either continuously increasing or continuously decreasing). For example, in a city with a slope, experience shows that there is a monotonically increasing relationship between the average daily temperature in summer and the amount of domestic water used by residents.
[0038] S4. The KAN-PINN collaborative prediction model is trained using the training set, and the model parameters are updated by optimizing the loss function containing the physical constraints.
[0039] Model parameters refer to the adjustable variables within a machine learning model. Their values are learned from data during the training process and determine the specific mapping behavior of the model. For example, the coordinates of the control points of the B-spline basis functions and the weight values of the neural network connections in the KAN-PINN model are all model parameters.
[0040] S5. Input the test set into the trained KAN-PINN collaborative prediction model to obtain the short-term water supply prediction results.
[0041] Among them, the short-term water supply forecast results refer to the numerical estimates of the hourly or daily water supply of a city in the near future using a trained forecast model; for example, using a trained model to predict the numerical sequence of hourly water supply of a city in a slope area in the next 24 hours.
[0042] The technical solution of this embodiment constructs a KAN-PINN collaborative prediction model, uses the KAN network structure to extract the nonlinear features of key influencing factors, and introduces physical constraints reflecting monotonic relationships into the loss function. This solves the problems of insufficient modeling of strong coupling of multiple factors and insufficient integration of data mechanisms, thereby improving the accuracy of short-term water supply prediction and the robustness of the model.
[0043] In one alternative approach, the preprocessing steps for the historical data sequence include:
[0044] Set the sliding window length and step size, calculate the mean and standard deviation of the data within the window, mark data points that exceed three times the standard deviation of the mean as candidate outliers, and perform secondary verification and final elimination of the candidate outliers based on the physical boundary constraints of the water supply system and known scenario records.
[0045] Candidate outliers refer to suspected outlier data points identified during the data preprocessing stage through preliminary statistical methods, whose numerical distribution significantly deviates from the main data pattern. For example, using the three-standard-deviation principle to initially screen water supply data, a water consumption data point that far exceeds the normal fluctuation range at a certain moment is marked as a candidate outlier. A water supply system refers to a collection of engineering facilities used for the production, transportation, and distribution of urban water, consisting of water sources, water plants, pumping stations, water transmission and distribution networks, and regulating facilities. For example, a city in a slope area may have a municipal water supply network comprising multiple water sources, water treatment plants, booster pumping stations, and thousands of kilometers of pipelines. Physical boundary constraints refer to the reasonable range of data values determined based on the physical limits and design capacity of the water supply system. For example, if the upper limit of the physical water transmission capacity of a certain section of the pipeline is 1000 cubic meters per hour, then the water supply data for that section should not exceed this upper limit. Known scenario records refer to specific events or operational conditions that have been clearly recorded in advance and may cause reasonable fluctuations in the data; for example, a water company's record of a large-scale planned pipeline flushing operation on a certain day, or a sudden large-scale emergency water use event. Secondary verification and final removal refer to the process of reviewing the reasonableness of the initially screened candidate outliers in conjunction with physical boundary constraints and known scenario records, and removing confirmed outlier data points; for example, if a candidate outlier is found to be neither caused by a recorded specific event nor exceeds the physical capacity limit, it will be permanently deleted from the data sequence.
[0046] Among the above-mentioned optional methods, candidate outliers are further identified through sliding window statistics and the three-standard-deviation principle, and secondary verification is performed by combining the physical boundaries of water supply and known scenario records to avoid misjudging normal fluctuations as anomalies and improve the accuracy of data cleaning.
[0047] In one alternative approach, the preprocessing step of the historical data sequence further includes: using a random forest interpolation method to divide the preprocessed, non-missing valid data into a training set and a test set; using the training set to train a random forest model and optimizing the model parameters through grid search; and using the optimized model to predict and impute missing values.
[0048] Random forest interpolation refers to a method based on the random forest ensemble learning algorithm. It utilizes the mapping relationship between known feature values and target values in a dataset to train a model to predict and fill in missing data values. For example, it uses water supply data from other dates at the same time, the same week type, and similar weather conditions to train a random forest model to predict and fill in missing water supply data at a certain time. Valid data refers to reliable data samples that have been cleaned, such as outlier removal, and can be directly used for subsequent analysis and modeling. For example, after cleaning the original data sequence, the remaining water supply data without outliers or missing values, along with corresponding influencing factors, constitute valid data. Grid search refers to an optimization strategy that systematically traverses a predefined space of parameter combinations to find the optimal hyperparameter configuration for a machine learning model. For example, when adjusting parameters for a random forest interpolation model, it tries all combinations of decision tree numbers (100, 150, 200) and maximum depths (5, 7, 10) to find the optimal configuration. Predictive imputation refers to the operation of using a trained prediction model to generate estimated values for the locations of missing values in a data sequence and then filling them in; for example, using an optimized random forest model, the missing 3-hour water supply values in urban data of a certain slope area due to temporary sensor failure are estimated and filled into the sequence.
[0049] Among the above-mentioned optional methods, random forest interpolation is further used to fill in the missing data. The model is trained using data without missing data and the parameters are optimized by grid search, so that the interpolation results are closer to the distribution characteristics of the real data and the integrity of the data sequence is enhanced.
[0050] In one alternative approach, the process of screening the key influencing factors associated with water supply forecasting includes: using Pearson correlation analysis to quantify the linear correlation strength between each influencing factor and water supply, and performing preliminary screening based on a preset correlation coefficient threshold to obtain a set of candidate factors.
[0051] Pearson correlation analysis refers to a statistical analysis method used to quantify the degree and direction of linear correlation between two continuous variables. For example, calculating the Pearson correlation coefficient between the daily average temperature series and the daily total water supply series in historical data measures the strength of their linear relationship. The strength of the linear association refers to the closeness of the linear relationship between two variables, measured by indicators such as the Pearson correlation coefficient. For example, a correlation coefficient of 0.65 between temperature and water supply indicates a moderately strong positive linear association. The correlation coefficient threshold is a manually set critical value during feature selection to determine whether the correlation between variables is significant enough to be retained for subsequent analysis. For example, setting an absolute value threshold of 0.3 means only factors with an absolute correlation coefficient greater than or equal to 0.3 with water supply are retained. The candidate factor set refers to the set of factors temporarily retained after preliminary correlation analysis, considered potentially relevant to the prediction target. For example, after preliminary Pearson analysis, holidays, temperature, humidity, and rainfall constitute the candidate factor set.
[0052] In the above-mentioned optional methods, Pearson correlation analysis is further used to quantify the linear correlation strength between each factor and water supply, and a set of candidate factors is selected based on a preset threshold to quickly locate potential influencing factors with linear relationships and narrow the scope of analysis.
[0053] In one alternative approach, the process of screening the key influencing factors further includes: using a coupling coordination degree model to perform pairwise analysis on the factors in the candidate factor set, calculating the coupling degree and coordination degree between the factors, constructing a coupling strength matrix, and identifying highly coupled factor groups based on the coupling strength matrix, thereby determining the key influencing factors.
[0054] The coupling coordination degree model refers to a mathematical model used to quantitatively assess the interaction strength and coordinated development level between two or more systems or elements. For example, this model can be used to analyze the interaction and coordinated development between the holiday factor subsystem and the temperature factor subsystem. The coupling strength matrix is a square matrix calculated using the coupling coordination degree model, reflecting the pairwise interaction strength between multiple factors. For example, a 4x4 matrix consisting of four factors: holidays, temperature, humidity, and rainfall, where each element represents the coupling degree between the two factors in the corresponding row and column. A high-coupling factor group refers to those factor pairs or groups whose interaction strength is significantly higher than other combinations, identified based on the analysis results of the coupling strength matrix. For example, the analysis results show that the coupling degree between the holiday factor and the temperature factor is significantly higher than other factor pairs, forming a high-coupling factor group.
[0055] In the above-mentioned optional methods, a coupling coordination degree model is further introduced to perform pairwise analysis on candidate factors, construct a coupling strength matrix to identify highly coupled factor groups, accurately capture the interaction relationship between factors, and determine the truly key influencing factors.
[0056] In one alternative approach, the KAN-PINN collaborative prediction model uses a KAN network structure for extracting nonlinear features as a multi-layer network comprising an input layer, at least one hidden layer, and an output layer, wherein the activation functions used in the hidden and output layers are learnable B-spline basis functions.
[0057] In this context, a multilayer network refers to a neural network structure containing multiple sequentially connected computational layers (such as an input layer, hidden layers, and an output layer), where data is transformed layer by layer starting from the input layer and passed to the output layer. For example, the Kolmogorov-Arnold Network constructed in this method contains one input layer, two hidden layers, and one output layer. B-spline basis functions refer to a set of locally supported, piecewise defined polynomial functions that can flexibly fit complex curves by adjusting the control point positions. In this invention, they serve as learnable activation functions for each layer of the KAN network. For example, each neuron in the hidden layer of the KAN network uses a set of B-spline basis functions defined by 30 control points to perform a nonlinear transformation on the input.
[0058] In the above-mentioned alternative approach, the KAN network structure is further designed as a multi-layer topology, with learnable B-spline basis functions used as activation functions for the hidden and output layers. This adaptively learns complex nonlinear mappings, enhancing the flexibility and approximation accuracy of feature extraction.
[0059] In one alternative approach, the loss function for model training is represented as a total loss function, which is a weighted sum of a data-driven loss term, a structural loss term, and a physical inconsistency loss term, wherein the structural loss term is used to constrain network weights to prevent overfitting, and the physical inconsistency loss term is used to quantify the degree of deviation of the model prediction from the monotonicity relationship.
[0060] The data-driven loss term refers to the part of the loss function that directly measures the error between the model's predicted values and the actual observed values, usually in the form of mean squared error or mean absolute error. For example, the mean of the squares of the differences between the model's predicted water supply and the actual water supply for all samples in the training set is used as the data-driven loss term. The structural loss term refers to the regularization part of the loss function designed to constrain model complexity and prevent overfitting, usually related to the norm of the model's weight parameters. For example, the sum of squares (L2 norm) of all weight parameters in the KAN-PINN model is used as a structural loss term. The physical inconsistency loss term refers to the part of the loss function used to penalize the model's predicted output for violating established physical laws or constraints. For example, whether the partial derivative of the predicted water supply with respect to temperature at artificially generated sample points violates the "monotonically increasing" relationship is calculated, and the number of violations is converted into a numerical penalty.
[0061] In the above-mentioned optional methods, a weighted sum of total loss functions including data-driven loss terms, structural loss terms, and physical inconsistency loss terms is further constructed to constrain network weights and quantify the degree of deviation from monotonicity, thereby balancing fitting ability and generalization performance.
[0062] In one alternative approach, the physical inconsistency loss term is calculated based on artificially generated sample data. For each of the key influencing factors, the calculation model outputs the sign of the partial derivative with respect to that factor and compares it with a preset monotonicity factor that reflects the physical laws, and accumulates a penalty term for sign inconsistency.
[0063] Here, sample data refers to a single data instance used for model training, validation, or testing, containing a set of input features and a corresponding target output value; for example, a sample data set includes: holiday indicator (yes / no), temperature (30℃), humidity (60%), rainfall (0mm), historical water supply (14000 cubic meters), and target water supply (15000 cubic meters). The penalty term refers to the additional cost component added to the loss function due to model behavior or output results not conforming to certain predetermined rules (such as physical constraints); for example, whenever the model predicts a decrease in water supply at a sample point as temperature increases, a positive constant penalty value is added to the physical inconsistency loss term.
[0064] In the above-mentioned optional methods, the physical inconsistency loss term is further calculated based on artificial samples. The partial derivative sign of the model is calculated for each key factor and compared with the preset monotonicity factor. The penalty term for sign inconsistency is accumulated, and the physical law is transformed into a quantifiable constraint.
[0065] In one alternative approach, after obtaining the short-term water supply prediction results, the prediction performance of the KAN-PINN collaborative prediction model is evaluated using mean square error, root mean square error, mean absolute error, and goodness of fit.
[0066] The mean squared error (MSE) is the average of the squared differences between predicted and actual values. It measures the average magnitude of prediction error. For example, the MSE is calculated by taking the squared differences between each of the 100 predicted values and the 100 actual values on the test set, and then taking the arithmetic mean. The root mean squared error (RMSE) is the arithmetic square root of the MSE. Its dimension is the same as the prediction target itself, and it is often used to comprehensively characterize the level of prediction error. For example, taking the square root of the calculated MSE value yields the RMS error value in cubic meters. The mean absolute error (MAE) is the average of the absolute values of the differences between predicted and actual values. It is relatively insensitive to outliers and directly reflects the magnitude of the average prediction error. For example, the arithmetic mean of the absolute differences between the predicted and actual values for each sample on the test set is calculated. The goodness of fit refers to the coefficient of determination R², which quantifies the proportion of variation in the target variable that the model's prediction results explain. The value ranges from 0 to 1. For example, an R² value of 0.87 indicates that the model can explain about 87% of the fluctuations in water supply data.
[0067] Among the above-mentioned optional methods, multiple indicators such as mean square error, root mean square error, mean absolute error, and goodness of fit are further used to evaluate the prediction results, measure the model's prediction bias and explanatory power from different perspectives, and provide a comprehensive and objective basis for performance evaluation.
[0068] In an optional approach, the method further includes a generalization capability verification step: obtaining water supply and related influencing factor data from another city or region as a new test set, using the KAN-PINN collaborative prediction model trained on the original training set to predict the new test set, and calculating prediction performance indicators to verify the cross-regional applicability of the model.
[0069] Cross-regional applicability refers to the ability of a prediction model trained on a dataset from one region or city to maintain good prediction performance on a dataset from another region or city that has not been trained on. For example, the KAN-PINN model trained on data from city A in the slope region can still achieve a high degree of fit and a low prediction error when evaluated on test data from city B in the slope region, indicating that the model has cross-regional applicability.
[0070] In the above-mentioned optional methods, a generalization capability verification step can be further added. Data from another city or region can be used as a new test set to evaluate the model performance, test the predictive stability under different water supply characteristics and conditions, and verify the application value for cross-regional promotion.
[0071] In this embodiment, it should be noted that:
[0072] The specific implementation of this technical solution is described in detail below with reference to the accompanying drawings and tables.
[0073] Figure 2 A schematic diagram of the Kolmogorov-Arnold network architecture is shown. This network is built upon the Kolmogorov-Arnold representation theorem, which applies to a smooth function defined on a unit hypercube. Its mathematical expression is shown in the formula:
[0074]
[0075] in, and All are smooth functions. This theorem shows that any multivariate continuous function can be expressed as the sum and composition of a finite number of univariate functions. At the implementation level, a multi-layered Kolmogorov-Arnold network can be viewed as a stack of multiple function matrices. As shown in the formula, a single function matrix... The definition is as follows:
[0076]
[0077] in, and They represent the first The input and output dimensions of a layer. The network's... Layer output Calculated by the formula:
[0078]
[0079] Ultimately, for a A network of layers, given input The overall output is shown in the formula:
[0080]
[0081] The activation function of each node in the network is parameterized using learnable B-spline basis functions, rather than fixed-form functions, thus giving the network a powerful adaptive nonlinear fitting capability.
[0082] The core of constructing a physical information neural network lies in embedding domain physical laws as soft constraints into the model training process. One of the key physical constraints is the monotonicity relationship between input and output. Output variables... For the Dimensional input variables partial derivatives The sensitivity and direction of change of these two factors are characterized by the formula:
[0083]
[0084] If physical laws require and If it is monotonically increasing, then the expected value is... For all reasonable If it holds true; conversely, if it is monotonically decreasing, then the expectation is... .
[0085] The loss function of the physical information neural network introduces two additional constraints on top of the traditional data fitting loss: structural loss. Used to control model complexity and prevent overfitting, its calculation is shown in the formula:
[0086]
[0087] in, and For network weights and bias parameters, Total number of parameters. Physical inconsistency loss. It is used to penalize model predictions that violate the pre-defined monotonic relationship, and its calculation is shown in the formula:
[0088]
[0089] in, For a sign function, when If the value is -1, then the value is 1; otherwise, the value is 1. For artificially generated The input portion of a synthetic sample; As a preset monotonicity factor, when required and The value is 1 when the expression is monotonically increasing, and -1 when the expression is monotonically decreasing; In order to target the The number of synthetic samples in the input dimension.
[0090] The total loss function of a physical information neural network It is the weighted sum of the three losses mentioned above, as shown in the formula:
[0091]
[0092] in, Data-driven loss (such as mean squared error) is used to measure the difference between predicted and actual values. and These are the weighting coefficients for structural loss and physical inconsistency loss, used to balance the importance of various constraints during training.
[0093] Figure 3 This paper presents the overall framework of the KAN-PINN collaborative prediction model. This framework combines the advantages of Kolmogorov-Arnold networks in approximating complex nonlinear functions with the ability of physical information neural networks to embed prior physical knowledge. The specific process begins with the collection and preprocessing of multi-source data, followed by the screening of key driving factors through statistical and modeling methods. Subsequently, a fusion network is constructed and trained, ultimately outputting a water supply prediction value that conforms to physical laws.
[0094] The data preprocessing stage includes outlier removal and missing value imputation. Outlier removal employs a sliding window method combined with the 3σ principle and domain-specific constraints. The sliding window length is set. Step length Calculate the mean of the data within the window. and standard deviation The calculation formula is shown below:
[0095]
[0096]
[0097] The data point in the center of the window that exceeds... Values within the specified range are marked as candidate outliers. Subsequently, these candidate points are further validated by considering the physical capacity boundaries of the water supply system (e.g., the maximum water delivery capacity of the pipe network) and known special event records (e.g., planned flushing, large-scale events), and data confirmed as outliers are removed. Missing value imputation is performed using random forest interpolation. Figure 4 and Figure 5 The original water supply data sequence and the regularized data sequence after the above preprocessing were compared intuitively.
[0098] The screening of key influencing factors is a two-stage process. First, such as... Figure 6 The correlation heatmap shown and Figure 7 The scatter plot shown uses Pearson correlation analysis to quantify the linear correlation strength between various potential influencing factors (such as holidays, temperature, humidity, and rainfall) and historical water supply. This is based on a preset correlation coefficient threshold (e.g., ...). First, a preliminary screening was conducted to obtain a set of candidate factors. Second, to further explore the interaction effects among multiple factors, a coupling coordination degree model was used to perform pairwise analysis of the candidate factors. Coupling degree With coordination The calculation formula is:
[0099]
[0100]
[0101]
[0102] in, and These are the comprehensive evaluation indices for the two factors. and As the weight, it is usually taken as By calculating the coupling and coordination degree among all candidate factor pairs, a coupling strength matrix is constructed, and highly coupled factor groups with coupling strength significantly higher than the average level are identified, thereby ultimately determining the set of key influencing factors used for model construction. Figure 8 and Figure 9 The dynamic changes in coupling and coordination among key factors are presented in the form of time-series evolution diagrams.
[0103] Model performance is comprehensively evaluated using multiple metrics, including mean squared error, root mean square error, mean absolute error, and goodness of fit. The calculation formulas are as follows:
[0104]
[0105] in, For the number of test samples, This represents the actual water supply volume. These are the model's predicted values. This is the average of the true values.
[0106] To verify the superiority of the KAN-PINN collaborative prediction model, a comparative experiment was designed. Figure 10 The results show a comparison of the prediction performance of the KAN-PINN model with those of a single Kolmogorov-Arnold network model, a single physical information neural network model, a long short-term memory network model, and a gated recurrent unit model on the same test set. As can be seen in the figure, the prediction curve of the KAN-PINN model has the highest degree of agreement with the actual value sequence. Figure 11 Table 1 further provides a quantitative comparison of performance evaluation indicators.
[0107] Table 1:
[0108]
[0109] Table 1 shows the goodness of fit of the proposed KAN-PINN model. It outperforms other baseline models in all aspects, including (0.871), root mean square error (5114.905), mean absolute error (4191.080), and mean square error (301.236).
[0110] To test the model's generalization ability, a cross-regional validation experiment was conducted. The KAN-PINN model, trained on data from one region, was used to predict data from another, unseen region. Figure 12 Water supply data for another region used in the generalization experiment are shown. Figure 13 The model's predictions on this new data are shown, demonstrating its ability to capture water supply variation patterns well across different regions. Table 2 quantifies the model's performance metrics on two different regional datasets. On the new regional test set, the model maintains a high degree of fit (…). The acceptable error levels (root mean square error of 5415.023 and mean absolute error of 4399.462) demonstrate that the proposed method has good cross-regional applicability and robustness.
[0111] Table 2:
[0112]
[0113] The technical solution of this embodiment will be fully described with reference to the following examples, specifically:
[0114] This embodiment addresses the short-term water supply forecasting task of urban water systems, specifically forecasting the total water supply of four core water supply companies in a certain slope area. The forecast relies on data from the water supply companies' monitoring and data acquisition systems and historical statistics platforms, with a time granularity of one hour. The core objective of the implementation process is to automate the entire chain of operations, from raw data preprocessing, feature engineering, model training to final prediction, through automated code workflows to obtain high-precision water supply forecast results.
[0115] The implementation process began with data collection and preprocessing. The collected raw data covered hourly data from January 2020 to May 2024, specifically including sequences of total water supply, holiday markers, temperature, humidity, and rainfall. The primary task of preprocessing was outlier removal, employing a sliding window method combined with the three-standard-deviation principle and domain-specific constraints. The sliding window length L was set to 24, and the step size S to 1. The arithmetic mean μ and standard deviation σ of the data within each window were calculated sequentially. The calculation formulas are as follows:
[0116]
[0117]
[0118] The value at the center data point of the window exceeds... Points within the intervals are marked as candidate outliers. A secondary verification process is then performed. Clearly erroneous data with water supply volumes less than zero or exceeding design capacity are directly removed based on the physical water supply capacity boundaries of the water supply network. Furthermore, the reasonableness of candidate outliers is assessed by considering known emergency scenarios (such as planned pipeline maintenance or water supply for large-scale events), ultimately completing the outlier removal process. For missing values remaining in the data sequence after outlier removal, random forest interpolation is used for imputation. The basic parameters of the random forest model are set as follows: 150 decision trees and a maximum tree depth of 7. Complete, non-missing samples in the dataset are randomly divided into training and validation subsets in a 7:3 ratio. The model is trained based on the training subset, and hyperparameters are optimized using a grid search strategy. The mean absolute error and root mean square error on the validation subset are used as indicators to select the optimal model. Finally, the optimal model is used to predict and imput all missing values.
[0119] After data cleaning, the next step was to screen key influencing factors. This screening process consisted of two steps. First, Pearson correlation analysis was used, with preprocessed water supply data as the dependent variable and holidays, temperature, humidity, and rainfall as independent variables. The Pearson correlation coefficients between each independent variable and the dependent variable were calculated. A threshold of 0.3 was set for the absolute value of the correlation coefficient, retaining factors whose correlation coefficients met the criteria, forming a candidate factor set including holidays, temperature, humidity, and rainfall. Second, to further analyze the interactions among multiple factors, a coupling coordination degree model was used to conduct pairwise analyses of the candidate factor set. First, the entropy weight method was used to calculate the weights of each factor. Then, based on the coupling coordination degree formula, the coupling degree C and coordination degree D between any two factors were calculated, thus constructing a coupling strength matrix. The calculation results showed that the average coupling strength among the factors was 0.0086, the average coordination degree was 0.0104, and the coupling degree C value was mainly distributed in the range of 0 to 0.2. This quantitative result indicates that during the study period, the interaction between the influencing factors and water supply exhibited a relatively stable and weak coupling state. Based on the above analysis, the set of key influencing factors for model construction was finally determined.
[0120] Next, the complete dataset was divided. The 1602 valid data points obtained after preprocessing and feature filtering were divided strictly in chronological order. The first 70% of the data was selected as the training set for learning and optimizing model parameters; the remaining 30% was used as the test set for the final evaluation of the model's predictive performance. This measure aims to avoid overly optimistic evaluation results due to data leakage.
[0121] To ensure the stability and convergence speed of model training, the input and output data are normalized. A min-maximum normalization method is used to normalize the input feature data of the training set to the [0, 1] interval, and the corresponding normalization parameters are saved. The input features of the test set are transformed using the same parameters to maintain the consistency of data distribution. The output data (i.e., water supply) also undergoes the same normalization process, and the output normalization parameters are saved for subsequent denormalization of the model predictions to restore them to the actual physical dimensions.
[0122] The core component is the construction of the KAN-PINN collaborative prediction model. The model includes a feature extraction module based on a Kolmogorov-Arnold network and a constraint module based on a physical information neural network. The input dimension of the feature extraction module is designed to be 5, consistent with the number of key influencing factors; the number of hidden layer units is set to 10; a learnable B-spline basis function is used as the activation function, and the polynomial approximation order is set to 4 to balance the model's expressive power and complexity. To prevent overfitting, L2 and L1 regularization are introduced, with coefficients set to 1e-5 respectively. Model parameters are initialized with small random values. The core of the physical constraint embedding module is to integrate prior physical knowledge, especially the monotonic relationship between key influencing factors and water supply, into the model training process. This is specifically achieved by constructing a total loss function, which is a weighted sum of data-driven loss, structural loss, and physical inconsistency loss, in the form of... Among them, the structural loss is used to constrain the network weights, while the physical inconsistency loss calculates the sign of the partial derivative of the model output with respect to specific input factors and compares it with a preset monotonicity factor to penalize behaviors that violate physical laws.
[0123] The Adam optimizer was used for model training, with 300 training iterations, a batch size of 256, an initial learning rate of 0.001, and a decay policy. During training, batch data was read sequentially, the total loss including physical constraints was calculated, and the basis function parameters of the Kolmogorov-Arnold network and the weights of the fully connected layers of the physical information neural network were updated using the backpropagation algorithm. The loss curve was monitored in real time during the training process.
[0124] After model training, a test set is used for prediction. The normalized test set is input into the trained KAN-PINN collaborative prediction model to obtain normalized prediction values. Then, the previously saved output normalization parameters are used for inverse normalization to restore the predicted water supply in cubic meters per hour. Finally, the model's predictive performance is quantitatively evaluated by calculating metrics such as mean absolute error, root mean square error, and goodness of fit.
[0125] To verify the model's generalization ability, a cross-regional validation experiment was conducted. Water supply and related influencing factor data from another city in a slope region from January 2020 to May 2024 were selected to form an independent validation dataset. The first 70% of this dataset was used as the training set, and the last 30% as the test set. The same KAN-PINN model architecture and training process were used for modeling and prediction as described above. Experimental results show that the model maintains high prediction accuracy and stability on this new regional dataset, with performance indicators similar to those on the original regional dataset. This demonstrates that the proposed KAN-PINN collaborative prediction method possesses good cross-regional applicability and robustness, providing solid support for its practical deployment in different urban water systems.
[0126] The above description is merely a preferred embodiment of the present invention and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of disclosure in this invention is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-disclosed concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this invention.
[0127] It should be noted that the terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and represent a limitation on a specific order or sequence. Where appropriate, the order of use for similar objects can be interchanged so that the embodiments of this application described herein can be implemented in an order other than that shown or described.
[0128] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. A short-term urban water supply prediction method driven by KAN-PINN synergy under multi-factor coupling, characterized in that, The method includes: A historical data sequence containing historical water supply and multiple influencing factors is obtained, and the historical data sequence is preprocessed to obtain a regularized data sequence. Key influencing factors associated with water supply prediction are screened from the regularized data sequence, and a training set and a test set containing the key influencing factors are constructed. A KAN-PINN collaborative prediction model is constructed. The nonlinear features of the key influencing factors are extracted through the KAN network structure of the KAN-PINN collaborative prediction model. Physical constraints are introduced into the loss function of the model training. The physical constraints reflect the monotonic relationship between the key influencing factors and the water supply. The KAN-PINN collaborative prediction model is trained using the training set, and the model parameters are updated by optimizing the loss function containing the physical constraints. The test set is input into the trained KAN-PINN collaborative prediction model to obtain short-term water supply prediction results.
2. The short-term urban water supply prediction method driven by KAN-PINN synergy under multi-factor coupling as described in claim 1, characterized in that, The preprocessing steps for the historical data sequence include: Set the sliding window length and step size, calculate the mean and standard deviation of the data within the window, mark data points that exceed three times the standard deviation of the mean as candidate outliers, and perform secondary verification and final elimination of the candidate outliers based on the physical boundary constraints of the water supply system and known scenario records.
3. The short-term urban water supply prediction method driven by KAN-PINN synergy under multi-factor coupling as described in claim 2, characterized in that, The preprocessing steps for the historical data sequence further include: using random forest interpolation to divide the preprocessed, non-missing valid data into a training set and a test set; using the training set to train a random forest model and optimizing the model parameters through grid search; and using the optimized model to predict and impute missing values.
4. The short-term urban water supply prediction method driven by KAN-PINN synergy under multi-factor coupling as described in claim 1, characterized in that, The process of screening the key influencing factors associated with water supply forecasting includes: using Pearson correlation analysis to quantify the linear correlation strength between each influencing factor and water supply, and conducting preliminary screening based on a preset correlation coefficient threshold to obtain a set of candidate factors.
5. The short-term urban water supply prediction method driven by KAN-PINN synergy under multi-factor coupling as described in claim 4, characterized in that, The process of screening the key influencing factors also includes: using a coupling and coordination degree model to perform pairwise analysis on the factors in the candidate factor set, calculating the coupling degree and coordination degree between the factors, constructing a coupling strength matrix, and identifying highly coupled factor groups based on the coupling strength matrix, thereby determining the key influencing factors.
6. The short-term urban water supply prediction method driven by KAN-PINN synergy under multi-factor coupling as described in claim 1, characterized in that, In the KAN-PINN collaborative prediction model, the KAN network structure for extracting nonlinear features is a multi-layer network containing an input layer, at least one hidden layer, and an output layer. The activation functions used in the hidden layer and the output layer are learnable B-spline basis functions.
7. The short-term urban water supply prediction method driven by KAN-PINN synergy under multi-factor coupling as described in claim 1, characterized in that, The loss function for training the model is represented as the total loss function, which is a weighted sum of the data-driven loss term, the structural loss term, and the physical inconsistency loss term. The structural loss term is used to constrain the network weights to prevent overfitting, and the physical inconsistency loss term is used to quantify the degree of deviation between the model prediction and the monotonicity relationship.
8. The short-term urban water supply prediction method driven by KAN-PINN synergy under multi-factor coupling as described in claim 7, characterized in that, The physical inconsistency loss term is calculated based on artificially generated sample data. For each key influencing factor, the calculation model outputs the sign of the partial derivative with respect to that factor and compares it with a preset monotonicity factor that reflects the physical law, and accumulates the penalty term for sign inconsistency.
9. The short-term urban water supply prediction method driven by KAN-PINN synergy under multi-factor coupling as described in claim 1, characterized in that, After obtaining the short-term water supply prediction results, the prediction performance of the KAN-PINN collaborative prediction model is evaluated using mean square error, root mean square error, mean absolute error, and goodness of fit.
10. The method for short-term urban water supply prediction driven by KAN-PINN synergy under multi-factor coupling as described in claim 1, characterized in that, The method further includes a generalization capability verification step: obtaining water supply and related influencing factor data of another city or region as a new test set, using the KAN-PINN collaborative prediction model trained on the original training set to predict the new test set, and calculating prediction performance indicators to verify the cross-regional applicability of the model.
