Ocean pH data anomaly detection method fusing spatio-temporal feature stacking ensemble learning
By integrating spatiotemporal feature stacking ensemble learning methods and utilizing diversity and performance indicators to select base models, a spatiotemporal feature extraction module is constructed. This solves the problems of low recall and insufficient generalization ability in marine data anomaly detection, and achieves more efficient anomaly pattern recognition and adaptive detection.
Patent Information
- Application Number
- CN202511518967.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-23
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2045-10-23
AI Technical Summary
Existing technologies for detecting anomalies in marine data suffer from low recall and insufficient generalization capabilities, making it difficult to effectively identify complex anomaly patterns and adapt to diverse application scenarios.
We adopt a stacked ensemble learning method that integrates spatiotemporal features. By combining a selective ensemble strategy with a stacked generalization framework, we use Kappa statistics, Q statistics, TPR and TNR indices to select base models, construct a spatiotemporal feature extraction module, extract time and space features, and perform classification through a meta-model knowledge enhancement network.
It improves the recall and generalization performance of marine data anomaly detection, enabling more comprehensive identification of anomaly patterns, adapting to the spatiotemporal variability of marine data, and improving the accuracy and efficiency of detection.
Smart Images

Figure CN120995319A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of marine data detection technology, and in particular to a method for detecting anomalies in marine pH data by integrating spatiotemporal feature stacking ensemble learning. Background Technology
[0002] Marine data anomaly detection refers to the process of filtering and removing outliers from marine data using manual or computer-aided algorithms to generate high-quality datasets. Manual quality control is flexible and accurate, but it relies on expert subjective experience, resulting in low efficiency and difficulty in meeting the needs of large-scale data processing. Computer-aided algorithms typically first use automated quality control algorithms to initially screen marine data, followed by manual verification of the anomalies identified in the initial screening. This approach ensures accuracy while significantly improving quality control efficiency. Automated quality control algorithms include rule-based and machine learning-based methods.
[0003] Rule-based methods are the mainstream approach used in data quality control at international data centers. They primarily employ established marine physicochemical or statistical rules for data inspection, such as range checks, spike checks, and climatological checks. Rule-based methods allow for the flexible combination of rules to form rule sets, thereby establishing rule-based quality control processes. Domestic and international research institutions, such as the China Argo Real-Time Data Center, the National Marine Information Center, the Institute of Atmospheric Physics and Ocean Research of the Chinese Academy of Sciences, the National Environmental Information Center of the National Oceanic and Atmospheric Administration (NOAA) of the United States, the World Ocean Circulation Laboratory, and the Hadley Meteorological Centre in the United Kingdom, have all established their own rule-based quality control processes. Ren Huanping et al. integrated multiple rules, including range checks, spike checks, and the Rhineda criterion, to propose a quality control method for marine buoy temperature and salinity data, which was tested on buoy data from Chinese nearshore observation stations. Tan et al. studied a quality control method for ocean temperature data containing 14 rules and constructed a local climatological range for the vertical temperature gradient to reduce the false positive rate. To determine suitable rule combinations, Good et al. developed a quality control framework for evaluating ocean temperature profile data. Experiments showed that the optimal rule combination method within this framework achieved a good data recall rate of 90% and an anomaly detection rate of 50%. Despite the good results achieved by existing methods, rule-based methods are still prone to misclassification and missed detection. First, because ocean monitoring data is highly susceptible to the influence of the marine environment and exhibits strong nonlinearity, it is difficult to fully satisfy the assumptions of the pre-set rules. For example, assuming a Gaussian distribution, under abnormal sea conditions, the actual monitoring data may deviate from the normal distribution range and be misclassified as anomalies. Furthermore, ocean monitoring data exhibits significant spatiotemporal variability, while the thresholds of rule-based methods are relatively fixed and cannot dynamically adapt to data changes.
[0004] Machine learning-based methods, capable of flexibly modeling complex data distributions and dynamically learning data anomaly features, have become a research hotspot in recent years. Jiang et al. improved the K-Means clustering algorithm, redefining the proximity of marine monitoring data and dynamically optimizing initial cluster centers, reducing false detections of Argo temperature and salinity anomalies. Jiang et al. introduced density reachability and dynamic layer selection strategies into K-medoids clustering, solving the problem of sensitive cluster center selection and improving the recall rate of anomaly data. Zhang et al. proposed a method based on Gaussian Mixture Model (GMM) clustering and convex hull geometry detection for the Argo temperature data profile in the South China Sea, achieving an anomaly detection rate of 70%. Mieruch et al. used a Multilayer Perceptron (MLP) neural network for quality control of the Mediterranean temperature dataset, demonstrating the effectiveness of neural networks in marine data quality control. Subsequently, Liu et al. constructed a multi-classification model for sea surface temperature monitoring data quality labels based on MLP and Deep Neural Network (DNN). Existing methods generally employ a single model, but a single model is difficult to capture anomalous patterns in complex marine monitoring data and is still not ideal in terms of anomalous data recall rate, making it difficult to meet the needs of practical application scenarios.
[0005] Existing technologies for processing marine data face significant challenges in detecting anomalies due to the inherent imbalances (e.g., a large disparity in the ratio of normal to anomalous data) and strong spatiotemporal variability (data changes drastically with time and location). This imbalance and spatiotemporal variability make it difficult to accurately identify and distinguish the features of anomalous data, resulting in low recall rates. Existing technologies tend to miss many genuine anomalies, failing to effectively meet the high recall requirements of marine data anomaly detection and thus limiting their application effectiveness. Furthermore, existing technologies rely on single models for anomaly detection, which are limited in their inability to comprehensively capture complex anomaly patterns within the data. Given the diversity of anomaly patterns in marine data, a single model may only identify a subset of anomaly types. This results in insufficient generalization ability across different environments and data distributions, hindering its adaptability to diverse application scenarios and limiting its widespread applicability in practical applications. Therefore, a method integrating spatiotemporal feature stacking ensemble learning is needed to address the problems of low recall and insufficient generalization ability in anomaly detection. Summary of the Invention
[0006] To address the aforementioned technical problems, this invention provides a method for anomaly detection in marine pH data that integrates spatiotemporal feature stacking ensemble learning. This invention primarily utilizes two diversity indices—Kappa statistic and Q statistic—and two performance indices—TPR and TNR—to quantify and score the output of the base model, selecting the base model in the ST-Stacking method. Simultaneously, the temporal and spatial feature columns of the pH data are input into a spatiotemporal feature extraction module. The temporal features are converted to timestamps and then periodically encoded. The encoded features are then input into an MLP (Multi-Level Processing) to extract deep temporal correlation information, resulting in high-dimensional temporal features. Spatial features such as longitude, latitude, and depth are transformed into spherical coordinates and input into a convolutional neural network to extract deep spatial features. The convolutional features are then pooled and input into the MLP again to extract high-dimensional spatial features. To automatically learn the joint representation and nonlinear interaction relationship of temporal and spatial features, the high-dimensional temporal and spatial features are combined and input into the MLP to extract the final spatiotemporal features as a supplement to the meta-model input features. Finally, the extracted spatiotemporal features are combined with the label probabilities output by multiple base models to form a new feature vector. The meta-model knowledge enhancement network then uses this new feature vector to obtain the final classification result.
[0007] The technical means employed in this invention are as follows: A method for detecting anomalies in ocean pH data by integrating spatiotemporal feature stacking ensemble learning includes: Multiple base models were fused using a selective ensemble strategy combined with a stacked generalization framework. The Kappa and Q statistics of ocean pH data were calculated, and the performance scores of each base model were calculated using the TNR and TPR performance metrics. The model corresponding to the peak value was selected as the base model. For each base model... The calculation of the Kappa statistic and Q statistic for the calculated ocean pH data specifically includes: assuming that 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:
[0008] 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. The Q statistic is used to quantify the consistency of the two models in classification errors, and its calculation formula is as follows:
[0009] 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:
[0010]
[0011] 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; Introducing an unbalanced weighting factor and Weighting the Kappa statistic scores:
[0012]
[0013] 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. Base model Weighted Kappa statistic with other base models Summing yields the base model. The sum of weighted Kappa statistics :
[0014] 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 :
[0015] 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:
[0016]
[0017] 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; Introducing an unbalanced weighting factor and Weight the Q statistic score:
[0018]
[0019] 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. Base model Weighted Q statistic with other base models Summing yields the base model. The sum of weighted Q statistics :
[0020] 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 :
[0021] For each base model, the two performance metrics, TNR and TPR, are calculated, specifically including: 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:
[0022] 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. 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... :
[0023] in, Represents the normalized i-th The TNR values of each base model are worth scoring; 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:
[0024] 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. 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. :
[0025] in, Represents the normalized i-th The TPR value of each base model is worth scoring; For the Base Model Kappa statistic score Q statistic score TPR deserves a score. TNR is worth scoring Sum as a performance score for fusion diversity :
[0026] The performance scores of each base model are sorted from high to low, and the number of base models is increased one by one. The model corresponding to the peak is selected as the base model through a selective ensemble strategy. A spatiotemporal feature extraction module is constructed to extract temporal and spatial features respectively. The temporal and spatial features are fused to obtain a spatiotemporal feature vector. Ocean pH data is input into the base model and the spatiotemporal feature extraction module respectively. The extracted spatiotemporal features are combined with the label probabilities output by multiple base models to form a new feature vector. The new feature vector is used to obtain the classification result through the meta-model knowledge enhancement network, thereby realizing the detection of ocean pH data.
[0027] Furthermore, during the extraction process, the time features are converted into periodic feature vectors using sine and cosine coding methods.
[0028]
[0029] in, Represents a timestamp. It indicates the length of a time period and measures the periodic variation of data. and It is the time feature after sine and cosine encoding.
[0030] Furthermore, the spatial features were extracted using a spherical coordinate transformation method to convert longitude and latitude into three-dimensional spherical coordinates.
[0031]
[0032]
[0033] Where x, y, and z are the three-dimensional coordinate values after spherical coordinate transformation. Indicates longitude. Indicates latitude; Standardize the depth value to eliminate the difference in magnitude from spherical coordinates:
[0034] in, and These are the mean and standard deviation of the depth feature, respectively. depthThe depth index value representing pH data, The standardized depth features are represented; a feature concatenation strategy is used to concatenate the spherical coordinates with the standardized depth feature values to form a four-dimensional vector:
[0035] The concatenated four-dimensional space vector It includes both spherical coordinates and depth features.
[0036] Furthermore, when fusing the temporal and spatial features, the extracted temporal feature vector and spatial feature vector are concatenated and then the spatiotemporal interaction information is extracted through a fully connected MLP and dimensionality reduction is performed. The final spatiotemporal feature vector is then output through a nonlinear transformation of the ReLU activation function.
[0037] Compared with the prior art, the present invention has the following advantages: This invention provides a method for detecting anomalies in marine pH data by integrating 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 indicators 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 extract temporal and spatial features respectively. These features are then fused to obtain 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.
[0038] The marine pH data anomaly detection method provided by this invention, which integrates spatiotemporal feature stacking ensemble learning, effectively integrates the advantages of multiple machine learning models by employing a base model selective ensemble strategy based on weighted diversity and performance indicators. This allows for a more comprehensive identification of anomalous patterns in marine data, improving the generalization performance of marine data anomaly detection. Furthermore, by introducing a spatiotemporal feature extraction module, this method effectively addresses the spatiotemporal variability of marine data, extracting spatiotemporal anomaly patterns and identifying more anomalous data, thereby improving the overall anomaly recall rate.
[0039] Based on the above reasons, this invention can be widely applied in fields such as marine data detection. Attached Figure Description
[0040] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1 This is a framework diagram of the marine pH data anomaly detection method that integrates spatiotemporal feature stacking ensemble learning in this invention.
[0042] Figure 2 This is the weighted Kappa statistic between machine learning models on the validation set in this embodiment of the invention.
[0043] Figure 3 This is the weighted Q-statistic among machine learning models on the validation set in this embodiment of the invention.
[0044] Figure 4 This represents the total score of the machine learning model on the validation set in this embodiment of the invention.
[0045] Figure 5 These are the ensemble performance metrics for different numbers of basis models on the validation set in this embodiment of the invention.
[0046] Figure 6 This refers to the Kappa statistic between machine learning models in this embodiment of the invention.
[0047] Figure 7 This refers to the Q-statistic between machine learning models in this embodiment of the invention.
[0048] Figure 8 The ROC curve (a) and AUC value (b) of the machine learning model in this embodiment of the invention are shown.
[0049] Figure 9 The ROC curve (a) and AUC value (b) of the comparative model are shown in the embodiments of the present invention. Detailed Implementation
[0050] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0051] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the present invention or its application or use. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0052] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0053] Unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps described in these embodiments do not limit the scope of the invention. It should also be understood that, for ease of description, the dimensions of the various parts shown in the drawings are not drawn to actual scale. Techniques, methods, and devices known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and devices should be considered part of the specification. In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values. It should be noted that similar reference numerals and letters in the following figures denote similar items; therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0054] like Figure 1 As shown, this invention provides a method for detecting anomalies in ocean pH data by integrating spatiotemporal features through stacked ensemble learning. The method includes: using a selective ensemble strategy combined with a stacked generalization framework to fuse multiple base models, calculating the Kappa statistic and Q statistic of ocean pH data, and combining the two performance indicators TNR and TPR to calculate the performance score of each base model, and selecting the model corresponding to the peak as the base model. The Stacking framework enhances the generalization ability of the overall model by fusing predictions from multiple base models; therefore, its performance is highly dependent on the base models. If the predictions from the base models are highly consistent, the ensemble model often struggles to outperform a single model. Conversely, if the predictions from the base models exhibit strong diversity and each possesses good performance (i.e., "good in different ways"), Stacking can more effectively combine the strengths of each model, improving overall performance. However, in anomaly detection tasks using marine monitoring data, severe data imbalance can cause diversity metrics such as the Kappa statistic and Q statistic to be influenced by the majority class dominance effect, making it difficult to effectively assess the diversity of model predictions on the minority class.
[0055] For diversity scores, when calculating the Kappa and Q statistics, the validation set data samples are separated according to their true labels, and the index values for the minority class (outliers) and the majority class (good data) are calculated separately. An imbalanced weighting factor is introduced to weight the two to obtain the corresponding diversity score. It is worth noting that the closer the Kappa and Q statistics are to 1, the more similar the classification results of the two models are, i.e., the lower the diversity. Conversely, the closer the performance index is to 1, the higher the model performance. To obtain a final score that integrates diversity and performance and conforms to subjective logic, the Kappa and Q statistics are transformed. In specific implementation, as a preferred embodiment of this invention, for each base model... The calculation of the Kappa statistic and Q statistic for the calculated ocean pH data specifically includes: 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:
[0056] 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. The Q statistic is used to quantify the consistency of the two models in classification errors, and its calculation formula is as follows:
[0057] 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:
[0058]
[0059] 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; Introducing an unbalanced weighting factor and Weighting the Kappa statistic scores:
[0060]
[0061] 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. Base model Weighted Kappa statistic with other base models Summing yields the base model. The sum of weighted Kappa statistics :
[0062] 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 :
[0063] 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:
[0064]
[0065] 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; Introducing an unbalanced weighting factor and Weight the Q statistic score:
[0066]
[0067] 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. Base model Weighted Q statistic with other base models Summing yields the base model. The sum of weighted Q statistics :
[0068] 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 :
[0069] For each base model, the two performance metrics, TNR and TPR, are calculated, specifically including: 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:
[0070] 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. 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... :
[0071] in, Represents the normalized i-th The TNR values of each base model are worth scoring; 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:
[0072] 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. 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. :
[0073] in, Represents the normalized i-th The TPR value of each base model is worth scoring; For the Base Model Kappa statistic score Q statistic score TPR deserves a score. TNR is worth scoring Sum as a performance score for fusion diversity :
[0074] The performance scores of each base model are sorted from high to low, and the number of base models is increased one by one. The model corresponding to the peak is selected as the base model through a selective ensemble strategy.
[0075] Ocean monitoring data typically contains a variety of information, including temporal, spatial, and physicochemical properties. This information not only includes independent spatiotemporal attributes but also complex spatiotemporal interactions. For example, the pH value in ocean data may be influenced by multiple factors such as time, latitude, longitude, and depth. Therefore, simply using the raw data for modeling may not fully capture these spatiotemporal variation characteristics when detecting data anomalies. To address this issue, this method proposes a spatiotemporal feature extraction module based on periodic encoding and CNNs to extract high-dimensional spatiotemporal features from input data such as time, longitude, latitude, and depth. These extracted spatiotemporal features can more effectively characterize the spatiotemporal variation patterns of the data, providing richer feature inputs for machine learning models.
[0076] A spatiotemporal feature extraction module is constructed to extract temporal and spatial features respectively. The temporal and spatial features are then fused to obtain a spatiotemporal feature vector. In a preferred embodiment of this invention, time data typically exhibits periodic variations in actual monitoring, such as daily tidal changes, seasonal temperature variations, and long-term trends. These periodic features are crucial for predicting data trends and identifying anomalies. However, time feature input is usually in the form of a timestamp, representing the number of seconds from 00:00:00 on January 1, 1970, to a specific time. While this time representation is a continuous numerical value, it cannot directly reflect the periodic patterns of time, such as the 24-hour cycle of a day or the 12-month cycle of a year. Therefore, simply using timestamps as model input may lead to the model's inability to capture periodic patterns in time, affecting feature extraction performance. During the time feature extraction process, sine and cosine coding methods are used to convert timestamps into periodic feature vectors.
[0077]
[0078] in, Represents a timestamp. The time period is represented by the number of seconds in one month (30 days), which is 30 * 24 * 3600, representing the periodic changes in the data measured over the past three buoy cycles. and It is the time feature after sine and cosine encoding.
[0079] This encoding method maps timestamps onto a unit circle. The timestamp at the beginning of a time period will be mapped to 0 radians, and the timestamps in the middle of the period will be mapped to various radians on the unit circle, enabling the model to recognize the periodic changes in time.
[0080] In marine monitoring data, longitude, latitude, and depth are key spatial features that directly affect the spatiotemporal distribution and physical changes of the data. However, the representation of these spatial features differs somewhat from the input requirements of machine learning models. Directly using longitude and latitude as model input may fail to accurately describe the positional relationships of data points on the Earth's surface. Especially in global data processing, the changes in longitude and latitude are not linear, involving complex factors such as variations in the arc length of the Earth's surface. In a preferred embodiment of this invention, a spherical coordinate transformation method is used during the extraction of spatial features to convert longitude and latitude into three-dimensional spherical coordinates.
[0081]
[0082]
[0083] Where x, y, and z are the three-dimensional coordinate values after spherical coordinate transformation. Indicates longitude. Indicates latitude; Through the above conversion formula, the original longitude and latitude data are mapped onto a three-dimensional unit sphere, facilitating the model's identification of the true spatial distribution of data points on the Earth's surface. In profile data, depth is also an important spatial dimension. To integrate depth features with longitude and latitude features, the depth values are standardized to eliminate the difference in magnitude between the depth and spherical coordinates.
[0084] in, and These are the mean and standard deviation of the depth feature, respectively. depth The depth index value representing pH data, The standardized depth features are represented; a feature concatenation strategy is used to concatenate the spherical coordinates with the standardized depth feature values to form a four-dimensional vector:
[0085] The concatenated four-dimensional space vector It includes both spherical coordinates and depth features. It is then input into a one-dimensional CNN and undergoes three convolutions to progressively extract higher-order spatial features. In the first convolution operation, a convolution kernel of size 1 is used, and the kernel moves along... Sequence sliding treats each data point's four values as a single element. For each element, the convolutional kernel performs a dot product with the input data, merging them into a single feature representation to extract the local spatial features of that single data point. In the subsequent two convolutions, the kernel size is set to 3, covering three adjacent elements in the sequence to extract spatial features between neighboring points. Then, an adaptive max-pooling layer aggregates the convolutional features, and finally, an MLP is used to map them into a final high-dimensional spatial feature vector. The fused spatial feature vector contains information about both horizontal spatial distribution and vertical depth variation.
[0086] Temporal and spatial features provide crucial data information from the temporal and spatial dimensions, respectively. However, the quality of actual marine monitoring data is often affected by the interaction of spatiotemporal features; that is, the relationship between temporal changes and spatial location often influences the physical and chemical properties of the monitoring data. In a preferred embodiment of this invention, when fusing temporal and spatial features, the extracted temporal feature vector is concatenated with the spatial feature vector, and then the spatiotemporal interaction information is extracted and dimensionality reduced using a fully connected MLP. Finally, the spatiotemporal feature vector is output through a nonlinear transformation using the ReLU activation function.
[0087] Ocean pH data is input into the base model and the spatiotemporal feature extraction module, respectively. The extracted spatiotemporal features are combined with the label probabilities output by multiple base models to form a new feature vector. The new feature vector is then used by the meta-model knowledge enhancement network to obtain the classification result, thereby realizing the detection of ocean pH data.
[0088] In its implementation, the meta-model knowledge augmentation network (Kolmogorov-Arnold networks, KAN) adopts publicly available techniques, citing the literature Liu Z, Wang Y, Vaidya S, et al. Kan: Kolmogorov-arnold networks [J]. arXiv preprint arXiv:240419756, 2024.
[0089] Example This embodiment takes pH data monitored by BGC-Argo buoys in global waters as the research object and uses the stacked ensemble learning quality control method (ST-Stacking) that integrates spatiotemporal features to detect abnormal data. Figure 2 and Figure 3These are the weighted Kappa statistic and weighted Q statistic among machine learning models on the validation set, respectively. Using these diversity evaluation metrics, five base models with both high diversity and good performance were selected from nine candidate base models. The base models are: DT (Decision Tree), KNN (K-Nearest Neighbors), RF (Random Forest), GNB (Gaussian Naive Bayes), XGB (Extreme Gradient Boosting), LGB (Light Gradient Boosting Machine), CatBoost (Categorical Boosting), NGB (Natural Gradient Boosting), and ADB (Adaptive Boosting).
[0090] Figure 4 The total score of each model is displayed. Based on this score, the models are sorted from high to low and the number of base models is gradually increased to finally determine the combination of base models. Figure 5 To validate the performance metrics of ensembles with different numbers of base models on the validation set, we show that the model's performance reaches its optimal equilibrium state when the number of base models reaches 5. Figure 6 and Figure 7 The Kappa and Q statistics of the models without a weighted strategy are shown, and the results under the weighted strategy are compared to verify the effectiveness of the weighted strategy. Figure 8 The ROC curve and AUC value of the machine learning model. Figure 9 To compare the ROC curves and AUC values of the models, these comparative experimental results show that the ST-Stacking method performs excellently on the test set. Its TNR and AUC metrics are higher than those of single machine learning models and other comparative methods, effectively improving the recall rate and generalization performance for anomalous data. The experimental results demonstrate that the method of this invention can effectively identify anomalous data in marine monitoring data. By fusing spatiotemporal features and employing a selective ensemble strategy, it solves the problem of difficult anomaly detection caused by the complex spatiotemporal variability and class imbalance of marine data.
[0091] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for detecting anomalies in ocean pH data by integrating spatiotemporal feature stacking ensemble learning, characterized in that, include: By using a selective ensemble strategy combined with a stacked generalization framework to fuse multiple base models, the Kappa statistic and Q statistic of ocean pH data were calculated. The performance score of each base model was calculated by combining the two performance indicators TNR and TPR, and the model corresponding to the peak was selected as the base model. For each base model The calculation of the Kappa statistic and Q statistic for the calculated ocean pH data specifically includes: 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: 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. The Q statistic is used to quantify the consistency of the two models in classification errors, and its calculation formula is as follows: 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: 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; Introducing an unbalanced weighting factor and Weighting the Kappa statistic scores: 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. Base model Weighted Kappa statistic with other base models Summing yields the base model. The sum of weighted Kappa statistics : 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 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: 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; Introducing an unbalanced weighting factor and Weight the Q statistic score: 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. Base model Weighted Q statistic with other base models Summing yields the base model. The sum of weighted Q statistics : 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 : For each base model, the two performance metrics, TNR and TPR, are calculated, specifically including: 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: 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. 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... : in, Represents the normalized i-th The TNR values of each base model are worth scoring; 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: 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. 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. : in, Represents the normalized i-th The TPR value of each base model is worth scoring; For the Base Model Kappa statistic score Q statistic score TPR deserves a score. TNR is worth scoring Sum as a performance score for fusion diversity : The performance scores of each base model are sorted from high to low, and the number of base models is increased one by one. The model corresponding to the peak is selected as the base model through a selective ensemble strategy. A spatiotemporal feature extraction module is constructed to extract temporal and spatial features respectively; the temporal and spatial features are then fused to obtain a spatiotemporal feature vector. Ocean pH data is input into the base model and the spatiotemporal feature extraction module, respectively. The extracted spatiotemporal features are combined with the label probabilities output by multiple base models to form a new feature vector. The new feature vector is then used by the meta-model knowledge enhancement network to obtain the classification result, thereby realizing the detection of ocean pH data.
2. The method for detecting anomalies in ocean pH data by fusing spatiotemporal feature stacking ensemble learning according to claim 1, characterized in that, During the extraction process, the time features are converted into periodic feature vectors using sine and cosine coding methods. in, Represents a timestamp. It indicates the length of a time period and measures the periodic variation of data. and It is the time feature after sine and cosine encoding.
3. The method for detecting anomalies in ocean pH data by fusing spatiotemporal feature stacking ensemble learning according to claim 1, characterized in that, The spatial features were extracted using a spherical coordinate transformation method, converting longitude and latitude into three-dimensional spherical coordinates: Where x, y, and z are the three-dimensional coordinate values after spherical coordinate transformation. Indicates longitude. Indicates latitude; Standardize the depth value to eliminate the difference in magnitude from spherical coordinates: in, and These are the mean and standard deviation of the depth feature, respectively. depth The depth index value representing pH data, The standardized depth features are represented; a feature concatenation strategy is used to concatenate the spherical coordinates with the standardized depth feature values to form a four-dimensional vector: The concatenated four-dimensional space vector It includes both spherical coordinates and depth features.
4. The method for detecting anomalies in ocean pH data by fusing spatiotemporal feature stacking ensemble learning according to claim 1, characterized in that, When fusing the temporal and spatial features, the extracted temporal feature vector is concatenated with the spatial feature vector, and then spatiotemporal interaction information is extracted through a fully connected MLP and dimensionality reduction is performed. After nonlinear transformation by the ReLU activation function, the final spatiotemporal feature vector is output.
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
Methods and systems for predicting rates of progression of age-related macular degeneration
US20230093471A1
Steof-LSTM-based method for predicting marine environmental elements
WO2022262500A1