Method for distinguishing granite tectonic environment based on machine learning

Through the semi-supervised convolutional random forest model and word embedding method, combined with the CNN model to extract geochemical data features, the accuracy problem of granite structural environment identification is solved, and high-accuracy identification and research results are achieved, which is suitable for different regions around the world. Granite data.

CN118520281BActive Publication Date: 2024-09-24SHANDONG UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410992745.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2024-09-24
Estimated Expiration
2044-07-24

AI Technical Summary

Technical Problem

Existing machine learning methods cannot effectively identify the tectonic environment of granite, mainly due to the complex diagenetic history of granite and the difficulty in interpreting its chemical composition. Moreover, traditional methods rely on limited data and cannot accurately constrain the rock tectonic background.

Method used

The semi-supervised convolutional random forest model (SCRF) is used to extract geochemical data features through feature importance analysis and word embedding methods, combined with the CNN model, to build a highly accurate granite structural environment discrimination method, and to process high-dimensional and non-linear structural data. Improved discrimination accuracy.

Benefits of technology

It achieves high-accuracy identification of the tectonic environment of granite, improves the accuracy of crustal evolution and tectonic environment research, saves test time and cost, and is suitable for data prediction of unknown types of granite in different regions around the world.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118520281B
    Figure CN118520281B
Patent Text Reader

Abstract

The present invention belongs to the field of geoscience big data technology, and proposes a granite tectonic environment discrimination method based on machine learning, comprising the following steps: S1, pre-processing sample data in granite, and dividing the processed data into a training data set and a test data set; S2, feature analysis of the above data set; S3, constructing a semi-supervised convolutional random forest model SCRF; S4, constructing a discrimination diagram through feature importance analysis; S5, comprehensive model evaluation, and discriminating the granite tectonic environment through the trained model. The present invention applies the semi-supervised convolutional random forest method to distinguish the granite tectonic environment, combines the advantages of supervised learning and unsupervised learning, improves the accuracy of the machine learning model, and can process a large amount of high-dimensional and nonlinear structural data, saving experimental time and cost, and increasing the comprehensiveness and accuracy of the data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of geoscience big data, and in particular relates to a granite tectonic environment identification method based on machine learning. Background Art

[0002] The identification of tectonic environments has always been an important topic in petrological research, and can provide important clues to the evolution of the mantle and the history of plate tectonics. Granite is the most widely distributed type of intrusive rock in the world, accounting for more than half of the magmatic rocks in the continental crust. It is the main candidate for explaining the deep geochemistry and crustal dynamics of the region. In many areas, the only exposed product of magmatic tectonic events is plutonic rocks, especially granite. Therefore, studying the tectonic environment of granite is helpful to reveal geological tectonic activities and crustal evolution processes.

[0003] The current mainstream method for identifying the structure of granite is to use geochemical diagrams to identify the tectonic environment of granite formation. Since traditional identification diagrams are based on geochemical evolution processes, they only rely on limited data and features in actual applications and cannot well constrain the rock tectonic background.

[0004] The invention patent with application number 202310582917.6 proposes a graphical method for discriminating the tectonic background of adakitic rocks by integrating machine learning, including the following steps: S1. Collecting the main and trace element data of adakitic rocks and establishing a main and trace element data set of adakitic rocks; S2. Data preprocessing: abnormal data cleaning, deletion of missing values ​​and zero-mean normalization preprocessing; S3. Using unsupervised machine learning methods to perform feature analysis on the data set; S4. Machine learning algorithm training, parameter adjustment and evaluation to construct a machine learning discriminant model for the tectonic background of adakitic rocks; S5. Exhaustively enumerate and screen characteristic element end members; S6. Machine learning algorithm training and drawing decision boundaries; S7. Comprehensive model evaluation and visual review results to obtain a visual discriminant diagram.

[0005] Although the above method is combined with machine learning, it is not applicable to granite for the following reasons: 1. The prior patent is aimed at adakite, which belongs to the alkaline basalt category. Basalt is a direct product of mantle melting. The geochemical composition of the rock is relatively clear, and it is relatively easy to study its tectonic environment compared to granite. Granite has similar characteristics and genesis to a certain extent, which will have a certain impact on the classification effect of the machine learning model. Therefore, the proposed machine learning method cannot be directly applied to granite. 2. It is difficult to sample granite. When they are exposed on the surface, it is often difficult to obtain clear geological evidence of the tectonic environment at the time of intrusion; in addition, the diagenetic history of granite is more complex, which may make its chemical composition difficult to explain. Crystal accumulation, the participation of the continental crust, the redistribution and loss of elements caused by volatile melting, and the crystallization of minor phases rich in trace elements may mask the important geochemical characteristics of granite. When training and evaluating the prior patent model, the rock characteristics of adakite were not taken into account. Therefore, the machine learning model obtained by training was not fully considered and a more accurate model performance could not be obtained. Summary of the invention

[0006] The purpose of the present invention is to provide a method for high-accuracy identification of granite structural background, which adopts the following technical scheme, including:

[0007] S1, preprocessing the sample data in the granite, and dividing the processed data into a training data set and a test data set;

[0008] S2, perform feature analysis on the above data set;

[0009] S3, build a semi-supervised convolutional random forest model SCRF;

[0010] S4. Construct discriminant diagrams through feature importance analysis;

[0011] S5. Comprehensive model evaluation: granite tectonic environment identification is performed through the trained model.

[0012] Further, in step S1, the preprocessing includes:

[0013] (1) A linear regression model is established by the least squares method to predict missing data values, where the linear regression model is: , where is the variable j with missing values, are the observed values ​​of other variables, is the regression coefficient, is the error term; by minimizing the objective function: Obtain estimated values ​​of regression coefficients for estimating and interpolating missing values;

[0014] (2) Standardize the processed data set. The standardization formula is as follows: Where: is the original data, To standardize data; is the average value of each column of data, is the standard deviation.

[0015] Furthermore, in step S2, the eigenvalue decomposition is performed through the following covariance matrix to obtain the eigenvalue and eigenvector, and the PCA loading diagram is further obtained. The elements with obvious differences are intended to be used as important factors for distinguishing the granite tectonic environment; ,in, is the element in the i-th row and j-th column of the covariance matrix Σ, is the value of the kth sample of the standardized data matrix Z on the i-th variable, is the value of the kth sample of the standardized data matrix Z on the jth variable, is the sample mean of all sample values ​​of the ith variable, is the sample mean of all sample values ​​of the j-th variable, is the number of variables.

[0016] Furthermore, step S3 includes:

[0017] (1) Construct a semi-supervised random forest model;

[0018] (2) Construct a CNN model for extracting feature information from geochemical element data and convert the text data into an input format suitable for CNN through word embedding method;

[0019] (3) Use the trained CNN model to extract the features of granite geochemical data and generate CNN model features.

[0020] (4) Based on the features extracted by the CNN model and the labeled information of the granite samples, the training set and test set were constructed;

[0021] (5) After training the semi-supervised random forest model on the training set, the geochemical features are extracted and predictions are generated through the CNN model, and these prediction results are input as features into the semi-supervised random forest model to generate a semi-supervised convolutional random forest model SCRF.

[0022] Furthermore, in step S4, the Shapley value is used to calculate the feature importance, and the calculation formula of the SHAP value for feature j and sample X is: ;in: represents the SHAP value of feature j for sample X, is the baseline value predicted by the model (usually the average predicted value of all training samples), is the total number of features, is a subset of the feature set, is the model's predicted output for sample X on feature set S, is the weight of the subset S, usually the reciprocal of the number of feature combinations of S, is the number of features in subset S, Represents the corresponding input sample on the feature set S, It is a feature subset formed by adding feature j to the feature set S. It is the predicted output value of the model for the input sample X in the feature set S and after adding feature j.

[0023] Furthermore, the method further includes step S6: using a confusion matrix and a characteristic curve to perform prediction evaluation on unused test data in the granite data set, specifically including:

[0024] (1) Classify the prediction results;

[0025] (2) Calculate various performance indicators of the model: accuracy, recall, precision, and F1_score. Accuracy: The ratio of all correctly predicted samples to the total number of samples. The calculation formula is: Accuracy = (TP + TN) / (TP + FP + FN + TN); Precision: The ratio of all samples correctly predicted as positive by the model to the total number of samples predicted as positive by the model. The calculation formula is: Precision = TP / (TP + FP); Recall: The ratio of all samples correctly predicted as positive by the model to the total number of actual positive samples. The calculation formula is: Recall = TP / (TP + FN); F1_score: The harmonic mean of precision and recall. The calculation formula is: F1_score = 2 × Precision × Recall / (Precision + Recall).

[0026] Further, the word embedding method includes:

[0027] (1) Treat each geochemical element content value as a word, and convert it into a corresponding vector representation to form preprocessed text data;

[0028] (2) Construct a one-dimensional convolutional neural network structure to transform the preprocessed text data.

[0029] Compared with the prior art, the advantages and positive effects of the present invention are as follows:

[0030] The present invention applies the semi-supervised convolutional random forest method to distinguish the tectonic environment of granite. Compared with the traditional geochemical diagram that uses a small amount of data to distinguish the tectonic environment of granite formation, the machine learning method provided by the present invention combines the advantages of supervised learning and unsupervised learning, improves the accuracy of machine learning projects, and can process a large amount of high-dimensional and nonlinear structural data, saving experimental time and cost, and increasing the comprehensiveness and accuracy of data.

[0031] The present invention uses a variety of machine learning methods to train and create a self-training model - a semi-supervised convolutional random forest model. It applies unlabeled rock data to model training, further improves the granite structural type, and achieves high-dimensional discrimination of granite structural environment. At the same time, a discriminant diagram for granite structural environment is proposed, which can predict unknown types of granite data in different regions around the world, improving the research on crustal evolution and structural environment evolution. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 It is a PCA loading diagram of an embodiment of the present invention;

[0033] Figure 2 This is a feature importance analysis diagram of an embodiment of the present invention;

[0034] Figure 3 This is a diagram for distinguishing the granite structural environment according to an embodiment of the present invention. DETAILED DESCRIPTION

[0035] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be understood as limiting the present application.

[0036] This embodiment proposes a granite structural environment identification method based on machine learning, including:

[0037] 1. Tectonic Granite Dataset

[0038] This embodiment obtains a large amount of information data of known structural types and unknown granite samples based on published literature records or professional databases in the field of geology. The information data of each granite sample at least includes the name and content value of the elements contained in the sample, as well as the corresponding granite type.

[0039] The granite data set is constructed based on the information data of the granite samples. Each sample in the data set corresponds to a granite sample. In the labeled data set, each sample data is classified according to the structural environment of the granite. The number and order of the characteristic elements of the unlabeled data must be consistent with the labeled data. Finally, the labeled and unlabeled data are sorted to obtain the granite data set.

[0040] 2. Data Preprocessing

[0041] (1) Check whether there are duplicate sample data in the granite dataset; if so, only retain the information data of one of the samples and delete the information data of the remaining samples to ensure that there are no duplicate samples.

[0042] (2) Screening and excluding a portion of the original data affected by weathering, erosion and metamorphism. In this embodiment, screening is performed using a limiting condition (loss on ignition LOI < 3%).

[0043] (3) Deleting some elements with serious missing values. This embodiment uses algorithm analysis to obtain the missing rate of each feature value in the data, and only uses sample data with a missing rate of <5 elements in the original data features.

[0044] (4) Data interpolation is performed on some sample data with missing values. This embodiment adopts the Multivariate Imputation by Chained Equation (MICE) method to interpolate the missing values ​​of data elements and generate new values ​​while maintaining statistical consistency with the characteristic data distribution (for example, mean, range, standard deviation, etc.) of the original uninterpolated data.

[0045] Logical interpolation can be used to fill in missing values ​​through the correlation between multiple variables, rather than just using the information of a single variable. This can more accurately estimate missing values ​​and improve the predictive power of the model.

[0046] This embodiment uses the ordinary least squares method (OLS) to fit and interpolate the data model. OLS estimates the model parameters by minimizing the residual sum of squares between the actual observations and the model predictions. When estimating the missing data values, a linear model is established using the existing data and information of other variables, and then the model is used to estimate the missing data. In the MICE method, for each variable with missing values, OLS is used to establish a linear regression model to predict the missing values. Specifically, for variable j with missing values, the relevant linear regression model is: , where is the variable j with missing values, are the observed values ​​of other variables, is the regression coefficient, is the error term; by minimizing the objective function: , solving the above objective function, we can get the estimated value of the regression coefficient, which can be used to estimate and interpolate the missing values;

[0047] (5) Standardize the processed data set. Appropriate preprocessing is used to transform the data to obtain relatively concentrated data without changing the nature and correlation of the data. The calculation formula for standard deviation standardization is: Where: is the original data, To standardize data; is the average value of each column of data, is the standard deviation;

[0048] The mean of the transformed data set is 0 and the standard deviation is 1. Standardized data can eliminate dimensional differences between features, speed up model convergence, improve data model stability, and improve model interpretability.

[0049] The characteristic elements finally screened out for the experiment are 12 trace elements (Ga, Rb, Sr, Y, Zr, Nb, Ba, Hf, Ta, Pb, Th, U) and 14 rare earth elements (La, Ce, Pr, Nd, Sm, Eu, Gd, Tb, Dy, Ho, Er, Tm, Yb, Lu).

[0050] After preprocessing, the number of samples corresponding to each granite type in the cleaned data set is counted; the samples corresponding to the granite type with a sample number less than the preset sample size are oversampled, or the samples corresponding to the granite type with a sample number greater than the preset sample size are undersampled to obtain a data-balanced zircon data set. The granite data set is randomly divided into a training data set and a test data set in a ratio of 7:3 using a 10-fold cross-validation method.

[0051] 3. Feature Analysis of Datasets

[0052] The applicant has concluded through analyzing the characteristics of granite that the trace elements of granite include zirconium (Zr), niobium (Nb), and rubidium (Rb), and their content and distribution in granite can provide important information about magma evolution and tectonic environment. For example, the zircon content and the radioactive element content in zircon can be used to determine the formation age and magma source of granite, while the copper content may be related to mineralization. The rare earth elements of granite include lanthanide elements (such as lanthanum, cerium, neodymium, etc.) and yttrium elements (such as terbium, erbium, yttrium, etc.), and their content and distribution in granite can provide important clues about the genesis of magmatic rocks and melt evolution. The distribution pattern of rare earth elements has a strong indicative significance for the origin and genesis of granite, and the distribution pattern of rare earth elements in granite under different tectonic environments will be different. Each of the above chemical elements has an impact on the determination of the tectonic environment. Therefore, when constructing a model database, at least the above chemical elements should be included.

[0053] Granite tectonic environment data has high-dimensional characteristics, including various geological features and attributes. In model design, the applicant focused on how to perform feature selection and dimensionality reduction to reduce data dimensions and improve the generalization ability of the model.

[0054] This embodiment uses dimensionality reduction techniques such as principal component analysis (PCA) to reduce the dimensionality of high-dimensional chemical element data, reduce the feature dimensions, and retain the most important information. The relationship between the original data and the principal components is analyzed through principal component analysis PCA in unsupervised learning. The result of the principal component analysis is a linear combination of variables, which can affect the element feature selection decision. For a data set X containing n samples and m features, when performing principal component analysis, the covariance matrix Σ of the data is first calculated, and then the eigenvalues ​​and eigenvectors are obtained by eigenvalue decomposition of the covariance matrix. The specific steps of principal component analysis are: (1) Standardizing the data, such as step 5 above: Standardizing the original data matrix X, that is, subtracting the mean of each feature from the value of the feature and dividing it by the standard deviation of the feature to obtain the standardized data matrix Z.

[0055] (2) Calculate the covariance matrix: The elements of the covariance matrix Σ are: ,in, is the element in the i-th row and j-th column of the covariance matrix Σ, is the value of the kth sample of the standardized data matrix Z on the i-th variable, is the value of the kth sample of the standardized data matrix Z on the jth variable, is the sample mean of all sample values ​​of the ith variable, is the sample mean of all sample values ​​of the j-th variable, is the number of variables.

[0056] (3) Eigenvalue decomposition: Perform eigenvalue decomposition on the covariance matrix Σ to obtain eigenvalues ​​and eigenvectors.

[0057] PCA loading plot (such as Figure 1 The results show that principal component 1 (PC1) and principal component 2 (PC2) account for 45.33% and 15.75% of the variance of the data set, respectively, and the cumulative variance is greater than 60%, indicating that the selected principal components are sufficient to reflect the characteristics of the granite data set. Therefore, the load diagrams of PC1 and PC2 are used to further analyze the element data. The principal component analysis load diagram shows that there are obvious differences in La, Y, Gd, and Pb between granite data in different tectonic environments. The obvious difference elements have less overlap in the diagram and low similarity with other elements. Moreover, these elements have better vector values ​​on the x-axis or y-axis, and their element load directions can be seen to have less correlation with other elements. Therefore, these elements can be considered as important factors for determining the tectonic environment of granite.

[0058] The random forest RF, support vector machine SVM, K-nearest KNN, gradient boosting tree XGBoost and multilayer perceptron MLP algorithms in machine learning are used to train the data set.

[0059] This embodiment uses grid search combined with 10-fold cross validation to set a score as the standard for evaluating the model. For the machine learning model of each characteristic element, the optimal hyperparameters of the above five machine learning methods for granite structural background type classification are found; after optimizing the parameters of each machine learning model, the performance of the model fitted by the grid search is evaluated using the test data set. The results show that the accuracy of the random forest is 0.955; the accuracy of the support vector machine is 0.937; the accuracy of the K-nearest neighbor is 0.934; the accuracy of the gradient boosting tree is 0.936; and the accuracy of the multilayer perceptron is 0.944. It can be concluded that the random forest algorithm has the highest accuracy.

[0060] 4. Constructing a semi-supervised convolutional random forest model SCRF

[0061] When designing a semi-supervised learning model, after obtaining the most important chemical element information through principal component analysis (PCA), weights are added according to the importance. The specific steps are as follows:

[0062] 1. Determine the results of principal component analysis: First, perform principal component analysis and determine the most important chemical element information, usually some principal components. These principal components represent the most discriminative and informative parts of the original features.

[0063] 2. Calculate the contribution of the principal component: Through principal component analysis, we can get the contribution of each principal component, that is, the proportion of the total variance explained by the principal component. Principal components with higher contribution usually contain more information about the original features.

[0064] 3. Add weights to chemical elements: Add weights to the corresponding chemical elements according to the contribution of the main components. Different weights are given to each chemical element according to the contribution ratio of the main components, so that in the feature representation, the more distinctive and important features are more affected.

[0065] 4. Feature weighting and feature selection: The weighted chemical element information is used as the input feature of the model, and the weighted features can be used to train the semi-supervised learning model. At the same time, feature selection methods can be combined as needed to further screen out the most representative chemical element features.

[0066] 5. Model training and optimization: Use weighted features to train the model and optimize it according to the model performance. Machine learning algorithms, such as support vector machines (SVMs) and neural networks, can be used to build models that can effectively capture and distinguish the characteristics of different components, and accurately identify the granite tectonic environment.

[0067] After processing the granite data through the above steps, we can conduct model training, combine data mining and machine learning methods to mine the patterns contained in this information, build a semi-supervised machine learning model that is most suitable for granite, and effectively capture and distinguish the characteristics of different components, thereby achieving accurate judgment of the granite tectonic environment.

[0068] When constructing the model, this embodiment selects random forest as the base classifier, trains the model on labeled data through a semi-supervised algorithm, and then uses the model to predict unlabeled data, screens out high-confidence prediction samples, adds them to the training set, and continuously iterates the training model until the maximum number of iterations is reached or the threshold condition is met, thereby creating a semi-supervised machine learning self-training initialization model based on random forest.

[0069] In order to better capture the geochemical characteristics of granite, this embodiment integrates the same model to establish discrimination, and combines the above-mentioned semi-supervised random forest and the convolutional neural network (CNN) method in deep learning to propose a "Semi-Supervised Convolutional Random Forest" (SCRF). This method combines the semi-supervised method, the integrated learning ability of random forests and the deep feature learning ability of CNN, aiming to effectively use a small amount of labeled data and a large amount of unlabeled data for model training and improve classification performance. SCRF will provide better generalization performance and robustness, especially for situations where the data set labeling cost is high or most of the data in the data set is unlabeled. The combination strategy of SCRF can make full use of the advantages of the three technologies, resulting in higher classification accuracy and more reliable prediction results. Convolutional Neural Network (CNN) is a deep learning model that is particularly suitable for processing data with grid structures, such as images and videos. The specific steps of SCRF are:

[0070] (1) Construct a CNN model for extracting feature information from geochemical element data (using the geochemical element data in the dataset to define the CNN architecture, including convolutional layers, activation functions, pooling layers, and fully connected layers). CNN can effectively capture the spatial and local information in the data and help learn the complex features in geological samples.

[0071] (2) Use the trained CNN model to extract the features of the granite geochemical data. By passing the data to the convolution and pooling layers of the CNN model, feature maps are obtained, that is, CNN model features are generated.

[0072] (3) The features extracted by the CNN model are used as input and combined with the labeled information of the granite samples to construct a training set and a test set.

[0073] (4) After training the semi-supervised random forest model on the training set, the CNN model extracts geochemical features and generates predictions, which are then input as features into the semi-supervised random forest model to generate the SCRF model.

[0074] Considering that CNN requires a large amount of labeled data as training samples, and the model training time is long and the convergence is slow; the training data for machine learning is text data, while CNN processes image data; the data set samples of the two are incompatible and cannot be integrated.

[0075] On the one hand, this embodiment uses a semi-supervised random forest algorithm to use a small amount of labeled data for initial training, and labels a large amount of unlabeled data as "pseudo labels", integrating a large amount of labeled and unlabeled data, thereby meeting the initial demand for a large amount of labeled data when establishing a CNN training data set.

[0076] On the other hand, the problems of long model training time and slow convergence can be solved through transfer learning. The pre-trained CNN model is used as the basic network, and the convergence speed and performance of the model in the task of granite tectonic environment discrimination are accelerated through fine-tuning or feature extraction.

[0077] In order to solve the problem of incompatibility between text data and image data, this embodiment proposes to use word embedding technology to convert words into dense vector representations. In this embodiment, the geochemical element content value is regarded as a "word" and each feature data is regarded as a "sentence" or "text". These "text data" are preprocessed, including word segmentation (that is, each element content value is regarded as a "word"), and the data is converted into a format suitable for input into CNN; for each element content value, it is converted into a corresponding vector representation, namely word embedding.

[0078] For each element in the granite dataset, the pre-trained word embedding model Word2Vec is used (Word2Vec is a word embedding model developed by Google that learns the vector representation of words through two different learning methods: the continuous bag of words model (CBOW) and the Skip-gram model. These two methods are respectively designed to predict the target word based on the context word, or predict the context word based on the target word, thereby learning the vector representation of the word); since the number of elements in each data is fixed, each data point can be converted into a sequence of the same length. Data points with insufficient length are padded, and data points with a length exceeding the set length are truncated to ensure that the length of each data is consistent; then a one-dimensional convolutional neural network (1D CNN) structure is constructed to process the converted data. 1D CNN can apply convolution operations along the dimension of the element sequence to extract features between elements; in the 1D CNN structure, 30 convolutional layers and pooling layers are included to extract more advanced features. The convolution layer is used to capture local features, while the pooling layer is used to reduce the number of features and retain the most important information. At the end of the convolutional neural network, a fully connected layer and an output layer are added to map the extracted features to specific classification labels (i.e., different granite tectonic environments). Through the above steps, the convolutional neural network (CNN) can be applied to the granite dataset to extract features of the geochemical element content values, thereby realizing the identification of the tectonic environment of the granite.

[0079] 5. Construct discriminant diagrams through feature importance analysis

[0080] After the model is built, the unused test data in the granite dataset is used for prediction evaluation using confusion matrix and characteristic curve. The prediction evaluation of confusion matrix includes the following steps: first, the prediction results are classified into true positive class, true negative class, false positive class and false negative class, where the true positive class represents the number of samples correctly predicted as positive by the model; the true negative class represents the number of samples correctly predicted as negative by the model; the false positive class represents the number of samples incorrectly predicted as negative by the model; the false negative class represents the number of samples incorrectly predicted as positive by the model; and the various performance indicators of the model are calculated: accuracy, recall, precision, and F1-score. Accuracy: It is the ratio of all correctly predicted samples to the total number of samples, and the calculation formula is: Accuracy = (TP + TN) / (TP + FP + FN + TN). Precision: It is the ratio of all samples correctly predicted as positive by the model to all samples predicted as positive by the model, and the calculation formula is: Precision = TP / (TP + FP). Recall: It is the ratio of the number of samples correctly predicted as positive by the model to the number of samples in the actual positive category, and the calculation formula is: Recall = TP / (TP+FN). F1-score: It is the harmonic mean of precision and recall, and the calculation formula is: F1-score = 2×Precision×Recall / (Precision+Recall). The receiver operating characteristic curve is a curve drawn in the range of [0, 1] with the false positive rate as the horizontal coordinate and the true positive rate as the vertical coordinate. The closer its value is to 1, the higher the classification accuracy of the model. After specific testing and verification of this embodiment, the accuracy value was 0.995, and the receiver operating characteristic curve ROC value was 0.998. Both performance indicators are very close to 1, which proves that the machine learning model trained in this embodiment has good classification ability for various structural environments of granite.

[0081] The machine learning model with the highest accuracy, namely SCRF, is selected as the tectonic environment discrimination model of granite. In this embodiment, the model is used to distinguish five tectonic environments: Archean craton, continental flood basalt, intraplate volcanic activity, convergent plate and rift volcanic activity.

[0082] In a trained machine learning model, the feature importance graph helps understand which features play a key role in the prediction of the target variable and which features have less impact on the prediction. The feature importance graph is a graph used in machine learning to show the importance of features to model predictions. In this embodiment, the Shapley value is used to calculate feature importance. The SHAP value for feature j and sample X is calculated as: ;in: represents the SHAP value of feature j for sample X, is the baseline value predicted by the model (usually the average predicted value of all training samples), is the total number of features, is a subset of the feature set, is the model's predicted output for sample X on feature set S, is the weight of the subset S, usually the reciprocal of the number of feature combinations of S, is the number of features in subset S, Represents the corresponding input sample on the feature set S, It is a feature subset formed by adding feature j to the feature set S. It is the predicted output value of the model for the input sample X in the feature set S and after adding feature j. By calculating the SHAP value of each feature and drawing a feature importance graph, it can help understand the influence of each feature in the model on the final classification result.

[0083] This example explains which element features are most predictive of the target variable based on the feature importance obtained by the SCRF model with the highest accuracy. Figure 2 As shown, the results show that Nb, La, Nd, and Eu are the top four important elements for distinguishing granites in different tectonic environments. In order to more accurately distinguish the tectonic environment of granite, this embodiment proposes to use the Nb / Nd-La / Eu combination as a new discriminant diagram for granite. When generating a visual decision boundary diagram, the SCRF algorithm is selected as the classifier of the model, and the prediction set data (the same number of characteristic elements as the training set sample) used to predict and verify the quality of the model is applied to the new discriminant diagram. Figure 3 As shown, the accuracy of the Nb / Nd-La / Eu discrimination diagram is 99%, which is much higher than the traditional discrimination diagram, which demonstrates the robustness of the machine learning method proposed in this embodiment for discriminating the granite tectonic environment.

[0084] After constructing the semi-supervised random forest model, since the diagenetic history of the research object is complex, the geochemical data is difficult to interpret. This embodiment introduces uncertainty estimation technology to help evaluate the model's estimate of uncertainty, improve the reliability of the classification results and the interpretability of the factual interpretation. In the random forest model, this embodiment adopts a confidence-based method: based on the out-of-bag estimate. This method uses data that is not extracted in the bagging process of the random forest to evaluate the uncertainty of the model. The specific uncertainty evaluation method is as follows:

[0085] For each sample 𝑥 𝑖, the out-of-bag confidence of the sample can be calculated as an estimate of the uncertainty of its classification result. Assume that sample 𝑥 𝑖 was drawn for training times, and was not drawn (out-of-bag) times during training, then the out-of-bag confidence of the sample is:

[0086] ; The closer the out-of-bag confidence is to 0, the less certain the classification result of the model is for the sample; conversely, the closer it is to 1, the more certain the classification result is for the sample. In the model of this embodiment, the final out-of-bag confidence is 0.88, indicating that the semi-supervised learning model established after training has good model robustness and interpretability for granite classification, and can be used as a prediction model for studying the tectonic environment of granite.

[0087] Finally, the model evaluation results are integrated, and the trained model is applied to the granite data set of unknown tectonic environment to perform predictive evaluation on the unknown data set. The input data has all the training element characteristics; the input data is fed into the prediction model, and the tectonic type corresponding to the granite to be predicted is determined based on the output data.

[0088] The above-described embodiments of the present invention do not constitute a limitation on the protection scope of the present invention. Any modification, equivalent replacement and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for distinguishing granite tectonic environment based on machine learning, characterized in that: The steps include: S1, preprocessing the sample data in the granite, and dividing the processed data into a training data set and a test data set; S2, perform feature analysis on the above data set; The eigenvalue decomposition is performed through the following covariance matrix to obtain the eigenvalues ​​and eigenvectors, and the PCA loading diagram is further obtained. The elements with obvious differences are intended to be used as important factors for distinguishing the granite tectonic environment; ; in: is the element in the i-th row and j-th column of the covariance matrix Σ, is the value of the kth sample of the standardized data matrix Z on the i-th variable, is the value of the kth sample of the standardized data matrix Z on the jth variable, is the sample mean of all sample values ​​of the ith variable, is the sample mean of all sample values ​​of the j-th variable, is the number of variables; S3, build a semi-supervised convolutional random forest model SCRF; (1) Construct a semi-supervised random forest model; (2) Construct a CNN model for extracting feature information from geochemical element data and convert the text data into an input format suitable for CNN through word embedding method; (3) Use the trained CNN model to extract the features of granite geochemical data and generate CNN model features; (4) Based on the features extracted by the CNN model and the labeled information of the granite samples, the training set and test set were constructed; (5) After training the semi-supervised random forest model on the training set, the CNN model is used to extract geochemical features and generate predictions, and these prediction results are input as features into the semi-supervised random forest model to generate a semi-supervised convolutional random forest model (SCRF); S4. Construct discriminant diagrams through feature importance analysis; The Shapley value is used to calculate the feature importance. The calculation formula of the SHAP value for feature j and sample X is: ; in: represents the SHAP value of feature j for sample X, is the baseline value predicted by the model, is the total number of features, is a subset of the feature set, is the model's predicted output for sample X on feature set S, is the weight of the subset S, usually the reciprocal of the number of feature combinations of S, is the number of features in subset S, Represents the corresponding input sample on the feature set S, It is a feature subset formed by adding feature j to the feature set S. It is the predicted output value of the model for the input sample X in the feature set S and after adding feature j; S5. Comprehensive model evaluation: granite tectonic environment identification is performed through the trained model.

2. The granite tectonic environment identification method based on machine learning according to claim 1 is characterized in that: In step S1, the preprocessing includes: (1) A linear regression model is established by the least squares method to predict missing data values, where the linear regression model is: ; In the formula, is the variable j with missing values, are the observed values ​​of other variables, is the regression coefficient, is the error term; by minimizing the objective function: Obtain estimated values ​​of regression coefficients for estimating and interpolating missing values; (2) Standardize the processed data set. The standardization formula is as follows: ; Where: is the original data, To standardize data; is the average value of each column of data, is the standard deviation.

3. The granite tectonic environment identification method based on machine learning according to claim 1 is characterized in that: Also includes: Step S6: Use the confusion matrix and characteristic curve to perform prediction evaluation on the unused test data in the granite dataset, including: (1) Classify the prediction results; (2) Calculate various performance indicators of the model: accuracy, recall, precision, and F1-score; Accuracy: the ratio of all correctly predicted samples to the total number of samples, calculated as: Accuracy = (TP + TN) / (TP + FP + FN + TN); Precision: the ratio of all samples correctly predicted as positive by the model to the total number of samples predicted as positive by the model, calculated as: Precision = TP / (TP + FP); Recall: the ratio of all samples correctly predicted as positive by the model to the total number of actual positive samples, calculated as: Recall = TP / (TP + FN); F1-score: the harmonic mean of precision and recall, calculated as: F1-score = 2 × Precision × Recall / (Precision + Recall).

4. The granite tectonic environment identification method based on machine learning according to claim 1 is characterized in that: The word embedding method includes: (1) Treat each geochemical element content value as a word, and convert it into a corresponding vector representation to form preprocessed text data; (2) Construct a one-dimensional convolutional neural network structure to transform the preprocessed text data.