Rock debris lithology identification method and system based on multi-feature separation and attention fusion, and storage medium

By combining feature separation and attention fusion in the Swin Transformer network model, the problem of existing models being unable to separate color, texture, and grain size features is solved, achieving efficient, accurate, and interpretable automated identification of rock debris lithology.

CN121661623APending Publication Date: 2026-03-13NORTHEAST GASOLINEEUM UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-05
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing deep learning models have failed to effectively simulate the multi-dimensional, separate analysis of rock fragment lithology by geological experts, and have failed to separately consider lithological characteristics such as color, texture, and grain size.

Method used

A lithology identification network model based on Swing Transformer is adopted. The image features are decoupled into three feature streams: color, texture, and granularity through the feature separation module. Self-attention calculation and fusion are performed through the multi-feature window attention module to generate a fused feature representation.

Benefits of technology

It improves the accuracy of automatic identification of rock fragment lithology, simulates the analytical logic of geological experts, provides interpretability, and realizes real-time and efficient automatic identification of lithology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121661623A_ABST
    Figure CN121661623A_ABST
Patent Text Reader

Abstract

The invention discloses a rock debris lithology identification method and system based on multi-feature separation and attention fusion, and a storage medium, relates to the technical field of geological exploration and oil-gas field development, and aims to solve the problem that an existing deep learning model cannot effectively simulate the'multi-dimensional and separated 'analysis of geological experts on rock debris lithology. According to the technical key points, a lithology identification network model based on Swin Transform is constructed, and a Swin Transform block of the model comprises a feature separation module, a multi-feature window attention module and an attention fusion module; the feature separation module is used for carrying out parallel multi-scale convolution operation on the input feature map and respectively decoupling the feature map into three parallel color feature flows, texture feature flows and granularity feature flows; the multi-feature window attention module is used for performing attention weighting on each feature flow; the attention fusion module is used for fusing attention weighted features; and identifying the lithology category based on the fused feature representation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of geological exploration and oil and gas field development technology, and more specifically, to a method, system and storage medium for identifying rock fragment lithology based on multi-feature separation and attention fusion. Background Technology

[0002] In petroleum geological exploration and development, drilling is the core means of obtaining subsurface geological information. Drill cuttings, generated during drilling, are fragments of formation rock carrying rich stratigraphic information. Lithology identification of drilling cuttings at different depths, i.e., determining their rock type, is one of the key steps in geological logging. Accurate lithology identification plays an irreplaceable role in establishing stratigraphic profiles, determining reservoir characteristics, and guiding drilling decisions.

[0003] Currently, traditional rock cuttings lithology identification mainly relies on manual visual observation by on-site logging engineers, usually with the help of tools such as microscopes. This often has problems such as strong subjectivity, low efficiency, high cost, and sample limitations, which further increases the difficulty and uncertainty of manual identification.

[0004] With the development of computer vision and deep learning technologies, automatically analyzing rock debris images using image recognition technology has become a promising research direction. Convolutional Neural Networks (CNNs) have been initially applied to lithology identification. CNNs, through layer-by-layer convolution operations, can effectively extract local and global features of images. However, standard CNNs still have limitations when processing highly specialized geological images such as lithology identification: Feature mixing: Standard CNNs, in both shallow and deep networks, tend to mix (muddle) multiple visual features of the image (such as color, texture, grain structure, shape, etc.) together to form a unified, high-dimensional feature representation. Lack of expert prior knowledge: When identifying lithology, geological experts often consciously and separately evaluate several key geological attributes: Color: For example, red may contain iron, dark may be rich in organic matter, and light may be quartz or carbonate, etc. Texture: For example, bedding, banding, spots, etc. Grain size and structure: For example, grain size, uniformity, cementation method, porosity, etc. A geologist's brain actually makes a comprehensive and weighted judgment based on these decoupled features. However, the "black box" feature extraction of standard CNNs cannot explicitly simulate this expert decision-making mechanism.

[0005] In recent years, vision models based on the Transformer architecture (Vision Transformer, ViT) and its improved versions, such as the Swin Transformer, have performed exceptionally well on various computer vision tasks. The Swin Transformer reduces computational complexity while maintaining global modeling capabilities by introducing window multi-head self-attention (W-MSA) and shifted window multi-S-MSA. Although the Swin Transformer possesses powerful feature representation capabilities, its standard self-attention mechanism remains a "full-feature" mode. That is, when calculating attention, it still mixes all information such as color, texture, and granularity into the Q, K, and V vectors for computation, without explicitly separating these geological feature dimensions crucial for lithology assessment.

[0006] Therefore, designing a novel deep learning network that can simulate the analytical logic of geological experts to explicitly separate, process, and adaptively fuse various key geological features (especially color, texture, and grain size) of rock debris images is a crucial technical challenge to address in order to improve the accuracy of automatic identification of rock debris lithology. This is to solve the problem that existing models have sufficient "generalization" but insufficient "professionalism" in feature extraction. Summary of the Invention

[0007] The technical problem to be solved by this invention is:

[0008] Existing deep learning models fail to effectively simulate the "multi-dimensional, separate" analysis of rock fragment lithology by geological experts, meaning they fail to separately consider lithological characteristics such as color, texture, and grain size.

[0009] Therefore, the present invention provides a method, system and storage medium for identifying rock debris lithology based on multi-feature separation and attention fusion.

[0010] The technical solution adopted by the present invention to solve the above-mentioned technical problems is as follows:

[0011] This invention provides a method for identifying rock fragment lithology based on multi-feature separation and attention fusion, comprising the following steps:

[0012] S1. Acquire rock cuttings image data and preprocess the acquired rock cuttings image data;

[0013] S2. Input the preprocessed image data into a lithology identification network model based on Swin Transformer for feature extraction. The model includes multiple Swin Transformer blocks, each comprising a feature separation module, a multi-feature window attention module, and an attention fusion module. The feature separation module performs parallel multi-scale convolution operations on the input feature map, decoupling the feature map into three parallel feature streams: color, texture, and granularity. The multi-feature window attention module performs self-attention calculation on each feature stream to obtain attention-weighted color, texture, and granular features. The attention fusion module fuses the attention-weighted color, texture, and granular features to generate a fused feature representation.

[0014] S3. Identify lithological categories based on fused feature representations.

[0015] Furthermore, the feature separation module includes parallel color feature convolution branches, texture feature convolution branches, and granular feature convolution branches. The color feature convolution branch uses a 1x1 convolution kernel to extract the color and channel information of the input feature map and generate the color feature stream. The texture feature convolution branch uses a 3x3 convolution kernel to extract the local texture information of the input feature map and generate the texture feature stream. The granular feature convolution branch uses a 5x5 dilated convolution kernel to extract the granularity and structural information of the input feature map and generate the granular feature stream.

[0016] Furthermore, the multi-feature window attention module, based on a multi-head attention mechanism and introducing a relative position bias, performs self-attention calculation for each feature stream:

[0017]

[0018] in, Scaling factor Here is a location bias matrix learned for different geological features, where Q is the query, K is the key, and V is the value, and:

[0019]

[0020] in, For characteristic flow, Each feature flow has its own independent weight matrix, and they do not share weights with each other.

[0021] Furthermore, the attention fusion module concatenates multiple parallel attention-weighted feature streams along the channel dimension, and then performs dimensionality reduction and information fusion on the concatenated high-dimensional features through a linear projection layer to obtain the fused feature representation.

[0022] Furthermore, the lithology identification network model is trained using a cross-entropy loss function with class weights:

[0023]

[0024] in, This represents the total number of lithological categories. This is the sign function, which is 1 when the sample belongs to class c, and 0 otherwise. Predict the probability that a sample belongs to class c for the model; represents the weight of class c.

[0025] Furthermore, the lithology identification network model includes: an image patch embedding layer, a first Transformer module composed of multiple SwinTransformer blocks, a first Patch merging layer, a second Transformer module composed of multiple SwinTransformer blocks, a second Patch merging layer, a third Transformer module composed of multiple SwinTransformer blocks, a third Patch merging layer, a fourth Transformer module composed of multiple SwinTransformer blocks, and a classification head.

[0026] Furthermore, the classification head includes a layer normalization layer, an adaptive average pooling layer, and a fully connected layer connected in sequence.

[0027] Furthermore, the functional implementation process of the Swin Transformer block is as follows:

[0028] S1: Input the input feature X into the feature separation module, and obtain three parallel feature streams F_color, F_texture, and F_gran through parallel multi-scale convolution operations;

[0029] S2: Apply the GELU activation function to each of the three parallel feature streams;

[0030] S3: Perform layer normalization on the three activated feature streams respectively;

[0031] S4: Input the normalized color feature stream F_color, texture feature stream F_texture, and granularity feature stream F_gran into the multi-feature window attention module in parallel, calculate the self-attention of their respective feature streams, and obtain the fused feature F_fused through the attention fusion module;

[0032] S5: The fused feature F_fused is processed through residual connection and random depth descent operation, and then added to the original input feature X to obtain the first residual output;

[0033] S6: Perform a second layer normalization on the first residual output;

[0034] S7: The features after the second normalization are fed into the multilayer perceptron module for nonlinear transformation and feature enhancement;

[0035] S8: The output of the multilayer perceptron module is passed through the second residual connection and random depth descent operation, and then added to the first residual output to obtain the final output of the Swing Transformer block.

[0036] This invention provides a rock debris lithology identification system based on multi-feature separation and attention fusion. The system has a program module corresponding to the steps of any of the above-described technical solutions, and executes the steps in the above-described rock debris lithology identification method based on multi-feature separation and attention fusion when running.

[0037] The present invention provides a computer-readable storage medium storing a computer program configured to, when invoked by a processor, implement the steps of the rock debris lithology identification method based on multi-feature separation and attention fusion as described in any of the above technical solutions.

[0038] Compared with the prior art, the beneficial effects of the present invention are:

[0039] 1. Simulating expert cognition: Through the collaborative design of the feature separation module and the multi-feature window attention module, this invention explicitly decouples the input features into multiple key geological feature flows such as color, texture, and granularity within the Swin Transformer block, in order to simulate the cognitive process of geological experts evaluating different geological attributes when making lithological judgments.

[0040] 2. Independent Feature Representation: This invention avoids the problem of key geological features being "submerged" due to the mixing of all features in attention calculation. Through parallel attention calculation, it ensures that each geological feature (color, texture, grain size) is fully and independently represented and weighted. The model can adaptively learn whether to "focus" more on color, texture, or grain size when judging a specific lithology, thereby greatly enhancing the discriminative power of the features.

[0041] 3. Enhanced interpretability: By analyzing the attention weights or fusion layer weights of the three parallel attention branches (color, texture, gran) in the MultiFeatureWindowAttention module, this invention can explore the degree of dependence of the model on these three types of features when identifying different lithologies, providing geological interpretability for decision-making.

[0042] 4. Real-time and efficient: The identification process of this invention is a fully automatic end-to-end calculation, which is extremely fast and completely eliminates the subjectivity and fatigue of manual identification. It can realize real-time, high-frequency and high-precision automatic lithology identification at the drilling site. Attached Figure Description

[0043] Figure 1 This is a flowchart of the rock debris lithology identification method based on multi-feature separation and attention fusion in an embodiment of the present invention;

[0044] Figure 2 This is a schematic diagram of the overall architecture of the Swin Transformer network model in an embodiment of the present invention.

[0045] Figure 3 This is a schematic diagram of the structure of the improved Swing Transformer block in an embodiment of the present invention;

[0046] Figure 4 This is a user terminal diagram of the rock cuttings lithology identification system based on the improved Swing Transformer model in this embodiment of the invention.

[0047] Figure 5 This is a comparison chart of the training and validation losses of the improved Swin Transformer model in different rounds of evaluation in this embodiment of the invention;

[0048] Figure 6 This is a comparison chart of the recognition accuracy of the Swin Transformer model before and after improvement in this embodiment of the invention. Detailed Implementation

[0049] To enable those skilled in the art to better understand the present invention, exemplary embodiments or examples of the present invention will be described below in conjunction with the accompanying drawings. Obviously, the described embodiments or examples are merely some, not all, of the embodiments or examples of the present invention. All other embodiments or examples obtained by those skilled in the art based on the embodiments or examples of the present invention without inventive effort should fall within the scope of protection of the present invention.

[0050] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0051] Specific Implementation Plan 1: Combining Figures 1 to 3 As shown, this invention provides a method for identifying rock debris lithology based on multi-feature separation and attention fusion, comprising the following steps:

[0052] S1. Acquire rock cuttings image data and preprocess the acquired rock cuttings image data;

[0053] S2. Input the preprocessed image data into a lithology identification network model based on Swin Transformer for feature extraction. The model includes multiple Swin Transformer blocks, each comprising a feature separation module, a multi-feature window attention module, and an attention fusion module. The feature separation module performs parallel multi-scale convolution operations on the input feature map, decoupling the feature map into three parallel feature streams: color, texture, and granularity. The multi-feature window attention module performs self-attention calculation on each feature stream to obtain attention-weighted color, texture, and granular features. The attention fusion module fuses the attention-weighted color, texture, and granular features to generate a fused feature representation.

[0054] S3. Identify lithological categories based on fused feature representations.

[0055] Specific implementation plan two: The preprocessing of the collected rock cuttings image data as described in S1 includes:

[0056] Images of collected rock cuttings Perform standardization processing. Assume the input image has [number] channels. The pixel value on Standardized pixel values The calculation formula is as follows:

[0057]

[0058] in, and The datasets are in the channels respectively The mean and standard deviation of the image. The preprocessed image is denoted as... This implementation plan is otherwise the same as Implementation Plan 1.

[0059] Specific implementation scheme three: The feature separation module includes three parallel color feature convolution branches, texture feature convolution branches, and granular feature convolution branches, which perform different convolution operations respectively. Extracting specific geological features:

[0060] Color feature convolution branch: using Convolution, which fuses and transforms information along the channel dimension, is suitable for extracting pixel-level spectral and color information; the formula is as follows:

[0061]

[0062] in, For point convolution weights, This represents the convolution operation, and LN stands for layer normalization.

[0063] Texture feature convolution branch: using Convolution is used to extract local neighborhood texture; the formula is as follows:

[0064]

[0065] in, For standard convolution weights, padding is set to 1.

[0066] Granularity feature convolution branch: using hole rate of Dentular convolution is used to obtain a larger receptive field without increasing computational load, capturing the size, distribution, and cementation patterns of rock particles; the formula is as follows:

[0067]

[0068] in, The padding is set to 4 for the dilated convolution weights. This implementation scheme is otherwise identical to specific implementation scheme two.

[0069] Specific Implementation Scheme 4: Multi-feature window attention module, targeting each decoupled feature stream. (in Divide it into non-overlapping windows. (For example Within each window, a query, key, and value matrix is ​​generated through independent linear transformations:

[0070]

[0071] in, Each feature flow has its own independent weight matrix, and they do not share weights with each other.

[0072] For each feature stream, a relative position bias is introduced. Calculate multi-head self-attention (MSA):

[0073]

[0074] in, Scaling factor This is a specific location bias matrix learned for different geological features. This implementation scheme is otherwise the same as specific implementation scheme three.

[0075] Specific implementation plan five: The attention fusion module concatenates the attention outputs of the three parallel branches along the channel dimension.

[0076]

[0077] in .

[0078] Subsequently, through the linear projection layer By mapping the features back to their original dimensions, deep fusion of information from the three feature streams is achieved, resulting in fused features. :

[0079]

[0080] in, This is for merging the weight matrix. All other aspects of this implementation scheme are the same as in specific implementation scheme four.

[0081] Specific Implementation Scheme Six: The lithology identification network model is trained using a weighted cross-entropy loss function, as shown in the following formula:

[0082]

[0083] in:

[0084] The total number of lithology categories (in this embodiment) );

[0085] For the sign function, when the true label of the sample is the first... Class Time ,otherwise ;

[0086] The model predicts that the sample belongs to the first... The probability of a class, i.e. ;

[0087] For the first The weighting coefficient for lithology is used to alleviate the problem of uneven distribution of rock cuttings samples.

[0088] This implementation plan is otherwise the same as Implementation Plan Five.

[0089] Specific Implementation Plan Seven: (e.g.) Figure 2 As shown, the lithology identification network model includes:

[0090] The image patch embedding layer uses a convolutional layer (proj) with a kernel size of 4×4 and a stride of 4 to transform the input 224×224×3 image into a 56×56×96 feature map (embed_dim=96); followed by a layer normalization layer for layer normalization.

[0091] Transformer Module 1 (Stage 1): Consists of two stacked improved Swin Transformer blocks. The feature map resolution in this stage is 56×56, and the feature dimension is 96.

[0092] The PatchMerging layer downsamples the 56×56×96 feature map output by Transformer Module 1, concatenating the features of adjacent 2×2 local regions, reducing the feature map resolution to 28×28. In the channel dimension, the features of four local regions (4×96=384) are concatenated, and a linear reduction layer is used to reduce the dimension to 192 (embed_dim×2).

[0093] Transformer Module 2 (Stage 2): Consists of two stacked improved Swin Transformer blocks. The feature map resolution in this stage is 28×28, and the feature dimension is 192.

[0094] Patch Merging Layer: Used to downsample a 28×28×192 feature map to 14×14×384.

[0095] Transformer Module 3 (Stage 3): Consists of 6 stacked improved Swin Transformer blocks. The feature map resolution in this stage is 14×14, and the feature dimension is 384.

[0096] Patch Merging Layer: Used to downsample a 14×14×384 feature map to 7×7×768.

[0097] Transformer Module 4 (Stage 4): Consists of two stacked improved Swin Transformer blocks. The feature map resolution in this stage is 7×7, and the feature dimension is 768.

[0098] The classification head includes: a final layer normalization layer; an adaptive average pooling layer to convert the 7×7×768 feature map into a 1×1×768 feature vector; and a fully connected layer (head) to map the 768-dimensional feature vector to a 13-dimensional (num_classes=13) classification score. Other aspects of this implementation are the same as in specific implementation scheme six.

[0099] Specific implementation plan eight: such as Figure 3 As shown, the functional implementation process of the Swin Transformer block is as follows:

[0100] 1. Feature decoupling and separation: First, input features The module then enters the Feature Separator. Through multi-scale convolution operations within this module, the input features are explicitly decoupled into three independent feature streams, each corresponding to a different geological attribute: the color feature stream. Texture feature flow and granularity feature flow .

[0101] 2. Attention Calculation and First Residual Connection: These three parallel feature streams then enter the Multi-Feature Window Attention module, where independent self-attention calculations are performed to capture their respective feature dependencies. These are then fused via linear projection through the attention fusion module to generate fused features. To avoid network degradation and maintain gradient propagation, the fused feature is processed through a random depth (DropPath) and then combined with the original input feature. Perform the first residual connection summation to obtain the first intermediate output. Its mathematical formula is:

[0102]

[0103] 3. Nonlinear Transformation and Feature Enhancement (MLP Layer): The first intermediate output obtained above After a second layer normalization (LN) process, the feature distribution is standardized. The normalized data is then fed into a multilayer perceptron (MLP) module for nonlinear transformation and further feature enhancement. This MLP module contains two fully connected linear layers with a GELU activation function introduced in between. The specific calculation process is as follows: first, the weight matrix... and bias A linear mapping is performed, followed by GELU activation, and then the weight matrix is ​​applied. and bias Perform the mapping. The formula is as follows:

[0104]

[0105] 4. Second Residual Connection and Final Output: This involves connecting the features output by the multilayer perceptron module. Similarly, after undergoing random depth (DropPath) processing, the features are connected via a second residual link to the features before entering the MLP. Element-wise addition is performed; the final output of the SwinTransformer block is obtained by fusing the global context information extracted by the attention mechanism with the nonlinear features extracted by the MLP. Its mathematical formula is:

[0106] .

[0107] This implementation plan is otherwise the same as Specific Implementation Plan VII.

[0108] The rock debris lithology identification method (algorithm) proposed in this invention based on multi-feature separation and attention fusion is the underlying technical core of this invention, and various products can be derived based on the algorithm.

[0109] Based on the method proposed in this invention, a rock debris lithology identification system based on multi-feature separation and attention fusion is developed using a programming language. This system has program modules corresponding to the steps of the above-mentioned technical solution, and executes the steps in the rock debris lithology identification method based on multi-feature separation and attention fusion when running.

[0110] The system can be deployed on a cloud server or a local workstation / edge computing device, and includes at least:

[0111] Image acquisition module: used to acquire raw images of rock cuttings; it is also equipped with an image file upload submodule, which supports batch uploading of locally acquired images and file list management, providing the system with complete image data input.

[0112] Data preprocessing and batch processing module: used to execute the preprocessing steps described in claim 1; it also supports batch image preview and single image browsing, realizing the visual management of preprocessed data.

[0113] The lithology identification module includes a processor (CPU / GPU) and memory. The memory contains or loads an improved Swin Transformer network model trained using the methods described above. This module is responsible for performing feature extraction on the preprocessed image, calculating the probability of various lithologies using the model, and completing the automatic lithology identification.

[0114] Results output module: Used to display the final lithology identification results to users, specifically in the form of lithology probability distribution map and identification result table, and supports result export.

[0115] User terminal module, such as Figure 4 As shown, this terminal provides an interactive interface for users and displays the identification results. It can be a monitoring screen in a logging room, a geologist's workstation PC, or an engineer's mobile device. This module includes a results output module (e.g., implemented as a web application or desktop software), which retrieves structured lithology identification results from the lithology identification server 505 and transforms them into a visual format, such as a lithology probability distribution map, a lithology identification result data table, or an integrated stratigraphic columnar section, presenting them intuitively to the user. Furthermore, users can also upload historical rock cuttings images through this user terminal for retrospective analysis and comparison.

[0116] The developed system (software) computer program is stored on a computer-readable storage medium, and the computer program is configured to implement the steps of the above-described rock cutting lithology identification method based on multi-feature separation and attention fusion when called by a processor. In other words, the invention is materialized on a carrier, becoming a computer program product.

[0117] Various implementations of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, application-specific integrated circuits (ASICs), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include: implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0118] The computational programs (also referred to as programs, software, software applications, or code) of this invention include machine instructions of a programmable processor and can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, device, and / or apparatus (e.g., disk, optical disk, memory, programmable logic device PLD) for providing machine instructions and / or data to a programmable processor, including machine-readable media that receive machine instructions as machine-readable signals. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.

[0119] The beneficial effects of the present invention will be described below with reference to specific embodiments.

[0120] Example 1

[0121] The lithology identification network model based on the improved Swin Transformer of this invention is compared with the original Swin Transformer network model.

[0122] Drilling cuttings were collected from multiple strata in the Changqing Oilfield, encompassing a total of 13 lithological categories (including: grayish-white medium sandstone, brownish-gray micritic limestone, light gray fine sandstone, dark gray mudstone, and dark gray silty mudstone). Multiple senior geological experts cross-validated and independently labeled all the cuttings images, constructing a high-quality labeled image dataset of over 5,000 images.

[0123] All rock debris images were processed to a standard input size of 224×224 pixels; the dataset was randomly divided into test, training, and validation sets. Online data augmentation was performed on the training set images, including random scaling and cropping (scaling ratio 0.7–1.0), random horizontal flipping (probability 0.5), random vertical flipping (probability 0.5), random rotation (-15° to +15°), and random color dithering (brightness, contrast, and saturation adjustments of 0.2 each). Validation set images were scaled to 256×256 pixels and then cropped to 224×224 pixels at the center. All images were standardized using the mean and standard deviation of the ImageNet dataset for pixel value normalization.

[0124] Optimizer: AdamW optimizer is used, with weight decay set to 5E-2.

[0125] Learning rate strategy: A cosine annealing learning rate scheduler is used, with an initial learning rate of 0.0001 and a minimum learning rate of 1e-6. During training, the learning rate decays according to a cosine curve.

[0126] Training process: Each model is trained on a GPU device, with a default training duration of 100 epochs and a batch size of 16. The loss and accuracy changes on both the training and validation sets are monitored until the model's performance on the validation set converges. Results are as follows: Figure 5 As shown.

[0127] After training, the preprocessed rock debris images to be identified are input into the trained model. The model outputs a 13-dimensional probability vector through the classification head. The lithology category corresponding to the index with the highest probability value is the final rock debris identification result, as shown in the figure. Figure 4 As shown, through Figure 6 It can be seen that the lithology identification network model based on the improved Swing Transformer of the present invention achieves a higher identification accuracy.

[0128] While the present invention has been disclosed above, its scope of protection is not limited thereto. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention, and all such changes and modifications will fall within the scope of protection of the present invention.

Claims

1. A method for identifying lithology of rock fragments based on multi-feature separation and attention fusion, characterized in that, Includes the following steps: S1. Acquire rock cuttings image data and preprocess the acquired rock cuttings image data; S2. Input the preprocessed image data into the lithology identification network model based on Swin Transformer for feature extraction. The model includes multiple Swin Transformer blocks, and each Swin Transformer block includes a feature separation module, a multi-feature window attention module, and an attention fusion module. The feature separation module is used to perform parallel multi-scale convolution operations on the input feature map, decoupling the feature map into three parallel feature streams: color feature stream, texture feature stream, and granular feature stream. The multi-feature window attention module is used to perform self-attention calculation on each feature stream to obtain attention-weighted color features, texture features, and granular features. The attention fusion module is used to fuse the attention-weighted color features, texture features, and granular features to generate a fused feature representation. S3. Identify lithological categories based on fused feature representations.

2. The lithological identification method for cuttings based on multi-feature separation and attention fusion according to claim 1, characterized in that, The feature separation module includes parallel color feature convolution branches, texture feature convolution branches, and granular feature convolution branches. The color feature convolution branch uses a 1x1 convolution kernel to extract the color and channel information of the input feature map and generate the color feature stream. The texture feature convolution branch uses a 3x3 convolution kernel to extract the local texture information of the input feature map and generate the texture feature stream. The granular feature convolution branch uses a 5x5 dilated convolution kernel to extract the granularity and structural information of the input feature map and generate the granular feature stream.

3. The lithological identification method for cuttings based on multi-feature separation and attention fusion according to claim 2, characterized in that, The multi-feature window attention module, based on a multi-head attention mechanism and incorporating a relative position bias, performs self-attention calculation for each feature stream: in, Scaling factor Here is a location bias matrix learned for different geological features, where Q is the query, K is the key, and V is the value, and: in, For characteristic flow, Each feature flow has its own independent weight matrix, and they do not share weights with each other.

4. The lithological identification method for cuttings based on multi-feature separation and attention fusion according to claim 3, characterized in that, The attention fusion module concatenates multiple parallel attention-weighted feature streams along the channel dimension, and then performs dimensionality reduction and information fusion on the concatenated high-dimensional features through a linear projection layer to obtain the fused feature representation.

5. The lithological identification method for cuttings based on multi-feature separation and attention fusion according to claim 4, characterized in that, The lithology identification network model is trained using a cross-entropy loss function with class weights. in, This represents the total number of lithological categories. This is the sign function, which is 1 when the sample belongs to class c, and 0 otherwise. Predict the probability that a sample belongs to class c for the model; represents the weight of class c.

6. The lithological identification method for cuttings based on multi-feature separation and attention fusion according to claim 5, characterized in that, The lithology identification network model includes: an image patch embedding layer, a first Transformer module composed of multiple Swin Transformer blocks, a first Patch merging layer, a second Transformer module composed of multiple Swin Transformer blocks, a second Patch merging layer, a third Transformer module composed of multiple Swin Transformer blocks, a third Patch merging layer, a fourth Transformer module composed of multiple Swin Transformer blocks, and a classification head.

7. The lithological identification method for cuttings based on multi-feature separation and attention fusion according to claim 6, characterized in that, The classification head includes a layer normalization layer, an adaptive average pooling layer, and a fully connected layer connected in sequence.

8. The method for identifying rock debris lithology based on multi-feature separation and attention fusion according to claim 7, characterized in that, The functional implementation process of the Swin Transformer block is as follows: S1: Input the input feature X into the feature separation module, and obtain three parallel feature streams F_color, F_texture, and F_gran through parallel multi-scale convolution operations; S2: Apply the GELU activation function to each of the three parallel feature streams; S3: Perform layer normalization on the three activated feature streams respectively; S4: Input the normalized color feature stream F_color, texture feature stream F_texture, and granularity feature stream F_gran into the multi-feature window attention module in parallel, calculate the self-attention of their respective feature streams, and obtain the fused feature F_fused through the attention fusion module; S5: The fused feature F_fused is processed through residual connection and random depth descent operation, and then added to the original input feature X to obtain the first residual output; S6: Perform a second layer normalization on the first residual output; S7: The features after the second normalization are fed into the multilayer perceptron module for nonlinear transformation and feature enhancement; S8: The output of the multilayer perceptron module is passed through the second residual connection and random depth descent operation, and then added to the first residual output to obtain the final output of the Swing Transformer block.

9. A lithological identification system for rock fragments based on multi-feature separation and attention fusion, characterized in that, The system has a program module corresponding to the steps of the method described in any one of claims 1 to 8, and executes the steps in the above-described rock debris lithology identification method based on multi-feature separation and attention fusion when it is run.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program configured to, when invoked by a processor, implement the steps of the rock debris lithology identification method based on multi-feature separation and attention fusion as described in any one of claims 1 to 8.