Yangtze river main stream abnormal water level data identification method based on meta learning
By using a meta-learning approach combined with FCM and MAML models, the problem of insufficient generalization ability of water level data identification models in different regions of the Yangtze River Basin was solved. This enabled the identification of abnormal water level data from a large number of stations with data from only a few stations, thus improving the identification rate and adaptability.
Patent Information
- Application Number
- CN202311189069.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-15
- Publication Date
- 2026-01-16
- Estimated Expiration
- 2043-09-15
AI Technical Summary
Existing abnormal water level data identification models cannot adapt to water level data from stations in different areas of the Yangtze River Basin, have poor generalization ability, and outliers in the water level data from automated monitoring equipment affect forecasting decisions.
A meta-learning-based approach is adopted, combining the FCM outlier detection model and the MAML model. Through meta-training and meta-testing tasks, prior knowledge is extracted and adapted to new scenarios, thereby improving the model's generalization ability and identifying abnormal water level data.
It has been developed to identify abnormal water level data applicable to a wide range of stations in the Yangtze River Basin, based on training data from a few stations. This has improved the recognition rate and generalization ability, and reduced the impact of outliers on forecasting decisions.
Smart Images

Figure CN117312910B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of water level data analysis, and particularly relates to a Yangtze River trunk stream abnormal water level data identification method based on meta-learning. BACKGROUND
[0002] The Yangtze River trunk stream has the characteristics of wide range and large drop, and an xx unit has built multiple telemetry stations in the Yangtze River basin. The telemetry station plays the role of a "long-range eyes" and "ears" of the Yangtze River water regime monitoring, and the water level sensor inside it monitors the water level of the Yangtze River basin at all times. However, due to the problem of large spacing between telemetry stations in the Yangtze River basin, the water level data measured by different telemetry stations in the upper reaches, the middle reaches and the lower reaches of the Yangtze River have large differences, and the existing abnormal identification model cannot well adapt to the abnormal identification task of water level data of different regional stations. Specifically, the identification model trained by the water level data of a specific station generally has good effect on the abnormal identification of water level data of the station or nearby stations, but if it is applied to the data of stations far away from its location, the effect of water level data abnormal identification will be significantly worse. In other words, the existing abnormal water level data identification model has poor generalization ability and cannot adapt to the abnormal identification task of water level data of stations with large range and large drop in the whole Yangtze River basin.
[0003] In addition, there are many abnormal values in the water level data collected by the water level sensors of the current automatic monitoring equipment, which will affect the normal forecast decision judgment. In view of this phenomenon, most scholars improve intelligent equipment, machine learning algorithm, and establish monitoring model to improve the measurement water level precision and intelligent judgment level. At present, many researchers propose to integrate self-learning algorithm into singular value elimination-La Rada criterion for detection of abnormal water level values, effectively eliminate abnormal values in water level data through smoothing processing of collected data, and will not affect the overall trend of the curve, but this method has poor migration ability and often has poor effect when applied to other stations.
[0004] There is also a single antenna based GNSS interferometric reflectometry technology in the prior art to retrieve monitoring water level, and the retrieval result is compared and analyzed with the measured data. This method realizes the accuracy and automation of water level reading compared with the traditional method, and at present, this high-tech is only used for research and experiment in special research institutes and scientific research institutions, and has not been completely popularized in general applicability. SUMMARY
[0005] To solve the technical problem that the current abnormal data identification method cannot be well applied to abnormal data identification of water level data of different stations due to the large distance between water level station sites in the Yangtze River Basin, the present application provides a Yangtze River trunk stream abnormal water level data identification method based on meta-learning, which can train an abnormal identification model applicable to water level data of other stations based on water level data of a few stations, and can achieve good identification effect and strong generalization ability of the model.
[0006] The technical scheme adopted by the present application is:
[0007] The Yangtze River trunk stream abnormal water level data identification method based on meta-learning comprises the following steps:
[0008] Step 1: identifying abnormal water level data based on a FCM outlier detection model;
[0009] Step 2: based on a meta-learning MAML model, dividing the meta-learning task into a meta-training task and a meta-testing task;
[0010] Step 3: in the meta-training task stage, designing multiple task training FCM outlier detection models to obtain FCM outlier detection model initialization parameters θ;
[0011] Step 4: in the meta-testing task stage, fine-tuning the FCM clustering model initialization parameters θ through support set data to predict query set node categories and detect whether the nodes are abnormal.
[0012] In step 1, in the FCM outlier detection model, the clustering objective function is as shown in formula (1):
[0013]
[0014] J m represents the distance between each sample and each cluster center and its membership μ ij square weighted sum; wherein m∈[1,+∞] is a weighted exponent; x k represents the kth sample point; v i represents the ith cluster center; ||·|| represents the calculation of the Euclidean distance; C is the number of cluster categories; N represents the total number of sample points; v i is the ith cluster center, V=(v1,v2,...,v c ) is the C cluster centers.
[0015] The first step of the FCM clustering algorithm: generally initialize the number of cluster categories C, 2≤C≤N, N is the number of data, set the iteration stop threshold ξ, initialize the cluster center v0, the cluster center set is V, and set the iteration counter b=0;
[0016] Step 2: calculating or updating μij :
[0017]
[0018] x j denotes the jth sample point; v i denotes the ith cluster center; v k denotes the kth cluster center.
[0019] The third step: updating the cluster center V b+1 :
[0020]
[0021] (μ ij ) m denotes the membership degree μ ij m times weighted.
[0022] The fourth step: if ||V b -V b+1 ||≤ξ, the algorithm stops, otherwise let b=b+1, continue to execute the second step.
[0023] Based on formula (2), (3), repeatedly modify the cluster center, data membership to classify data, when the algorithm converges, the cluster center of each class and the membership of each sample to each node class can be obtained, in the present application, the node class is normal point and abnormal point, thereby completing fuzzy clustering division, then the points with high similarity between data will form a cluster, abnormal data will generally be far away from the cluster, normal data and abnormal data will be separated in the clustering result, as shown in the figure Figure 3 The blue points are the recognized normal points, the green points are the abnormal points recognized by the algorithm, and the yellow stars represent the final cluster center.
[0024] In the step 2, the meta-training task is used to extract prior knowledge, and the meta-testing task is used to adapt to new scenes; there are training sets and test sets in each task, the training set in each task is defined as a support set (Support Set), and the test set in each task is defined as a query set (Query Set).
[0025] In the step 2, the meta-learning MAML model is specifically as follows:
[0026] MAML(Model-agnostic meta-learning, model-agnostic meta-learning) is a model-agnostic meta-learning model, in other words, the model can be compatible with any model with gradient descent training, the way is to optimize the gradient direction vector of the parameter on each task, select a best gradient descent direction based on all tasks, and can be used for various learning problems, including clustering, classification, regression, etc. The goal of meta-learning is to train a model on different meta-training tasks, and then solve new learning tasks with only a small amount of training samples. The tasks designed in MAML can be divided into meta-training tasks and meta-testing tasks. Meta-training tasks are used to extract prior knowledge, and meta-testing tasks are generally new tasks to adapt to new scenarios. Each task has a training set and a test set. In order to avoid confusion with the name of the data set in machine learning, the training set in each task is defined as the support set, and the test set in each task is defined as the query set.
[0027] In step 2, the data set used by the meta-training task is the water level data measured by several stations in the middle reaches of the Yangtze River; the data set used by the meta-testing task is the water level data measured by several stations in the upper reaches of the Yangtze River. This is the requirement of MAML model design, to improve the generalization ability of the anomaly detection model, the data set in the meta-training task must be completely separated from the data set in the meta-testing task, and the anomaly detection model after training in the meta-training task can be fine-tuned in the new data set in the meta-testing task, which can better improve the adaptability of the model to different data sets.
[0028] Step 3 includes the following steps:
[0029] S3.1: Train the FCM anomaly detection model using the support set data of the meta-training task, and obtain the intermediate parameter θ of the FCM clustering model ′ , and use the intermediate parameter θ to predict the abnormal data in the query set data of the meta-training task; ′
[0030] S3.2: Calculate the loss value based on all query set data to update the model intermediate parameter θ ′ , when calculating the abnormal data of the query set data, the query set data is regarded as the support set data, and the support set data is regarded as the query set data;
[0031] S3.3: Update the initialization parameter θ based on the loss value of the query set data of all tasks.
[0032] In step 3, the meta-training set D1 consists of data from a telemetry station in the middle reaches of the Yangtze River.
[0033] Define the meta-training set D1 = {(v1, y1), (v2, y2), ..., (v...} i y i ), ..., (v N y N )}, where N is the number of samples in the meta-training set, and the range of N values is determined by the size of the dataset; v i Represents the sample point; y i Let y be the sample point category; define the set of data categories in the meta-training set as C1, then we have y i ∈C1; Randomly sample M meta-training tasks {T1, T2, ..., T} from D1. M}, T1, T2, ..., T M These represent the tasks in the meta-training process; each meta-training task is represented by a support set S. i and query set Q i composition;
[0034] The generation of the meta-training task includes the following steps:
[0035] First, randomly sample |C2| categories from the category set C1. Use these sampled categories as the total categories for this task, denoted as C0. i Through C i Able to obtain all belonging to C i Category nodes are represented as
[0036] Next, in order to simulate the N-way K-shot problem in few-shot learning, C... i K nodes are randomly sampled from each category. Since this is a small sample problem, K is relatively small. The resulting |C2|×K nodes are used as the support set S. i ;
[0037] Finally, P nodes are randomly selected from the remaining nodes to form the query set Q. i Supports collection S i and query set Q i Together they form the meta-training task T i That is, T i =S i +Q i .
[0038] Repeat the above steps M times to obtain M different meta-training tasks T1, T2, ..., T M .
[0039] Meta-training is as follows:
[0040] In the meta-training task T k , the support set data S k is sent into the FCM anomaly detection model fine-tuned by gradient descent, and the Loss function of the FCM anomaly detection model in the above formula (1) is used as the loss function, as shown in formula (4) below:
[0041]
[0042] k represents the kth task, and θ′ k is the intermediate process parameter of the FCM anomaly detection model; S k represents the support set data; represents the loss value of each anomaly data detection task, and in the meta-training task T k , the gradient descent method is used to update the initial parameter θ of the FCM anomaly detection model, as shown in formula (5).
[0043]
[0044] Wherein: α1 represents the task learning rate; θ′ k represents the optimal parameter on the task T k ; S k represents the support set data. The loss value of the kth task for the data set S k .
[0045] The above formula shows the process of single gradient descent, but in the actual experiment, multiple gradient descent is performed, and the number of gradient descent is determined according to the specific situation. The present application sets the number of iterations to 10.
[0046] Then the query set Q k in this task is sent into the model fine-tuned by formula (5), and the loss value is calculated using the FCM anomaly detection model Loss function, as shown in formula (6).
[0047]
[0048] represents the loss value function of the query set Q k .
[0049] One of the goals of MAML model is to obtain a good FCM model initialization parameter, which is suitable for multiple similar tasks, and can quickly adapt to different tasks using a small number of samples and a small number of gradient descent steps. Therefore, the query set loss of all tasks is added and gradient descent is performed. The best gradient descent direction based on all tasks is obtained as shown in formula (7), that is, the parameter θ is widely adapted to all task data, rather than a single task.
[0050] The meta-learning MAML model optimization method is shown in formula (5).
[0051]
[0052] Wherein: α2 is the meta-learning rate, which can simultaneously learn multiple meta-training tasks and comprehensively consider the optimization direction of gradient descent of each task to accelerate convergence.
[0053] In step 4, in the meta-test task phase, the initialization parameter θ is fine-tuned through the support set data in each task, which can be used to predict the query set node class, as follows:
[0054] Define the meta-test task as: T k-test = S mt + Q mt ,
[0055] Wherein: S mt = {v i1 , v i2 ,..., v is} = (x mt1 , y mt1 ), (x mt2 , y mt2 ),..., (x mts , y mts ), S mt is the support set in the meta-test task,
[0056] v i1 , v i2 ,..., v is respectively represent sample points; (x mt1 , y mt1 ), (x mt2 , y mt2 ),..., (x mts , y mts ) represent node values and node labels;
[0057] Q mt is the query set in the meta-test task, based on formula (1), according to S mLet t be used to calculate the loss value of the current fine-tuned FCM anomaly detection model, as shown in Equation (8):
[0058]
[0059] The dataset S represents mt The loss function; The loss function of the FCM anomaly detection model on the k-th task is represented by .
[0060] To obtain the appropriate meta-test task T k-test The parameter θ′ mt As shown in equation (9).
[0061]
[0062] α1 is the task learning rate; after updating the parameter θ′ mt Then, query set Q m The sample t is input into θ′ mt In the FCM anomaly detection model with parameters, the classification results of nodes can be obtained, and whether these nodes are abnormal can be detected.
[0063] This invention discloses a method for identifying abnormal water level data in the main stream of the Yangtze River based on meta-learning, with the following technical effects:
[0064] 1) This invention addresses the problem that the initialization parameters of the FCM anomaly detection model significantly affect its clustering effect. By combining the meta-learning model, better initialization parameters can be obtained, thereby improving the clustering effect and enhancing the anomaly data identification rate.
[0065] 2) This invention proposes an abnormal water level data identification method with good generalization ability. The method is based on the FCM anomaly identification model for anomaly identification and utilizes the characteristics of meta-learning model to improve the generalization ability of the FCM anomaly identification model, and has a good ability to identify abnormal data of different water level stations. Attached Figure Description
[0066] Figure 1 This is a flowchart of the process for training the FCM anomaly recognition model using the meta-learning MAML model of this invention.
[0067] Figure 2 This is a diagram illustrating the steps involved in generating the meta-training task of this invention.
[0068] Figure 3 This is a diagram showing the effect of the FCM clustering algorithm.
[0069] Figure 4 An outlier map for FCM clustering algorithm. Detailed Implementation
[0070] The application uses a meta-learning model to train an FCM anomaly identification model using a small amount of different site data in a meta-training task, so that the FCM anomaly identification model obtains good generalization capability initialization parameters, and through a small amount of support set (supplement of training set site data) data fine-tuning in a meta-test task, an abnormal water level data identification method capable of quickly adapting to new site data is obtained.
[0071] (I) FCM anomaly identification model:
[0072] The FCM anomaly identification model is a data clustering method based on optimization of an objective function, and the clustering result is the membership degree of each data point to the cluster center, which is represented by a numerical value. The disadvantage of the algorithm is that some parameters need to be set in the algorithm, and if the initialization of the parameters is not appropriate, the correctness of the clustering may be affected. The FCM anomaly identification model used in the application is used to identify abnormal points of water level data. The model can identify the data difference between normal data and abnormal data, thereby completing the identification of abnormal data. The clustering objective function is shown in formula (1) and formula (2):
[0073]
[0074] J m represents the distance between each sample and each cluster center and its membership μ ij square weighted sum, where m∈[1, +∞] is a weighted exponent; x k represents the kth sample point; v i represents the ith cluster center; ||·|| represents the calculation of the Euclidean distance, C is the number of cluster categories; N represents the total number of sample points; v i is the ith cluster center, V=(u1, v2,..., v c ) is the C cluster centers.
[0075] The first step of the FCM clustering algorithm generally initializes the number of cluster categories C, 2≤C≤N, N is the number of data, sets the iteration stop threshold ξ, initializes the cluster center v0, the cluster center set is V, and sets the iteration counter b=0.
[0076] The second step calculates or updates μ according to formula (2):
[0077]
[0078] The third step updates the cluster center V b+ according to formula (3):
[0079]
[0080] The fourth step is to determine whether the iteration is stopped if |V b -Vb+ If < ξ, the algorithm stops, otherwise let b = b + 1, continue to execute the second step.
[0081] (II) Meta-learning framework:
[0082] Meta-learning is mainly to model the ability of human beings to learn how to learn a new task, and to use the knowledge obtained from the original task as prior knowledge to help quickly learn new tasks. Existing research uses meta-learning to extract prior knowledge. Meta-learning not only enables the model to learn a certain task, but also enables the model to learn how to learn, so that when meta-learning is combined with other models, the other models can learn how to learn.
[0083] Meta-learning tasks can be divided into meta-training tasks and meta-testing tasks. Meta-training tasks are used to extract prior knowledge, and meta-testing tasks are generally new tasks to adapt to new scenarios. Each task has a training set and a test set. In order to avoid confusion with the name of the data set in machine learning, the training set in each task is defined as the support set, and the test set in each task is defined as the query set.
[0084] MAML (Model-agnostic meta-learning) is a model-agnostic meta-learning model, in other words, the model can be compatible with any model with gradient descent training, and can be used for various learning problems, including clustering, classification, regression, etc. The goal of meta-learning is to train a model in different meta-training tasks, and then use only a small amount of training samples to solve new learning tasks.
[0085] 1: Meta-learning MAML model:
[0086] The meta-learning MAML model directly trains the parameters of the FCM anomaly detection model, and a few steps of gradient descent on the small amount of data on the new task can achieve good generalization performance on the task. The core idea of the meta-learning MAML model is to obtain a better initialization parameter through training, so that any gradient descent FCM anomaly detection model can converge on a new task only relying on a small amount of data according to this initialization parameter.
[0087] The meta-learning MAML model training FCM anomaly detection model flow chart as shown in Figure 1
[0088] First, the FCM anomaly detection model is trained by using the support set data of the meta-training task, and the intermediate parameter θ' of the FCM anomaly detection model is obtained, and the intermediate parameter θ' is used to predict the abnormal data in the query set data of the meta-training task,
[0089] Then, the loss value based on all query set data is calculated to update the model intermediate parameter θ', and the same clustering anomaly recognition method is adopted when calculating the abnormal data of the query set data, and the loss value of each task based on the query set data can be obtained.
[0090] Finally, based on the loss value of the query set data of all tasks, an initialization parameter θ with generalization ability is obtained.
[0091] In the meta-test phase, the initialization parameter θ obtained in the meta-training phase is fine-tuned through a small amount of support set data of the meta-test task, and then the abnormality can be recognized in the meta-test query set data.
[0092] 2: Meta-learning task generation:
[0093] The content studied by the present application is based on the meta-learning MAML model, so it is necessary to design several meta-training tasks and meta-test tasks according to the meta-learning paradigm. The meta-test task designed in the present application is similar to the meta-training task, except that different data is used. The data set used for designing the meta-training task is the water level data measured at several stations in the middle reaches of the Yangtze River, and the data set used for designing the meta-test task is the water level data measured at several stations in the upper reaches of the Yangtze River. Only the design process of the meta-training task will be introduced in the following.
[0094] The meta-training set D1 is composed of data of a certain station in the middle reaches of the Yangtze River, and the meta-training set D1 is defined as {(v1, y1), (v2, y2),..., (vN, yN)}, N is the number of samples in the meta-training set, vN represents a sample point, yN is whether the sample point is abnormal, and the data class set C1 in the meta-training set is defined as C1, so yN C1. M meta-training tasks {T1, T2,..., TM} are randomly sampled from D1, and each meta-training task is composed of a support set S and a query set Q. i i N N i i i The generation steps of the meta-training task are described in M i i
[0095] Figure 2 Figure 2 As shown, firstly, |C2| categories are randomly sampled from the category set C1. The sampled categories are then used as the total categories for this task, denoted as C. i Through C i We can obtain all those belonging to C i Category nodes are represented as Next, in order to simulate the N-way K-shot problem in few-shot learning, C... i K nodes are randomly sampled from each category. Since this is a small sample problem, K is generally small. The resulting |C2|×K nodes are used as the support set S. i Finally, in P nodes are randomly selected from the remaining nodes to form the query set Q. i The size of P is generally not strictly required, and it supports sets S. i and query set Q i Together they form the meta-training task T i That is, T i =S i +Q i .
[0096] Repeating the above steps M times will yield M different meta-training tasks T1, T2, ..., T M It is worth noting that the meta-test task is performed only once, because the meta-test task is set up entirely according to the few-sample learning configuration, without any extra samples to generate different tasks.
[0097] 3: Meta-training:
[0098] In the meta-training task T k In this paper, the initialization parameter θ of the FCM anomaly detection model is updated using the gradient descent method, as shown in equation (3).
[0099]
[0100] Where: α1 represents the task learning rate, θ′ k Indicates in task T k The optimal parameters on, S k This indicates that the data set is supported. The above formula illustrates the process of a single gradient descent, but in actual experiments, multiple gradient descent iterations were performed. The number of iterations depends on the specific situation; in this invention, the number of iterations is set to 10.
[0101] The query set data Q kThe query set data can be regarded as the support set data in this method, and the original support set data in the task can be regarded as the query set data. The obtained node embedding is input into the FCM anomaly identification model, and the FCM model loss function is used to calculate the Loss loss value, as shown in formula (10).
[0102]
[0103] Wherein: ψ(i: θ) represents the class label predicted by the support set optimized model for sample node i, and the output result of the above formula can reflect the performance of the model on the query set after multiple gradient descent. It is not difficult to see that after the learning rate and the number of gradient descent steps are determined, the parameter θ' k is only related to the initialization parameter θ, so if a good initialization parameter θ that is easy to fine-tune can be obtained, a good parameter θ' k can be obtained through a small amount of gradient descent with a small amount of labeled sample data, and the recognition effect of the model on the query set will be better, and the learning efficiency will be improved.
[0104] The meta-learning MAML model optimizes the initialization parameter θ, and uses random gradient descent for optimization. In order to make the clustering model initialization parameter θ have generalization ability and quickly adapt to new tasks, rather than only applicable to a specific task, the optimization method is shown in formula (7).
[0105]
[0106] Wherein: α2 is the meta-learning rate. In order to speed up the convergence, multiple meta-training tasks can be learned at the same time, and the optimization direction of the gradient descent of each task is considered comprehensively. Formula (5) is also the core formula for optimizing the initialization parameter of the FCM clustering model of the meta-learning MAML model, which reveals the core strategy of parameter optimization. Here, the problem of multi-order gradient is involved, and in actual operation, the first-order gradient is used to approximate the second-order gradient.
[0107] 4: Meta-test:
[0108] In the meta-training phase, a good model initialization parameter θ with generalization ability can be obtained through the training of the water level data of the stations distributed in the region. The task design in the meta-test phase is similar to that in the meta-training phase, which will not be repeated here.
[0109] In the meta-test phase, the initialization parameter θ is fine-tuned through the support set data in each task, which can be used to predict the query set node class.
[0110] Define the meta-test task as T k-test = S mt + Q mt ;
[0111] Wherein: S mt =(v i1 v i2 , ..., v is}=(x mt1 y mt1 ), (x mt2 y mt2 ), ..., (x mts y mts ) represents the support set in the meta-test task, Q mt For the query set in the meta-test task, based on S m t is used to calculate the loss value of the FCM anomaly recognition model, as shown in Equation (11).
[0112]
[0113] Then, the same gradient descent steps as in equation (3) are used to obtain the appropriate gradient for this meta-test task T. k-test The parameter θ′ mt As shown in equation (9).
[0114]
[0115] After updating parameter θ′ mt Then, query set Q mt The sample input to θ′ mt In a model with parameters, the classification results of nodes can be obtained, which means that it is possible to detect whether these nodes are abnormal.
[0116] Based on formulas (2) and (3), the cluster centers and data membership degrees are repeatedly modified to classify the data. When the algorithm converges, the cluster centers of each class and the membership degrees of each sample to each node class (in this patent, the node classes are normal points and abnormal points) can be obtained, thus completing the fuzzy clustering partition. Then, points with high similarity between data will form a cluster, and abnormal data will generally be far away from the cluster. Normal data and abnormal data will be separated in the clustering results, such as Figure 3 The blue dots are the normal dots identified, while the green dots are the abnormal dots identified by the algorithm.
[0117] (III) Verification Implementation Examples:
[0118] This invention uses data from Shipai, Qinjiatuo, and Huanglingmiao stations, which are located upstream of the Sange area, as training data. The number of continuous time series data selected for each station is 50,000, and a segment of continuous time series data from Gezhouba Station No. 5 is selected as test data, with a data volume of 10,000.
[0119] Model recognition results are as followsFigure 4 As shown, the yellow points represent the identified normal points, the blue points represent the abnormal points, the abscissa represents time, and the ordinate represents the water level value. The overall abnormality identification rate of the model can reach 98.3%. From the figure, it can be seen that the abnormality identification rate of the model is very high, and the model can effectively identify the abnormal points in the water level data. Figure 4 It can be seen that the abnormality identification model based on meta-learning fundamentally performs better than the traditional threshold-based abnormality identification method. The threshold-based abnormality identification method can only be used in a certain specific station and a certain period. Because the fall of the Yangtze River basin is large, the water level values of most stations are different. At the same time, due to the large difference between the water levels in the flood season and the dry season, the water level value amplitude is large for different periods. The model method proposed in the present application is not affected by the station location and the flood season and dry season of the Yangtze River. It does not show that more than a certain threshold value is considered as an abnormal value. It only identifies the points that are more deviated as abnormal values. This is also affected by the selection of the FCM clustering algorithm to identify abnormal points.
Claims
1. A method for identifying abnormal water level data in the main stream of the Yangtze River based on meta-learning, characterized in that Comprising the following steps: Step 1: identifying abnormal water level data based on the FCM outlier detection model; Step 2: based on the meta-learning MAML model, the meta-learning task is divided into a meta-training task and a meta-testing task; Step 3: in the meta-training task stage, a plurality of task training FCM outlier detection models are designed to obtain FCM outlier detection model initialization parameters θ; Step 4: in the meta-testing task stage, the FCM clustering model initialization parameters θ are fine-tuned by the support set data to predict the query set node category and detect whether the node is abnormal. The step 3 comprises the following steps: S3.1: training the FCM outlier detection model using the support set data of the meta-training task, and obtaining the intermediate parameters θ' of the FCM clustering model, and using the intermediate parameters θ' to predict abnormal data in the query set data of the meta-training task; S3.2: updating the model intermediate parameters θ' based on the loss value of all query set data, and regarding the query set data as the support set data and regarding the support set data as the query set data when calculating the abnormal data of the query set data; S3.3: updating the initialization parameters θ based on the loss value of the query set data of all tasks; In the step 3, the meta-training set D1 is composed of data of a station in the middle reaches of the Yangtze River, Define the meta-training set D1 = {(v1, y1), (v2, y2), ..., (v...} i y i ), ..., (v N y N )}, where N is the number of samples in the meta-training set; v i Represents the sample point; y i Let y be the sample point category; define the set of data categories in the meta-training set as C1, then we have y i ∈C1; Randomly sample M meta-training tasks {T1, T2, ..., T} from D1. M }, T1, T2, ..., T M Each meta-training task set represents a support set S; each meta-training task is represented by a support set S. i and query set Q i composition; The generation of the meta-training task comprises the following steps: First, randomly sample |C2| categories from the category set C1. Use these sampled categories as the total categories for this task, denoted as C0. i Through C i Able to obtain all belonging to C i Category nodes are represented as Next, in order to simulate the N-way K-shot problem in small sample learning, K nodes are randomly sampled for each class in C i , and since the value of K is small in the small sample problem, the obtained |C2| x K nodes are taken as the support set S i ; Finally, in the remaining nodes randomly extract P nodes as the query set Q i , the support set S i and the query set Q i together constitute the meta-training task T i , that is, T i =S i +Q i ; The above step M is repeated times to obtain M different meta-training tasks T1, T2,..., TM M ; The meta-learning is specifically as follows: In the meta-training task T k The support set data Sk is input into the FCM anomaly detection model fine-tuned by gradient descent, and the Loss function of the FCM anomaly detection model in formula (1) above is used as the loss function, as shown in formula (4): k represents the kth task; θ is the FCM anomaly detection model initialization parameter; S k represents the support set data; represents the loss value of each anomaly data detection task, and the meta-training task T k In this way, the initialization parameter θ of the FCM anomaly detection model is updated using the gradient descent method, as shown in equation (5). where: a1 represents a task learning rate; θ' represents an optimal parameter on a task T k k k S represents support set data; The above formula shows the process of a single gradient descent; Then take the query set Q in this task k The loss value is fed into the model after fine-tuning using equation (5) and the loss value is calculated using the FCM anomaly detection model Loss function, as shown in equation (6). a loss value function representing a query set Q k a loss value function representing a query set Q The meta-learning MAML model optimization method is shown in formula (7); Wherein: α2 is the meta-learning rate; In the step 4, in the meta-testing task stage, the initialization parameters θ are fine-tuned by the support set data in each task, which can be used to predict the query set node category, and the specific steps are as follows: Define the test task as: T k-test = S mt + Q mt , wherein: S mt = {v i1 , v i2 ,..., v is} = (x mt1 , y mt1 ), (x mt2 , y mt2 ),..., (x mts , y mts ); S mt is the support set in the meta-test task, v i1 , v i2 ,..., v is represent sample points respectively; (x mt1 , y mt1 ), (x mt2 , y mt2 ),..., (x mts , y mts ) represent node values and node labels respectively; Q mt For the query set in the meta-test task, the loss value of the current FCM anomaly detection model after fine-tuning is calculated according to S m t, as shown in equation (8): a dataset S represented by mt a loss function of the FCM anomaly detection model; a loss function of the FCM anomaly detection model on the kth task; To obtain the appropriate meta-test task T k-test The parameter θ′ mt As shown in equation (9); a1 is the task learning rate; after updating the parameters θ' mt Then, the samples of the query set Q mt are input into the FCM anomaly detection model with parameters θ mt to obtain the classification results of the nodes and detect whether these nodes are abnormal.
2. The method of claim 1, wherein the method is characterized by: In the step 1, in the FCM outlier detection model, the clustering objective function is shown in formula (1): J m denotes the distance of each sample to each cluster center and its membership μ ij weighted sum of squares, where m ∈ [1, +∞] is the weighting exponent; x k represents the kth sample point; v i represents the ith cluster center; ||·|| represents the Euclidean distance; C is the number of cluster classes; N represents the total number of sample points.
3. The abnormal water level data identification method based on meta-learning of the middle reaches of the Yangtze River according to claim 2, characterized in that: The FCM clustering algorithm is specifically as follows: First step: initialize the number of clustering categories C, 2 ≤ C ≤ N, N is the number of data, set the iteration stop threshold ξ, initialize the clustering center v0, the clustering center set is V, and set the iteration counter b = 0; Step 2: Calculate or update μ according to equation (2) ij : x j denotes the jth sample point; v i denotes the ith cluster center; v k denotes the kth cluster center; Step 3: Update the cluster centers V according to formula (3) b+1 : (μ ij ) m denotes the mth power weighting of the membership degree μ ij Step 4: If ||V b -V b+1 ||≤ξ, the algorithm stops, otherwise let b = b + 1 and continue with Step 2. Based on formula (2) and formula (3), the clustering center and the data membership are repeatedly modified to classify the data. When the algorithm converges, the clustering center of each class and the membership of each sample to each node class are obtained, the node class is the normal point and the abnormal point, thereby completing the fuzzy clustering division. The points with high similarity between the data will form a cluster, the abnormal data will be far away from the cluster, and the normal data and the abnormal data will be separated in the clustering result.
4. The method of claim 1, wherein the method is characterized by: In the step 2, the meta-training task is used to extract prior knowledge, and the meta-testing task is used to adapt to new scenarios; there are training sets and test sets in each task, the training set in each task is defined as the support set (Support Set), and the test set in each task is defined as the query set (Query Set).
5. The method of claim 1, wherein the method is characterized by: In the step 2, the data set used by the meta-training task is water level data measured at several stations in the middle reaches of the Yangtze River; and the data set used by the meta-testing task is water level data measured at several stations in the upper reaches of the Yangtze River.
Citation Information
Patent Citations
Small sample fault diagnosis method based on task sorting meta learning
CN113837000A