Rock stratum classification method and device based on image recognition, equipment and medium
By extracting texture and color features from rock strata images using image recognition technology, and filtering features using information gain and mutual information selection algorithms, combined with the ST-CNN model, the problem of time-consuming, labor-intensive, and inaccurate existing rock strata classification is solved, achieving efficient and accurate rock strata classification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-16
- Publication Date
- 2026-03-13
AI Technical Summary
Existing rock strata classification methods rely on manual analysis, which is time-consuming, labor-intensive, and highly susceptible to subjective factors, making it difficult to meet the demands of modern geological engineering for efficiency and accuracy.
By using image recognition technology, texture and color features of rock strata images are extracted, and important features are filtered using information gain selection algorithm and mutual information selection algorithm. The rock strata are then classified using a shifted window convolution ST-CNN model.
It significantly improves the accuracy and efficiency of rock strata classification, reduces the time and manpower costs of manual analysis, and ensures the consistency and accuracy of classification results.
Smart Images

Figure CN121661372A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of geological engineering technology, specifically to the field of geological rock strata data processing technology, and in particular to a rock strata classification method, apparatus, equipment and medium based on image recognition. Background Technology
[0002] In geological engineering fields such as oil development, road construction, and geological testing, accurate identification and classification of rock strata are crucial for ensuring the scientific design and successful implementation of geological engineering projects. Rock strata classification results not only provide fundamental data support for geological exploration and assist in the formulation of resource development plans, but also play an important role in environmental research, such as analyzing the stability of the geological environment and predicting geological hazards.
[0003] In existing technologies, rock strata identification and classification mainly rely on on-site investigation and experience judgment by geological experts, combined with laboratory physical, chemical and microscopic analysis after core sampling to obtain rock strata classification results.
[0004] However, the method of identifying rock strata types through manual analysis relies heavily on the on-site investigation and experience judgment of geological experts. This method is not only time-consuming and labor-intensive, but also greatly affected by subjective factors. Its accuracy and identification efficiency are difficult to meet the needs of modern geological engineering. Summary of the Invention
[0005] This application provides a rock strata classification method, apparatus, device, and medium based on image recognition. It is used to analyze the image of the rock strata to be identified, extract the texture and color features in the rock strata image, and filter out important features through information gain selection algorithm and mutual information selection algorithm, thereby determining the rock strata category based on these filtered important features, thus improving the accuracy and efficiency of rock strata classification.
[0006] In a first aspect, this application provides a rock strata classification method based on image recognition, the method comprising:
[0007] Acquire the initial image of the rock strata to be identified;
[0008] The initial image is preprocessed to obtain the preprocessed image;
[0009] Based on the preprocessed image, the first texture features and color features are obtained;
[0010] Based on the first texture features and color features, a first feature set is obtained;
[0011] The second feature set is obtained by filtering each feature in the first feature set using the information gain selection algorithm and the mutual information selection algorithm.
[0012] Based on the feature image formed by the combination of features in the second feature set, and the pre-trained shifted window convolutional ST-CNN model, the classification result of the rock layer to be identified is obtained.
[0013] In one possible design, based on the preprocessed image, the first texture features and color features are obtained, including:
[0014] Based on the preprocessed image, a 5-layer image scale space of the Gaussian pyramid is constructed. In the 5-layer image scale space of the Gaussian pyramid, the resolution of each layer decreases as the number of layers increases.
[0015] The first texture feature is obtained based on the five-level image scale space of the Gaussian pyramid;
[0016] The preprocessed image is converted from the RGB color space to the HSV color space.
[0017] Color characteristics are obtained in the HSV color space.
[0018] In one possible design, the first texture features are obtained based on the five-level image scale space of the Gaussian pyramid, including:
[0019] For each image layer, a three-level discrete wavelet transform is performed to extract wavelet coefficients in the horizontal, vertical, and diagonal directions, respectively, to obtain the second texture feature containing the texture details of each image layer;
[0020] For each image layer, texture feature parameters are calculated using the gray-level co-occurrence matrix;
[0021] The third texture feature is obtained based on the texture feature parameters of each layer of the image;
[0022] The second and third texture features are used as the first texture feature.
[0023] In one possible design, color characteristics are obtained in the HSV color space, including:
[0024] In the HSV color space, the statistical characteristics of the hue channel, saturation channel and lightness channel are calculated respectively. The statistical characteristics include the mean of pixel values, the standard deviation of pixel values, the skewness of pixel values and the kurtosis of pixel values in each channel.
[0025] The color features are obtained by concatenating the mean, standard deviation, skewness, and kurtosis of pixel values in each channel.
[0026] In one possible design, the features in the first feature set are filtered using the information gain selection algorithm and the mutual information selection algorithm to obtain the second feature set, which includes:
[0027] The information gain of each feature in the first feature set is calculated according to the information gain selection algorithm, and the information gain is compared with a preset gain threshold. In the first feature set, features with information gain less than the preset gain threshold are deleted to obtain the third feature set.
[0028] The mutual information value between any two features in the third feature set is calculated according to the mutual information selection algorithm. The mutual information value is compared with the preset mutual information threshold. In the third feature set, the first feature in the feature pair with the mutual information value greater than the preset mutual information threshold is deleted to obtain the fourth feature set. In this set, the first feature and the second feature form a feature pair, and the information gain of the first feature is less than the information gain of the second feature.
[0029] The fourth feature set is used as the second feature set.
[0030] In one possible design, the initial image is preprocessed to obtain a preprocessed image, including:
[0031] The initial image is divided into multiple sub-images, and histogram equalization is performed on each sub-image to obtain multiple second sub-images.
[0032] Multiple second sub-images are stitched together to form a second image, wherein the contrast of the rock layer texture in the second image is higher than the contrast of the rock layer texture in the initial image, and the contrast of the rock layer boundary in the second image is higher than the contrast of the rock layer boundary in the initial image.
[0033] Based on the homomorphic filtering algorithm, the second image is subjected to brightness uniformization processing to obtain the third image, wherein the brightness difference in the third image is smaller than the brightness difference in the second image;
[0034] The third image is processed to remove noise using a nonlocal mean filtering algorithm, resulting in a preprocessed image where the pixel difference value of the preprocessed image is smaller than that of the third image.
[0035] In one possible design, the pre-trained ST-CNN model includes a Swing-Transformer backbone network, multi-scale convolutional branches, a feature pyramid, feature channels, and a fully connected output layer.
[0036] Based on the feature image formed by the combination of features in the second feature set, and the pre-trained shift-window convolutional ST-CNN model, the classification result of the rock strata to be identified is obtained, including:
[0037] Based on the feature image formed by the combination of features in the second feature set and the Swin-Transformer backbone network, a multi-stage feature map is obtained;
[0038] Multi-scale structural features are obtained based on multi-stage feature maps and multi-scale convolutional branches;
[0039] The feature pyramid is used to fuse multi-stage feature maps and multi-scale structural features to obtain a fused feature map.
[0040] Based on the fused feature map and feature channels, multiple channel features are obtained;
[0041] Based on multiple channel features and a fully connected output layer, the classification results of the rock strata to be identified are obtained.
[0042] Secondly, this application provides a rock strata classification device based on image recognition, the device comprising:
[0043] The acquisition module is used to acquire the initial image of the rock strata to be identified;
[0044] The preprocessing module is used to preprocess the initial image to obtain the preprocessed image;
[0045] The feature extraction module is used to obtain the first texture features and color features based on the preprocessed image;
[0046] The feature extraction module is also used to obtain a first feature set based on the first texture features and color features;
[0047] The feature extraction module is also used to filter each feature in the first feature set according to the information gain selection algorithm and the mutual information selection algorithm to obtain the second feature set;
[0048] The result output module is used to obtain the classification result of the rock layer to be identified based on the feature image formed by the combination of features in the second feature set and the pre-trained shift window convolution ST-CNN model.
[0049] In one possible design, the feature extraction module includes: a Gaussian pyramid construction module, a first texture feature extraction module, a color space conversion module, and a color feature extraction module;
[0050] A Gaussian pyramid module is constructed to build a 5-layer image scale space of a Gaussian pyramid based on the preprocessed image. In the 5-layer image scale space of the Gaussian pyramid, the resolution of each layer decreases as the number of layers increases.
[0051] The first texture feature extraction module is used to obtain the first texture features based on the five-layer image scale space of the Gaussian pyramid;
[0052] The color space conversion module is used to convert the pre-processed image from the three primary colors RGB color space to the hue-saturation-brightness HSV color space;
[0053] The color feature extraction module is used to obtain color features in the HSV color space.
[0054] In one possible design, the module for extracting the first texture feature includes: a module for extracting the second texture feature, a module for calculating texture feature parameters, and a module for extracting the third texture feature.
[0055] The second texture feature extraction module is used to perform three-level discrete wavelet transform on each layer of the image to extract wavelet coefficients in the horizontal, vertical and diagonal directions, respectively, and obtain the second texture features containing the texture details of each layer of the image.
[0056] The texture feature parameter calculation module is used to calculate texture feature parameters for each image layer using the gray-level co-occurrence matrix.
[0057] The module for extracting the third texture feature is used to obtain the third texture feature based on the texture feature parameters of each layer of the image;
[0058] The module for extracting the first texture feature is also used to use the second and third texture features as the first texture feature.
[0059] In one possible design, the color feature extraction module includes: a statistical feature calculation module;
[0060] The statistical feature calculation module is used to calculate the statistical features of the hue channel, saturation channel and lightness channel in the HSV color space. The statistical features include the mean, standard deviation, skewness and kurtosis of the pixel values in each channel.
[0061] The color feature extraction module is also used to connect the mean, standard deviation, skewness, and kurtosis of pixel values in each channel to obtain color features.
[0062] In one possible design, the feature extraction module also includes: an information gain module and a mutual information module;
[0063] The information gain module is used to calculate the information gain of each feature in the first feature set according to the information gain selection algorithm, compare the information gain with a preset gain threshold, and delete each feature in the first feature set whose information gain is less than the preset gain threshold to obtain the third feature set.
[0064] The mutual information module is used to calculate the mutual information value between any two features in the third feature set according to the mutual information selection algorithm, and compare the mutual information value with the preset mutual information threshold. In the third feature set, the first feature in the feature pair with the mutual information value greater than the preset mutual information threshold is deleted to obtain the fourth feature set, wherein the first feature and the second feature form a feature pair, and the information gain of the first feature is less than the information gain of the second feature.
[0065] The feature extraction module is also used to use the fourth feature set as the second feature set.
[0066] In one possible design, the preprocessing module includes: a segmentation module, a stitching module, a brightness processing module, and a noise removal module;
[0067] The segmentation module is used to divide the initial image into multiple sub-images, and perform histogram equalization on each of the multiple sub-images to obtain multiple second sub-images.
[0068] The stitching module is used to stitch multiple second sub-images into a second image, wherein the contrast of the rock layer texture in the second image is higher than the contrast of the rock layer texture in the initial image, and the contrast of the rock layer boundary in the second image is higher than the contrast of the rock layer boundary in the initial image.
[0069] The brightness processing module is used to perform brightness uniformization processing on the second image according to the homomorphic filtering algorithm to obtain the third image, wherein the brightness difference in the third image is smaller than the brightness difference in the second image;
[0070] The noise removal module is used to remove noise from the third image according to the nonlocal mean filtering algorithm to obtain a preprocessed image, wherein the pixel difference value of the preprocessed image is smaller than the pixel difference value of the third image.
[0071] In one possible design, the pre-trained ST-CNN model includes a Swing-Transformer backbone network, multi-scale convolutional branches, a feature pyramid, feature channels, and a fully connected output layer.
[0072] The output module includes: a feature map extraction module, a structural feature extraction module, a fusion module, and a channel feature extraction module;
[0073] The feature map extraction module is used to obtain multi-stage feature maps based on the feature image formed by the combination of features in the second feature set and the Swin-Transformer backbone network.
[0074] The structural feature extraction module is used to obtain multi-scale structural features based on multi-stage feature maps and multi-scale convolutional branches;
[0075] The fusion module is used to fuse multi-stage feature maps and multi-scale structural features through feature pyramids to obtain fused feature maps.
[0076] The channel feature extraction module is used to obtain multiple channel features based on the fused feature map and feature channels;
[0077] The results output module is also used to obtain the classification results of the rock strata to be identified based on multiple channel features and a fully connected output layer.
[0078] Thirdly, this application provides an electronic device, including: a processor, and a memory communicatively connected to the processor.
[0079] The memory stores the instructions that the computer executes.
[0080] The processor executes computer execution instructions stored in memory to implement a rock strata classification method based on image recognition, as described in the first aspect of the invention.
[0081] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement an image recognition-based rock strata classification method according to the first aspect of the invention.
[0082] Fifthly, this application provides a computer program product, including a computer program, which, when executed by a processor, is used to implement an image recognition-based rock strata classification method according to the first aspect of the invention.
[0083] Based on the implementation methods provided in the above aspects, this application can be further combined to provide more implementation methods.
[0084] This application provides a method, apparatus, device, and medium for rock strata classification based on image recognition, comprising: first, acquiring an initial image of the rock strata to be identified; then, preprocessing the initial image to obtain a preprocessed image; next, obtaining first texture features and color features based on the preprocessed image; subsequently, obtaining a first feature set based on the first texture features and color features; then, filtering each feature in the first feature set using an information gain selection algorithm and a mutual information selection algorithm to obtain a second feature set; finally, obtaining the classification result of the rock strata to be identified based on the feature image formed by combining the features in the second feature set and a pre-trained shifted window convolutional ST-CNN model. This achieves the following technical effects: by analyzing the image of the rock strata to be identified, extracting texture and color features from the rock strata image, and filtering the extracted texture and color features using an information gain selection algorithm and a mutual information selection algorithm to obtain important features, and then accurately determining the rock strata category based on these selected important features, significantly improving the accuracy and efficiency of rock strata classification. Attached Figure Description
[0085] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0086] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0087] Figure 1 A schematic flowchart illustrating a rock strata classification method based on image recognition provided in this application embodiment;
[0088] Figure 2 A schematic diagram of the structure of a rock strata classification device based on image recognition provided in an embodiment of this application;
[0089] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0090] Figure label:
[0091] 210 - Acquisition module; 220 - Preprocessing module; 230 - Feature extraction module; 240 - Result output module; 310 - Processor; 320 - Memory; 330 - Communication component; 340 - Bus. Detailed Implementation
[0092] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0093] In the embodiments of this application, the terms "first" and "second" are used to distinguish identical or similar items with substantially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and that "first" and "second" do not necessarily imply difference. It should be noted that in the embodiments of this application, the words "exemplary" or "for example" are used to indicate that something is being used as an example, illustration, or description. Any embodiment or design scheme described as "exemplary" or "for example" in this application should not be construed as being better or more advantageous than other embodiments or design schemes. Specifically, the use of "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner. In the embodiments of this application, "at least one" refers to one or more, and "more than one" refers to two or more.
[0094] It should be noted that the phrase "at...time" in the embodiments of this application can refer to the instant at which a certain situation occurs, or to a period of time after the occurrence of a certain situation; the embodiments of this application do not specifically limit this. Furthermore, the rock strata classification method based on image recognition provided in the embodiments of this application is merely an example; a rock strata classification method based on image recognition may also include more or less content.
[0095] In various geological engineering practices, including oil and gas exploration and development, road and tunnel construction, mineral resource exploration, and environmental geological analysis, accurate identification and classification of geological strata are crucial for ensuring engineering safety, optimizing resource extraction plans, and conducting scientific environmental analysis. The type of strata directly affects core aspects such as drilling trajectory design, reservoir evaluation, foundation stability analysis, and geological hazard prediction. Therefore, efficient and accurate strata classification methods have significant engineering application value.
[0096] Currently, traditional rock strata classification techniques mainly rely on on-site observation by geological experts and the collection of rock cores for experimental analysis to determine the rock strata type. Specifically, geological experts need to go to the site in person, use their professional knowledge and experience to make a preliminary judgment on the appearance characteristics of the rock strata, and then collect rock core samples to bring back to the laboratory. They then use various experimental methods, such as thin section identification and mineral composition analysis, to further clarify the rock strata category.
[0097] However, this manual analysis method has many limitations. On the one hand, the entire process is time-consuming and labor-intensive, requiring a significant investment of manpower, resources, and time, from field observation and core collection to laboratory analysis. Efficiency is a particularly prominent issue in large-scale geological engineering projects. On the other hand, manual analysis is heavily influenced by subjective factors. Different geological experts have varying levels of experience and judgment standards, which can lead to different classification results even when dealing with the same rock strata samples. This makes it difficult to guarantee the accuracy and consistency of classification, failing to meet the urgent needs of modern geological engineering for efficient and accurate rock strata classification.
[0098] Based on this, embodiments of this application propose a rock strata classification method, apparatus, device, and medium based on image recognition, which can be used in the field of geological engineering technology, specifically in the field of geological rock strata data processing technology, aiming to solve the above-mentioned technical problems of the prior art. By analyzing the image of the rock strata to be identified, the texture and color features in the rock strata image are accurately extracted, and the extracted texture and color features are filtered using information gain selection algorithm and mutual information selection algorithm to obtain important features. Then, based on these important features, the rock strata category is accurately determined, significantly improving the accuracy and efficiency of rock strata classification.
[0099] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0100] Figure 1 This is a schematic flowchart illustrating a rock strata classification method based on image recognition, provided as an embodiment of this application. Figure 1 As shown, the method includes:
[0101] S101. Obtain the initial image of the rock stratum to be identified.
[0102] In this embodiment, the executing entity of an image recognition-based rock strata classification method can be a data processing server or other devices with data processing capabilities, such as smartphones, laptops, personal computers, tablets, etc. The data processing server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server, etc., without specific limitations. For ease of description, this embodiment uniformly describes the executing entity of an image recognition-based rock strata classification method as a server.
[0103] Specifically, the initial image acquisition process for the rock strata to be identified can include: First, using a high-definition geological image acquisition device equipped with a high-pixel visible light camera and an infrared thermal imager, images of the rock strata to be identified are taken from multiple angles, such as horizontal, vertical, ±30°, and ±45°, under different lighting conditions, including daytime, dusk, and nighttime. Each shot acquires at least three initial images at different resolutions, such as 1920 pixels × 1080 pixels, 3840 pixels × 2160 pixels, and 7680 pixels × 4320 pixels. Simultaneously, metadata such as the device's Global Positioning System (GPS) coordinates, altitude, and shooting angle are recorded. Through the acquisition of these multi-source initial images, initial images containing multi-dimensional information such as visible light texture and thermal radiation differences of the rock strata to be identified are obtained. These acquired initial images of the rock strata to be identified can then be input into a server for analysis and processing.
[0104] S102. Preprocess the initial image to obtain the preprocessed image.
[0105] In this embodiment, the server first divides the initial image into multiple sub-images, performs histogram equalization on each sub-image to obtain multiple second sub-images. Then, the multiple second sub-images are stitched together to form a second image, wherein the contrast of the rock texture in the second image is higher than that in the initial image, and the contrast of the rock boundary in the second image is also higher than that in the initial image. Next, the second image is subjected to brightness uniformization processing using a homomorphic filtering algorithm to obtain a third image, wherein the brightness difference in the third image is smaller than that in the second image. Finally, the third image is subjected to noise removal processing using a non-local mean filtering algorithm to obtain a pre-processed image, wherein the pixel difference value of the pre-processed image is smaller than that of the third image.
[0106] Specifically, the server can first divide the input initial image into multiple sub-images of 16 pixels × 16 pixels, and then perform histogram equalization on each sub-image to improve the contrast of rock layer texture and rock layer boundary in each sub-image, thereby obtaining the second sub-image corresponding to each sub-image.
[0107] Furthermore, during the equalization process, the server can set the contrast limit parameter to 0.02 to constrain the distribution variation of pixel grayscale values in the histogram, thereby preventing over-enhancement from causing noise or distortion in each sub-image.
[0108] By adjusting the local histograms of each sub-image, the contrast of rock textures and boundaries in each local area of each sub-image can be enhanced in a targeted manner, making the originally blurry and indistinct rock textures and the boundaries between different rock layers clearer.
[0109] After the equalization process is completed and multiple second sub-images are obtained, the server can stitch these multiple second sub-images into a second image. This results in a second image where the contrast of the rock layer texture and the contrast of the rock layer boundaries are both higher than those of the initial image.
[0110] Then, the server can use a homomorphic filtering algorithm to homogenize the brightness of the second image, thereby reducing the brightness difference in the second image and obtaining a third image with a smaller brightness difference than the second image. Specifically, the homomorphic filtering algorithm is based on the illuminance-reflectance model of the second image, which decomposes the brightness variation of the second image into illuminance and reflectance components for separate processing.
[0111] Specifically, during processing, a high-frequency gain coefficient (e.g., 1.8) can be used to enhance high-frequency information in the second image, namely the reflectivity component, to highlight the detailed texture of the rock surface. Conversely, a low-frequency gain coefficient (e.g., 0.4) can be used to suppress low-frequency information in the second image, namely the illuminance component, thereby reducing brightness differences caused by uneven illumination. A cutoff frequency of 0.06 can be used as the boundary between high-frequency and low-frequency information, thus controlling the transition range between high-frequency enhancement and low-frequency suppression. By setting the high-frequency gain coefficient, low-frequency gain coefficient, and cutoff frequency of 0.06 when applying the homomorphic filtering algorithm, brightness differences in the second image caused by different ambient lighting conditions can be effectively eliminated, resulting in a third image with more uniform overall brightness that retains and enhances the key feature information of the rock layer.
[0112] Finally, the server can use a nonlocal mean filtering algorithm to remove noise from the third image by taking advantage of the similarity information that is widely present in the image.
[0113] Specifically, when processing the third image using the nonlocal mean filtering algorithm, the search window size can be set to 11 pixels × 11 pixels and the similarity window size to 3 pixels × 3 pixels. Based on the local structural similarity in the third image, the weight corresponding to each similar window can be determined. Then, based on the determined weight, the gray value of each pixel in the third image after removing noise can be calculated to remove noise from the third image and obtain the preprocessed image.
[0114] Specifically, the server can define an 11-pixel × 11-pixel search window centered on each pixel, and search for regions within this search window that have a similar structure to the surrounding 3-pixel × 3-pixel similar windows. Next, by calculating the pixel grayscale differences between different similar windows, based on the principle of local image structural similarity, each similar window is assigned a corresponding weight: the smaller the pixel grayscale difference, i.e., the more similar the structure, the greater the weight; conversely, the larger the pixel grayscale difference, i.e., the less similar the structure, the smaller the weight. Then, a weighted average is performed on the pixels within the search window according to these weights to obtain the grayscale value of the current pixel after noise removal. By performing the above operation on each pixel in the third image, various types of noise, such as Gaussian noise and salt-and-pepper noise, can be effectively removed from the third image while preserving the detail and edge information of the rock strata image to the greatest extent, ultimately obtaining a preprocessed image with a pixel difference value smaller than that of the third image.
[0115] S103. Based on the preprocessed image, obtain the first texture features and color features.
[0116] In this embodiment, the server first constructs a 5-layer image scale space of a Gaussian pyramid based on the preprocessed image, wherein the resolution of each layer decreases as the number of layers increases in the 5-layer image scale space of the Gaussian pyramid; then, the first texture feature is obtained based on the 5-layer image scale space of the Gaussian pyramid; then, the preprocessed image is converted from the three primary color RGB color space to the hue-saturation-brightness HSV color space; finally, the color feature is obtained in the HSV color space.
[0117] Specifically, the server first uses the preprocessed image as the bottom layer of the Gaussian pyramid, and then generates layers 1 through 4 sequentially through Gaussian blur and downsampling operations. The resolution of each layer gradually decreases as the number of layers increases. The resolution of each layer can be reduced to one-quarter of the resolution of the next layer.
[0118] Next, the server can perform a three-level discrete wavelet transform on each layer of the image to extract wavelet coefficients in the horizontal, vertical, and diagonal directions, respectively, to obtain the second texture feature containing the texture details of each layer of the image; for each layer of the image, the texture feature parameters are calculated through the gray-level co-occurrence matrix; based on the texture feature parameters of each layer of the image, the third texture feature is obtained; and the second texture feature and the third texture feature are used as the first texture feature.
[0119] Specifically, the server can perform a three-level discrete wavelet transform on each layer of the Gaussian pyramid image. Based on the principle of multi-resolution analysis, this three-level discrete wavelet transform decomposes each layer into different frequency sub-bands. In each level of the transform, each layer can be decomposed into four detail sub-images, corresponding to the approximate component and the detail components in the horizontal, vertical, and diagonal directions, respectively. Through the three-level discrete wavelet transform, the server can obtain rich detail information of each layer at different frequencies. By extracting the detail components (i.e., wavelet coefficients) in the horizontal, vertical, and diagonal directions after the three-level discrete wavelet transform of each layer, the server can use these extracted wavelet coefficients as a second texture feature, thus obtaining a second texture feature containing the texture details of each layer. These wavelet coefficients can include the edge and texture details of the rock layers at different scales.
[0120] Next, for each layer of the Gaussian pyramid image, the server can calculate the gray-level co-occurrence matrix (GLCM) in different directions. For example, the GLCM can be calculated at four directional offsets (such as 0°, 45°, 90°, and 135°) to obtain the frequency of occurrence of pixel pairs with preset gray values and specific spatial relationships in each layer of the image. Here, the specific spatial relationship can refer to the fact that the direction of the offset is determined (such as 0°, 45°, 90°, and 135°) and the distance between pixels is determined (usually 1 pixel).
[0121] Based on the calculated gray-level co-occurrence matrix, the server can further extract four texture feature parameters: energy, entropy, contrast, and correlation. Energy characterizes the uniformity or consistency of texture in each image layer; higher energy values indicate more regular textures. Entropy reflects the complexity of texture in each image layer; higher entropy values indicate more information and more complex textures. Contrast reflects the degree of gray-level contrast in each image layer; higher contrast results in clearer textures. Correlation measures the correlation between pixel gray-level values in each image layer, revealing the linear dependence between pixels. Higher correlation indicates a strong directional association between pixels, meaning higher correlation leads to more directional textures. The server can concatenate these four texture feature parameters (energy, entropy, contrast, and correlation) calculated for each image layer at different offsets to form the texture feature vector for that layer. Then, the texture feature vectors from all five layers are concatenated to construct a third texture feature containing complete multi-scale texture feature vectors.
[0122] Finally, the server can use the second and third texture features as the first texture feature. High-frequency details are captured using wavelet coefficients, and texture feature parameters extracted using the gray-level co-occurrence matrix are used to quantify texture complexity, thus forming a complementary feature description.
[0123] After introducing the extraction process of the first texture feature, the extraction process of the color feature will be explained in detail.
[0124] Specifically, the Red-Green-Blue (RGB) color space represents colors based on the mixing of the three primary colors: red, green, and blue. In contrast, the Hue-Saturation-Value (HSV) color space describes colors from three dimensions: hue, saturation, and lightness, which is more in line with human visual perception.
[0125] The preprocessed image obtained by the server in step S102 is an image in the RGB color space. In order to further extract color features, the server can use existing color space conversion formulas to convert the preprocessed image from the RGB color space to the HSV color space, and then separate the three channels: hue channel, saturation channel, and lightness channel.
[0126] In the HSV color space, the server can calculate the statistical characteristics of the hue channel, saturation channel, and lightness channel separately. The statistical characteristics include the mean, standard deviation, skewness, and kurtosis of the pixel values in each channel.
[0127] For each channel, the mean pixel value reflects the average level of pixel values within that channel; the standard deviation of pixel values measures the dispersion of pixel values relative to the mean; the skewness of pixel values describes the asymmetry of the pixel value distribution; and the kurtosis of pixel values reflects the steepness of the pixel value distribution. The server can sequentially arrange and concatenate the mean, standard deviation, skewness, and kurtosis of pixel values from these three channels to construct a color feature vector containing 12 elements, and use this color feature vector as the extracted color feature.
[0128] S104. Based on the first texture features and color features, obtain the first feature set.
[0129] Specifically, after obtaining the first texture features and color features, the server can merge the extracted first texture features and color features together to obtain the first feature set.
[0130] S105. Based on the information gain selection algorithm and the mutual information selection algorithm, each feature in the first feature set is filtered to obtain the second feature set.
[0131] In this embodiment, the server first calculates the information gain of each feature in the first feature set according to the information gain selection algorithm, and compares the information gain with a preset gain threshold. In the first feature set, features with information gains less than the preset gain threshold are deleted to obtain a third feature set. Then, the server calculates the mutual information value between any two features in the third feature set according to the mutual information selection algorithm, and compares the mutual information value with a preset mutual information threshold. In the third feature set, the first feature in the feature pair with a mutual information value greater than the preset mutual information threshold is deleted to obtain a fourth feature set, wherein the first feature and the second feature form a feature pair, and the information gain of the first feature is less than the information gain of the second feature. Finally, the fourth feature set is used as the second feature set.
[0132] Specifically, for each feature in the first feature set, the server can calculate the information gain of that feature based on preset rock strata category labels. The calculation process can be as follows: first, calculate the information entropy of the rock strata category distribution when the feature is absent, i.e., the overall uncertainty; then, calculate the conditional entropy of the rock strata category distribution when the feature value is known, i.e., the uncertainty of the rock strata category when the feature is present; finally, subtract the conditional entropy from the information entropy to obtain the information gain of the feature. Information gain reflects the incremental information that the feature brings to rock strata category classification; the larger the gain, the more important the feature is for rock strata classification.
[0133] After calculating the information gain of each feature in the first feature set, the server can compare the calculated information gain of each feature with a preset gain threshold (such as 0.12), and delete each feature in the first feature set whose information gain is less than the preset gain threshold, thereby removing those features that contribute little to the classification of rock strata and cannot effectively reduce classification uncertainty, and obtaining a third feature set after simplification of the first feature set.
[0134] For the features retained after information gain filtering, the server can calculate the mutual information value between any two features in the third feature set using a mutual information selection algorithm. By calculating the mutual information value between any two features in the third feature set, the relationship between the joint distribution of the two features and their respective marginal distributions can be obtained, thus revealing the dependency and information sharing degree between any two features. A higher mutual information value indicates a stronger correlation between the two features and a greater amount of duplicate information.
[0135] The server can compare the mutual information value with a preset mutual information threshold (e.g., 0.06). Within the third feature set, for feature pairs with mutual information values greater than this threshold, it retains the feature with the higher information gain and deletes the other feature, thus removing redundant features from the third feature set and preventing data redundancy caused by redundant features providing similar information. By deleting redundant features with lower information gain from feature pairs with mutual information values greater than the preset threshold, the server can obtain a fourth feature set that possesses high classification value and where features are independent and non-repeating.
[0136] After two rounds of screening based on the information gain selection algorithm and the mutual information selection algorithm, the fourth feature set is the final second feature set used for subsequent model input. Through the above feature screening process, the phenomenon of overfitting in subsequent models can be reduced, thereby improving the accuracy and efficiency of rock strata classification.
[0137] S106. Based on the feature image formed by the combination of features in the second feature set and the pre-trained shift window convolution ST-CNN model, the classification result of the rock layer to be identified is obtained.
[0138] In this embodiment, the pre-trained Swin-Transformer Convolutional Neural Network (ST-CNN) model includes a Shifted Window Transformer (Swin-Transformer) backbone network, multi-scale convolutional branches, feature pyramids, feature channels, and a fully connected output layer.
[0139] The Swin-Transformer backbone network in a pre-trained ST-CNN model typically requires pre-training. As a Transformer-based visual model, the performance of the Swin-Transformer backbone network depends on pre-training on a large-scale dataset. The pre-training process includes: training the initial ST-CNN model using a large-scale, general-purpose image dataset to learn general image feature representations; optimizing the model parameters of the pre-trained ST-CNN model through self-supervised or supervised learning to extract global context and local detail features from feature images; and fine-tuning the pre-trained ST-CNN model on labeled data for specific tasks, adjusting the output layer to adapt to the target category.
[0140] The server first obtains a multi-stage feature map based on the feature image formed by combining various features in the second feature set and the Swin-Transformer backbone network. Then, it obtains multi-scale structural features based on the multi-stage feature map and multi-scale convolutional branches. Next, it fuses the multi-stage feature map and multi-scale structural features through a feature pyramid to obtain a fused feature map. Then, it obtains multiple channel features based on the fused feature map and feature channels. Finally, it obtains the classification result of the rock layer to be identified based on the multiple channel features and the fully connected output layer.
[0141] Specifically, the server can recombine and reorganize the features in the second feature set to generate a simplified feature image, and then input the feature image into the pre-trained ST-CNN model to extract global contextual information and local detail features of the feature image through the Swin-Transformer backbone network.
[0142] Specifically, the Swin-Transformer backbone network can adopt a hierarchical Swin-Transformer structure. After receiving the feature image input from the server, it first divides the feature image into multiple 4-pixel × 4-pixel local windows, with each pixel within a local window serving as an independent processing unit. This partitioning method allows the Swin-Transformer backbone network to efficiently extract detailed features within the local window range. Subsequently, the server can perform hierarchical downsampling operations, gradually reducing the resolution of the feature image to 1 / 4, 1 / 8, 1 / 16, and 1 / 32 of its original value. During the process of reducing the feature image resolution, the network's receptive field of view (receptive field) continuously expands, thereby enabling the extraction of global contextual information from the feature image. Simultaneously, the number of feature channels in the Swin-Transformer backbone network gradually increases accordingly, from the original 24 to 96, 192, 384, and 768. A greater number of feature channels can provide the Swin-Transformer backbone network with richer feature representation capabilities, enabling the Swin-Transformer backbone network to extract features from rock strata images from different dimensions and obtain multi-stage feature maps.
[0143] Then, the server can perform convolution operations on the multi-stage feature maps output by the Swin-Transformer backbone network through multi-scale convolution branches to obtain multi-scale structural features of the rock strata image. The multi-scale convolution branches include three parallel convolution branches, which can use convolution kernels of different sizes: 3 pixels × 3 pixels, 5 pixels × 5 pixels, and 7 pixels × 7 pixels, respectively. Different sized convolution kernels can have different receptive fields: the small 3-pixel × 3-pixel kernel is used to capture minute details and local textures in the rock strata image, such as fine cracks on the rock surface; the 5-pixel × 5-pixel kernel is used to extract medium-scale structural features, such as small bedding structures in the rock strata; and the large 7-pixel × 7-pixel kernel is used to capture larger-scale structural information, such as the overall morphological outline of the rock strata. The three convolution branches work in parallel, simultaneously performing convolution operations on the multi-stage feature maps output by the Swin-Transformer backbone network, allowing for the extraction of structural features from the rock strata image at multiple scales, thus enriching the pre-trained ST-CNN model's ability to describe rock strata features.
[0144] Subsequently, the server can fuse multi-stage feature maps output from different stages of the Swin-Transformer backbone network with multi-scale structural features output from multi-scale convolutional branches using a feature pyramid. The feature pyramid adjusts the resolution of multi-stage feature maps through upsampling and downsampling operations, aligning feature maps from different sources and resolutions. Upsampling can employ methods such as bilinear interpolation to enlarge low-resolution multi-stage feature maps to match higher-resolution ones; downsampling can reduce the size of high-resolution multi-stage feature maps through pooling. After resolution adjustment, multi-stage feature maps of the same resolution can be fused using element-wise addition. In other words, by adjusting the resolution of multi-stage feature maps through upsampling and downsampling, aligning feature maps of different resolutions, and then integrating global-local features with multi-scale structural features by performing element-wise addition on feature maps of the same resolution. This fusion method effectively integrates the global and local features extracted from different stages of the Swin-Transformer backbone network with the multi-scale structural features obtained from multi-scale convolutional branches, resulting in a fused feature map. This fully leverages the advantages of the Swin-Transformer backbone network and the multi-scale convolutional branches to enhance the pre-trained ST-CNN model's comprehensive ability to represent rock strata features.
[0145] For the fused feature map, the server can obtain global context information for each feature channel through global average pooling and global max pooling, respectively, and then generate feature channel attention weights using a multilayer perceptron and an activation function (Sigmoid). Global average pooling and global max pooling are two commonly used pooling methods that can compress the fused feature map spatially. Specifically, global average pooling calculates the average value of all pixels in each feature channel; global max pooling selects the maximum value of each pixel in each feature channel. Through these two pooling operations, the server can compress the spatial information of the fused feature map into a vector in the feature channel dimension, thereby obtaining the global context information of the feature channels. The resulting vector undergoes a nonlinear transformation through a multilayer perceptron to further extract the complex relationships between feature channels, obtaining multiple channel features. The output is then mapped to between 0 and 1 using the activation function (Sigmoid) to generate channel attention weights. These channel attention weights reflect the importance of each channel feature for rock layer identification.
[0146] Next, the server can output the recognition and classification results of the pre-trained ST-CNN model through a fully connected output layer. Specifically, the fully connected output layer integrates all channel features to obtain a feature vector. Then, through a series of weight matrix operations, the feature vector is mapped to an output vector with the same dimension as the number of rock stratum categories. Each element of the output vector corresponds to a rock stratum category, and the value of the element represents the probability that the feature image of the input rock stratum to be identified belongs to that category. Finally, the server can select the category with the highest probability value as the recognition and classification result of the pre-trained ST-CNN model for the input feature image, thus completing the automatic identification process of rock stratum categories.
[0147] In other words, the pre-trained ST-CNN model can output probability vectors indicating which rock strata belong to different categories through a fully connected output layer. The dimension of this probability vector corresponds to the number of rock strata categories, such as the common 10 categories like sandstone, shale, and limestone. The server can then select the category with the highest probability value as the category of the rock strata to be identified, based on the principle of maximizing probability, thereby completing the automatic identification and classification of the rock strata.
[0148] This embodiment provides a rock strata classification method based on image recognition. First, an initial image of the rock strata to be identified is acquired. Then, the initial image is preprocessed to obtain a preprocessed image. Next, based on the preprocessed image, first texture features and color features are obtained. Subsequently, based on the first texture features and color features, a first feature set is obtained. Then, each feature in the first feature set is filtered according to the information gain selection algorithm and the mutual information selection algorithm to obtain a second feature set. Finally, based on the feature image formed by the combination of each feature in the second feature set and the pre-trained shifted window convolutional ST-CNN model, the classification result of the rock strata to be identified is obtained.
[0149] The following technical effects were achieved: By analyzing the image of the rock strata to be identified, texture and color features were extracted from the rock strata image. Information gain selection and mutual information selection algorithms were then used to filter the extracted texture and color features to obtain important features. Based on these selected important features, the rock strata category was accurately determined, significantly improving the accuracy and efficiency of rock strata classification. By adjusting the local histograms of each sub-image, the contrast of rock strata textures and boundaries in each local region of each sub-image could be specifically enhanced, making the originally blurry and indistinct rock strata textures and boundaries between different rock strata clearer. High-frequency details were captured using wavelet coefficients, and texture feature parameters extracted using the gray-level co-occurrence matrix were used to quantify texture complexity, thereby forming… The model employs complementary feature descriptions; through a two-round selection process using information gain selection and mutual information selection algorithms, it reduces overfitting in subsequent models, thereby improving the accuracy and efficiency of rock strata classification; by having three convolutional branches work in parallel and simultaneously perform convolution operations on the multi-stage feature maps output by the Swin-Transformer backbone network, it can extract structural features from rock strata images at multiple scales, obtaining multi-scale structural features, thus enriching the pre-trained ST-CNN model's ability to describe rock strata features; by fully utilizing the advantages of the Swin-Transformer backbone network and the multi-scale convolutional branches, the pre-trained ST-CNN model's comprehensive ability to express rock strata features is enhanced.
[0150] This application embodiment can divide an electronic device or main control device into functional modules according to the above method examples. For example, each function can be divided into its own functional modules, or two or more functions can be integrated into one processing unit. The integrated unit can be implemented in hardware or as a software functional module. It should be noted that the module division in this embodiment is illustrative and only represents one logical functional division; in actual implementation, there may be other division methods.
[0151] Figure 2This is a schematic diagram of a rock strata classification device based on image recognition, provided as an embodiment of this application. Figure 2 As shown, the device includes: an acquisition module 210; a preprocessing module 220; a feature extraction module 230; and a result output module 240.
[0152] The acquisition module 210 is used to acquire an initial image of the rock stratum to be identified;
[0153] Preprocessing module 220 is used to preprocess the initial image to obtain a preprocessed image;
[0154] The feature extraction module 230 is used to obtain the first texture features and color features based on the preprocessed image;
[0155] The feature extraction module 230 is also used to obtain a first feature set based on the first texture features and color features;
[0156] The feature extraction module 230 is also used to filter each feature in the first feature set according to the information gain selection algorithm and the mutual information selection algorithm to obtain the second feature set;
[0157] The output module 240 is used to obtain the classification result of the rock layer to be identified based on the feature image formed by the combination of features in the second feature set and the pre-trained shift window convolution ST-CNN model.
[0158] In one possible design, the feature extraction module 230 includes: a Gaussian pyramid construction module, a first texture feature extraction module, a color space conversion module, and a color feature extraction module;
[0159] A Gaussian pyramid module is constructed to build a 5-layer image scale space of a Gaussian pyramid based on the preprocessed image. In the 5-layer image scale space of the Gaussian pyramid, the resolution of each layer decreases as the number of layers increases.
[0160] The first texture feature extraction module is used to obtain the first texture features based on the five-layer image scale space of the Gaussian pyramid;
[0161] The color space conversion module is used to convert the pre-processed image from the three primary colors RGB color space to the hue-saturation-brightness HSV color space;
[0162] The color feature extraction module is used to obtain color features in the HSV color space.
[0163] In one possible design, the module for extracting the first texture feature includes: a module for extracting the second texture feature, a module for calculating texture feature parameters, and a module for extracting the third texture feature.
[0164] The second texture feature extraction module is used to perform three-level discrete wavelet transform on each layer of the image to extract wavelet coefficients in the horizontal, vertical and diagonal directions, respectively, and obtain the second texture features containing the texture details of each layer of the image.
[0165] The texture feature parameter calculation module is used to calculate texture feature parameters for each image layer using the gray-level co-occurrence matrix.
[0166] The module for extracting the third texture feature is used to obtain the third texture feature based on the texture feature parameters of each layer of the image;
[0167] The module for extracting the first texture feature is also used to use the second and third texture features as the first texture feature.
[0168] In one possible design, the color feature extraction module includes: a statistical feature calculation module;
[0169] The statistical feature calculation module is used to calculate the statistical features of the hue channel, saturation channel and lightness channel in the HSV color space. The statistical features include the mean, standard deviation, skewness and kurtosis of the pixel values in each channel.
[0170] The color feature extraction module is also used to connect the mean, standard deviation, skewness, and kurtosis of pixel values in each channel to obtain color features.
[0171] In one possible design, the feature extraction module 230 further includes: an information gain module and a mutual information module;
[0172] The information gain module is used to calculate the information gain of each feature in the first feature set according to the information gain selection algorithm, compare the information gain with a preset gain threshold, and delete each feature in the first feature set whose information gain is less than the preset gain threshold to obtain the third feature set.
[0173] The mutual information module is used to calculate the mutual information value between any two features in the third feature set according to the mutual information selection algorithm, and compare the mutual information value with the preset mutual information threshold. In the third feature set, the first feature in the feature pair with the mutual information value greater than the preset mutual information threshold is deleted to obtain the fourth feature set, wherein the first feature and the second feature form a feature pair, and the information gain of the first feature is less than the information gain of the second feature.
[0174] The feature extraction module 230 is also used to use the fourth feature set as the second feature set.
[0175] In one possible design, the preprocessing module 220 includes: a segmentation module, a stitching module, a brightness processing module, and a noise removal module;
[0176] The segmentation module is used to divide the initial image into multiple sub-images, and perform histogram equalization on each of the multiple sub-images to obtain multiple second sub-images.
[0177] The stitching module is used to stitch multiple second sub-images into a second image, wherein the contrast of the rock layer texture in the second image is higher than the contrast of the rock layer texture in the initial image, and the contrast of the rock layer boundary in the second image is higher than the contrast of the rock layer boundary in the initial image.
[0178] The brightness processing module is used to perform brightness uniformization processing on the second image according to the homomorphic filtering algorithm to obtain the third image, wherein the brightness difference in the third image is smaller than the brightness difference in the second image;
[0179] The noise removal module is used to remove noise from the third image according to the nonlocal mean filtering algorithm to obtain a preprocessed image, wherein the pixel difference value of the preprocessed image is smaller than the pixel difference value of the third image.
[0180] In one possible design, the pre-trained ST-CNN model includes a Swing-Transformer backbone network, multi-scale convolutional branches, a feature pyramid, feature channels, and a fully connected output layer.
[0181] The result output module 240 includes: a feature map extraction module, a structural feature extraction module, a fusion module, and a channel feature extraction module;
[0182] The feature map extraction module is used to obtain multi-stage feature maps based on the feature image formed by the combination of features in the second feature set and the Swin-Transformer backbone network.
[0183] The structural feature extraction module is used to obtain multi-scale structural features based on multi-stage feature maps and multi-scale convolutional branches;
[0184] The fusion module is used to fuse multi-stage feature maps and multi-scale structural features through feature pyramids to obtain fused feature maps.
[0185] The channel feature extraction module is used to obtain multiple channel features based on the fused feature map and feature channels;
[0186] The output module 240 is also used to obtain the classification results of the rock strata to be identified based on multiple channel features and a fully connected output layer.
[0187] This embodiment provides a rock strata classification device based on image recognition, which can execute a rock strata classification method based on image recognition in the above embodiment. Its implementation principle and technical effect are similar, and will not be described again here.
[0188] In the aforementioned specific implementation of an image recognition-based rock strata classification device, each module can be implemented as a processor. The processor can execute computer execution instructions stored in the memory, thereby enabling the processor to execute the aforementioned image recognition-based rock strata classification method.
[0189] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 3 As shown, the electronic device includes at least one processor 310 and a memory 320. The electronic device also includes a communication component 330. The processor 310, memory 320, and communication component 330 are connected via a bus 340.
[0190] In the specific implementation process, at least one processor 310 executes computer execution instructions stored in memory 320, causing at least one processor 310 to execute a rock layer classification method based on image recognition as executed on the electronic device side as described above.
[0191] The specific implementation process of processor 310 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0192] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0193] The memory may include high-speed RAM, and may also include non-volatile storage (NVM), such as at least one disk storage.
[0194] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0195] The above description of the functions implemented by electronic devices and main control devices has introduced the solutions provided by the embodiments of the present invention. It is understood that, in order to implement the above functions, the electronic device or main control device includes hardware structures and / or software modules corresponding to the execution of each function. By combining the units and algorithm steps of the various examples described in the embodiments of the present invention, the embodiments of the present invention can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the technical solutions of the embodiments of the present invention.
[0196] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the above-described image recognition-based rock strata classification method.
[0197] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0198] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in an electronic device or a host device.
[0199] This application also provides a computer program product, which includes a computer program stored in a readable storage medium. At least one processor of an electronic device can read the computer program from the readable storage medium, and the at least one processor executes the computer program to cause the electronic device to perform the solution provided in the above embodiments.
[0200] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disk, or optical disk.
[0201] The technical solutions of this application have been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it is readily understood by those skilled in the art that the scope of protection of this application is obviously not limited to these specific embodiments. The above embodiments are only used to illustrate the technical solutions of this application and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. These modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A rock strata classification method based on image recognition, characterized in that, include: Acquire the initial image of the rock strata to be identified; The initial image is preprocessed to obtain a preprocessed image; Based on the preprocessed image, the first texture features and color features are obtained; Based on the first texture feature and color feature, a first feature set is obtained; The first feature set is filtered using the information gain selection algorithm and the mutual information selection algorithm to obtain the second feature set; Based on the feature image formed by the combination of features in the second feature set, and the pre-trained shifted window convolutional ST-CNN model, the classification result of the rock layer to be identified is obtained.
2. The method according to claim 1, characterized in that, The step of obtaining the first texture feature and color feature based on the preprocessed image includes: Based on the preprocessed image, a 5-layer image scale space of the Gaussian pyramid is constructed, wherein the resolution of each layer decreases as the number of layers increases in the 5-layer image scale space of the Gaussian pyramid. The first texture feature is obtained based on the five-layer image scale space of the Gaussian pyramid; The preprocessed image is converted from the RGB color space to the HSV color space. The color features are obtained in the HSV color space.
3. The method according to claim 2, characterized in that, The process of obtaining the first texture feature based on the five-layer image scale space of the Gaussian pyramid includes: For each image layer, a three-level discrete wavelet transform is performed to extract wavelet coefficients in the horizontal, vertical, and diagonal directions, respectively, to obtain the second texture feature containing the texture details of each image layer; For each image layer, texture feature parameters are calculated using the gray-level co-occurrence matrix; The third texture feature is obtained based on the texture feature parameters of each layer of the image; The second texture feature and the third texture feature are used as the first texture feature.
4. The method according to claim 2, characterized in that, Obtaining the color features in the HSV color space includes: In the HSV color space, the statistical characteristics of the hue channel, saturation channel and lightness channel are calculated respectively. The statistical characteristics include the mean, standard deviation, skewness and kurtosis of the pixel values in each channel. The color feature is obtained by concatenating the mean, standard deviation, skewness, and kurtosis of the pixel values in each channel.
5. The method according to claim 1, characterized in that, The second feature set is obtained by filtering each feature in the first feature set according to the information gain selection algorithm and the mutual information selection algorithm, including: The information gain of each feature in the first feature set is calculated according to the information gain selection algorithm, and the information gain is compared with a preset gain threshold. In the first feature set, each feature whose information gain is less than the preset gain threshold is deleted to obtain the third feature set. The mutual information value between any two features in the third feature set is calculated according to the mutual information selection algorithm, and the mutual information value is compared with a preset mutual information threshold. In the third feature set, the first feature in the feature pair whose mutual information value is greater than the preset mutual information threshold is deleted to obtain a fourth feature set, wherein the first feature and the second feature form the feature pair, and the information gain of the first feature is less than the information gain of the second feature. The fourth feature set is used as the second feature set.
6. The method according to claim 1, characterized in that, The step of preprocessing the initial image to obtain a preprocessed image includes: The initial image is divided into multiple sub-images, and histogram equalization is performed on each of the multiple sub-images to obtain multiple second sub-images; Multiple second sub-images are stitched together to form a second image, wherein the contrast of the rock layer texture in the second image is higher than the contrast of the rock layer texture in the initial image, and the contrast of the rock layer boundary in the second image is higher than the contrast of the rock layer boundary in the initial image. According to the homomorphic filtering algorithm, the second image is subjected to brightness uniformization processing to obtain a third image, wherein the brightness difference in the third image is smaller than the brightness difference in the second image; The third image is subjected to noise removal processing according to the nonlocal mean filtering algorithm to obtain a preprocessed image, wherein the pixel difference value of the preprocessed image is smaller than the pixel difference value of the third image.
7. The method according to any one of claims 1-6, characterized in that, The pre-trained ST-CNN model includes a Swin-Transformer backbone network, a multi-scale convolutional branch, a feature pyramid, feature channels, and a fully connected output layer; The process of obtaining the classification result of the rock strata to be identified based on the feature image formed by combining the features in the second feature set and the pre-trained shift-window convolutional ST-CNN model includes: Based on the feature image formed by the combination of features in the second feature set and the Swin-Transformer backbone network, a multi-stage feature map is obtained; Based on the multi-stage feature map and the multi-scale convolutional branch, multi-scale structural features are obtained; The multi-stage feature map and the multi-scale structural features are fused using the feature pyramid to obtain a fused feature map. Based on the fused feature map and the feature channels, multiple channel features are obtained; Based on the multiple channel features and the fully connected output layer, the classification result of the rock strata to be identified is obtained.
8. A rock strata classification device based on image recognition, characterized in that, include: The acquisition module is used to acquire the initial image of the rock strata to be identified; The preprocessing module is used to preprocess the initial image to obtain a preprocessed image; The feature extraction module is used to obtain first texture features and color features based on the preprocessed image; The feature extraction module is further configured to obtain a first feature set based on the first texture feature and the color feature; The feature extraction module is further configured to filter each feature in the first feature set according to the information gain selection algorithm and the mutual information selection algorithm to obtain a second feature set; The result output module is used to obtain the classification result of the rock layer to be identified based on the feature image formed by the combination of features in the second feature set and the pre-trained shift window convolution ST-CNN model.
9. An electronic device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Hybrid characteristic selecting method for data excavation with redundant eliminating ability
CN101030219A
Sandstone microscopic image classification method and system based on improved Swin Transform
CN118570797A
Automated classification of images using deep learning--back end
US10402699B1
Product classification method and apparatus based on deep learning
WO2017113232A1