A rock nuclear magnetic resonance T2 spectrum prediction method based on image feature transfer learning

By integrating image feature transfer learning with rock physical handcrafted features, a hybrid method was developed to achieve high-precision prediction of rock nuclear magnetic resonance T2 spectra using a small number of samples. This solved the problems of insufficient prediction accuracy and stability under small sample conditions, and enabled rapid and economical evaluation of rock physical parameters.

CN122090118APending Publication Date: 2026-05-26OCEAN UNIV OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
OCEAN UNIV OF CHINA
Filing Date
2026-01-04
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately map two-dimensional thin section images of rocks to nuclear magnetic resonance T2 spectra under small sample conditions, resulting in insufficient prediction accuracy and weak generalization ability.

Method used

A hybrid approach combining image feature transfer learning and rock physics handcrafted features is adopted. Deep semantic features are extracted through a pre-trained deep convolutional neural network. Combined with principal component analysis and support vector regression models, a regression model of high-dimensional features to T2 spectrum is constructed to achieve high-precision prediction under small sample conditions.

Benefits of technology

It achieves high-precision prediction of rock nuclear magnetic resonance T2 spectra with a small number of samples, breaking through the limitations of traditional methods that require high core samples, have long measurement cycles, and are expensive, thus improving the stability and prediction accuracy of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122090118A_ABST
    Figure CN122090118A_ABST
Patent Text Reader

Abstract

This invention discloses a method for predicting the T2 spectrum of rock nuclear magnetic resonance (NMR) based on image feature transfer learning, relating to the field of oil and gas exploration and development technology. The method includes: S1. Standardization and enhancement preprocessing of rock casting thin section images; S2. Hybrid feature extraction fusing pre-trained deep features and handcrafted rock physical features; S3. Construction and training of a regression model from high-dimensional features to T2 spectrum under small sample conditions; S4. Direct prediction of rock NMR T2 spectrum. By employing image feature transfer and small sample learning strategies, this method overcomes the limitations of traditional NMR experiments, such as high requirements for core samples, long measurement cycles, and high costs. It enables rapid and efficient prediction of rock NMR T2 spectra using a small number of casting thin section images. Simultaneously, it significantly reduces the cost and time of rock property analysis, providing rapid support for rock property parameters in oil and gas reservoir evaluation, and has broad application prospects and economic benefits.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of oil and gas exploration and development technology, specifically to a method for predicting rock nuclear magnetic resonance T2 spectra based on image feature transfer learning. Background Technology

[0002] In oil and gas exploration and development, nuclear magnetic resonance (NMR) T2 spectra are key parameters for characterizing rock pore structure, assessing reservoir permeability, and predicting production capacity. Traditional T2 spectrum acquisition primarily relies on laboratory core NMR measurements. While this method offers high accuracy, it depends on complete and representative core samples, is time-consuming and expensive, and struggles to acquire large-scale, rapid T2 spectrum data from continuous formations. Although well logging NMR technology can provide continuous data, its vertical resolution is limited, the instruments are expensive, and it is not suitable for all well conditions.

[0003] In recent years, the combination of digital rock physics technology and machine learning methods has provided new avenues for predicting rock properties. Existing research has attempted to predict rock parameters using visual data such as CT scan images. However, these methods typically rely on large-scale, high-quality training datasets. In geological exploration practice, the number of precisely paired "image-T2 spectrum" samples available is extremely limited, severely restricting the performance of data-driven models and resulting in insufficient prediction accuracy and weak generalization ability. Current technologies have not yet effectively solved the problem of accurate and stable mapping from two-dimensional thin-section rock images to complex nuclear magnetic resonance T2 spectra under small sample conditions. Summary of the Invention

[0004] The purpose of this invention is to address the above-mentioned shortcomings by proposing a hybrid method that integrates image feature transfer learning and rock physical handcrafted features, which can achieve high-precision prediction of rock nuclear magnetic resonance T2 spectra using a small number of samples.

[0005] The present invention specifically adopts the following technical solution:

[0006] A method for predicting T2 NMR spectra of rocks based on image feature transfer learning includes the following steps:

[0007] S1. Normalization and enhancement preprocessing of thin section images of rock castings;

[0008] S2. Hybrid feature extraction that combines pre-trained deep features with rock physical handcrafted features;

[0009] S3. Construction and training of regression models from high-dimensional features to T2 spectra under small sample conditions;

[0010] S4. Direct prediction of T2 nuclear magnetic resonance spectra of rocks.

[0011] Preferably, S1 specifically includes the following steps:

[0012] S1.1. Collect core samples, prepare cast thin sections and obtain microscopic images, and conduct nuclear magnetic resonance experiments on core samples from the same source to measure and obtain T2 spectrum data, forming a set of cast thin section-T2 spectrum paired datasets;

[0013] S1.2. Perform color correction and white balance processing on all thin-section images, and use a standard color chart to standardize the colors to ensure color consistency of the dataset;

[0014] S1.3. Perform data augmentation on the standardized images, including random horizontal flipping, vertical flipping, small-angle rotation, and fine-tuning of brightness and contrast, thereby expanding the scale of the data and improving the generalization ability of the model.

[0015] Preferably, S2 specifically includes the following steps:

[0016] S2.1. Use a ResNet50 convolutional neural network pre-trained on the large natural image dataset ImageNet as a fixed feature extractor, remove the fully connected classification layer at the end of the network, input the cast thin slice image preprocessed in step S1 into the network, and extract the feature vector output after the global average pooling layer as the deep semantic feature vector.

[0017] S2.2. Quantitatively extract low-dimensional handcrafted features related to rock structure from thin section images, specifically including texture features based on gray-level co-occurrence matrix and morphological features based on pore space Otsu threshold segmentation;

[0018] S2.3. The high-dimensional deep semantic feature vector is directly concatenated with the low-dimensional handmade feature vector composed of texture features and morphological features to form a high-dimensional mixed feature vector containing all the original feature information. The mixed feature vector is linearly reduced by principal component analysis. By retaining the principal components with a cumulative variance contribution rate of more than 95%, a low-dimensional mixed feature is constructed.

[0019] Preferably, S3 specifically includes the following steps:

[0020] S3.1. Using the dimensionality-reduced hybrid features from step S2.3 as input and the nuclear magnetic resonance T2 spectrum as output, construct a support vector regression model;

[0021] S3.2. Divide the entire paired dataset into a training set and a test set, and use the training set to train the regression model with the goal of minimizing the mean square error between the predicted T2 spectrum and the true T2 spectrum.

[0022] S3.3. The K-fold cross-validation method is used to evaluate the model stability, and the model hyperparameters are optimized by grid search;

[0023] S3.4. On the test set, the root mean square error and Pearson correlation coefficient are used to evaluate the model’s prediction accuracy and generalization ability.

[0024] S4. Direct prediction of T2 nuclear magnetic resonance spectra of rocks.

[0025] Preferably, in S2.1, the extraction of deep semantic feature vectors is achieved through a deterministic forward propagation and data aggregation process: the preprocessed cast thin-slice image is input into a ResNet50 network that has undergone head removal processing. The image undergoes nonlinear transformation and feature abstraction layer by layer through the network's convolutional layers and residual blocks, ultimately generating a high-level spatial feature map with [C, H, W] dimensions. Subsequently, this feature map undergoes spatial aggregation through a global average pooling layer, that is, the arithmetic mean of the feature values ​​at all spatial positions (i, j) of each feature channel c is calculated, mathematically expressed as:

[0026]

[0027] Where, x c (i, j) represents the feature value of the c-th channel in the high-level spatial feature map output by the convolutional neural network at spatial position (p, q); c is the number of channels in the high-level spatial feature map; H is the number of pixels in the high-level spatial feature map in the vertical direction; W is the number of pixels in the high-level spatial feature map in the vertical direction; i is the spatial position index in the vertical direction of the feature map; j is the spatial position index in the horizontal direction of the feature map; f c This is the scalar eigenvalue obtained by performing global average pooling on the c-th channel at all spatial locations;

[0028] This compresses a three-dimensional tensor [C, H, W] containing spatial information into a one-dimensional feature vector F_deep = [f_1, f_2, ..., f_C] with a fixed dimension of C. This vector is the extracted deep semantic feature vector that represents the high-level semantic content of the image.

[0029] Preferably, in S2.3, the high-dimensional hybrid feature vector is F. hybrid :

[0030]

[0031] Where Concat(⋅) represents the vector concatenation function, F hybrid It is a high-dimensional hybrid feature vector containing all the original feature information, with a dimension of d. d +d h ;F deep The vector is a deep semantic feature vector obtained by global average pooling from a convolutional neural network, with dimension d. d ;F handThis is a handcrafted feature vector obtained by concatenating texture and morphological features, with dimension d. h ;

[0032] To mitigate the curse of dimensionality and the risk of overfitting with small samples caused by high-dimensional features, a matrix composed of high-dimensional mixed feature vectors from all training samples is used. Principal component analysis is performed; using the singular value decomposition algorithm, a new set of orthogonal bases, i.e., principal components, is found such that the variance of the data projected onto these bases is maximized. Specifically, the covariance matrix is ​​calculated. Find the eigenvalues ​​and eigenvectors of the vector, and arrange the eigenvalues ​​in descending order: λ1≥λ2≥...≥λ dd+dh Its corresponding feature vectors v1, v2, ..., v dd+dh That is, the direction of the principal component;

[0033] Set the cumulative variance contribution rate threshold θ = 95%, and select the minimum k such that:

[0034]

[0035] λ i Let be the i-th eigenvalue of the covariance matrix, sorted from largest to smallest; θ is the cumulative variance contribution rate threshold; k is the minimum number of principal components that satisfy the cumulative variance contribution rate not less than 0, i.e., the number of principal components retained.

[0036] The projection matrix is ​​constructed by selecting the first k principal component directions. , where v i λ is the eigenvalue corresponding to the covariance matrix i The eigenvector of the i-th principal component is the direction of the i-th principal component.

[0037] Finally, the original high-dimensional mixed feature vector F hybrid Projecting onto the low-dimensional subspace spanned by the first k principal components yields the dimensionality-reduced low-dimensional mixed feature vector F. low :

[0038]

[0039] This k-dimensional vector F low This serves as the input feature for the subsequent regression model. It retains over 95% of the information from the original high-dimensional mixed features, while simultaneously achieving feature compression and decorrelation. W PCA Let F be the projection matrix formed by the columns of the first k principal component directions. low The reduced low-dimensional mixed feature vector is obtained by converting F... hybrid The representation obtained by projecting onto a low-dimensional subspace spanned by the first k principal components.

[0040] Preferably, in S3.1, the constructed support vector regression model uses a kernel-based nonlinear regression function for mapping. The specific form of the decision function of this model is as follows:

[0041]

[0042] Where x is the input low-dimensional mixed feature vector, For the first The feature vectors of each training sample and The Lagrange multipliers obtained through optimization are given, b is the bias term, and the kernel function K(⋅,⋅) uses radial basis functions. f(x) is the predicted value of the input sample x in a certain T2 spectral discrete dimension by the support vector regression model, and N... train K is the number of samples in the training set; K is the kernel function used to measure the difference between the input sample x and the training sample x. The similarity in the high-dimensional feature space, where b is the bias term of the support vector regression model.

[0043]

[0044] Where γ is the kernel function parameter and ϵ is the insensitive loss parameter, determined through grid search optimization. For m discrete amplitude values ​​of the T2 spectrum, m independent regression functions are constructed for prediction; || x i -x j || 2 For vector x i With x j The squared Euclidean distance in the low-dimensional feature space, where γ is the kernel width parameter of the RBF kernel function, controls the influence of distance on the similarity decay rate.

[0045] Preferably, the specific process in S3.4 is as follows:

[0046] Forecasting and Data Preparation

[0047] All cast thin-slice image samples in the test set are processed sequentially through steps S1 and S2 to obtain corresponding low-dimensional mixed feature vectors. Subsequently, these feature vectors are input into the final support vector regression model trained in step S3 to obtain the predicted T2 spectrum for each sample. where i = 1, 2, ..., N test The index represents the test sample, m is the discrete dimension of the T2 spectrum, and the true T2 spectrum of each sample is obtained through nuclear magnetic resonance experiments. ;

[0048] Evaluation index calculation

[0049] Based on the predicted spectrum and the true spectrum set of all test samples Calculate the following two core indicators respectively:

[0050] Root Mean Square Error (RMSE): This metric measures the overall average deviation between predicted and actual values. A smaller value indicates higher prediction accuracy. For multidimensional T2 spectra, the overall RMSE is calculated as follows:

[0051]

[0052] Where, N test ŷ is the number of samples in the test set, m is the total number of amplitude dimensions of the T2 spectrum discreteness, and ŷ ij Let y be the predicted value of the i-th test sample in the j-th T2 spectrum discrete dimension; ij This represents the true measurement value of the i-th test sample on the j-th discrete dimension of the T2 spectrum. Simultaneously, the RMSE on each T2 spectrum dimension j can be calculated. j To analyze the distribution of prediction error of the model in different relaxation time intervals;

[0053] The Pearson correlation coefficient measures the linear correlation between the predicted and actual spectra. A value closer to 1 indicates better consistency in the predicted trend and stronger generalization ability. For multi-dimensional outputs, the overall correlation coefficient R is typically calculated as the sum of all data points × the dimension.

[0054]

[0055] in, and These are the global averages of all predicted values ​​and all true values, respectively. Similarly, the interspectral correlation coefficient R for each test sample i is also calculated. i To evaluate the consistency of the model's predictions for a single sample;

[0056] Comprehensive assessment of generalization ability

[0057] A RMSE value lower than the set empirical threshold indicates that the model has high prediction accuracy;

[0058] The overall Pearson correlation coefficient R is greater than 0.8, indicating that the predicted spectrum and the actual spectrum have a highly consistent shape and trend.

[0059] The interspectral correlation coefficients Ri of each sample are concentrated with high mean and small variance, indicating that the model has stable predictive performance and strong generalization ability for different test samples.

[0060] Preferably, in step S4, the direct prediction of the rock nuclear magnetic resonance T2 spectrum specifically includes:

[0061] S4.1. For a new image of a cast thin section with an unknown T2 spectrum, perform step S1 normalization and enhancement preprocessing, and step S2 hybrid feature extraction in sequence.

[0062] S4.2. Input the extracted final feature representation into the regression model trained in step S3, and directly output its predicted nuclear magnetic resonance T2 spectrum.

[0063] The present invention has the following beneficial effects:

[0064] This scheme overcomes the limitations of traditional nuclear magnetic resonance experiments, such as high requirements for core samples, long measurement cycles, and high costs, by standardizing and fusing features of thin-section images of rock castings and combining them with a few-sample learning strategy. It can quickly and efficiently predict the nuclear magnetic resonance T2 spectrum of rocks using a small number of thin-section images.

[0065] This method integrates deep migration features with prior knowledge of rock physics, significantly improving prediction accuracy and model stability under small sample conditions. It provides rapid support for rock property parameters in oil and gas reservoir evaluation and has broad application prospects and economic benefits. Attached Figure Description

[0066] Figure 1 This is a method for predicting T2 NMR spectra of rocks based on image feature transfer learning;

[0067] Figure 2 This is a comparison chart of the predicted T2 spectrum of rock nuclear magnetic resonance in this invention and the T2 spectrum measured in the laboratory. Detailed Implementation

[0068] The specific embodiments of the present invention will be further described below with reference to the accompanying drawings and specific examples:

[0069] A method for predicting T2 NMR spectra of rocks based on image feature transfer learning includes the following steps:

[0070] S1. Normalization and enhancement preprocessing of thin section images of rock castings;

[0071] S2. Hybrid feature extraction that combines pre-trained deep features with rock physical handcrafted features;

[0072] S3. Construction and training of regression models from high-dimensional features to T2 spectra under small sample conditions;

[0073] S4. Direct prediction of T2 nuclear magnetic resonance spectra of rocks.

[0074] S1 specifically includes the following steps:

[0075] S1.1. Collect core samples, prepare cast thin sections and obtain microscopic images, and conduct nuclear magnetic resonance experiments on core samples from the same source to measure and obtain T2 spectrum data, forming a set of cast thin section-T2 spectrum paired datasets;

[0076] S1.2. Perform color correction and white balance processing on all thin-section images, and use a standard color chart to standardize the colors to ensure color consistency of the dataset;

[0077] S1.3. Perform data augmentation on the standardized images, including random horizontal flipping, vertical flipping, small-angle rotation, and fine-tuning of brightness and contrast, thereby expanding the scale of the data and improving the generalization ability of the model.

[0078] S2 specifically includes the following steps:

[0079] S2.1. Use a ResNet50 convolutional neural network pre-trained on the large natural image dataset ImageNet as a fixed feature extractor, remove the fully connected classification layer at the end of the network, input the cast thin slice image preprocessed in step S1 into the network, and extract the feature vector output after the global average pooling layer as the deep semantic feature vector.

[0080] S2.2. Quantitatively extract low-dimensional handcrafted features related to rock structure from thin section images, specifically including texture features based on gray-level co-occurrence matrix and morphological features based on pore space Otsu threshold segmentation;

[0081] S2.3. The high-dimensional deep semantic feature vector is directly concatenated with the low-dimensional handmade feature vector composed of texture features and morphological features to form a high-dimensional mixed feature vector containing all the original feature information. The mixed feature vector is linearly reduced by principal component analysis. By retaining the principal components with a cumulative variance contribution rate of more than 95%, a low-dimensional mixed feature is constructed.

[0082] S3 specifically includes the following steps:

[0083] S3.1. Using the dimensionality-reduced hybrid features from step S2.3 as input and the nuclear magnetic resonance T2 spectrum as output, construct a support vector regression model;

[0084] S3.2. Divide the entire paired dataset into a training set and a test set, and use the training set to train the regression model with the goal of minimizing the mean square error between the predicted T2 spectrum and the true T2 spectrum.

[0085] S3.3. The K-fold cross-validation method is used to evaluate the model stability, and the model hyperparameters are optimized by grid search;

[0086] S3.4. On the test set, the root mean square error and Pearson correlation coefficient are used to evaluate the model’s prediction accuracy and generalization ability.

[0087] S4. Direct prediction of T2 nuclear magnetic resonance spectra of rocks.

[0088] In S2.1, the extraction of deep semantic feature vectors is achieved through a deterministic forward propagation and data aggregation process: the preprocessed cast thin-slice image is input into a ResNet50 network that has undergone head removal processing. The image undergoes nonlinear transformation and feature abstraction layer by layer through the network's convolutional layers and residual blocks, ultimately generating a high-level spatial feature map with [C, H, W] dimensions. Subsequently, this feature map undergoes spatial aggregation through a global average pooling layer, that is, the arithmetic mean of the feature values ​​at all spatial positions (i, j) for each feature channel c is calculated, mathematically expressed as:

[0089]

[0090] Where, x c (i, j) represents the feature value of the c-th channel in the high-level spatial feature map output by the convolutional neural network at spatial position (p, q); c is the number of channels in the high-level spatial feature map; H is the number of pixels in the high-level spatial feature map in the vertical direction; W is the number of pixels in the high-level spatial feature map in the vertical direction; i is the spatial position index in the vertical direction of the feature map; j is the spatial position index in the horizontal direction of the feature map; f c This is the scalar eigenvalue obtained by performing global average pooling on the c-th channel at all spatial locations;

[0091] This compresses a three-dimensional tensor [C, H, W] containing spatial information into a one-dimensional feature vector F_deep = [f_1, f_2, ..., f_C] with a fixed dimension of C. This vector is the extracted deep semantic feature vector that represents the high-level semantic content of the image.

[0092] In S2.3, the high-dimensional mixed feature vector is F. hybrid :

[0093]

[0094] Where Concat(⋅) represents the vector concatenation function, F hybrid It is a high-dimensional hybrid feature vector containing all the original feature information, with a dimension of d. d +d h ;F deep The vector is a deep semantic feature vector obtained by global average pooling from a convolutional neural network, with dimension d. d ;F hand This is a handcrafted feature vector obtained by concatenating texture and morphological features, with dimension d. h ;

[0095] To mitigate the curse of dimensionality and the risk of overfitting with small samples caused by high-dimensional features, a matrix composed of high-dimensional mixed feature vectors from all training samples is used. Principal component analysis is performed; using the singular value decomposition algorithm, a new set of orthogonal bases, i.e., principal components, is found such that the variance of the data projected onto these bases is maximized. Specifically, the covariance matrix is ​​calculated. Find the eigenvalues ​​and eigenvectors of the vector, and arrange the eigenvalues ​​in descending order: λ1≥λ2≥...≥λ dd+dh Its corresponding feature vectors v1, v2, ..., v dd+dh That is, the direction of the principal component;

[0096] Set the cumulative variance contribution rate threshold θ = 95%, and select the minimum k such that:

[0097]

[0098] λ i Let be the i-th eigenvalue of the covariance matrix, sorted from largest to smallest; θ is the cumulative variance contribution rate threshold, which is set to 95% in this method; k is the minimum number of principal components that satisfy the cumulative variance contribution rate of not less than 0, i.e., the number of principal components retained.

[0099] The projection matrix is ​​constructed by selecting the first k principal component directions. , where v i λ is the eigenvalue corresponding to the covariance matrix i The eigenvector of the i-th principal component is the direction of the i-th principal component.

[0100] Finally, the original high-dimensional mixed feature vector F hybrid Projecting onto the low-dimensional subspace spanned by the first k principal components yields the dimensionality-reduced low-dimensional mixed feature vector F. low :

[0101]

[0102] This k-dimensional vector F low This serves as the input feature for the subsequent regression model. It retains over 95% of the information from the original high-dimensional mixed features, while simultaneously achieving feature compression and decorrelation. W PCA Let F be the projection matrix formed by the columns of the first k principal component directions. low The reduced low-dimensional mixed feature vector is obtained by converting F... hybrid The representation obtained by projecting onto a low-dimensional subspace spanned by the first k principal components.

[0103] In S3.1, the constructed support vector regression model uses a kernel-based nonlinear regression function for mapping. The specific form of the decision function of this model is as follows:

[0104]

[0105] Where x is the input low-dimensional mixed feature vector, For the first The feature vectors of each training sample and The Lagrange multipliers obtained through optimization are given, b is the bias term, and the kernel function K(⋅,⋅) uses radial basis functions. f(x) is the predicted value of the input sample x in a certain T2 spectral discrete dimension by the support vector regression model, and N... train K is the number of samples in the training set; K is the kernel function used to measure the input samples. With training samples The similarity in the high-dimensional feature space, where b is the bias term of the support vector regression model.

[0106]

[0107] Where γ is the kernel function parameter and ϵ is the insensitive loss parameter, determined through grid search optimization. For m discrete amplitude values ​​of the T2 spectrum, m independent regression functions are constructed for prediction; || x i -x j || 2 For vector x i With x j The squared Euclidean distance in the low-dimensional feature space, where γ is the kernel width parameter of the RBF kernel function, controls the influence of distance on the similarity decay rate.

[0108] The specific process in S3.4 is as follows:

[0109] Forecasting and Data Preparation

[0110] All cast thin-slice image samples in the test set are processed sequentially through steps S1 and S2 to obtain corresponding low-dimensional mixed feature vectors. Subsequently, these feature vectors are input into the final support vector regression model trained in step S3 to obtain the predicted T2 spectrum for each sample. where i = 1, 2, ..., N test The index represents the test sample, m is the discrete dimension of the T2 spectrum, and the true T2 spectrum of each sample is obtained through nuclear magnetic resonance experiments. ;

[0111] Evaluation index calculation

[0112] Based on the predicted spectrum and the true spectrum set of all test samples Calculate the following two core indicators respectively:

[0113] Root Mean Square Error (RMSE): This metric measures the overall average deviation between predicted and actual values. A smaller value indicates higher prediction accuracy. For multidimensional T2 spectra, the overall RMSE is calculated as follows:

[0114]

[0115] Where, N test ŷ is the number of samples in the test set, m is the total number of amplitude dimensions of the T2 spectrum discreteness, and ŷ ij Let y be the predicted value of the i-th test sample in the j-th T2 spectrum discrete dimension; ij This represents the true measurement value of the i-th test sample on the j-th discrete dimension of the T2 spectrum. Simultaneously, the RMSE on each T2 spectrum dimension j can be calculated. j To analyze the distribution of prediction error of the model in different relaxation time intervals;

[0116] The Pearson correlation coefficient measures the linear correlation between the predicted and actual spectra. A value closer to 1 indicates better consistency in the predicted trend and stronger generalization ability. For multi-dimensional outputs, the overall correlation coefficient R is typically calculated as the sum of all data points × the dimension.

[0117]

[0118] in, and These are the global averages of all predicted values ​​and all true values, respectively. Similarly, the interspectral correlation coefficient R for each test sample i is also calculated. i To evaluate the consistency of the model's predictions for a single sample;

[0119] Comprehensive assessment of generalization ability

[0120] A RMSE value lower than the set empirical threshold indicates that the model has high prediction accuracy;

[0121] The overall Pearson correlation coefficient R is greater than 0.8, indicating that the predicted spectrum and the actual spectrum have a highly consistent shape and trend.

[0122] The interspectral correlation coefficients Ri of each sample are concentrated with high mean and small variance, indicating that the model has stable predictive performance and strong generalization ability for different test samples.

[0123] In step S4, the direct prediction of the rock nuclear magnetic resonance T2 spectrum specifically includes:

[0124] S4.1. For a new image of a cast thin section with an unknown T2 spectrum, perform step S1 normalization and enhancement preprocessing, and step S2 hybrid feature extraction in sequence.

[0125] S4.2. Input the extracted final feature representation into the regression model trained in step S3, and directly output its predicted nuclear magnetic resonance T2 spectrum. Taking the tight sandstone reservoir of Oilfield A in a basin of China as an example, this invention provides a method for predicting rock nuclear magnetic resonance T2 spectra based on image feature transfer and few-sample learning. Figure 1 As shown, it includes the following steps:

[0126] S1. Normalization and enhancement preprocessing of thin section images of rock castings.

[0127] S1.1. Thirty representative samples were selected from core samples drilled from the target formation in Oilfield A. Each sample was prepared into a standard blue cast thin section, and high-resolution digital images were acquired under a microscope. Simultaneously, laboratory nuclear magnetic resonance (NMR) tests were performed on the core samples from the same source to obtain accurate T2 spectra, and 30 sets of paired datasets of "thin section images-T2 spectra" were established.

[0128] S1.2. Use the X-Rite ColorChecker standard color chart to perform color correction on all 30 thin film images to ensure that the blue filling pores and skeleton mineral color of the resin are consistent across different images, eliminating color deviations caused by differences in staining and lighting.

[0129] S1.3. Data augmentation is performed on the 30 corrected base images. Each image is subjected to one horizontal flip, one vertical flip, one 5-degree clockwise rotation, and one 5-degree counter-clockwise rotation, with brightness and contrast adjusted between 90% and 110%. Finally, the original dataset is expanded to 150 images.

[0130] S2. Hybrid feature extraction combining pre-trained deep features and rock physical handcrafted features:

[0131] S2.1. A ResNet50 model pre-trained in the Keras framework is used, with the top classification layer removed. 150 pre-processed images are input into the network, and 150 2048-dimensional deep semantic feature vectors are extracted from the layer before the global average pooling layer.

[0132] S2.2. For each slice image, calculate its gray-level co-occurrence matrix and extract four texture feature parameters: contrast, correlation, energy, and homogeneity. Simultaneously, use the Otsu algorithm to perform binarization segmentation on the image, distinguishing between pores and skeleton, and calculate four morphological feature parameters for the pore region: area, perimeter, aspect ratio, and circularity. Finally, eight handcrafted features are obtained for each image.

[0133] S2.3. The 2048-dimensional deep features of each sample are concatenated with the 8-dimensional handcrafted features to obtain a 2056-dimensional mixed feature vector. Subsequently, principal component analysis is used to reduce the dimensionality of this high-dimensional feature vector, and finally the top 82 principal components with a cumulative contribution rate of 95.2% are retained to form an 82-dimensional low-dimensional mixed feature vector for subsequent modeling.

[0134] S3. Construction and training of regression models from high-dimensional features to T2 spectra under small sample conditions:

[0135] S3.1. Using 82-dimensional low-dimensional mixed features as input and the corresponding T2 spectral data (128 points) as output, construct a support vector regression model and select the radial basis function as the kernel function.

[0136] S3.2. Randomly divide the dataset of 150 samples into a training set (105 samples) and a test set (45 samples). Train the SVR model using the training set, with the objective function being to minimize the mean square error between the predicted T2 spectrum and the true T2 spectrum across all 128 points.

[0137] S3.3. Five-fold cross-validation was used on the training set to evaluate model stability. Hyperparameters were optimized using a grid search, with the penalty coefficient C in the range [0.1, 1, 10, 100] and the gamma parameter in the range [0.001, 0.01, 0.1, 1]. The optimal hyperparameter combination was determined to be C=10 and gamma=0.01.

[0138] S3.4. The optimized model was evaluated on a test set of 45 samples. The calculated mean root mean square error was 0.18, and the mean Pearson correlation coefficient between the predicted T2 spectrum and the true T2 spectrum reached 0.89, indicating that the model has excellent prediction accuracy and generalization ability.

[0139] S4. Direct prediction of T2 NMR spectra in rocks:

[0140] S4.1. Obtain core R1 from a new well in the same section of Oilfield A, prepare a cast thin section and acquire an image. Perform color normalization processing on the new image of core R1 as described in S1.2, and extract its 82-dimensional hybrid features (step S2).

[0141] S4.2. The features of core R1 were input into the pre-trained optimal SVR model, and the model successfully output the predicted T2 spectrum curve. The prediction results highly matched the actual T2 spectrum morphology measured in the laboratory later (e.g., Figure 2 As shown in the figure, this effectively verifies the practicality and accuracy of the method of the present invention.

[0142] Of course, the above description is not intended to limit the present invention, and the present invention is not limited to the examples given above. Any changes, modifications, additions or substitutions made by those skilled in the art within the scope of the present invention should also fall within the protection scope of the present invention.

Claims

1. A method for predicting T2 nuclear magnetic resonance spectra of rocks based on image feature transfer learning, characterized in that, Includes the following steps: S1. Normalization and enhancement preprocessing of thin section images of rock castings; S2. Hybrid feature extraction that combines pre-trained deep features with rock physical handcrafted features; S3. Construction and training of regression models from high-dimensional features to T2 spectra under small sample conditions; S4. Direct prediction of T2 nuclear magnetic resonance spectra of rocks.

2. The method for predicting rock nuclear magnetic resonance T2 spectra based on image feature transfer learning as described in claim 1, characterized in that, S1 specifically includes the following steps: S1.

1. Collect core samples, prepare cast thin sections and obtain microscopic images, and conduct nuclear magnetic resonance experiments on core samples from the same source to measure and obtain T2 spectrum data, forming a set of cast thin section-T2 spectrum paired datasets; S1.

2. Perform color correction and white balance processing on all thin-section images, and use a standard color chart to standardize the colors to ensure color consistency of the dataset; S1.

3. Perform data augmentation on the standardized images, including random horizontal flipping, vertical flipping, small-angle rotation, and fine-tuning of brightness and contrast, thereby expanding the scale of the data and improving the generalization ability of the model.

3. The method for predicting rock nuclear magnetic resonance T2 spectra based on image feature transfer learning as described in claim 1, characterized in that, S2 specifically includes the following steps: S2.

1. Use a ResNet50 convolutional neural network pre-trained on the large natural image dataset ImageNet as a fixed feature extractor, remove the fully connected classification layer at the end of the network, input the cast thin slice image preprocessed in step S1 into the network, and extract the feature vector output after the global average pooling layer as the deep semantic feature vector. S2.

2. Quantitatively extract low-dimensional handcrafted features related to rock structure from thin section images, specifically including texture features based on gray-level co-occurrence matrix and morphological features based on pore space Otsu threshold segmentation; S2.

3. The high-dimensional deep semantic feature vector is directly concatenated with the low-dimensional handmade feature vector composed of texture features and morphological features to form a high-dimensional mixed feature vector containing all the original feature information. The mixed feature vector is linearly reduced by principal component analysis. By retaining the principal components with a cumulative variance contribution rate of more than 95%, a low-dimensional mixed feature is constructed.

4. The method for predicting T2 nuclear magnetic resonance spectra of rocks based on image feature transfer learning as described in claim 1, characterized in that, S3 specifically includes the following steps: S3.

1. Using the dimensionality-reduced hybrid features from step S2.3 as input and the nuclear magnetic resonance T2 spectrum as output, construct a support vector regression model; S3.

2. Divide the entire paired dataset into a training set and a test set, and use the training set to train the regression model with the goal of minimizing the mean square error between the predicted T2 spectrum and the true T2 spectrum. S3.

3. The K-fold cross-validation method is used to evaluate the model stability, and the model hyperparameters are optimized by grid search; S3.

4. On the test set, the root mean square error and Pearson correlation coefficient are used to evaluate the model’s prediction accuracy and generalization ability. S4. Direct prediction of T2 nuclear magnetic resonance spectra of rocks.

5. The method for predicting rock nuclear magnetic resonance T2 spectra based on image feature transfer learning as described in claim 3, characterized in that, In S2.1, the extraction of deep semantic feature vectors is achieved through a deterministic forward propagation and data aggregation process: the preprocessed cast thin-slice image is input into a ResNet50 network that has undergone head removal processing. The image undergoes nonlinear transformation and feature abstraction layer by layer through the network's convolutional layers and residual blocks, ultimately generating a high-level spatial feature map with [C, H, W] dimensions. Subsequently, this feature map undergoes spatial aggregation through a global average pooling layer, that is, the arithmetic mean of the feature values ​​at all spatial positions (i, j) for each feature channel c is calculated, mathematically expressed as: Where, x c (i, j) represents the feature value of the c-th channel in the high-level spatial feature map output by the convolutional neural network at spatial position (p, q); c is the number of channels in the high-level spatial feature map; H is the number of pixels in the high-level spatial feature map in the vertical direction; W is the number of pixels in the high-level spatial feature map in the vertical direction; i is the spatial position index in the vertical direction of the feature map; j is the spatial position index in the horizontal direction of the feature map; f c This is the scalar eigenvalue obtained by performing global average pooling on the c-th channel at all spatial locations; This compresses a three-dimensional tensor [C, H, W] containing spatial information into a one-dimensional feature vector F_deep = [f_1, f_2, ..., f_C] with a fixed dimension of C. This vector is the extracted deep semantic feature vector that represents the high-level semantic content of the image.

6. The method for predicting rock nuclear magnetic resonance T2 spectra based on image feature transfer learning as described in claim 3, characterized in that, In S2.3, the high-dimensional mixed feature vector is F. hybrid : Where Concat(⋅) represents the vector concatenation function, F hybrid It is a high-dimensional hybrid feature vector containing all the original feature information, with dimension d. d +d h ;F deep The vector is a deep semantic feature vector obtained by global average pooling from a convolutional neural network, with dimension d. d ;F hand This is a handcrafted feature vector obtained by concatenating texture and morphological features, with dimension d. h ; To mitigate the curse of dimensionality and the risk of overfitting with small samples caused by high-dimensional features, a matrix composed of high-dimensional mixed feature vectors from all training samples is used. Principal component analysis is performed; using the singular value decomposition algorithm, a new set of orthogonal bases, i.e., principal components, is found such that the variance of the data projected onto these bases is maximized. Specifically, the covariance matrix is ​​calculated. Find the eigenvalues ​​and eigenvectors of the vector, and arrange the eigenvalues ​​in descending order: λ1≥λ2≥...≥λ dd+dh Its corresponding feature vectors v1, v2, ..., v dd+dh That is, the direction of the principal component; Set the cumulative variance contribution rate threshold θ = 95%, and choose the minimum k such that: λ i Let be the i-th eigenvalue of the covariance matrix, sorted from largest to smallest; θ is the cumulative variance contribution rate threshold; k is the minimum number of principal components that satisfy the cumulative variance contribution rate not less than 0, i.e., the number of principal components retained. The projection matrix is ​​constructed by selecting the first k principal component directions. , where v i λ is the eigenvalue corresponding to the covariance matrix i The eigenvectors of the i-th principal component are the directions of the i-th principal component. Finally, the original high-dimensional mixed feature vector F hybrid Projecting onto the low-dimensional subspace spanned by the first k principal components yields the dimensionality-reduced low-dimensional mixed feature vector F. low : This k-dimensional vector F low This serves as the input feature for the subsequent regression model. It retains over 95% of the information from the original high-dimensional mixed features, while simultaneously achieving feature compression and decorrelation. W PCA Let F be the projection matrix formed by the columns of the first k principal component directions. low The reduced low-dimensional mixed feature vector is obtained by converting F... hybrid The representation obtained by projecting onto a low-dimensional subspace spanned by the first k principal components.

7. The method for predicting rock nuclear magnetic resonance T2 spectra based on image feature transfer learning as described in claim 4, characterized in that, In S3.1, the constructed support vector regression model uses a kernel-based nonlinear regression function for mapping. The specific form of the decision function of this model is as follows: Where x is the input low-dimensional mixed feature vector, For the first The feature vectors of each training sample and Let N be the Lagrange multiplier obtained through optimization, b be the bias term, K(⋅,⋅) be the radial basis function, f(x) be the predicted value of the input sample x in a certain T2 spectral discrete dimension of the support vector regression model, and N be the value of the kernel function K(⋅,⋅). train K(x) is the number of samples in the training set. v ,x): Kernel function, used to measure the difference between the input sample x and the training sample x. The similarity in the high-dimensional feature space, where b is the bias term of the support vector regression model. Where γ is the kernel function parameter and ϵ is the insensitive loss parameter, determined through grid search optimization. For m discrete amplitude values ​​of the T2 spectrum, m independent regression functions are constructed for prediction; ||x i -x j || 2 For vector x i With x j The squared Euclidean distance in the low-dimensional feature space, where γ is the kernel width parameter of the RBF kernel function, controls the influence of distance on the similarity decay rate.

8. The method for predicting rock nuclear magnetic resonance T2 spectra based on image feature transfer learning as described in claim 4, characterized in that, The specific process in S3.4 is as follows: Forecasting and Data Preparation All cast thin-slice image samples in the test set are processed sequentially through steps S1 and S2 to obtain corresponding low-dimensional mixed feature vectors. Subsequently, these feature vectors are input into the final support vector regression model trained in step S3 to obtain the predicted T2 spectrum for each sample. where i = 1, 2, ..., N test The index represents the test sample, m is the discrete dimension of the T2 spectrum, and the true T2 spectrum of each sample is obtained through nuclear magnetic resonance experiments. ; Evaluation index calculation Based on the predicted spectrum and the true spectrum set of all test samples Calculate the following two core indicators respectively: Root Mean Square Error (RMSE): This metric measures the overall average deviation between predicted and actual values. A smaller value indicates higher prediction accuracy. For multidimensional T2 spectra, the overall RMSE is calculated as follows: Where, N test ŷ represents the number of samples in the test set, m represents the total number of amplitude dimensions in the T2 spectrum discreteness, and ŷ ij Let y be the predicted value of the i-th test sample in the j-th T2 spectrum discrete dimension; ij This represents the true measurement value of the i-th test sample on the j-th discrete dimension of the T2 spectrum. Simultaneously, the RMSE on each T2 spectrum dimension j can be calculated. j To analyze the distribution of prediction error of the model in different relaxation time intervals; The Pearson correlation coefficient measures the linear correlation between the predicted and actual spectra. A value closer to 1 indicates better consistency in the predicted trend and stronger generalization ability. For multi-dimensional outputs, the overall correlation coefficient R is typically calculated as the sum of all data points × the dimension. in, and These are the global averages of all predicted values ​​and all true values, respectively. Similarly, the interspectral correlation coefficient R for each test sample i is also calculated. i To evaluate the consistency of the model's predictions for a single sample; Comprehensive assessment of generalization ability A RMSE value lower than the set empirical threshold indicates that the model has high prediction accuracy; The overall Pearson correlation coefficient R is greater than 0.8, indicating that the predicted spectrum and the actual spectrum have a highly consistent shape and trend. The interspectral correlation coefficients Ri of each sample are concentrated with high mean and small variance, indicating that the model has stable predictive performance and strong generalization ability for different test samples.

9. The method for predicting T2 nuclear magnetic resonance spectra of rocks based on image feature transfer learning as described in claim 1, characterized in that, In step S4, the direct prediction of the rock nuclear magnetic resonance T2 spectrum specifically includes: S4.

1. For a new image of a cast thin section with an unknown T2 spectrum, perform step S1 normalization and enhancement preprocessing, and step S2 hybrid feature extraction in sequence. S4.

2. Input the extracted final feature representation into the regression model trained in step S3, and directly output its predicted nuclear magnetic resonance T2 spectrum.