An anomaly detection method for ocean pH data by integrating spatiotemporal feature stacking ensemble learning

By integrating spatiotemporal feature stacking ensemble learning methods, selecting base models using diversity and performance indicators, and constructing a spatiotemporal feature extraction module, the problems of low recall and insufficient generalization ability in marine data anomaly detection are solved, achieving more efficient anomaly data identification and adaptability.

CN120995319BActive Publication Date: 2026-01-30NATIONAL MARINE ENVIRONMENTAL MONITORING CENTRE
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511518967.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-23
Publication Date
2026-01-30
Estimated Expiration
2045-10-23

AI Technical Summary

Technical Problem

Existing technologies for detecting anomalies in marine data suffer from low recall and insufficient generalization capabilities, making it difficult to effectively identify and adapt to diverse marine environments and data distributions.

Method used

We adopt a stacked ensemble learning method that integrates spatiotemporal features. By combining a selective ensemble strategy with a stacked generalization framework, we select base models using Kappa statistics, Q statistics, TPR and TNR indices, and construct a spatiotemporal feature extraction module to extract temporal and spatial features. We then combine MLP and CNN for feature fusion and finally perform classification through a meta-model.

Benefits of technology

It improves the recall and generalization performance of marine data anomaly detection, enabling more comprehensive identification of anomaly patterns in marine data and adapting to the spatiotemporal variability of marine data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120995319B_ABST
    Figure CN120995319B_ABST
Patent Text Reader

Abstract

This invention relates to the field of marine data detection, specifically a method for detecting anomalies in marine pH data that integrates spatiotemporal feature stacking ensemble learning. It utilizes a selective ensemble strategy combined with a stacked generalization framework to fuse multiple base models, calculates the Kappa and Q statistics of the marine pH data, and uses TNR and TPR performance metrics to calculate the performance score of each base model, selecting the model corresponding to the peak value as the base model. A spatiotemporal feature extraction module is constructed to fuse temporal and spatial features, obtaining a spatiotemporal feature vector. Marine pH data is input into both the base models and the spatiotemporal feature extraction module. The extracted spatiotemporal features are combined with the label probabilities output by multiple base models to form a new feature vector. A meta-model knowledge enhancement network is then used to obtain classification results using this new feature vector, thus achieving the detection of marine pH data. This invention, by employing a spatiotemporal feature stacking ensemble learning method, solves the problems of low recall and insufficient generalization ability for anomaly data.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of marine data detection, and particularly relates to a marine pH data anomaly detection method based on spatiotemporal feature fusion and stacked ensemble learning. BACKGROUND

[0002] Marine data anomaly detection refers to a process of screening data by manual or computer-aided algorithm, eliminating abnormal data, and generating a high-quality data set. Manual quality control has strong flexibility and high accuracy, but it relies on the subjective experience of experts and is inefficient, which is difficult to meet the demand of large-scale data processing. Computer-aided algorithm usually adopts automatic quality control algorithm to preliminarily screen marine data, and then manually verifies the abnormal results of the preliminary screening, which not only ensures the accuracy but also greatly improves the quality control efficiency. Automatic quality control algorithm includes two types of methods based on rules and machine learning.

[0003] The rule-based method is the mainstream means of data quality control in international data centers, which mainly adopts established marine physicochemical rules or statistical rules for data checking, such as range checking, spike checking, and climate state checking. The rule-based method can flexibly combine various rules to form a rule set, and then establish a rule quality control process. Domestic and foreign research institutions such as China Argo Real-time Data Center, National Marine Information Center, and Institute of Atmospheric Physics and Ocean Research of Chinese Academy of Sciences, National Environmental Information Center of the United States National Oceanic and Atmospheric Administration, World Ocean Circulation Laboratory, and Hadley Meteorological Center of the United Kingdom have established their own rule quality control processes. Ren Huanping et al. integrated a variety of rules such as range checking, spike checking, and Reinhardt criterion, and proposed a quality control method for marine buoy temperature and salinity data, which was tested on the data of China offshore observation station buoy. Tan et al. studied a marine temperature data quality control method containing 14 rules, and constructed a local climatology range of vertical temperature gradient to reduce the false positive rate. In order to determine the appropriate rule combination, Good et al. developed a quality control framework for evaluating marine temperature profile data, and the experimental results showed that the recall rate of good data of the optimal rule combination method under the framework reached 90%, and the anomaly data detection rate was 50%. Although the existing methods have achieved good results, the rule-based method is still prone to false positives and false negatives. First, marine monitoring data is easily affected by marine environment and has strong nonlinearity, which is difficult to fully meet the assumptions of preset rules, such as assuming that the data is Gaussian distribution rule. Under abnormal sea conditions, the actual monitoring data may deviate from the normal distribution interval and be misjudged as abnormal. In addition, marine monitoring data has significant spatiotemporal variability, and the threshold of the rule method is relatively fixed and cannot dynamically adapt to the changes of data.

[0004] Machine learning-based methods can flexibly model complex data distributions and dynamically learn data anomaly features, and are a research hotspot in recent years. Jiang et al. improved the K-means clustering algorithm, redefined the proximity of marine monitoring data, and dynamically optimized the initial clustering center, reducing the false detection of Argo temperature and salinity anomaly data. Jiang et al. introduced density accessibility and dynamic layer selection strategy in K-medoids clustering, solved the problem of sensitive clustering center selection, and improved the recall rate of abnormal data. Zhang et al. proposed a method based on Gaussian mixture model (GMM) clustering and convex hull geometry detection for Argo temperature data profiles in the South China Sea, with an anomaly detection rate of 70%. Mieruch et al. used a multilayer perceptron (MLP) neural network to quality control the temperature data set in the Mediterranean Sea, proving the effectiveness of neural networks in ocean data quality control. Subsequently, Liu Yulong et al. built a multi-classification model for sea surface temperature monitoring data quality labels based on MLP and deep neural network (DNN). Existing methods generally use a single model, which is difficult to capture complex anomaly patterns in marine monitoring data, and the recall rate of abnormal data is still not ideal, making it difficult to meet the requirements of practical application scenarios.

[0005] The prior art has great challenges in detecting abnormal data when dealing with marine data due to the significant imbalance between normal data and abnormal data and strong spatiotemporal variability of marine data. This imbalance and spatiotemporal variability make it difficult to accurately identify and distinguish the features of abnormal data, resulting in a low recall rate of abnormal data. The prior art is prone to miss a large number of true abnormal points when identifying abnormal data, and cannot effectively meet the high recall rate requirement of marine data anomaly detection, thereby limiting its application effect in marine data anomaly detection. Moreover, the prior art relies on a single model for anomaly detection, which has the limitation that it is difficult to comprehensively capture complex anomaly patterns in the data. Since the anomaly patterns in marine data are diverse, a single model may only be able to identify some types of anomalies, which makes the technology lack generalization ability when facing different environments and data distributions, making it difficult to adapt to diverse application scenarios, thereby limiting its widespread applicability in practical applications. Therefore, a method of fusing spatiotemporal feature stacking ensemble learning is needed to solve the problems of low recall rate of abnormal data and insufficient generalization ability. SUMMARY

[0006] The application provides a marine pH data anomaly detection method based on spatio-temporal feature stacking ensemble learning.

[0007] The technical means adopted by the application are as follows:

[0008] The marine pH data anomaly detection method based on spatio-temporal feature stacking ensemble learning comprises the following steps.

[0009] The Kappa statistic and the Q statistic of the marine pH data are calculated by using a selective integration strategy combined with a stacking generalization framework, and the performance score of each base model is calculated by combining the TNR and TPR performance indicators, and the model corresponding to the peak value is selected as the base model. The Kappa statistic and the Q statistic of the marine pH data are calculated, and the calculation process comprises the following steps. And The classification results of two different models are assumed, wherein a represents the number of data classified correctly by both models, d represents the number of data classified incorrectly by both models, b represents the number of samples classified correctly by model but incorrectly by model , and c represents the number of samples classified incorrectly by model but correctly by model . The calculation formula of the Kappa statistic is as follows.

[0010]

[0011] Wherein, represents the probability that the classification results of two models are consistent, and is called actual consistency, The probability that two models will agree on the classification result under random guessing is called stochastic consistency.

[0012] The Q statistic is used to quantify the consistency of the two models in classification errors, and its calculation formula is as follows:

[0013] For the base model and Based on the classification results and the true labels, the Kappa statistics for the minority and majority classes are calculated separately to obtain the Kappa statistics for the minority class. Kappa statistic on the majority class Perform Kappa statistic transformation:

[0014]

[0015]

[0016] in, express and The Kappa statistics of the two models after transformation on the minority class. express and Kappa statistics for both models after transformation on the majority class;

[0017] Introducing an unbalanced weighting factor and Weighting the Kappa statistic scores:

[0018]

[0019]

[0020] in, express and The Kappa statistics of the two models after transformation across all categories. and These represent the sample sizes for the minority class and the majority class, respectively.

[0021] Base model Weighted Kappa statistic with other base models Summing yields the base model. The sum of weighted Kappa statistics :

[0022]

[0023] Calculate separately The weighted Kappa statistics of each of the base models are calculated, and the sum of the weighted Kappa statistics of all base models is used as the denominator. The weighted Kappa statistics of each base model are then normalized to obtain the nth... Kappa statistic score of each basic model :

[0024]

[0025] For the base model and Based on the classification results and the true labels, the Q-statistics are calculated for the minority and majority classes respectively, yielding the Q-statistic for the minority class. Q statistic on the majority class Perform Q-statistic transformation:

[0026]

[0027]

[0028] in, express and The Q-statistics of the two models after transformation on the minority class, express and Q-statistics of the two models after transformation on the majority class;

[0029] Introducing an unbalanced weighting factor and Weight the Q statistic score:

[0030]

[0031]

[0032] in, express and The Q-statistics of the two models after transformation across all categories. and These represent the sample sizes for the minority class and the majority class, respectively.

[0033] Base model Weighted Q statistic with other base models Summing yields the base model. The sum of weighted Q statistics :

[0034]

[0035] Calculate separately The weighted Q-statistics of each of the base models are calculated, and the sum of the weighted Q-statistics of all base models is used as the denominator. The weighted Q-statistic of each base model is then normalized to obtain the result. i Q-statistic score of each base model :

[0036]

[0037] For each base model, the two performance metrics, TNR and TPR, are calculated, specifically including:

[0038] The TNR represents the proportion of samples correctly predicted as anomalous data by the model out of all actual anomalous data samples, i.e., the recall rate of anomalous data, calculated using the following formula:

[0039]

[0040] in, This indicates the number of outliers that the model correctly identified as outliers. This indicates the number of outlier data points that the model incorrectly identified as good data.

[0041] For the performance score, the TNR score is calculated based on the base model using the true label and classification result. TNR value ,Will The sum of the TNR values ​​of the ... i The TNR values ​​of each base model are divided into... :

[0042]

[0043] in, Represents the normalized i-th The TNR values ​​of each base model are worth scoring;

[0044] The TPR represents the proportion of samples correctly predicted as good data by the model out of all actual good data samples, i.e., the recall rate of good data, calculated using the following formula:

[0045]

[0046] in, This indicates the number of good data points that the model correctly identifies as good data points. This indicates the number of good data points that the model incorrectly identified as outliers.

[0047] For the performance score, the TPR score is calculated based on the base model using the true labels and classification results. TPR value of the i-th base model The sum of TPR values of all base models is taken as the denominator to normalize the TPR value of each base model to obtain the TPR value score of the i-th base model i

[0048]

[0049] Among them, denotes the normalized TPR value score of the i-th base model;

[0050] The Kappa statistic score, Q statistic score, TPR value score and TNR value score of the i-th base model The performance score of each base model is sorted from high to low, and the number of base models is increased one by one, and the corresponding model at the peak value is selected as the base model selected by the selective integration strategy;

[0051]

[0052] The performance score of each base model is sorted from high to low, and the number of base models is increased one by one, and the corresponding model at the peak value is selected as the base model selected by the selective integration strategy;

[0053] The space-time feature extraction module is constructed to extract time features and space features respectively; the time features and space features are fused to obtain a space-time feature vector; the marine pH data are input into the base model and the space-time feature extraction module respectively, the extracted space-time features and the label probabilities output by the plurality of base models are combined into a new feature vector, and the meta-model knowledge enhancement network uses the new feature vector to obtain a classification result, thereby realizing detection of marine pH data.

[0054] Further, in the extraction process, the timestamp is converted into a periodic feature vector by using the sine and cosine encoding method;

[0055]

[0056]

[0057] Among them, denotes the timestamp, denotes the period length of time, which measures the periodical change of data, and are the time features after sine and cosine encoding.

[0058] ​​​​​​​​​​Further, the spatial feature adopts a spherical coordinate conversion method in the extraction process to convert the longitude and latitude into three-dimensional spherical coordinates:

[0059]

[0060]

[0061]

[0062] wherein x, y, z are three-dimensional coordinate values converted by spherical coordinates, represents longitude, represents latitude.

[0063] The depth value is standardized to eliminate the difference between the spherical coordinate magnitude:

[0064]

[0065] wherein, and are the mean and standard deviation of the depth feature respectively, depth represents the depth index value of the pH data, represents the standardized depth feature; the spherical coordinates and the standardized depth feature value are spliced into a four-dimensional vector by using a feature splicing strategy:

[0066]

[0067] The four-dimensional spatial vector after splicing contains both spherical coordinates and depth features.

[0068] Further, when the time feature and the spatial feature are fused, the extracted time feature vector and the spatial feature vector are spliced, then the space-time interaction information is extracted by a fully connected MLP and is reduced in dimension, and the final space-time feature vector is output after nonlinear conversion by a ReLU activation function.

[0069] Compared with the prior art, the present application has the following advantages:

[0070] The marine pH data anomaly detection method fusing spatio-temporal feature stacking ensemble learning provided by the application fuses multiple base models by using a selective integration strategy combined with a stacking generalization framework, calculates Kappa statistics and Q statistics of marine pH data, calculates the performance score of each base model in combination with two performance indicators of TNR and TPR, and selects the model corresponding to the peak value as the base model; a spatio-temporal feature extraction module is constructed to extract time features and space features respectively; the time features and the space features are fused to obtain a spatio-temporal feature vector; the marine pH data are input into the base model and the spatio-temporal feature extraction module respectively, the extracted spatio-temporal features and the label probabilities output by the multiple base models are combined to form a new feature vector, and the new feature vector is used to obtain a classification result by using a meta-model knowledge enhancement network, so that the detection of marine pH data is realized.

[0071] The marine pH data anomaly detection method fusing spatio-temporal feature stacking ensemble learning provided by the application can effectively integrate the advantages of multiple machine learning models by using a base model selective integration strategy based on weighted diversity and performance indicators, so as to more comprehensively identify abnormal patterns in marine data and improve the generalization performance of marine data anomaly detection. In addition, by introducing the spatio-temporal feature extraction module, the method can effectively cope with the spatio-temporal variability of marine data, extract spatio-temporal abnormal patterns in marine data, identify more abnormal data, and thus improve the overall abnormal data recall rate.

[0072] Based on the above reasons, the application can be widely popularized in the field of marine data detection. BRIEF DESCRIPTION OF DRAWINGS

[0073] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description are some embodiments of the application, and for those skilled in the art, other drawings can also be obtained without creative labor.

[0074] Figure 1 The marine pH data anomaly detection method fusing spatio-temporal feature stacking ensemble learning in the application is a framework diagram.

[0075] Figure 2 The weighted Kappa statistics between machine learning models on the validation set in the embodiment of the application.

[0076] Figure 3 The weighted Q statistics between machine learning models on the validation set in the embodiment of the application.

[0077] Figure 4 The total score of the machine learning model on the validation set in the embodiment of the application.

[0078] Figure 5 For the performance index of different number of base model integration on the validation set in the embodiment of the application.

[0079] Figure 6 For the Kappa statistics between machine learning models in the embodiment of the application.

[0080] Figure 7 For the Q statistics between machine learning models in the embodiment of the application.

[0081] Figure 8 For the ROC curve (a) and AUC value (b) of machine learning models in the embodiment of the application.

[0082] Figure 9 For the ROC curve (a) and AUC value (b) of comparative models in the embodiment of the application. DETAILED DESCRIPTION

[0083] It should be noted that the embodiments and features of the embodiments in the application can be combined with each other without conflict. The application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0084] In order to make the purpose, technical scheme and advantages of the embodiments of the application clearer, the technical scheme of the embodiments of the application will be described clearly and completely below in combination with the drawings of the embodiments of the application. Obviously, the described embodiments are only part of the embodiments of the application, not all the embodiments. The description of the at least one exemplary embodiment is actually only illustrative, but not as any limitation on the application and its application or use. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the application.

[0085] It should be noted that the terms used herein are only for the purpose of describing specific embodiments, and are not intended to limit the exemplary embodiments according to the application. As used herein, the singular form is intended to include the plural form unless the context clearly indicates otherwise, and it should also be understood that when the terms "comprise" and / or "include" are used in the specification, there is a feature, step, operation, device, component and / or combination thereof.

[0086] The relative arrangement of parts and steps, numerical expressions, and numerical values set forth in these embodiments are not meant to limit the scope of the present application unless otherwise specifically indicated. It is also to be understood that the dimensions of the various parts shown in the drawings are not necessarily to scale, and that, for clarity, specific structural or functional details disclosed herein which are readily apparent to those of ordinary skill in the relevant arts have not been described in great detail. However, the technology, methods, and devices known to the relevant arts can not be discussed in detail herein. In all examples shown and discussed herein, any specific values are to be interpreted as merely exemplary, and not as a limitation. Thus, other examples of exemplary embodiments can have different values. It is to be noted that like reference numerals and letters refer to like items in the drawings, and thus, once an item is defined in one drawing, it need not be discussed further in subsequent drawings.

[0087] As Figure 1 illustrated, the present application provides a marine pH data anomaly detection method based on spatio-temporal feature fusion and stacking ensemble learning, comprising: fusing multiple base models by using a selective ensemble strategy combined with a stacking generalization framework, calculating Kappa statistics and Q statistics of marine pH data, and calculating performance scores of each base model in combination with two performance indicators of TNR and TPR, and selecting a model corresponding to the peak value as the base model.

[0088] The stacking framework improves the generalization ability of the overall model by fusing the prediction results of multiple base models, and thus its performance is highly dependent on the base models. If the prediction results of the base models are highly consistent, the effect of the ensemble model is often difficult to surpass that of a single model; on the contrary, if the prediction results of the base models have strong diversity and each has good performance, i.e., "good but different", the stacking can more effectively integrate the advantages of each model and improve the overall performance. However, in the task of anomaly detection of marine monitoring data, the serious imbalance of data will lead to the influence of the majority class dominant effect on the diversity measurement indicators Kappa statistics and Q statistics, making it difficult to effectively evaluate the prediction result diversity of the model on the minority class.

[0089] For the diversity score, when calculating Kappa statistics and Q statistics, the validation set data samples are divided according to the true labels, and the indicator values of the minority class (abnormal data) and the majority class (good data) are calculated respectively, and an imbalance weight factor is introduced to weight the two to obtain the corresponding diversity score. It is worth mentioning that the closer the values of Kappa statistics and Q statistics are to 1, the more similar the classification results of the two models are, i.e., the lower the diversity is, and the closer the performance indicator value is to 1, the higher the model performance is. In order to obtain the final score of the comprehensive diversity and performance and meet the subjective logic, Kappa statistics and Q statistics are transformed. Specifically, as a preferred embodiment of the present application, for each base model The calculation of the Kappa statistic and Q statistic for the calculated ocean pH data specifically includes:

[0090] Suppose for two different models and The classification results are given, where 'a' represents the number of data points correctly classified for both, 'd' represents the number of data points incorrectly classified for both, and 'b' represents the model score. Correct Divide Model The number of misclassified samples, where c is the model number. Correct Divide Model The number of misclassified samples, the formula for calculating the Kappa statistic is:

[0091]

[0092] in, The probability that two models achieve the same classification results is called actual consistency. The probability that two models will agree on the classification result under random guessing is called stochastic consistency.

[0093] The Q statistic is used to quantify the consistency of the two models in classification errors, and its calculation formula is as follows:

[0094] For the base model and Based on the classification results and the true labels, the Kappa statistics for the minority and majority classes are calculated separately to obtain the Kappa statistics for the minority class. Kappa statistic on the majority class Perform Kappa statistic transformation:

[0095]

[0096]

[0097] in, express and The Kappa statistics of the two models after transformation on the minority class. express and Kappa statistics for both models after transformation on the majority class;

[0098] Introducing an unbalanced weighting factor and Weighting the Kappa statistic scores:

[0099]

[0100]

[0101] wherein, denotes and the Kappa statistics of the two models after conversion on all categories, and the sample sizes of the minority class and the majority class, respectively;

[0102] The base model is weighted Kappa statistics is added to the weighted Kappa statistics of other base models, and the sum of the weighted Kappa statistics of the base model is obtained :

[0103]

[0104] The weighted Kappa statistics of base models are calculated respectively, and the sum of the weighted Kappa statistics of all base models is taken as the denominator, and the weighted Kappa statistics of each base model is normalized to obtain the Kappa statistics score of the base model :

[0105]

[0106] For the classification results of the base model and , according to the true label, the Q statistics on the minority class and the majority class are calculated respectively, and the Q statistics on the minority class and the Q statistics on the majority class are obtained, and the Q statistics conversion is performed:

[0107]

[0108]

[0109] wherein, denotes and the Q statistics of the two models after conversion on the minority class, denotes and the Q statistics of the two models after conversion on the majority class;

[0110] An imbalance weight factor and is introduced, and the Q statistics score is weighted:

[0111]

[0112]

[0113] wherein, denotes and the Q statistics of the two models after conversion on all categories, and respectively the number of samples of the minority class and the majority class;

[0114] The base model is added to the weighted Q statistics of other base models to obtain the sum of the weighted Q statistics of the base model :

[0115]

[0116] The weighted Q statistics of base models are calculated respectively, and the sum of the weighted Q statistics of all base models is summed as the denominator to normalize the weighted Q statistics of each base model to obtain the Q statistics score of the i th base model :

[0117]

[0118] The two performance indicators of TNR and TPR are calculated for each base model, specifically including:

[0119] The TNR represents the proportion of the number of samples correctly predicted as abnormal data by the model to the number of all actual abnormal data samples, that is, the recall rate of abnormal data, and the calculation formula is:

[0120]

[0121] wherein, denotes the number of abnormal data correctly judged as abnormal data by the model, denotes the number of abnormal data incorrectly judged as good data by the model;

[0122] For the performance score, the TNR value of the base model is calculated according to the true label and the classification result , and the sum of the TNR values of base models is taken as the denominator to normalize the TNR value of each base model to obtain the TNR value score of the i th base model :

[0123]

[0124] wherein, denotes the TNR value score of the normalized i-th base model; The TPR represents the proportion of the number of samples correctly predicted as good data by the model to the number of all actual good data samples, that is, the recall rate of good data, and the calculation formula is:

[0125]

[0126]

[0127] wherein, denotes the number of good data correctly judged as good data by the model, denotes the number of good data incorrectly judged as abnormal data by the model;

[0128] For the performance score, the TPR value of the base model is calculated according to the true label and the classification result, the sum of the TPR values of all base models is taken as the denominator to normalize the TPR value of each base model, and the TPR value score of the i-th base model is obtained : i

[0129]

[0130] wherein, denotes the normalized TPR value score of the i-th base model; The Kappa statistical quantity score

[0131] , the Q statistical quantity score , the TPR value score , and the TNR value score of the i-th base model are added as the performance score of the fusion diversity:

[0132]

[0133] The performance scores of each base model are sorted from high to low, the number of base models is increased one by one, and the corresponding model at the peak value is selected as the base model selected by the selective integration strategy.

[0134] ​​​​​​Ocean monitoring data usually contains multiple information such as time, space and physicochemical properties. These information not only contains independent spatio-temporal attributes, but also complex spatio-temporal interaction characteristics. For example, the pH value in ocean data may be jointly affected by time, longitude, latitude, depth and other factors, so when performing data anomaly detection, simply using the original data for modeling may not be able to fully capture these spatio-temporal variation characteristics. In order to solve this problem, the method proposes a spatio-temporal feature extraction module based on periodic encoding and CNN, which is used to extract high-dimensional spatio-temporal features from time, longitude, latitude and depth input data. These extracted spatio-temporal features can more effectively represent the spatio-temporal variation pattern of the data and provide more rich feature input for the machine learning model.

[0135] The spatio-temporal feature extraction module is constructed to extract time features and space features respectively; the time features and the space features are fused to obtain a spatio-temporal feature vector; in the specific implementation, as a preferred embodiment of the application, the time data usually has periodic variation characteristics in actual monitoring, such as daily tidal variation, seasonal temperature variation and long-term trend, etc. These periodic characteristics are of great significance for predicting the variation trend of data and identifying anomalies. However, the time feature input is usually in the form of a timestamp, representing the number of seconds from 1970-01-01 00:00:00 to a specific time. Although this time representation is a continuous numerical value, it cannot directly reflect the periodic pattern of time, such as the 24-hour cycle of each day and the 12-month cycle of each year. Therefore, simply using the timestamp as the input of the model may cause the model to be difficult to capture the periodicity of time, affecting the feature extraction effect. In the extraction process of time features, the timestamp is converted into a periodic feature vector by using the sine and cosine encoding method;

[0136]

[0137]

[0138] wherein, represents the timestamp, represents the period length of time, and is set to 30*24*3600 seconds, which is the period of nearly 3 buoy measurement data, and are the time features after sine and cosine encoding.

[0139] This encoding method maps the timestamp to a unit circle, so that the timestamp at the beginning of a time period will be mapped to 0 radian, and the timestamp at the middle of the period will be mapped to each radian on the unit circle, so that the model can identify the periodic variation of time.

[0140] In marine monitoring data, longitude, latitude and depth are key spatial features, which directly affect the spatio-temporal distribution and physical changes of data. However, there are certain differences between the representation of these spatial features and the input requirements of machine learning models. If longitude and latitude are directly used as model inputs, the position relationship of data points on the earth's surface may not be accurately described. Especially in global data processing, the change of longitude and latitude is not a linear relationship, and there are complex factors such as the change of earth's surface arc length. In the specific implementation, as the preferred embodiment of the application, the spatial feature adopts a spherical coordinate conversion method in the extraction process, which converts longitude and latitude into three-dimensional spherical coordinates:

[0141]

[0142]

[0143]

[0144] wherein x, y, z are three-dimensional coordinate values converted by spherical coordinates, represents longitude, represents latitude;

[0145] Through the above conversion formula, the original longitude and latitude data are mapped to a three-dimensional unit sphere, which is convenient for model to identify the real spatial distribution of data points on the earth's surface. In the profile data, depth is also an important spatial dimension. In order to fuse depth features with longitude and latitude features, the depth value is standardized to eliminate the difference between the magnitude of spherical coordinate and the magnitude of depth:

[0146]

[0147] wherein, and are the mean and standard deviation of the depth feature, depth represents the depth index value of pH data, represents the standardized depth feature; the feature splicing strategy is adopted to splice the spherical coordinates and the standardized depth feature value into a four-dimensional vector:

[0148]

[0149] The four-dimensional spatial vector after splicing contains both spherical coordinates and depth features. Then it is input into a one-dimensional CNN to gradually extract high-order spatial features through 3 convolution operations. In the first convolution operation, a convolution kernel with a size of 1 is used, and the convolution kernel is along the Sequence sliding, taking four values of each piece of data as an element, for each element position, the convolution kernel will perform a dot product operation with the input data, combining them into a single feature representation, extracting the local spatial features of a single data. In the next two convolutions, the convolution kernel size is set to 3, covering the adjacent three elements in the sequence, extracting the spatial features between adjacent points. Then an adaptive max-pooling layer is used to aggregate the features after convolution, and finally an MLP is used to map it to a final high-dimensional spatial feature vector. The fused spatial feature vector contains both horizontal spatial distribution information and vertical depth variation information.

[0150] Temporal and spatial features provide key data information from temporal and spatial dimensions, respectively. However, the quality of actual marine monitoring data is often affected by the interaction of temporal and spatial features, i.e. the mutual relationship between temporal changes and spatial positions often affects the physical and chemical properties of monitoring data. In practice, as a preferred embodiment of the present application, when the temporal and spatial features are fused, the extracted temporal feature vector and spatial feature vector are spliced and then passed through a fully connected MLP to extract spatio-temporal interaction information and reduce dimensionality. After nonlinear conversion by the ReLU activation function, the final spatio-temporal feature vector is output.

[0151] The marine pH data is input into the base model and the spatio-temporal feature extraction module, respectively. The extracted spatio-temporal features and the label probabilities output by the multiple base models are combined into a new feature vector, and the meta-model knowledge enhancement network uses the new feature vector to obtain the classification result, realizing the detection of marine pH data.

[0152] In practice, the meta-model knowledge enhancement network (Kolmogorov-Arnold networks, KAN) uses the technical means disclosed in the prior art, and the reference document Liu Z, Wang Y, Vaidya S, et al. Kan: Kolmogorov-arnold networks [J]. arXiv preprint arXiv:240419756, 2024.

[0153] Embodiment

[0154] This embodiment takes the pH data monitored by BGC-Argo buoys in global marine areas as the research object, and uses the stacking ensemble learning quality control method (ST-Stacking) that fuses spatio-temporal features to detect abnormal data. Figure 2 and Figure 3respectively, the weighted Kappa statistics and the weighted Q statistics between machine learning models on the validation set, through these diversity evaluation indicators, 5 base models with high diversity and good performance are selected from 9 candidate base models. DT (Decision Tree) is a decision tree, KNN (K-Nearest Neighbors) is K-nearest neighbor, RF (Random Forest) is random forest, GNB (Gaussian Naive Bayes) is Gaussian naive Bayes, XGB (Extreme Gradient Boosting) is extreme gradient boosting, LGB (Light Gradient Boosting Machine) is light gradient boosting machine, CatBoost (Categorical Boosting) is integrated boosting tree, NGB (Natural Gradient Boosting) is natural gradient boosting, and ADB (Adaptive Boosting) is adaptive boosting.

[0155] Figure 4 The total score of each model is shown, and the base model number is increased from high to low based on the score, and finally the base model combination is determined. Figure 5 For the performance indicators of different numbers of base models on the validation set, it is shown that when the number of base models reaches 5, the performance of the model reaches an optimal balance state. Figure 6 and Figure 7 The Kappa statistics and Q statistics between models without using the weighting strategy are shown, and the results under the weighting strategy are compared to verify the effectiveness of the weighting strategy. Figure 8 For the ROC curve and AUC value of the machine learning model, Figure 9 For the ROC curve and AUC value of the comparison model, through the comparison of these experimental results, it can be seen that the ST-Stacking method performs excellently on the test set, and the TNR and AUC indicators are higher than those of single machine learning model and other comparison methods, effectively improving the recall rate and generalization performance of abnormal data. It can be seen from the experimental results that the method of the present application can effectively identify abnormal data in marine monitoring data, and through the fusion of spatial and temporal features and the selective ensemble strategy, the problem of abnormal detection caused by the complexity of spatial and temporal variability of marine data and the imbalance of categories is solved.

[0156] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, and are not intended to limit the present application; although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that the technical solutions recorded in the above embodiments can be modified, or some or all of the technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for ocean pH data anomaly detection based on fusion of spatio-temporal feature stacking ensemble learning, characterized in that, The method comprises the following steps: Fusing multiple base models by using a selective integration strategy combined with a stacking generalization framework, calculating Kappa statistics and Q statistics of marine pH data, and calculating the performance score of each base model by combining two performance indicators of TNR and TPR, and selecting the model corresponding to the peak value as the base model; For each base model calculating a Kappa statistic and a Q statistic for the calculated ocean pH data, specifically comprising: For the classification results of two different models and , where a represents the number of data classified correctly by both; d represents the number of data classified incorrectly by both, b is the number of samples classified correctly by model but incorrectly by model , c is the number of samples classified correctly by model but incorrectly by model , and the calculation formula of the Kappa statistic is: where, denotes the probability that the two models agree on the classification result, referred to as actual agreement, denotes the probability that the two models agree on the classification result in case of random guessing, referred to as random agreement; The Q statistic is used to quantify the agreement in classification errors between two models, and is calculated as: For the base model and classification results, the Kappa statistics on the minority class and the majority class are calculated according to the true label, respectively, to obtain the Kappa statistics on the minority class and the Kappa statistics on the majority class , and the Kappa statistics conversion is carried out: wherein denotes and Kappa statistics of the two models after conversion on the minority class, denotes and Kappa statistics of the two models after conversion on the majority class; Introducing an unbalanced weight factor and Weighting the Kappa statistic score: wherein, indicates and Kappa statistics of the two models after conversion on all categories, and respectively, the number of samples of the minority class and the majority class; The base model is The weighted Kappa statistic for other base models The sum of the weighted Kappa statistics for the base models The sum of the weighted Kappa statistics for the base models : Calculate separately The weighted Kappa statistics of each of the base models are calculated, and the sum of the weighted Kappa statistics of all base models is used as the denominator. The weighted Kappa statistics of each base model are then normalized to obtain the nth... Kappa statistic score of each basic model : For the base model and classification results, the Q statistic on the minority class and the majority class is calculated according to the true label, respectively, to obtain the Q statistic on the minority class and the Q statistic on the majority class Q statistic conversion is performed: wherein represents and Q statistics of the two models after transformation on the minority class, represents and Q statistics of the two models after transformation on the majority class; Introducing an imbalance weight factor and Weighting the Q-statistic score: wherein, denotes and Q statistics of the two models after transformation on all categories, and respectively the number of samples of the minority class and the majority class; The base model The weighted Q statistics of other base models The sum of the weighted Q statistics of the base models :​ Calculate separately The weighted Q-statistics of each of the base models are calculated, and the sum of the weighted Q-statistics of all base models is used as the denominator. The weighted Q-statistic of each base model is then normalized to obtain the result. i Q-statistic score of each base model : The TNR and TPR performance indicators are calculated for each base model, specifically including: The TNR represents the proportion of the number of samples correctly predicted by the model as abnormal data to the total number of actual abnormal data samples, that is, the recall rate of abnormal data, and the calculation formula is: wherein, represents the number of times the model correctly judges abnormal data as abnormal data, represents the number of times the model incorrectly judges abnormal data as good data; For the performance score, the TNR score normalizes the TNR value of each base model by the sum of the TNR values of the base models based on the true labels and the classification results , and the TNR value of the first base model is given by the sum of the TNR values of the base models as the denominator i the TNR value of the first base model is given by the TNR value of the first base model is given by wherein, TNR value score of the normalized 1st base model; The TPR represents the proportion of the number of samples correctly predicted by the model as good data to the total number of actual good data samples, that is, the recall rate of good data, and the calculation formula is: wherein, represents the number of good data that the model correctly judges as good data, represents the number of good data that the model incorrectly judges as abnormal data; For the performance score, the TPR score is calculated based on the base model using the true labels and classification results. TPR value All The sum of the TPR values ​​of the base models is used as the denominator to normalize the TPR value of each base model, resulting in the... i The TPR of each base model is worth dividing. : wherein, represents the TPR value score of the normalized 1 th base model. Summing the Kappa statistic scores, Q statistic scores, TPR value scores, TNR value scores of the first base model ​​​​​​ The performance scores of each base model are sorted from high to low, and the number of base models is increased one by one, and the model corresponding to the peak value is selected as the base model selected by the selective integration strategy; A space-time feature extraction module is constructed to extract time features and space features respectively; the time features and the space features are fused to obtain a space-time feature vector; The marine pH data are input into the base model and the space-time feature extraction module, the extracted space-time features and the label probabilities output by the multiple base models are combined to form a new feature vector, and the meta-model knowledge enhancement network uses the new feature vector to obtain a classification result, thereby realizing the detection of marine pH data.

2. The ocean pH data anomaly detection method of spatio-temporal feature fusion stacking ensemble learning according to claim 1, characterized in that, In the extraction process of the time features, the timestamp is converted into a periodic feature vector by using a sine and cosine encoding method; wherein, denotes a time stamp, denotes a length of a cycle of time, measuring the inter-cycle variation of data, and are sine and cosine encoded time features.

3. The ocean pH data anomaly detection method of spatio-temporal feature fusion stacking ensemble learning according to claim 1, characterized in that, In the extraction process of the space features, a spherical coordinate conversion method is used to convert the longitude and latitude into three-dimensional spherical coordinates: wherein x, y, z are three-dimensional coordinate values converted from spherical coordinates, denotes longitude, denotes latitude; The depth value is standardized to eliminate the difference between the order of magnitude and the spherical coordinate: where, and are the mean and standard deviation of the depth feature, respectively, The time features and the space features are fused by splicing the extracted time feature vector and the space feature vector, then passing through a fully connected MLP to extract space-time interaction information and reduce dimension, and finally outputting the final space-time feature vector through a nonlinear conversion of a ReLU activation function. denotes the depth indicator value of the pH data, denotes the normalized depth feature; a feature concatenation strategy is adopted to concatenate the spherical coordinates and the normalized depth feature value into a four-dimensional vector: Concatenated four-dimensional space vector Both spherical coordinates and depth features are included.

4. The ocean pH data anomaly detection method of spatio-temporal feature fusion stacking ensemble learning according to claim 1, characterized in that, ​

Citation Information

Patent Citations

  • Construction method for intelligent screening decision model of enhanced oil extraction technology based on improved Stacking

    CN120046498A

  • Abnormal traffic detection method based on time sequence

    CN120614168A