Financial data anomaly detection method and system based on artificial intelligence
By combining technologies such as deep learning and reinforcement learning, we build a periodic load prediction model and multi-dimensional data analysis to solve the complex and nonlinear detection problems in power system financial data, achieve efficient abnormal pattern recognition and self-optimization, and reduce costs. Business risks.
Patent Information
- Application Number
- CN202410707269.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-03
- Publication Date
- 2024-09-20
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional financial data anomaly detection methods are difficult to handle complex and nonlinear financial data in power systems, resulting in the inability to effectively identify abnormal patterns and increasing operational risks and financial losses.
Adopt artificial intelligence-based methods, combine deep learning, reinforcement learning and multi-dimensional data analysis, and construct Cyclic load forecasting model identifies non-linear relationships and hidden patterns in financial data and optimizes detection strategies through reinforcement learning.
It improves the accuracy and efficiency of financial data anomaly detection, can adapt to rapid changes in the power market and operating conditions, and provides power companies with reliable financial data management tools.
Smart Images

Figure CN118673430A
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of artificial intelligence, and in particular relates to a financial data anomaly detection method and system based on artificial intelligence. Background Art
[0002] In today's rapidly developing power market, with the expansion of power system scale and the increase of complexity, financial data management has become one of the important challenges faced by power companies. Traditional financial data anomaly detection methods mainly rely on rule-based detection and simple statistical analysis. Although these methods have played a certain role in early power system management, with the explosive growth of data volume and the complexity of power system operating environment, these traditional methods have been unable to meet the needs of modern power systems for financial data management. For example, rule-based methods cannot effectively handle nonlinear and high-dimensional data characteristics, while simple statistical analysis methods have difficulty identifying complex abnormal patterns. These limitations make it difficult for power companies to promptly discover and handle abnormal situations in financial data, thereby increasing operating risks and financial losses.
[0003] In recent years, with the rapid development of artificial intelligence technology, anomaly detection methods based on machine learning have begun to be applied to many fields, including financial data management. These methods can automatically identify abnormal data that do not conform to these patterns by learning patterns in historical data. However, the financial data of the power system has its own unique complexity. For example, it is affected by various factors such as seasonal changes, weather conditions, and policy adjustments. These factors make the financial data of the power system highly nonlinear and dynamically changing. In addition, the financial data of the power system also involves large-scale capital expenditures and operation and maintenance costs, and there are complex interrelationships between these data. Existing anomaly detection methods based on machine learning often ignore these characteristics, resulting in limited application effects in the management of financial data in power systems. Therefore, how to effectively combine the characteristics of financial data in power systems and develop more efficient and accurate anomaly detection methods has become an urgent problem to be solved. Summary of the invention
[0004] The purpose of the present invention is to design a financial data anomaly detection method and system based on artificial intelligence, which solves the problems existing in the prior art in a targeted manner by integrating deep learning, reinforcement learning and multidimensional data analysis technology.
[0005] In order to achieve the above object, a first aspect of the present invention provides a financial data anomaly detection method based on artificial intelligence, the method comprising:
[0006] S1. Obtain the financial data of the power system and perform data cleaning and normalization processing on the financial data of the power system to obtain financial data, then use adaptive window technology, statistical characteristic calculation and event recognition enhancement algorithm to extract key time features, and then use the autoencoder based on deep learning to reduce the data dimension, and optimize the autoencoder parameters through reinforcement learning; wherein, the original data set is X, the normalized data is X', and the normalization function is f(·). For any data point x∈X, the data cleaning and normalization processing are expressed as follows:
[0007]
[0008] Among them, μ and σ represent the dynamic mean and standard deviation of the data in x respectively;
[0009] S2. Construct a periodic load forecasting model based on long and short-term neural networks to capture and predict the periodic changes of power system financial data, introduce seasonal adjustment to calculate the adjusted financial data, and integrate the time series features and external influencing factors learned from the long and short-term neural networks in the feature fusion layer of the long and short-term neural networks, input them into the fully connected layer, design a loss function based on the periodic weights of power system financial data, and use the Adam optimizer to dynamically adjust the learning rate; wherein, the loss function L is expressed as follows:
[0010]
[0011] Among them, w t is a periodic weight factor based on time t, N represents the number of samples, X' t represents the actual seasonally adjusted financial data value, represents the predicted financial data value; in addition, the periodic weight factor is expressed as follows:
[0012]
[0013] Among them, P represents the cycle length, φ is the cycle phase offset, and α is the weight adjustment factor, which is used to control the influence of the periodic weight; the dynamic adjustment of the learning rate using the Adam optimizer is expressed as follows:
[0014]
[0015] Among them, η new is the adjusted learning rate, η base is the basic learning rate, β is the learning rate adjustment factor, which is used to control the amplitude of the learning rate change;
[0016] S3. The financial data is formed into a financial data set D, and then the financial data set D is standardized to obtain features. Then, the kernel method is used to expand the features to calculate the nonlinear relationship and hidden mode of the financial data. Then, based on the processed features, a multidimensional association graph G = (V, E) is constructed, where the node V represents the different dimensional features of the power financial data, and the edge E represents the strength of the association between different features. Then, based on the graph embedding technology, the multidimensional association graph is converted into a low-dimensional vector space, and then the features that contribute most to the prediction task are selected through the feature selection algorithm.
[0017] S4, using causal reasoning and association rule learning techniques to analyze the relationship between these data;
[0018] S5. Use machine learning classification algorithms to detect and identify abnormal data;
[0019] S6. Based on the feedback results of anomaly detection, the Actor-Critic network in reinforcement learning is used to continuously adjust and optimize the detection strategy and model parameters;
[0020] S7. Integrate the detection and identification structure of abnormal data and user feedback into the system optimization loop, and continuously iterate and update the model.
[0021] Furthermore, the adaptive window technology indicates that the set of change points {cp1, cp2, ..., cp n}, and then divide the time window according to these change points;
[0022] The statistical characteristic calculation means calculating the statistical characteristic S(T) in each adaptive window. i ), where the statistical characteristic S(T i ) including the mean mean(T i ), variance var(T i ), trend(T i ), which is expressed as follows:
[0023] S(T i )={mean(T i ),var(T i ),trend(T i ),…}
[0024] Among them, T i represents the data sequence within time window i;
[0025] The event recognition enhancement algorithm uses text analysis technology to extract electricity-related event labels from financial reports and market news, and incorporates the event labels into the model as additional features.
[0026] Furthermore, the loss function L(X,E) of the autoencoder in S1 is decode (E encode (X))) represents the following:
[0027] L(X,E decode (E encode (X))) = MSE(X,E decode (E encode (X)))+λ||θ|| 2
[0028] Where X represents the raw financial data input to the autoencoder; E encode represents the encoding part of the autoencoder, which is responsible for converting the input data into a low-dimensional representation; E decode represents the decoding part of the autoencoder, which is used to restore the low-dimensional representation to the original data format; MSE represents the mean square error; λ is the regularization parameter, and θ is the parameter of the autoencoder.
[0029] Furthermore, the seasonal adjustment is introduced to calculate the adjusted financial data, which is expressed as follows:
[0030]
[0031] Among them, X t Represents the original data at time t; S t represents the seasonal factor, which is obtained based on the average value of the same scene in historical data; X' t Denotes seasonally adjusted data.
[0032] Furthermore, in S3, the financial data set D is standardized as follows:
[0033]
[0034] Among them, d' i represents the processed data point, and the data point d i ∈D,μ i and σ i Represent the mean and standard deviation of feature i respectively;
[0035] The kernel method is used to expand the features and calculate the nonlinear relationship and hidden pattern of financial data, which is expressed as follows:
[0036]
[0037] Among them, φ(d' i ) represents the feature d' i The new representation of the nonlinear relationship expression of financial data is enhanced by kernel method transformation; d' irepresents the preprocessed financial data features; c represents the center of the kernel function, and σ represents the width parameter of the kernel function;
[0038] Then, based on the graph embedding technology, the multi-dimensional association graph is transformed into a low-dimensional vector space, which is expressed as follows:
[0039]
[0040] Among them, p(d′ i ,d′ j ) represents the joint probability distribution, p(d′ i ) and p(d′ j ) represents the marginal probability distribution;
[0041] Then, the feature selection algorithm is used to select the features that contribute most to the prediction task, as shown below:
[0042] L=α·L pred +(1-α)·L graph
[0043] L pred represents the prediction error term, L graph represents the graph regularization term, and α represents the weight parameter that adjusts the importance of both.
[0044] Furthermore, the S4 specifically includes:
[0045] S41, integrating the capital expenditure data C of the power system and the operation and maintenance cost data O to form a unified data set D = {C, O}, and preprocessing the data set D;
[0046] S42. Variable conversion of capital expenditure data C and operation and maintenance cost data O before time series analysis is performed as follows:
[0047] C′=log(C+1),O′=log(O+1)
[0048] Among them, C' represents the converted capital expenditure data, and O' represents the converted operation and maintenance cost data;
[0049] S43. A time lag model is used to identify the lag effect between the converted capital expenditure data C' and the converted operation and maintenance cost data O', which is expressed as follows:
[0050] O' t =α+βC' t-L +∈ t
[0051] Where L represents the lag period, α and β are model parameters, ∈ t is the error term, and t represents time.
[0052] Furthermore, the S5 specifically includes:
[0053] S51. Integrate the financial data of the power system with other relevant data to form a comprehensive data set, use a deep autoencoder to learn high-level feature representation from the comprehensive data set, and use a reconstruction error-based method to calculate the anomaly score of each data point; wherein the anomaly score is the Euclidean distance between the input data and the reconstructed data, expressed as follows:
[0054]
[0055] Where x is the original data point, is the reconstructed data point;
[0056] S52, perform statistical analysis on the abnormal scores S(x) of all data points in the training set, draw a distribution histogram of the abnormal scores, and calculate the basic statistics of the distribution, and then calculate the threshold τ based on the statistics of the abnormal score distribution to identify potential abnormal data; wherein the threshold τ is calculated as follows:
[0057] τ=μ+kσ
[0058] Among them, k is a constant preset according to the abnormal proportion, which is used to adjust the strictness of the threshold;
[0059] S53, preliminarily label each data point in the data set according to the calculated threshold value τ, if the anomaly score S(x) of the current data point is higher than the threshold value τ, label it as abnormal; otherwise, label it as normal;
[0060] S54. Select a small number of data points for manual review to obtain accurately labeled data. Use the accurately labeled data as a seed set to train a semi-supervised learning model. Then use the semi-supervised learning model to predict the unlabeled data to expand the seed set.
[0061] Furthermore, the Actor-Critic network includes a Critic loss function and an Actor loss function, wherein the Critic loss function L Critic It is used to evaluate the prediction accuracy of the value function and add the weight of abnormal data, which is expressed as follows:
[0062]
[0063] Among them, w i represents the weight dynamically adjusted according to the abnormality of data point i, y i represents the target value, which is calculated by the reward signal and the target critic network; Q(s i ,a i ∣θ Q) indicates that the Critic network uses parameter θ Q Evaluation in state i Take action a i The value of y i Indicates the target value;
[0064] The Actor loss function L Actor It is expressed as follows:
[0065]
[0066] Among them, Q(s i ,π(s i ∣θ π )|θ Q ) represents the value of the Critic network evaluation, where π(s i ∣θ π ) is determined by the Actor network in state s i The best action to take under the current policy π and the Actor's parameters; θ Q and θ π Represent the parameters of the Critic and Actor networks respectively.
[0067] Furthermore, the S7 specifically includes:
[0068] S71. Conduct an in-depth analysis of the periodic characteristics of the power system financial data, and use the autocorrelation function to identify the periodic pattern of the data; wherein the calculation formula of the autocorrelation function ACF(k) is:
[0069]
[0070] Where T represents the length of the time series, X t represents the value of financial data at time t, Represents X t The mean of , k represents the lag coefficient;
[0071] S72. Based on the results of the periodic analysis, use a moving average filter and a standard deviation threshold method to identify abnormal patterns;
[0072] S73. Perform periodic analysis based on the results of the abnormal pattern and adjust system parameters for iterative update.
[0073] In a second aspect of the present invention, a financial data anomaly detection system based on artificial intelligence is provided, comprising a computer-readable storage medium and a processor, wherein the computer-readable storage medium is used to store an executable program; the processor is used to read the executable program stored in the computer-readable storage medium and execute the above-mentioned financial data anomaly detection method based on artificial intelligence.
[0074] The beneficial technical effects of the present invention are at least as follows:
[0075] (1) The present invention uses recurrent neural networks (RNNs) and long short-term memory networks (LSTMs) to predict the periodic changes in financial data, and uses graph neural networks (GNNs) to integrate and analyze the complex relationship between financial data and external factors. These methods can effectively process and learn the nonlinear characteristics and dynamic changes in power system financial data, thereby improving the accuracy of anomaly detection.
[0076] (2) In order to address the problem that existing methods ignore the complex relationship between large-scale capital expenditure and operation and maintenance cost data in power system financial data, the present invention introduces causal reasoning and association rule learning technology to specifically analyze the relationship between these data to identify abnormal data points that do not conform to normal financial logic.
[0077] (3) In order to solve the problem of insufficient adaptability of the existing technology, the present invention designs a reinforcement learning optimization engine, which can continuously optimize the parameters and strategies of the model according to the results of anomaly detection, thereby realizing continuous learning and self-optimization of the anomaly detection process of power system financial data.
[0078] (4) Through these innovations, the present invention can not only effectively overcome the limitations of the existing technology in detecting abnormalities in power system financial data and improve the accuracy and efficiency of detection, but also adapt to the rapid changes in the power market and operating conditions, and provide a reliable and efficient financial data management tool for power companies. These features make the present invention have broad application prospects and significant social and economic value.
[0079] (5) The present invention constructs an intelligent and adaptive power financial data anomaly detection system through a series of closely connected steps, aiming to comprehensively solve the complex challenges in the financial data management of power systems. First, through the data preprocessing and feature extraction steps, the system can effectively handle the diversity and complexity of power system financial data, laying a solid foundation for subsequent in-depth analysis. Then, by constructing a periodic load forecasting model, conducting a comprehensive analysis of multidimensional data, and analyzing the correlation between capital expenditures and operation and maintenance costs, the system deeply explores the complex relationship between financial data and external factors, and accurately identifies abnormal data points based on the financial structure characteristics of the power system. These steps support each other and jointly improve the accuracy and efficiency of anomaly detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0080] The present invention is further described using the accompanying drawings, but the embodiments in the accompanying drawings do not constitute any limitation to the present invention. A person skilled in the art can obtain other drawings based on the following drawings without creative work.
[0081] Figure 1 This is a flow chart of a financial data anomaly detection method based on artificial intelligence in the present invention. DETAILED DESCRIPTION
[0082] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0083] In one or more embodiments, Figure 1 As shown, the present invention discloses a method for detecting anomalies in financial data based on artificial intelligence, which includes steps S1-S7:
[0084] S1. Obtain the financial data of the power system and perform data cleaning and normalization processing on the financial data of the power system to obtain financial data, then use adaptive window technology, statistical characteristic calculation and event recognition enhancement algorithm to extract key time features, and then use the autoencoder based on deep learning to reduce the data dimension, and optimize the autoencoder parameters through reinforcement learning; wherein, the original data set is X, the normalized data is X', and the normalization function is f(·). For any data point x∈X, the data cleaning and normalization processing are expressed as follows:
[0085]
[0086] Among them, μ and σ represent the running mean and standard deviation of the data in x respectively.
[0087] Specifically, the adaptive window technology represents identifying a set of change points {cp1, cp2, ..., cp n}, and then divide the time window according to these change points;
[0088] The statistical characteristic calculation means calculating the statistical characteristic S(T) in each adaptive window. i ), where the statistical characteristic S(T i ) including the mean mean(T i ), variance var(T i ), trend(T i ), which is expressed as follows:
[0089] S(T i )={mean(T i ),var(T i ),trend(T i ),…}
[0090] Among them, T i Represents the data sequence in time window i, mean, var, and trend represent the calculation functions of mean, variance, and trend respectively;
[0091] The event recognition enhancement algorithm uses text analysis technology to extract electricity-related event labels from financial reports and market news, and incorporates event labels into the model as additional features.
[0092] Specifically, adaptive window technology refers to dynamically determining the size of the time window based on the change point detection (CPD) technology. Change point detection aims to identify the points where the statistical characteristics of the time series change, so as to adaptively adjust the time window. For the power financial data sequence T, the CPD algorithm is used to identify the change point set {cp1, cp2,…, cp n}, and then divide the time window according to these change points.
[0093] Statistical characteristic calculation means calculating the statistical characteristic S(T i ), including the mean mean(T i ), variance var(T i ), trend(T i ) etc. Trend calculation can be done by linear regression analysis, that is, linear fitting is performed on the data points in the time window, and the slope represents the trend.
[0094] Event recognition enhancement means that in addition to statistical features, an event recognition algorithm is introduced to identify whether the window contains important financial events. Based on text analysis techniques such as natural language processing (NLP), power-related event labels are extracted from financial reports and market news, and these labels are incorporated into the model as additional features.
[0095] Specifically, an autoencoder based on deep learning is used to reduce the data dimension, and the encoder parameters are optimized through reinforcement learning to better capture the intrinsic characteristics of the data. Let the autoencoder be E, and its encoding and reconstruction error is:
[0096] minimize L(X,E decode (E encode (X)))
[0097] Where L is the loss function, which measures the difference between the original data X and the reconstructed data. Design a deep autoencoder E with multiple hidden layers. encode Encode the input data X and then pass it through E decodeDecoding is performed with the goal of minimizing the reconstruction error between the input data and the decoded data. In order to capture the complex characteristics of power financial data, nonlinear activation functions and batch normalization layers are introduced to improve the learning ability and stability of the model. The loss function L is defined as the mean square error (MSE) between the original data X and the reconstructed data plus a regularization term, the latter of which is used to prevent overfitting.
[0098] Among them, the loss function of the autoencoder L(X,E decode (E encode (X))) represents the following:
[0099] L(X,E decode (E encode (X))) = MSE(X,E decode (E encode (X)))+λ||θ|| 2
[0100] Where X represents the raw financial data input to the autoencoder; E encode represents the encoding part of the autoencoder, which is responsible for converting the input data into a low-dimensional representation; E decode represents the decoding part of the autoencoder, which is used to restore the low-dimensional representation to the original data format; MSE represents the mean square error; λ is the regularization parameter, and θ is the parameter of the autoencoder.
[0101] S2. Construct a periodic load forecasting model based on long-short time neural network to capture and predict the periodic changes of power system financial data, and introduce seasonal adjustment to calculate the adjusted financial data; specifically, the introduction of seasonal adjustment to calculate the adjusted financial data is expressed as follows:
[0102]
[0103] Among them, X t Represents the original data at time t; S t represents the seasonal factor, which is obtained based on the average value of the same scene in historical data; X' t Denotes seasonally adjusted data.
[0104] At the same time, the time series features and external influencing factors learned from the long and short time neural network are integrated in the feature fusion layer of the long and short time neural network, and input into the fully connected layer. The loss function based on the periodic weight of the power system financial data is designed, and the Adam optimizer is used to dynamically adjust the learning rate.
[0105] Specifically, the long short-term memory network (LSTM) is used as the core architecture. Due to the advantages of LSTM in processing time series data, it can effectively learn the long-term dependencies of data. In particular, the periodic time window W is introduced.p , which is dynamically adjusted according to the specific cycle of the power system (such as quarter, year) to capture the periodic change pattern. The feature fusion layer is designed to integrate the time series features learned from LSTM and external influencing factors (such as weather conditions, policy changes, etc.). This layer uses a fully connected network, and the input includes the output of LSTM and the external factor feature F ext , which enhances the model’s ability to perceive the particularity of power financial data.
[0106] Among them, the design loss function L is expressed as follows:
[0107]
[0108] Among them, w t is a periodic weight factor based on time t, reflecting the different contributions of different time points to the forecast accuracy. In particular, these weights can be dynamically adjusted according to the historical periodic characteristics of power system financial data (such as seasonal load fluctuations). For example, the weight can be increased in the month when the financial report is released or before and after important holidays to reflect the higher requirements for data accuracy during these periods; N represents the number of samples, X' t represents the actual seasonally adjusted financial data value, represents the predicted financial data value; in addition, the periodic weight factor is expressed as follows:
[0109]
[0110] Where P represents the period length, φ is the period phase offset, and α is the weight adjustment factor, which is used to control the influence of the periodic weight;
[0111] An Adam optimizer based on dynamic learning rate adjustment is adopted, called "Periodicity-aware Dynamic Learning Rate Adjustment Strategy (CP-DLRS)". Different from the traditional Adam optimizer, CP-DLRS dynamically adjusts the learning rate according to periodic load changes to adapt to the characteristics of power system financial data. The dynamic adjustment of learning rate using the Adam optimizer is expressed as follows:
[0112]
[0113] Among them, η new is the adjusted learning rate, η base is the base learning rate, and β is the learning rate adjustment factor, which is used to control the magnitude of the learning rate change.
[0114] In this way, the model can adapt to new data patterns more quickly during periods of large cyclical changes (for example, when the seasons change), while maintaining a more stable learning rate during periods of small cyclical changes, thereby achieving more efficient and stable optimization throughout the training process. This innovative loss function design and optimization strategy not only enables the CPAN model to more accurately capture and predict cyclical changes in power system financial data, but also enhances the model's adaptability and robustness to data fluctuations, providing strong support for power system financial management.
[0115] S3, the financial data is formed into a financial data set D, and then the financial data set D is standardized to obtain features, and then the features are expanded using a kernel method to calculate the nonlinear relationship and hidden pattern of the financial data;
[0116] Specifically, the financial data set D is standardized as follows:
[0117]
[0118] Among them, d' i represents the processed data point, and the data point d i ∈D,μ i and σ i Represent the mean and standard deviation of feature i respectively;
[0119] The kernel method is used to expand the features and calculate the nonlinear relationship and hidden pattern of financial data, which is expressed as follows:
[0120]
[0121] Among them, φ(d' i ) represents the feature d' i The new representation of the nonlinear relationship expression of financial data is enhanced by kernel method transformation; d' i represents the preprocessed financial data features; c represents the center of the kernel function, and σ represents the width parameter of the kernel function;
[0122] Then, based on the processed features, a multidimensional association graph G = (V, E) is constructed, where the node V represents the different dimensional features of the power financial data, and the edge E represents the association strength between different features. Then, based on the graph embedding technology, the multidimensional association graph is converted into a low-dimensional vector space, and then the feature selection algorithm is used to screen out the features that contribute most to the prediction task.
[0123] Then, based on the graph embedding technology, the multi-dimensional association graph is transformed into a low-dimensional vector space, which is expressed as follows:
[0124]
[0125] Among them, p(d′i ,d′ j ) represents the joint probability distribution, p(d′ i ) and p(d′ j ) represents the marginal probability distribution;
[0126] Then, the feature selection algorithm is used to select the features that contribute most to the prediction task, as shown below:
[0127] L=α·L pred +(1-α)·L graph
[0128] L pred represents the prediction error term, L graph represents the graph regularization term, and α represents the weight parameter that adjusts the importance of both.
[0129] As an embodiment of the present invention, the gradient descent method is used to optimize the model parameters, and in particular, the graph structure information is introduced into the graph regularization term to ensure that the optimization process not only reduces the prediction error, but also maintains the intrinsic structure of the data. Through the construction of advanced feature expansion and multi-dimensional association graphs, the complex relationships and nonlinear patterns in the power financial data are effectively captured, and the depth and breadth of data analysis are improved. In particular, the graph embedding and feature selection steps enable the model to focus on the features that have the greatest impact on the prediction while maintaining the data structure, thereby improving the efficiency and accuracy of the analysis. This comprehensive analysis framework has obvious innovation and application value in the field of power financial data processing, and provides strong data support for the financial management of power systems.
[0130] S4. Use causal reasoning and association rule learning techniques to analyze the relationships between these data, including:
[0131] S41. Integrate the capital expenditure data C and the operation and maintenance cost data O of the power system to form a unified data set D = {C, O}, and preprocess the data set D; wherein the preprocessing includes missing value processing, outlier detection and correction, and data standardization to ensure data quality and consistency.
[0132] S42. Variable conversion is performed on the capital expenditure data C and the operation and maintenance cost data O before time series analysis. Optionally, the conversion method may adopt logarithmic transformation, etc., to reduce the skewed distribution of the data, as shown below:
[0133] C′=log(C+1),O′=log(O+1)
[0134] Among them, C' represents the converted capital expenditure data, and O' represents the converted operation and maintenance cost data;
[0135] S43. A time lag model is used to identify the lag effect between the converted capital expenditure data C' and the converted operation and maintenance cost data O', which is expressed as follows:
[0136] O' t =α+βC' t-L +∈ t
[0137] Where L represents the lag period, α and β are model parameters, ∈ t is the error term, and t represents time.
[0138] S5. Use machine learning classification algorithms to detect and identify abnormal data, including:
[0139] S51. Integrate the financial data of the power system with other relevant data to form a comprehensive data set, use a deep autoencoder to learn high-level feature representation from the comprehensive data set, and use a reconstruction error-based method to calculate the anomaly score of each data point; wherein the anomaly score is the Euclidean distance between the input data and the reconstructed data, expressed as follows:
[0140]
[0141] Where x is the original data point, is the reconstructed data point;
[0142] S52, perform statistical analysis on the abnormal scores S(x) of all data points in the training set, draw a distribution histogram of the abnormal scores, and calculate the basic statistics of the distribution, and then calculate the threshold τ based on the statistics of the abnormal score distribution to identify potential abnormal data; wherein the threshold τ is calculated as follows:
[0143] τ=μ+kσ
[0144] Among them, k is a constant preset according to the anomaly ratio, which is used to adjust the strictness of the threshold. In practice, the value of k can be adjusted according to the anomaly ratio expected to be detected.
[0145] Considering that the characteristics of different power system financial data sets may be different, this step further adaptively adjusts the value of k within a certain range through cross-validation to achieve the best anomaly detection performance.
[0146] S53, preliminarily label each data point in the data set according to the calculated threshold value τ, if the anomaly score S(x) of the current data point is higher than the threshold value τ, label it as abnormal; otherwise, label it as normal;
[0147] S54. Select a small number of data points (including data points initially marked as abnormal and normal) for manual review to obtain accurately labeled data, use the accurately labeled data as a seed set to train a semi-supervised learning model, and then use the semi-supervised learning model to predict the unlabeled data to expand the seed set.
[0148] S6. Based on the feedback results of anomaly detection, the Actor-Critic network in reinforcement learning is used to continuously adjust and optimize the detection strategy and model parameters.
[0149] Specifically, this step adopts a reinforcement learning-based architecture, which includes an intelligent agent, an environment, a set of actions, states, and reward signals. The intelligent agent represents the anomaly detection model, and the environment is the power system financial data and its anomaly detection task.
[0150] State (S) definition: The state is an encoding of the current model performance and data characteristics, including but not limited to model accuracy, recall, and data change rate. For example, the state can be represented by a vector, S = [accuracy, recall, data_change_rate].
[0151] Action (A) definition: An action defines a set of operations that can be performed, aiming to adjust model parameters or select different data processing strategies. Actions include changing the learning rate, adjusting the number of layers in the network structure, selecting feature extraction methods, etc. Each action is encoded by a continuous value or a discrete value.
[0152] Reward (R) design: The reward function is the key in reinforcement learning and is used to evaluate the effect of performing a specific action. The reward function takes into account the improvement of model performance and the cost of the action, and the expression is:
[0153] R=α·(Δaccuracy+Δrecall)-β·Cost
[0154] Among them, Δaccuracy and Δrecall represent the changes in accuracy and recall respectively, Cost represents the cost of executing the action, and α and β are weight coefficients used to balance performance improvement and cost.
[0155] Specifically, the Deep Deterministic Policy Gradient (DDPG) algorithm is used to optimize the anomaly detection of power financial data using the Actor-Critic network.
[0156] The Actor-Critic network includes a Critic loss function and an Actor loss function, wherein the Critic loss function L CriticThe mean square error (MSE) loss is usually used to evaluate the prediction accuracy of the value function. For power financial data, the loss function can add the weight of abnormal data to emphasize the importance of abnormal detection performance, as shown below:
[0157]
[0158] Among them, w i represents the weight dynamically adjusted according to the abnormality of data point i, y i represents the target value, which is calculated by the reward signal and the target critic network; Q(s i ,a i ∣θ Q ) indicates that the Critic network uses parameter θ Q Evaluation in state i Take action a i The value of y i Indicates the target value;
[0159] The Actor loss function L Actor , the goal of the actor is to maximize the expected reward of the critic evaluation. In the application of power financial data, the direction of action generation can be optimized by adjusting the actor loss function to ensure that the action can effectively improve the performance of anomaly detection. The actor's loss function can be expressed as the negative average of the value evaluation of the action generated by the critic network for the current strategy, expressed as follows:
[0160]
[0161] Among them, Q(s i ,π(s i ∣θ π )|θ Q ) represents the value of the Critic network evaluation, where π(s i ∣θ π ) is determined by the Actor network in state s i The best action to take under the current policy π and the Actor's parameters; θ Q and θ π Represent the parameters of the Critic and Actor networks respectively.
[0162] As an embodiment of the present invention, during the training process, a dynamic learning rate adjustment strategy based on performance feedback can be adopted for the optimization of the Actor and Critic networks. For example, if an improvement in anomaly detection performance is detected, the learning rate is increased to accelerate the learning process; conversely, if the performance decreases, the learning rate is reduced to stabilize the training. In order to prevent overfitting, especially when processing high-dimensional power financial data, regularization techniques such as Dropout or L2 regularization can be added to the network structure to improve the generalization ability of the model.
[0163] The special design and optimization of the network structure and loss function in the DDPG algorithm enable the algorithm to better adapt to the characteristics of power system financial data and improve the accuracy and efficiency of anomaly detection. With the combination of these innovations, this step has significant advantages and application potential in the field of power financial data processing and anomaly detection.
[0164] S7. Integrate the detection and identification structure of abnormal data and user feedback into the system optimization cycle, and continuously iterate and update the model, including:
[0165] S71. Conduct an in-depth analysis of the periodic characteristics of the power system financial data, and use the autocorrelation function to identify the periodic pattern of the data; wherein the calculation formula of the autocorrelation function ACF(k) is:
[0166]
[0167] Where T represents the length of the time series, X t represents the value of financial data at time t, Represents X t The mean of , k represents the lag coefficient;
[0168] S72. Based on the results of the periodic analysis, use moving average filtering and standard deviation threshold method to identify abnormal patterns.
[0169] Specifically, based on the results of periodic analysis, the moving average filter (MAF) and standard deviation threshold method are used to identify abnormal patterns. If the difference between the financial data at a certain point in time and its periodic expected value exceeds the set standard deviation threshold, the data point will be marked as a potential anomaly.
[0170] S73, performing periodic analysis based on the results of the abnormal mode, and adjusting system parameters for iterative updating;
[0171] Specifically, the results of anomaly detection are fed back to the system, especially those data points marked as potential anomalies, to analyze the periodic characteristics of their occurrence and the similarity with historical anomaly patterns. Based on the results of the feedback analysis, the system parameters are adjusted, such as the window size or standard deviation threshold of the MAF, to better adapt to the periodic changes of the data and capture abnormal patterns. The above analysis, identification, feedback and adjustment process is repeated periodically to form a closed-loop iterative update mechanism. Through continuous iteration, the system can adaptively optimize parameter settings and improve the detection performance of anomalies in power system financial data.
[0172] This step makes full use of the periodic characteristics of power system financial data and optimizes the anomaly detection process through statistical methods and control theory principles. This physics-based solution does not rely on complex deep learning models, is easy to implement and deploy, and can effectively adapt to changes in data characteristics and improve the accuracy and efficiency of anomaly detection. It is particularly suitable for scenarios with limited resources or restrictions on the application of deep learning models, providing an efficient and reliable data analysis tool for power system financial management.
[0173] In a second aspect of the present invention, a financial data anomaly detection system based on artificial intelligence is provided, comprising a computer-readable storage medium and a processor, wherein the computer-readable storage medium is used to store an executable program; the processor is used to read the executable program stored in the computer-readable storage medium and execute the above-mentioned financial data anomaly detection method based on artificial intelligence.
[0174] In summary, the present invention, a method and system for detecting anomalies in financial data based on artificial intelligence, constructs an intelligent and adaptive power financial data anomaly detection system, aiming to comprehensively solve the complex challenges in the financial data management of power systems. First, through the data preprocessing and feature extraction steps, the system can effectively handle the diversity and complexity of the financial data of the power system, laying a solid foundation for subsequent in-depth analysis. Then, by constructing a periodic load forecasting model, conducting a comprehensive analysis of multidimensional data, and analyzing the correlation between capital expenditures and operation and maintenance costs, the system deeply explores the complex relationship between financial data and external factors, and accurately identifies abnormal data points based on the financial structure characteristics of the power system. These steps support each other and jointly improve the accuracy and efficiency of anomaly detection.
[0175] Subsequently, the system uses a machine learning classification algorithm to integrate the above analysis results through anomaly detection and identification steps to efficiently and accurately identify abnormal patterns in financial data. The reinforcement learning optimization engine continuously adjusts and optimizes the detection strategy and model parameters based on the feedback results of anomaly detection, realizing the self-learning and adaptability of the detection system, and further improving the efficiency and accuracy of long-term operation. Finally, through result feedback and system iteration steps, the system can self-optimize and update according to actual operating results and user needs, ensuring long-term stable and efficient operation. The entire solution closely combines data preprocessing, deep analysis, anomaly detection, self-optimization and feedback iteration to form an organic whole, aiming to provide a comprehensive, efficient and intelligent financial data anomaly detection solution for the power system.
[0176] The above disclosures are only some preferred embodiments of the present invention, which certainly cannot be used to limit the scope of rights of the present invention. Ordinary technicians in this field can understand that all or part of the processes of the above embodiments and equivalent changes made according to the claims of the present invention are still within the scope of the invention.
Claims
1. A financial data anomaly detection method based on artificial intelligence, characterized in that: The method comprises: S1. Obtain the financial data of the power system and perform data cleaning and normalization processing on the financial data of the power system to obtain financial data, then use adaptive window technology, statistical characteristic calculation and event recognition enhancement algorithm to extract key time features, and then use the autoencoder based on deep learning to reduce the data dimension, and optimize the autoencoder parameters through reinforcement learning; wherein, the original data set is X, the normalized data is X', and the normalization function is f(·). For any data point x∈X, the data cleaning and normalization processing are expressed as follows: Among them, μ and σ represent the dynamic mean and standard deviation of the data in x respectively; S2. Construct a periodic load forecasting model based on long and short-term neural networks to capture and predict the periodic changes of power system financial data, introduce seasonal adjustment to calculate the adjusted financial data, and integrate the time series features and external influencing factors learned from the long and short-term neural networks in the feature fusion layer of the long and short-term neural networks, input them into the fully connected layer, design a loss function based on the periodic weights of power system financial data, and use the Adam optimizer to dynamically adjust the learning rate; wherein, the loss function L is expressed as follows: Among them, w t is a periodic weight factor based on time t, N represents the number of samples, X' t represents the actual financial data value after seasonal adjustment, represents the predicted financial data value; in addition, the periodic weight factor is expressed as follows: Among them, P represents the cycle length, φ is the cycle phase offset, and α is the weight adjustment factor, which is used to control the influence of the periodic weight; the dynamic adjustment of the learning rate using the Adam optimizer is expressed as follows: Among them, η new is the adjusted learning rate, η base is the basic learning rate, β is the learning rate adjustment factor, which is used to control the amplitude of the learning rate change; S3. The financial data is formed into a financial data set D, and then the financial data set D is standardized to obtain features. Then, the kernel method is used to expand the features to calculate the nonlinear relationship and hidden mode of the financial data. Then, based on the processed features, a multidimensional association graph G = (V, E) is constructed, where the node V represents the different dimensional features of the power financial data, and the edge E represents the strength of the association between different features. Then, based on the graph embedding technology, the multidimensional association graph is converted into a low-dimensional vector space, and then the features that contribute most to the prediction task are selected through the feature selection algorithm. S4, using causal reasoning and association rule learning techniques to analyze the relationship between these data; S5. Use machine learning classification algorithms to detect and identify abnormal data; S6. Based on the feedback results of anomaly detection, the Actor-Critic network in reinforcement learning is used to continuously adjust and optimize the detection strategy and model parameters; S7. Integrate the detection and identification structure of abnormal data and user feedback into the system optimization loop, and continuously iterate and update the model.
2. The method for detecting anomalies in financial data based on artificial intelligence according to claim 1, characterized in that: The adaptive window technology indicates that the set of change points {cp1, cp2, ..., cp n }, and then divide the time window according to these change points; The statistical characteristic calculation means calculating the statistical characteristic S(T) in each adaptive window. i ), where the statistical characteristic S(T i Including mean(T i ), variance var(T i ), trend(T i ), which is expressed as follows: S(T i )={mean(T i ),var(T i ),trend(T i ),…} Among them, T i represents the data sequence within time window i; The event recognition enhancement algorithm uses text analysis technology to extract electricity-related event labels from financial reports and market news, and incorporates the event labels into the model as additional features.
3. The method for detecting anomalies in financial data based on artificial intelligence according to claim 1, characterized in that: The loss function L(X,E) of the autoencoder in S1 decode (E encode (X))) represents the following: L(X,E decode (AND encode (X)))=MSE(X,E decode (AND encode (X)))+λ||θ|| 2 Where X represents the raw financial data input to the autoencoder; E encode represents the encoding part of the autoencoder, which is responsible for converting the input data into a low-dimensional representation; E decode represents the decoding part of the autoencoder, which is used to restore the low-dimensional representation to the original data format; MSE represents the mean square error; λ is the regularization parameter, and θ is the parameter of the autoencoder.
4. The method for detecting anomalies in financial data based on artificial intelligence according to claim 1, characterized in that: The adjusted financial data after introducing seasonal adjustment is expressed as follows: Among them, X t Represents the original data at time t; S t Represents seasonal factors, based on the same historical data The average value of the section is obtained; X' t Denotes seasonally adjusted data.
5. The method for detecting anomalies in financial data based on artificial intelligence according to claim 1, characterized in that: In S3, the financial data set D is standardized as follows: Among them, d' i represents the processed data point, and the data point d i ∈D,μ i and σ i Represent the mean and standard deviation of feature i respectively; The kernel method is used to expand the features and calculate the nonlinear relationship and hidden pattern of financial data, which is expressed as follows: Among them, φ(d' i ) represents the feature d' i The new representation of the nonlinear relationship expression of financial data is enhanced by kernel method transformation; d' i represents the preprocessed financial data features; c represents the center of the kernel function, and σ represents the width parameter of the kernel function; Then, based on the graph embedding technology, the multi-dimensional association graph is transformed into a low-dimensional vector space, which is expressed as follows: Among them, p(d' i ,d′ j ) represents the joint probability distribution, p(d' i ) and p(d′ j ) represents the marginal probability distribution; Then, the feature selection algorithm is used to select the features that contribute most to the prediction task, as shown below: L=α·L pred +(1-a)·L graph L pred represents the prediction error term, L graph represents the graph regularization term, and α represents the weight parameter that adjusts the importance of both.
6. The method for detecting anomalies in financial data based on artificial intelligence according to claim 1, characterized in that: The S4 specifically includes: S41, integrating the capital expenditure data C of the power system and the operation and maintenance cost data O to form a unified data set D = {C, O}, and preprocessing the data set D; S42. Variable conversion of capital expenditure data C and operation and maintenance cost data O before time series analysis is performed as follows: C′=log(C+1),O′=log(O+1) Among them, C' represents the converted capital expenditure data, and O' represents the converted operation and maintenance cost data; S43. A time lag model is used to identify the lag effect between the converted capital expenditure data C' and the converted operation and maintenance cost data O', which is expressed as follows: O' t =α+βC' t-L +∈ t Where L represents the lag period, α and β are model parameters, ∈ t is the error term, and t represents time.
7. The method for detecting anomalies in financial data based on artificial intelligence according to claim 1, characterized in that: The S5 specifically includes: S51. Integrate the financial data of the power system with other relevant data to form a comprehensive data set, use a deep autoencoder to learn high-level feature representation from the comprehensive data set, and use a reconstruction error-based method to calculate the anomaly score of each data point; wherein the anomaly score is the Euclidean distance between the input data and the reconstructed data, expressed as follows: Where x is the original data point, is the reconstructed data point; S52, perform statistical analysis on the abnormal scores S(x) of all data points in the training set, draw a distribution histogram of the abnormal scores, and calculate the basic statistics of the distribution, and then calculate the threshold τ based on the statistics of the abnormal score distribution to identify potential abnormal data; wherein the threshold τ is calculated as follows: τ=μ+kσ Among them, k is a constant preset according to the abnormal proportion, which is used to adjust the strictness of the threshold; S53, preliminarily label each data point in the data set according to the calculated threshold value τ, if the anomaly score S(x) of the current data point is higher than the threshold value τ, label it as abnormal; otherwise, label it as normal; S54. Select a small number of data points for manual review to obtain accurately labeled data. Use the accurately labeled data as a seed set to train a semi-supervised learning model. Then use the semi-supervised learning model to predict the unlabeled data to expand the seed set.
8. The method for detecting anomalies in financial data based on artificial intelligence according to claim 1, characterized in that: The Actor-Critic network includes a Critic loss function and an Actor loss function, wherein the Critic loss function L Critic It is used to evaluate the prediction accuracy of the value function and add the weight of abnormal data, which is expressed as follows: Among them, w i represents the weight dynamically adjusted according to the abnormality of data point i, y i represents the target value, which is calculated by the reward signal and the target critic network; Q(s i ,a i ∣θ Q ) indicates that the Critic network uses parameter θ Q Evaluation in state i Take action a i The value of y i Indicates the target value; The Actor loss function L Actor It is expressed as follows: Among them, Q(s i ,π(s i ∣θ π )|θ Q ) represents the value of the Critic network evaluation, where π(s i ∣θ π ) is determined by the Actor network in state s i The best action to take under the current policy π and the Actor's parameters θ π θ Q and θ π Represent the parameters of the Critic and Actor networks respectively.
9. The method for detecting anomalies in financial data based on artificial intelligence according to claim 1, characterized in that: The S7 specifically includes: S71. Conduct an in-depth analysis of the periodic characteristics of the power system financial data, and use the autocorrelation function to identify the periodic pattern of the data; wherein the calculation formula of the autocorrelation function ACF(k) is: Where T represents the length of the time series, X t represents the value of financial data at time t, Represents X t The mean of , k represents the lag coefficient; S72. Based on the results of the periodic analysis, use a moving average filter and a standard deviation threshold method to identify abnormal patterns; S73. Perform periodic analysis based on the results of the abnormal pattern and adjust system parameters for iterative update.
10. A financial data anomaly detection system based on artificial intelligence, comprising a computer-readable storage medium and a processor, characterized in that: The computer-readable storage medium is used to store an executable program; the processor is used to read the executable program stored in the computer-readable storage medium and execute the artificial intelligence-based financial data anomaly detection method as described in any one of claims 1-9.
Citation Information
Patent Citations
Federal learning-based power data anomaly detection method
CN116451117A
Artificial intelligence management system based on cross-platform data interaction
CN117271981A
Metering chip anomaly detection method and system based on artificial intelligence
CN117574308A
Cited By
Bidding and tendering supervision system for engineering project
CN119130622A
Vehicle insurance intelligent application method and platform based on cloud side end
CN119205374A
Audit monitoring method and system based on big data
CN119251004A
Abnormal data monitoring method and system based on artificial intelligence
CN119293491A
An abnormal data monitoring method and system based on artificial intelligence
CN119293491B
