Ocean thermocline data visualization method, device, equipment and medium based on PCA-SVM
The PCA-SVM method is used to reduce dimensionality, filter, interpolation fit and SVM classification of ocean thermoclimb data, which solves the problem of low processing accuracy of ocean thermoclimb data and realizes high-precision visualization of data.
Patent Information
- Application Number
- CN202211022965.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-24
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2042-08-24
AI Technical Summary
In the prior art, the data processing accuracy of the ocean thermoclip layer is not high, resulting in insufficient display accuracy during data visualization and data loss.
The PCA-SVM method is used to reduce dimensionality, filter, interpolation fit and SVM classification of ocean thermoclip data. The initial data is processed through the principal component analysis method, outliers are filtered using the filter control method, interpolation fitting of BP neural network, and SVM model is classified, and the data is finally converted into json format for visualization.
It improves the accuracy and visualization of ocean thermoclimb data, solves the problems of insufficient display accuracy and data loss due to low data accuracy, and realizes the reliable and accurate visualization of ocean thermoclimb data.
Smart Images

Figure CN115358327B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data visualization, and in particular to a method, device, equipment and medium for visualizing ocean thermocline data based on PCA-SVM. Background Art
[0002] China is experiencing rapid development in marine information research and application. The efficient processing and utilization of marine data is fundamental to promoting the exploration and development of marine resources. my country boasts vast sea areas, and the rational development and utilization of marine resources is of great significance to my country's economic development and scientific and technological progress. Currently, with the increasing frequency of marine data surveys and the ever-expanding sea areas surveyed, marine information data collected by survey vessels and satellites exhibits numerous characteristics, including strong temporal and spatial correlations, complex and large scale, and diverse data formats. These diverse and complex data formats make data analysis software difficult and inefficient, requiring the development of different data processing software for marine information in different data formats. Therefore, standardizing data formats and establishing unified data standards are of great significance for marine data processing.
[0003] Classic ocean thermocline analysis and processing methods simply calculate partial derivatives and gradients of step data. While this method can reveal data trends, due to the inherent errors inherent in data collection and surveying, these methods often fail to eliminate these errors and can only serve to determine and observe data trends. This can lead to reduced accuracy and data loss in ocean data processing.
[0004] In summary, the existing technology has the problem of low accuracy in processing ocean thermocline data, which leads to insufficient display accuracy and data loss during data visualization. Summary of the Invention
[0005] In view of this, it is necessary to provide a method and device for visualizing ocean thermocline data based on PCA-SVM to solve the technical problem that the accuracy of ocean thermocline data processing in the existing technology is not high, which leads to insufficient display accuracy and data loss in the data visualization process.
[0006] In order to solve the above technical problems, on the one hand, the present invention provides a method for visualizing ocean thermocline data based on PCA-SVM, comprising:
[0007] Obtain the initial ocean thermocline dataset;
[0008] Performing dimensionality reduction processing on the initial ocean thermocline data based on principal component analysis to obtain a reduced-dimensional ocean thermocline data set;
[0009] Performing filtering on the dimension-reduced ocean thermocline data based on a filtering control method to obtain a filtered ocean thermocline data set;
[0010] Obtaining a target BP neural network model, inputting the filtered ocean thermocline data set into the target BP neural network model for interpolation fitting, and obtaining a fitted ocean thermocline data set;
[0011] Obtaining a target SVM model, inputting the fitted ocean thermocline data set into the target SVM model to perform identification and classification of ocean thermoclines at different depths, and obtaining ocean thermocline target data;
[0012] Visualization processing is performed on the ocean thermocline target data to obtain a visualized ocean thermocline.
[0013] In some possible implementations, the initial ocean thermocline data set includes four dimensions and seawater temperature data corresponding to the four dimensions, wherein the four dimensions include longitude, latitude, depth, and time.
[0014] In some possible implementations, performing dimensionality reduction processing on the initial ocean thermocline dataset based on principal component analysis to obtain a dimensionality-reduced ocean thermocline dataset includes:
[0015] Zeroing the initial ocean thermocline data set to obtain a central matrix;
[0016] Calculating the covariance according to the centralization matrix to obtain a covariance matrix;
[0017] Calculate eigenvalues based on the covariance coefficients obtained from the covariance matrix, and calculate eigenvectors based on the eigenvalues to construct an eigenvector matrix;
[0018] Screening the eigenvector matrix according to a preset eigenvalue screening threshold to obtain a primary screening matrix;
[0019] The primary screening matrix is scaled to obtain a scaled matrix, which constitutes the dimension-reduced ocean thermocline dataset.
[0020] In some possible implementations, the filtering control method is used to filter the dimension-reduced ocean thermocline data to obtain a filtered ocean thermocline dataset, including:
[0021] Performing abnormal data filtering on the dimension-reduced ocean thermocline dataset to obtain a preliminary filtered ocean thermocline dataset;
[0022] The mean square error (MSE) of the unfiltered data in the preliminary filtered ocean thermocline data set is calculated, and the data whose difference between the data value and the average value in the unfiltered data is greater than the preset multiplier mean square error is marked as abnormal, thereby obtaining the filtered ocean thermocline data set.
[0023] In some possible implementations, determining the target BP neural network model includes:
[0024] Obtain a sample set of ocean thermocline data to be fitted;
[0025] Determine the number of input layers, hidden layers and output layers in the BP neural network and establish the initial BP neural network model;
[0026] Determining initial weight values and initial thresholds of the input layer, hidden layer, and output layer, and iteratively training the initial BP neural network model based on the ocean thermocline data sample set to be fitted;
[0027] The initial weight values and initial thresholds of the input layer, hidden layer and output layer are updated based on the genetic algorithm until a preset training accuracy is reached to obtain the target BP neural network model.
[0028] In some possible implementations, determining the target SVM model includes:
[0029] Obtaining a sample set of ocean thermocline data to be classified, and dividing the sample set of ocean thermocline data to be classified into a training set and a test set by selecting different proportions;
[0030] Determine the optimization objective function, model training function, decision function and SVM kernel function to establish the initial SVM model;
[0031] The SVM model is trained and tested based on the training set and the test set respectively until the optimal penalty factor and kernel function coefficient are determined to obtain the target SVM model.
[0032] In some possible implementations, the visualizing the target ocean thermocline data set and importing a visualization model to visualize the thermocline data includes:
[0033] Perform matrix transformation on the target ocean thermocline dataset to obtain a one-dimensional json data format file;
[0034] Adding header file information to the one-dimensional JSON data format file, wherein the header file information includes time latitude and longitude range, time, ocean depth, and display mode, to obtain a target JSON file;
[0035] Import the target json file into the visualization model to realize the visualization of ocean thermocline data.
[0036] On the other hand, the present invention also provides a device for visualizing ocean thermocline data based on PCA-SVM, characterized in that it includes:
[0037] Data acquisition module, used to obtain the initial ocean thermocline data set;
[0038] A dimensionality reduction processing module is used to perform dimensionality reduction processing on the initial ocean thermocline data based on a principal component analysis method to obtain a reduced-dimensional ocean thermocline data set;
[0039] A filtering processing module is used to perform filtering processing on the dimension-reduced ocean thermocline data based on a filtering control method to obtain a filtered ocean thermocline data set;
[0040] A fitting processing module is used to obtain a target BP neural network model, input the filtered ocean thermocline data set into the target BP neural network model for interpolation fitting, and obtain a fitted ocean thermocline data set;
[0041] A classification processing module is used to obtain a target SVM model, input the fitted ocean thermocline data set into the target SVM model to perform identification and classification of ocean thermoclines at different depths, and obtain ocean thermocline target data;
[0042] A visualization module is used to perform visualization processing on the ocean thermocline target data to obtain a visualized ocean thermocline.
[0043] On the other hand, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the processor executes the program, the ocean thermocline data visualization method based on PCA-SVM described in the above implementation method is implemented.
[0044] Finally, the present invention also provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the method for visualizing ocean thermocline data based on PCA-SVM described in the above implementation manner is implemented.
[0045] The beneficial effects of adopting the above embodiment are as follows: the ocean thermocline data visualization method based on PCA-SVM provided by the present invention, on the one hand, greatly improves the accuracy of ocean thermocline data information by performing a series of pre-processing on the initial ocean thermocline data, including PCA dimensionality reduction, outlier filtering, interpolation supplementation, step labeling, and SVM classification training. On the other hand, the processed ocean thermocline data information is converted into json data format through matrix transformation, and then the json data is displayed through a visualization model. Since the ocean thermocline data visualization method based on PCA-SVM can perform dimensionality reduction and feature scaling on the ocean thermocline data, this will make the thermocline data visualization operation more intuitive, solving the problem of data loss caused by insufficient display accuracy due to the low accuracy of ocean thermocline data information. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0047] Figure 1 A schematic flow chart of an embodiment of the ocean thermocline data visualization method based on PCA-SVM provided by the present invention;
[0048] Figure 2 A schematic diagram of a flow chart of an embodiment of PCA dimensionality reduction processing provided by the present invention;
[0049] Figure 3 A schematic diagram of a process flow of an embodiment of abnormal data filtering provided by the present invention;
[0050] Figure 4 A schematic diagram of a process for constructing a target BP neural network model according to an embodiment of the present invention;
[0051] Figure 5 A schematic diagram of an embodiment of the relationship between the BP neural network error propagation method and the network hierarchy provided by the present invention;
[0052] Figure 6 A schematic diagram of a flow chart of an embodiment of a BP neural network model based on a genetic algorithm provided by the present invention;
[0053] Figure 7 A schematic diagram of a process for constructing a target SVM model according to an embodiment of the present invention;
[0054] Figure 8A schematic diagram of a flow chart of an embodiment of ocean thermocline data processing based on PCA-SVM provided by the present invention;
[0055] Figure 9 A schematic diagram of a process flow of an embodiment of ocean thermocline data visualization provided by the present invention;
[0056] Figure 10 A schematic structural diagram of an embodiment of a PCA-SVM-based ocean thermocline data visualization device provided by the present invention;
[0057] Figure 11 This is a structural diagram of an embodiment of an electronic device provided by the present invention. DETAILED DESCRIPTION
[0058] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making any creative efforts shall fall within the scope of protection of the present invention.
[0059] It should be understood that the schematic drawings are not drawn to scale. The flowcharts used in the present invention illustrate operations implemented according to some embodiments of the present invention. It should be understood that the operations in the flowcharts may be implemented out of sequence, and steps that do not have a logical contextual relationship may be reversed or performed simultaneously. In addition, those skilled in the art, guided by the present disclosure, may add one or more additional operations to the flowcharts or remove one or more operations from the flowcharts.
[0060] Some of the blocks shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor systems and / or microcontroller systems.
[0061] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present invention. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute a separate or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0062] Before describing the embodiments, the following definitions are given for the relevant terms:
[0063] PCA: PCA (principal component analysis) is a mathematical dimensionality reduction method that uses orthogonal transformation to convert a series of possibly linearly correlated variables into a set of linearly uncorrelated new variables, also called principal components, so as to use the new variables to display the characteristics of the data in a smaller dimension.
[0064] SVM: SVM (support vector machine) is a trainable machine learning method. It is a supervised learning model and related learning algorithm for analyzing data in classification and regression analysis. Given a set of training examples, each labeled as belonging to one or the other of two categories, the SVM training algorithm creates a model that assigns new instances to one of the two categories, making it a non-probabilistic binary linear classifier. The SVM model represents instances as points in space, such that the mapping separates instances of different categories by as wide a clear gap as possible. New instances are then mapped into the same space and their category is predicted based on which side of the gap they fall.
[0065] Thermocline: Thermocline is a thin layer located about 100-200 meters below the sea surface with huge changes in temperature and density. It is a layer where the water temperature drops sharply between the thin warm water layer on the upper layer and the thick cold water layer on the lower layer.
[0066] Based on the above technical terms, with the increasing frequency of ocean data surveys and the ever-expanding survey areas, ocean data collected by survey vessels and satellites exhibits numerous characteristics, including strong spatiotemporal correlation, complex and large-scale data formats, and diverse data formats. Effective analysis and processing of ocean thermocline data is crucial for ocean surveys and submarine operations. Prior art methods for analyzing and processing ocean thermoclines typically rely solely on partial derivatives and gradients of step data. While these methods can reveal data trends, due to the inherent errors inherent in the data survey and collection process, partial derivatives and gradients often fail to eliminate these errors and instead only serve to determine and observe data trends. This can lead to reduced accuracy and data loss in ocean data processing. Therefore, the present invention proposes a method for visualizing ocean thermocline data based on PCA-SVM, which improves the accuracy of ocean thermocline data processing and addresses the data loss caused by insufficient display accuracy due to low ocean data accuracy. This makes the collection, analysis, processing, and display of ocean thermocline data more reliable, accurate, and intuitive.
[0067] The specific embodiments are described in detail below:
[0068] The embodiments of the present invention provide a method, device, electronic device and storage medium for visualizing ocean thermocline data based on PCA-SVM, which are described below respectively.
[0069] like Figure 1 As shown, Figure 1 A flow chart of an embodiment of the ocean thermocline data visualization method based on PCA-SVM provided by the present invention is shown in FIG. Figure 1 As shown in Figure 2, the ocean thermocline data visualization method based on PCA-SVM includes:
[0070] S101, obtaining an initial ocean thermocline dataset;
[0071] S102, performing dimensionality reduction processing on the initial ocean thermocline data based on principal component analysis to obtain a reduced-dimensional ocean thermocline data set;
[0072] S103, performing filtering processing on the dimension-reduced ocean thermocline data based on a filtering control method to obtain a filtered ocean thermocline data set;
[0073] S104, obtaining a target BP neural network model, inputting the filtered ocean thermocline data set into the target BP neural network model for interpolation fitting, and obtaining a fitted ocean thermocline data set;
[0074] S105, obtaining a target SVM model, inputting the fitted ocean thermocline data set into the target SVM model to perform identification and classification of ocean thermoclines at different depths, and obtaining ocean thermocline target data;
[0075] S106: Perform visualization processing on the ocean thermocline target data to obtain a visualized ocean thermocline.
[0076] Compared with the prior art, the PCA-SVM-based ocean thermocline data visualization method provided in the embodiment of the present invention, on the one hand, greatly improves the accuracy of ocean thermocline data information by performing a series of pre-processing on the initial ocean thermocline data, including PCA dimensionality reduction, outlier filtering, interpolation supplementation, step labeling, and SVM classification training. On the other hand, the processed ocean thermocline data information is converted into JSON data format through matrix transformation, and then the JSON data is displayed through a visualization model. Since the PCA-SVM-based ocean thermocline data visualization method can reduce the dimensionality of ocean thermocline data and perform feature scaling processing, this will make the thermocline data visualization operation more intuitive, solving the problem of data loss caused by insufficient display accuracy due to the low accuracy of ocean thermocline data information.
[0077] In some embodiments of the present invention, the initial ocean thermocline data set is obtained through various survey vessels, marine detection sensors, satellites and other detection equipment, wherein the ocean thermocline data includes four dimensions and seawater temperature data corresponding to the four dimensions, wherein the four dimensions include longitude, latitude, depth and time.
[0078] In some embodiments of the present invention, Figure 2 As shown, Figure 2 This is a flow chart of an embodiment of PCA dimensionality reduction processing provided by the present invention, where step S102 includes:
[0079] S201, performing zero-value processing on the initial ocean thermocline data set to obtain a central matrix;
[0080] S202, calculating the covariance according to the centralization matrix to obtain a covariance matrix;
[0081] S203, calculating eigenvalues based on the covariance coefficients obtained from the covariance matrix, and constructing an eigenvector matrix based on the eigenvalues and eigenvectors calculated from the eigenvalues;
[0082] S204, screening the eigenvector matrix according to a preset eigenvalue screening threshold to obtain a primary screening matrix;
[0083] S205 , scaling the primary screening matrix to obtain a scaling matrix, where the scaling matrix constitutes the dimensionality-reduced ocean thermocline dataset.
[0084] In a specific embodiment of the present invention, since ocean temperature data contains four dimensions, namely longitude, latitude, depth, and time, these four dimensions can determine the ocean temperature data at any time and any location in the world. In order to better process the data, the ocean temperature data needs to be reduced in dimension.
[0085] First, the collected ocean thermocline data is zero-meaned. Each column of the two-dimensional data at a certain moment is organized into a new N*M matrix Y, where N corresponds to the number of rows in the data, which is also the basic characteristic attribute of the data. Based on this, m-dimensional data and the thermocline marker K are established. The average value of all dimensions in the Y matrix is calculated, and then the data in different dimensions are subtracted from this average value. The calculation method is as follows:
[0086]
[0087]
[0088] Among them, Y is the matrix composed of the data of seawater temperature at a certain sampling time within a certain longitude and latitude range, m is the matrix dimension, and Y m is the mean value of the mth column of the matrix, Y mis the mth column of the Y matrix, N corresponds to the number of rows of the data matrix, y in is the original data matrix that has not been processed.
[0089] Then, the covariance matrix is introduced. The different data features in the Y matrix are N. The correlation between different data is judged based on the covariance coefficient. The covariance coefficient is positively correlated with the impact of the feature on the entire data set. The specific calculation method is as follows:
[0090]
[0091] Among them, M cov The covariance matrix is obtained by calculating the covariance of the seawater temperature data in different dimensions. The covariance coefficient is used to calculate the eigenvalue. After the eigenvalue is calculated, the eigenvector composed of the eigenvalue is used to construct a new matrix ξ. The eigenvalue is then screened to remove the eigenvalues outside the threshold. Set λ j is the eigenvalue of the jth row, so the specific implementation formula is as follows:
[0092] ξ=[ξ1,ξ2,L,ξ m ],|λ j |>ε
[0093] Where ξ is a new matrix composed of the eigenvectors of the data matrix, λ j is the eigenvalue of the jth row, and ε is the set eigenvalue screening threshold.
[0094] Finally, after the above data is initially processed, a new vector space is formed. The new vector space is as follows:
[0095] Y′=[Y1,Y2,L,Y m ],ξ j →Y j
[0096] Y′ is the new vector space formed after the above data processing. The new vector space has actually completed the initial screening. However, compared with other data formats, the coordinate magnitude of thermocline data in one-dimensional depth is significantly different. In order to display it more intuitively on the coordinate axis, the processed data samples are scaled. The calculation method is as follows:
[0097]
[0098] Among them, δ n Represents the standard deviation of the unprocessed data, and the data matrix Y′ used for training is obtained after scaling n , import the data matrix into the transform function in StandarScaler for scaling.
[0099] The embodiment of the present invention reduces the dimension of the ocean thermocline data by using PCA to reduce the dimension of the ocean thermocline data, and further scales the reduced-dimensional data to preliminarily improve the accuracy of ocean thermocline data processing.
[0100] Furthermore, in some embodiments of the present invention, Figure 3 As shown, Figure 3 This is a flow chart of an embodiment of abnormal data filtering provided by the present invention. Step S103 includes:
[0101] S301, performing abnormal data filtering on the dimension-reduced ocean thermocline dataset to obtain a preliminary filtered ocean thermocline dataset;
[0102] S302. Calculate the mean square error of the unfiltered data in the preliminary filtered ocean thermocline data set, and mark as abnormal the data whose difference between the data value and the average value in the unfiltered data is greater than a preset multiplier mean square error, to obtain the filtered ocean thermocline data set.
[0103] In a specific embodiment of the present invention, since various instruments in ocean surveys inevitably generate some uncontrollable errors due to external factors during measurement, abnormal data filtering is still required for the data after feature extraction. Ocean data errors often come from two aspects: first, errors caused by position errors due to abnormalities in the surveying vessel and GPS signals. Such errors are more obvious after data cluster analysis; second, errors caused by faulty measuring devices. Such errors have more intuitive data characteristics and are significantly different from data in different dimensions.
[0104] In order to better perform data analysis, the present invention adopts a filtering control method to filter abnormal data, and compares the verified data set within a small range to remove abnormal data.
[0105] First, set the thermocline observation element dataset as G i (i=1,2...,N), observation element dataset G i Its physical meaning is the depth of seawater at a certain time and in a certain longitude and latitude area, and it is set when G i In (G min ,G max ) range, there is no error. If it exceeds this range, delete the value and use the average value of reasonable data within the observation range. Fill, where N is the number of data sets. The specific processing method is shown in the following formula:
[0106]
[0107] In order to better test the effect of abnormal data filtering, the mean square error of the unfiltered data is calculated. If the difference between the data value of a certain point and the average value is greater than n times the mean square error, the value of the data point will be marked as abnormal. The specific processing process is as follows:
[0108]
[0109] Var represents the mean square error within the normal data range. The value of n determines the accuracy of marking anomalies and the proportion of marked abnormal data. The value of n is between 3 and 6, which has a great impact on subsequent data analysis.
[0110] The embodiment of the present invention further improves the accuracy of ocean thermocline data processing by filtering outliers on the data after dimensionality reduction, calculating the mean square error of the data without filtering, and marking outliers that meet the abnormal characteristics.
[0111] Furthermore, in some embodiments of the present invention, Figure 4 As shown, Figure 4 This is a flow chart of an embodiment of constructing a target BP neural network model provided by the present invention. The process of obtaining the target BP neural network model in step S103 includes:
[0112] S401, obtaining a sample set of ocean thermocline data to be fitted;
[0113] S402, determining the number of input layers, hidden layers, and output layers in the BP neural network, and establishing an initial BP neural network model;
[0114] S403, determining initial weight values and initial thresholds of the input layer, hidden layer, and output layer, and iteratively training the initial BP neural network model based on the ocean thermocline data sample set to be fitted;
[0115] S404: updating the initial weight values and initial thresholds of the input layer, hidden layer, and output layer based on a genetic algorithm until a preset training accuracy is reached, thereby obtaining the target BP neural network model.
[0116] In a specific embodiment of the present invention, after filtering and marking anomalies in the thermocline data, interpolation fitting is required to maintain continuity of the ocean data information at unit precision. This invention employs a back propagation (BP) neural network to interpolate and fit the filtered thermocline data to ensure data continuity and prepare for subsequent data visualization.
[0117] BP neural network has a wide range of applications in data processing and is suitable for interpolation fitting of thermocline. Its implementation process is as follows: first, a large number of sample data sets that need to be fitted are repeatedly trained, and then the network error in the training model is reversely transferred to adjust the threshold and weight coefficient in the entire system network. Gradient search is performed on the thermocline data with gradient changes so that the error function presents a negative gradient descent, and then the output new data set is close to the expected data set, thereby achieving interpolation fitting.
[0118] The BP neural network structure includes input layer, output layer and hidden layer. The error transmission mode and network hierarchy relationship are as follows: Figure 5 As shown, Figure 5 This is a schematic diagram of an embodiment of the relationship between the BP neural network error propagation method and the network hierarchy provided by the present invention.
[0119] The data acquisition scale of the ocean thermocline determines the number of output and input layers in the neural network. The setting of the hidden layer is often determined through repeated experiments. Too many hidden layer neurons will affect the computing speed of the neural network system and cause overfitting problems, that is, the generation of unnecessary high-precision data. Insufficient number of hidden layer neurons will directly affect the quality of data fitting. Therefore, the present invention adopts the following relationship to select the number of hidden layer neurons:
[0120]
[0121] Where m represents the number of neurons in the hidden layer, k represents the number of neurons in the input layer, l represents the number of neurons in the output layer, and b is a constant between [1,15].
[0122] The system activation function is defined as:
[0123]
[0124] The training algorithm uses the LM (Levenberg-Marquardt) algorithm. The LM algorithm has certain advantages for ocean thermocline data. If the data gradient in a certain area decreases too quickly, the LM algorithm will adjust the value of τ to convert the training algorithm to the Gauss-Newton algorithm. If the gradient decreases too slowly, the LM algorithm will adjust the value of λ to convert the training algorithm to the gradient descent method. It can be seen that λ is mainly used to calculate the system step size increment. The specific calculation method is as follows:
[0125]
[0126] Among them, G k is the observation element dataset matrix G i After filtration, g is G k The Jacobian matrix, Δ TThe algorithm step increment, ξ, mentioned in step 1, is a matrix composed of eigenvectors, and τ is the algorithm adjustment threshold. The predicted output of the neural network system is denoted as U(n), and the actual output after model training is denoted as V(n). The input and output are represented as follows:
[0127] U(N)=[u1,u2,L,u N ]
[0128] V(N)=[v1,v2,L,v N ]
[0129] The mean square error is used to evaluate the error between the actual output and the predicted output, that is, the mean square error is used to evaluate the data interpolation fitting effect. MSE is the mean square error evaluation coefficient, N is the input data dimension, u i is the i-th column of the output prediction matrix, v i is the actual output matrix column i, the specific implementation method is as follows:
[0130]
[0131] It should be noted that in the actual processing process, when using thermocline sample data for training, the weight coefficients of the neural network model will converge to local extreme points. Therefore, in order to achieve a better neural network fitting effect, the present invention uses a genetic algorithm to perform global optimization of the neural network when limiting the iterative weights and thresholds. The implementation process is shown in Figure 6 , Figure 6 This is a flow chart of an embodiment of a BP neural network model based on a genetic algorithm provided by the present invention.
[0132] The embodiment of the present invention designs a BP neural network model based on a genetic algorithm to interpolate and fit the missing parts of the ocean thermocline data after abnormal data processing and marking, thereby ensuring the integrity of the ocean thermocline data set, further improving the accuracy of the ocean thermocline data, and providing reliable protection for subsequent data visualization.
[0133] Furthermore, in some embodiments of the present invention, Figure 7 As shown, Figure 7 This is a flow chart of an embodiment of constructing a target SVM model provided by the present invention. The process of obtaining the target SVM model in step S104 includes:
[0134] S701, obtaining a sample set of ocean thermocline data to be classified, and dividing the sample set of ocean thermocline data to be classified into a training set and a test set by selecting different proportions;
[0135] S702, determine the optimization objective function, model training function, decision function and SVM kernel function to establish an initial SVM model;
[0136] S703 , training and testing the SVM model based on the training set and the test set respectively, until the optimal penalty factor and kernel function coefficient are determined to obtain a target SVM model.
[0137] In a specific embodiment of the present invention, data that has undergone dimensionality reduction processing, abnormal data filtering, and interpolation fitting are used as input features of a support vector machine (SVM) to classify ocean temperatures at different depths and identify ocean thermoclines. The trained SVM model greatly improves the data identification and processing efficiency of the thermocline.
[0138] To train the SVM model, a large amount of data processed in the above-described embodiments must be fed into the SVM algorithm. This processed data set is called the training set, which directly influences the penalty factor C and kernel function coefficients in the SVM model. The test set, consisting of unprocessed data, is used to verify the model's effectiveness. The training set is a two-dimensional matrix of floating-point data. The trained SVM model inputs a two-dimensional matrix of unprocessed ocean information and outputs a two-dimensional matrix of analyzed ocean information that can be used for prediction and display.
[0139] Support vector machines (SVMs) are linear classification models that use supervised learning to perform binary classification on oceanographic data. SVMs often use the maximum margin plane, obtained from preprocessed sample data, as the decision boundary, resulting in the following optimization objective function.
[0140]
[0141] Among them, m represents the dimension of the new matrix formed by re-splitting the ocean information data matrix in the process of dimensionality reduction, j represents the number of sample indexes, and y j Represents the sample data for training, x i represents the number of rows of ocean information data samples, ω and b are target decision parameters, C is the penalty factor in SVM, δ i is a slack variable. Considering the effect and speed of the SVM model algorithm, the Gaussian kernel function is selected for model training as shown below:
[0142] K(y,c)=exp(-γ||yy′|| 2 )
[0143] The two core indicators for SVM model optimization are the penalty factor C and the kernel function coefficient γ. The penalty factor C mainly adjusts the step size and accuracy of the classifier, while λ determines the plane space in which the kernel function affects the mapping of ocean information data. The kernel function coefficient and penalty factor have a significant impact on model training and classification. The kernel function coefficient and penalty factor directly determine whether the SVM model can be applied to ocean information data samples. Therefore, it is necessary to optimize the penalty factor C and the kernel function coefficient λ. Based on this, the decision function and SVM kernel function are obtained as shown below:
[0144]
[0145]
[0146] Based on the established and trained SVM model, the ocean thermocline data that has undergone PCA dimensionality reduction, abnormal data filtering, and interpolation fitting processing is processed to obtain the ocean thermocline target data, which can be used for prediction and display of a two-dimensional data matrix of ocean information.
[0147] In order to more clearly illustrate the data processing process in the embodiment of the present invention, please refer to Figure 8 , Figure 8 This is a flow chart of an embodiment of ocean thermocline data processing based on PCA-SVM provided by the present invention.
[0148] The embodiment of the present invention establishes an SVM model to classify ocean temperatures at different depths and identify ocean thermoclines, thereby further improving the accuracy of ocean thermocline data and ensuring the display accuracy of ocean thermocline data visualization.
[0149] Furthermore, in some embodiments of the present invention, Figure 9 As shown, Figure 9 This is a flow chart of an embodiment of the present invention for visualizing ocean thermocline data, step S107 including:
[0150] S901, performing matrix transformation on the target ocean thermocline dataset to obtain a one-dimensional json data format file;
[0151] S902, adding header file information to the one-dimensional JSON data format file, wherein the header file information includes a time latitude and longitude range, time, ocean depth, and display mode, to obtain a target JSON file;
[0152] S903: Import the target json file into a visualization model to realize visualization of ocean thermocline data.
[0153] In a specific embodiment of the present invention, the data display method, after the steps in the above-mentioned data processing embodiment, the processed data is still two-dimensional data. However, after filtering, interpolation fitting, and SVM model processing, the data accuracy and reliability are greatly improved. Within a certain latitude and longitude range, the data accuracy can be increased from 0.5°×0.5° to even 0.25°×0.25°. First, MATLAB is used to perform a matrix transformation on the two-dimensional data matrix to obtain a one-dimensional JSON data format. A header file is added to the JSON file. The header file information should include the time latitude and longitude range, time, ocean depth, and display mode. The processed JSON file is then imported into a visualization model in the D3.js library to achieve visualization of the thermocline data.
[0154] In order to verify the superiority of the PCA-SVM-based ocean thermocline data visualization method provided by the present invention in applying it to the ocean thermocline, combined with the current more authoritative evaluation mechanism, the models processed by PCA and those not processed by PCA were compared under the same thermocline data input. In order to verify its superiority over other algorithms, the random forest algorithm, naive Bayes, KNN, and logistic regression were selected to test the same input ocean thermocline data. The comparison criteria were running time and accuracy. The comparison results are shown in Table 1.
[0155] Table 1 Comparison of running results of different algorithm models
[0156] algorithm parameter Type I error Type II error Runtime Accuracy Support Vector Machine λ=0.1,C=1 13 16 0.14960 99.55% BP-SVM λ=0.1,C=1 2 9 0.09675 99.83% KNN n_neighbors=5 9 5 0.19459 99.78% Naive Bayes Auto 25 16 0.01296 99.36% Logistic regression Auto 7 8 0.04199 99.77% Random Forest n_estimators=10 3 0 0.03191 99.95% Algorithm of the present invention λ=0.5,C=108.5 2 0 0.03291 99.97%
[0157] As can be seen in Table 1, the models using different algorithms all achieved good performance indicators. However, a vertical comparison of the different models clearly shows that the algorithm model proposed in this paper has the best indicators, indicating that the PCA-SVM-based ocean thermocline data visualization method proposed in this paper has higher accuracy in processing ocean thermocline data, and further enables data visualization with correspondingly higher display accuracy.
[0158] In order to better implement the ocean thermocline data visualization method based on PCA-SVM in the embodiment of the present invention, on the basis of the ocean thermocline data visualization method based on PCA-SVM, the embodiment of the present invention also provides an ocean thermocline data visualization device based on PCA-SVM, such as Figure 10 As shown, the ocean thermocline data visualization device 1000 based on PCA-SVM includes:
[0159] Data acquisition module 1001, used to obtain an initial ocean thermocline data set;
[0160] A dimensionality reduction processing module 1002 is configured to perform dimensionality reduction processing on the initial ocean thermocline data based on a principal component analysis method to obtain a reduced-dimensional ocean thermocline data set;
[0161] A filter processing module 1003 is configured to perform filter processing on the dimension-reduced ocean thermocline data based on a filter control method to obtain a filtered ocean thermocline data set;
[0162] The fitting processing module 1004 is used to obtain a target BP neural network model, input the filtered ocean thermocline data set into the target BP neural network model for interpolation fitting, and obtain a fitted ocean thermocline data set;
[0163] A classification processing module 1005 is used to obtain a target SVM model, input the fitted ocean thermocline data set into the target SVM model to perform identification and classification of ocean thermoclines at different depths, and obtain ocean thermocline target data;
[0164] The visualization module 1006 is configured to perform visualization processing on the ocean thermocline target data to obtain a visualized ocean thermocline.
[0165] The PCA-SVM-based ocean thermocline data visualization device 1000 provided in the above embodiment can implement the technical solution described in the above embodiment of the PCA-SVM-based ocean thermocline data visualization method. The specific implementation principles of the above modules or units can refer to the corresponding contents in the above embodiment of the PCA-SVM-based ocean thermocline data visualization method, which will not be repeated here.
[0166] like Figure 11 As shown, the present invention also provides an electronic device 1100. The electronic device 1100 includes a processor 1101, a memory 1102 and a display 1103. Figure 11 Only some of the components of the electronic device 1100 are shown, but it should be understood that it is not required to implement all of the shown components, and more or fewer components may be implemented instead.
[0167] In some embodiments, the processor 1101 can be a central processing unit (CPU), a microprocessor, or other data processing chip, used to run the program code or process data stored in the memory 1102, such as the ocean thermocline data visualization method based on PCA-SVM in the present invention.
[0168] In some embodiments, processor 1101 may be a single server or a server group. The server group may be centralized or distributed. In some embodiments, processor 1101 may be local or remote. In some embodiments, processor 1101 may be implemented on a cloud platform. In one embodiment, the cloud platform may include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, an on-premises cloud, a multi-cloud, or any combination thereof.
[0169] In some embodiments, the memory 1102 may be an internal storage unit of the electronic device 1100, such as a hard disk or memory of the electronic device 1100. In other embodiments, the memory 1102 may also be an external storage device of the electronic device 1100, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 1100.
[0170] Furthermore, the memory 1102 may include both an internal storage unit of the electronic device 1100 and an external storage device. The memory 1102 is used to store application software installed on the electronic device 1100 and various data.
[0171] In some embodiments, the display 1103 can be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. The display 1103 is used to display information on the electronic device 1100 and to display a visual user interface. Components 1101-1103 of the electronic device 1100 communicate with each other via a system bus.
[0172] In one embodiment, when the processor 1101 executes the pipeline leakage intelligent reorganization and recovery program based on the pipeline network topology structure in the memory 1102, the following steps may be implemented:
[0173] Obtain the initial ocean thermocline dataset;
[0174] Performing dimensionality reduction processing on the initial ocean thermocline data based on principal component analysis to obtain a reduced-dimensional ocean thermocline data set;
[0175] Performing filtering on the dimension-reduced ocean thermocline data based on a filtering control method to obtain a filtered ocean thermocline data set;
[0176] Obtaining a target BP neural network model, inputting the filtered ocean thermocline data set into the target BP neural network model for interpolation fitting, and obtaining a fitted ocean thermocline data set;
[0177] Obtaining a target SVM model, inputting the fitted ocean thermocline data set into the target SVM model to perform identification and classification of ocean thermoclines at different depths, and obtaining ocean thermocline target data;
[0178] Visualization processing is performed on the ocean thermocline target data to obtain a visualized ocean thermocline.
[0179] It should be understood that, when the processor 1101 executes the PCA-SVM-based ocean thermocline data visualization program in the memory 1102 , in addition to the above functions, it can also implement other functions. For details, please refer to the description of the corresponding method embodiment above.
[0180] Furthermore, the embodiment of the present invention does not specifically limit the type of the electronic device 1100 mentioned. The electronic device 1100 may be a portable electronic device such as a mobile phone, a tablet computer, a personal digital assistant (PDA), a wearable device, a laptop computer, or the like. Exemplary embodiments of portable electronic devices include, but are not limited to, portable electronic devices equipped with IOS, Android, Microsoft, or other operating systems. The above-mentioned portable electronic devices may also be other portable electronic devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the present invention, the electronic device 1100 may not be a portable electronic device, but a desktop computer with a touch-sensitive surface (e.g., a touch panel).
[0181] Accordingly, an embodiment of the present application also provides a computer-readable storage medium, which is used to store computer-readable programs or instructions. When the program or instructions are executed by a processor, it can implement the steps or functions of the ocean thermocline data visualization method based on PCA-SVM provided in the above-mentioned method embodiments.
[0182] Those skilled in the art will appreciate that all or part of the process steps of the above-described embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the computer program can be stored in a computer-readable storage medium. The computer-readable storage medium may be a magnetic disk, an optical disk, a read-only memory, or a random access memory.
[0183] The above is a detailed introduction to the ocean thermocline data visualization method and device based on PCA-SVM provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the ideas of the present invention, there may be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A method for visualizing ocean thermocline data based on PCA-SVM, characterized in that: include: Obtain the initial ocean thermocline dataset; Performing dimensionality reduction processing on the initial ocean thermocline data based on principal component analysis to obtain a reduced-dimensional ocean thermocline data set; Performing filtering on the dimension-reduced ocean thermocline data based on a filtering control method to obtain a filtered ocean thermocline data set; Obtaining a target BP neural network model, inputting the filtered ocean thermocline data set into the target BP neural network model for interpolation fitting, and obtaining a fitted ocean thermocline data set; Obtaining a target SVM model, inputting the fitted ocean thermocline data set into the target SVM model to perform identification and classification of ocean thermoclines at different depths, and obtaining ocean thermocline target data; Visualization processing is performed on the ocean thermocline target data to obtain a visualized ocean thermocline.
2. The method for visualizing ocean thermocline data based on PCA-SVM according to claim 1, characterized in that: The initial ocean thermocline data set includes four dimensions and seawater temperature data corresponding to the four dimensions, wherein the four dimensions include longitude, latitude, depth and time.
3. The method for visualizing ocean thermocline data based on PCA-SVM according to claim 1, characterized in that: The dimensionality reduction processing of the initial ocean thermocline data set based on the principal component analysis method to obtain a dimensionality-reduced ocean thermocline data set includes: Zeroing the initial ocean thermocline data set to obtain a central matrix; Calculating the covariance according to the centralization matrix to obtain a covariance matrix; Calculate eigenvalues based on the covariance coefficients obtained from the covariance matrix, and calculate eigenvectors based on the eigenvalues to construct an eigenvector matrix; Screening the eigenvector matrix according to a preset eigenvalue screening threshold to obtain a primary screening matrix; The primary screening matrix is scaled to obtain a scaled matrix, which constitutes the dimension-reduced ocean thermocline dataset.
4. The method for visualizing ocean thermocline data based on PCA-SVM according to claim 1, characterized in that: The filtering control method is used to filter the dimension-reduced ocean thermocline data to obtain a filtered ocean thermocline data set, including: Performing abnormal data filtering on the dimension-reduced ocean thermocline dataset to obtain a preliminary filtered ocean thermocline dataset; The mean square error (MSE) of the unfiltered data in the preliminary filtered ocean thermocline data set is calculated, and the data whose difference between the data value and the average value in the unfiltered data is greater than the preset multiplier mean square error is marked as abnormal, thereby obtaining the filtered ocean thermocline data set.
5. The method for visualizing ocean thermocline data based on PCA-SVM according to claim 1, characterized in that: Determining the target BP neural network model includes: Obtain a sample set of ocean thermocline data to be fitted; Determine the number of input layers, hidden layers, and output layers in the BP neural network, and establish an initial BP neural network model; Determining initial weight values and initial thresholds of the input layer, hidden layer, and output layer, and iteratively training the initial BP neural network model based on the ocean thermocline data sample set to be fitted; The initial weight values and initial thresholds of the input layer, hidden layer and output layer are updated based on the genetic algorithm until a preset training accuracy is reached to obtain the target BP neural network model.
6. The method for visualizing ocean thermocline data based on PCA-SVM according to claim 1, characterized in that: Determining the target SVM model includes: Obtaining a sample set of ocean thermocline data to be classified, and dividing the sample set of ocean thermocline data to be classified into a training set and a test set by selecting different proportions; Determine the optimization objective function, model training function, decision function and SVM kernel function to establish the initial SVM model; The SVM model is trained and tested based on the training set and the test set respectively until the optimized penalty factor and kernel function coefficient are determined to obtain the target SVM model.
7. The method for visualizing ocean thermocline data based on PCA-SVM according to claim 1, characterized in that: Visualizing the ocean thermocline target data and importing a visualization model to realize visualization of the thermocline data includes: Performing matrix transformation on the ocean thermocline target data to obtain a one-dimensional json data format file; Adding header file information to the one-dimensional JSON data format file, wherein the header file information includes time latitude and longitude range, time, ocean depth, and display mode, to obtain a target JSON file; Import the target json file into the visualization model to realize the visualization of ocean thermocline data.
8. A PCA-SVM-based ocean thermocline data visualization device, characterized in that: include: Data acquisition module, used to obtain the initial ocean thermocline data set; A dimensionality reduction processing module is used to perform dimensionality reduction processing on the initial ocean thermocline data based on a principal component analysis method to obtain a reduced-dimensional ocean thermocline data set; A filtering processing module is used to perform filtering processing on the dimension-reduced ocean thermocline data based on a filtering control method to obtain a filtered ocean thermocline data set; A fitting processing module is used to obtain a target BP neural network model, input the filtered ocean thermocline data set into the target BP neural network model for interpolation fitting, and obtain a fitted ocean thermocline data set; A classification processing module is used to obtain a target SVM model, input the fitted ocean thermocline data set into the target SVM model to perform identification and classification of ocean thermoclines at different depths, and obtain ocean thermocline target data; A visualization module is used to perform visualization processing on the ocean thermocline target data to obtain a visualized ocean thermocline.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the ocean thermocline data visualization method based on PCA-SVM according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the ocean thermocline data visualization method based on PCA-SVM according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Mass concrete temperature monitoring data prediction method and system and medium
CN114742260A
Efficiently discovering and synthesizing maps from a large corpus of maps
US20090210388A1