Surrounding rock structure small sample analysis model training and identification method, device, equipment and medium

By calculating the tensor field and anisotropic distance metric of the surrounding rock structure for superpixel segmentation, and combining feature extraction model and knowledge distillation training, the problem of high accuracy and generalization under small sample data in surrounding rock structure identification is solved, and efficient surrounding rock structure analysis is achieved.

CN122435388APending Publication Date: 2026-07-21CHINA THREE GORGES CORPORATION
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610600528.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-30
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing methods for identifying surrounding rock structures rely on manual annotation, which is inefficient and highly subjective. It is difficult to achieve high accuracy and strong generalization ability under small sample conditions, and self-supervised methods are difficult to maintain the directionality and integrity of slender continuous structures.

Method used

By calculating the structural tensor field of unlabeled surrounding rock samples, an anisotropic distance metric is constructed for superpixel segmentation. Combined with the initial feature extraction model and knowledge distillation training, a target feature extraction model is obtained for small sample analysis of surrounding rock structures.

Benefits of technology

It reduces reliance on manually labeled data, improves the accuracy and generalization ability of surrounding rock structure identification, and can quickly adapt to actual engineering needs with a small amount of labeled data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122435388A_ABST
    Figure CN122435388A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of surrounding rock image processing, and discloses a surrounding rock structure small sample analysis model training and identification method, device, equipment and medium, the method comprises the following steps: obtaining an unannotated surrounding rock sample image, extracting a local texture direction based on a structure tensor field, and constructing a superpixel region conforming to the texture direction; taking the superpixel region as a semantic unit to perform region-level contrast learning, and obtaining an inter-class feature model; performing unsupervised clustering based on the region features extracted by the inter-class model, and performing intra-class contrast learning in each clustering set to obtain a plurality of intra-class expert models; distilling a student model by taking the inter-class model as a leading teacher and the intra-class expert as an expert teacher, and obtaining a target feature extraction model; and performing migration training on the target model by adding a task head to the target model using an annotated surrounding rock image, so that lithology classification and structure surface identification are realized. The application can improve the identification accuracy of a model for surrounding rock structure under the condition that a large amount of artificial annotation is lacking.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of surrounding rock image processing technology, specifically to training and recognition methods, devices, equipment, and media for small sample analysis models of surrounding rock structures. Background Technology

[0002] In the field of geological engineering, the structural characteristics of surrounding rock, such as lithology, joints, fissures, bedding, and fracture zones, in tunnel, raised shaft, and underground cavern construction are crucial for construction risk assessment, support design, and stability determination. Current methods for identifying surrounding rock structures largely rely on manual interpretation, resulting in low efficiency, strong subjectivity, and insufficient consistency. In recent years, deep learning methods have been applied to rock image recognition and surrounding rock structure analysis; however, these methods typically depend on a large number of high-quality labeled samples. Annotation of surrounding rock images requires professional geologists, leading to high costs and long processing times, especially for low-contrast, fine-scale, and blurred-boundary fissure and joint structures, which present even greater challenges. Existing contrastive learning or self-supervised methods often use entire images or regular image blocks as learning objects, making it difficult to maintain the directionality and integrity of slender, continuous structures. This results in the structural semantics being easily fragmented or weakened, affecting the model's recognition accuracy and generalization ability. Therefore, there is an urgent need for a surrounding rock structure analysis method suitable for small sample conditions, capable of fully utilizing unlabeled surrounding rock images, and enhancing the representation of local structures. Summary of the Invention

[0003] This invention provides a method for training a small-sample analysis model of surrounding rock structures to address the problem that related deep learning methods struggle to achieve high-precision, high-generalization-ability classification of surrounding rock lithology and pixel-level identification of structural surfaces under conditions of scarce professionally labeled data and insufficient samples of key geological structures.

[0004] In a first aspect, the present invention provides a training method for a small-sample analysis model of surrounding rock structures, comprising: calculating the structural tensor field of an unlabeled surrounding rock sample image, and determining the local principal texture direction of each pixel in the image based on the structural tensor field; constructing an anisotropic distance metric based on the local principal texture direction, and performing superpixel segmentation on the unlabeled surrounding rock sample image according to the anisotropic distance metric to obtain multiple superpixel regions conforming to the texture direction of the surrounding rock, wherein the superpixel regions serve as the smallest semantic units for surrounding rock structure analysis; creating an initial feature extraction model, and extracting the region features corresponding to each superpixel region through the initial feature extraction model; and performing region-level comparative learning based on the region features to train the model. The inter-class feature extraction model is used to extract regional features. Unsupervised clustering of superpixel regions is performed based on these inter-class feature extraction models to obtain multiple cluster sets. Intra-class comparative learning is then performed on the superpixel regions within each cluster set to obtain multiple intra-class expert feature extraction models. The inter-class feature extraction model is used as the lead teacher model, and the multiple intra-class expert feature extraction models are used as expert teacher models. Knowledge distillation training is then performed on the student model to obtain the target feature extraction model. A small-sample analysis model of the surrounding rock structure is trained using labeled surrounding rock sample images. This small-sample analysis model includes a target feature extraction model and a task head, which includes a classification head and / or a segmentation head.

[0005] In one optional implementation, the structure tensor field of the unlabeled surrounding rock sample image is calculated, and the local principal texture direction of each pixel in the image is determined based on the structure tensor field. This includes: performing Gaussian smoothing on the unlabeled surrounding rock sample image and calculating the image gradients of the smoothed unlabeled surrounding rock sample image in the horizontal and vertical directions; constructing the gradient outer product matrix corresponding to each pixel based on the image gradients, and performing neighborhood integration or Gaussian weighted smoothing on the gradient outer product matrix to obtain the structure tensor matrix; and performing eigenvalue decomposition on the structure tensor matrix to obtain the local principal texture direction and the normal direction perpendicular to the local principal texture direction of the corresponding pixel.

[0006] In one optional implementation, an anisotropic distance metric is constructed based on the local principal texture direction, and superpixel segmentation is performed on the unlabeled surrounding rock sample image according to the anisotropic distance metric. This includes: constructing a metric tensor corresponding to the pixel based on the local principal texture direction and the normal direction, wherein the metric tensor is used to reduce the distance weight along the local principal texture direction and increase the distance weight perpendicular to the local principal texture direction; constructing a comprehensive distance between the cluster center and the pixel based on the color distance, spatial distance, and the anisotropic texture distance corresponding to the metric tensor; performing superpixel clustering according to the comprehensive distance, and performing connectivity correction on the clustering results to obtain multiple superpixel regions conforming to the orientation of joints, fractures, and / or bedding.

[0007] In one optional implementation, a region-level contrastive learning is performed based on regional features to train an inter-class feature extraction model, including: image enhancement of superpixel regions to obtain enhanced regions corresponding to the superpixel regions; taking the same superpixel region and its enhanced region as positive sample pairs, and taking superpixel regions in different superpixel regions and / or different unlabeled surrounding rock sample images as negative samples; extracting regional features of positive sample pairs and negative samples respectively through an initial feature extraction model; adjusting the model parameters of the initial feature extraction model based on a region-level contrastive loss function to increase the similarity of regional features between positive sample pairs and decrease the similarity of regional features between negative samples, thereby obtaining an inter-class feature extraction model.

[0008] In one optional implementation, unsupervised clustering of superpixel regions is performed based on the regional features extracted by the inter-class feature extraction model to obtain multiple cluster sets. This includes: inputting each superpixel region into the inter-class feature extraction model to obtain the region embedding features corresponding to each superpixel region; and using an unsupervised clustering algorithm to cluster each superpixel region based on the region embedding features to obtain multiple cluster sets. Each cluster set is used to characterize a potential surrounding rock structure semantic category, which includes at least one of intact rock mass, jointed region, fractured region, fractured zone, and mudstone interlayer.

[0009] In one optional implementation, intra-class contrastive learning is performed based on the superpixel regions within each cluster set to obtain multiple intra-class expert feature extraction models. This includes: for any given cluster set, obtaining multiple superpixel regions belonging to that cluster set; creating a corresponding independent initial expert feature extraction model for that cluster set; performing two different data augmentations on each superpixel region within the cluster set to obtain a first augmented view and a second augmented view corresponding to the same superpixel region; inputting the first and second augmented views into the independent initial expert feature extraction model to obtain the corresponding intra-class region representation; constructing an intra-class contrastive learning loss based on the representation consistency between different augmented views of the same superpixel region; and training the independent initial expert feature extraction model from the initial state according to the intra-class contrastive learning loss, enabling it to learn the specific structural representation corresponding to the cluster set, thereby obtaining the intra-class expert feature extraction model corresponding to that cluster set.

[0010] In one optional implementation, the inter-class feature extraction model is used as the master teacher model, and multiple intra-class expert feature extraction models are used as expert teacher models. Knowledge distillation training is performed on the student model to obtain the target feature extraction model. This includes: creating a student model; using the inter-class feature extraction model as the master teacher model and the intra-class expert feature extraction models corresponding to each cluster set as expert teacher models; determining the target cluster set to which the input superpixel region belongs, and inputting the input superpixel region into the expert teacher model corresponding to the target cluster set to obtain expert teacher features; inputting the input superpixel region into the master teacher model to obtain master teacher projection features; inputting the input superpixel region into the student model to obtain student features; constructing an expert distillation loss based on the difference between student features and expert teacher features; inputting student features into the projection module corresponding to the master teacher model to obtain student projection features, and constructing a master distillation loss based on the difference between student projection features and master teacher projection features; constructing a comprehensive distillation loss based on the expert distillation loss and the master distillation loss, and training the student model based on the comprehensive distillation loss, using the trained student model as the target feature extraction model.

[0011] Secondly, the present invention provides a method for identifying surrounding rock structures, the method comprising: acquiring an image of the surrounding rock to be identified; calculating the structural tensor field of the image of the surrounding rock to be identified, and determining the local principal texture direction in the image of the surrounding rock to be identified based on the structural tensor field; performing anisotropic superpixel segmentation on the image of the surrounding rock to be identified based on the local principal texture direction to obtain multiple superpixel regions to be identified; inputting each superpixel region to be identified into a small sample analysis model of the surrounding rock structure trained by any of the methods in the first aspect, to obtain the surrounding rock structure identification result corresponding to each superpixel region to be identified; and performing structural annotation on the image of the surrounding rock to be identified based on the surrounding rock structure identification result corresponding to each superpixel region to be identified, to obtain lithological classification results and structural surface segmentation results.

[0012] Thirdly, this invention provides a training device for a small-sample analysis model of surrounding rock structures. The device includes: an image acquisition module for acquiring unlabeled surrounding rock sample images; a structure tensor calculation module for calculating the structure tensor field of the unlabeled surrounding rock sample images and determining the local principal texture direction of each pixel in the image based on the structure tensor field; a superpixel segmentation module for constructing an anisotropic distance metric based on the local principal texture direction and performing superpixel segmentation on the unlabeled surrounding rock sample images according to the anisotropic distance metric to obtain multiple superpixel regions conforming to the texture direction of the surrounding rock; and an inter-class training module for creating an initial feature extraction model and performing region-level comparative learning based on the region features corresponding to the superpixel regions to train and obtain class... The system comprises the following modules: an inter-class feature extraction model; a clustering module for unsupervised clustering of superpixel regions based on the regional features extracted by the inter-class feature extraction model, resulting in multiple cluster sets; an intra-class contrastive learning module for intra-class contrastive learning based on the superpixel regions within each cluster set, resulting in multiple intra-class expert feature extraction models; a distillation module for training student models using the inter-class feature extraction model as the lead teacher model and the multiple intra-class expert feature extraction models as expert teacher models, to obtain the target feature extraction model; and a task adaptation module for training a small-sample analysis model of surrounding rock structures using labeled surrounding rock sample images. The small-sample analysis model of surrounding rock structures includes the target feature extraction model and a task head.

[0013] Fourthly, the present invention provides an electronic device, comprising: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the rock mass structure small sample analysis model training method of the first aspect or any corresponding embodiment thereof, or the rock mass structure identification method of the second aspect.

[0014] Fifthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to execute the rock mass structure small sample analysis model training method of the first aspect or any corresponding embodiment thereof, or the rock mass structure identification method of the second aspect.

[0015] Based on the aforementioned technical means, this invention automatically constructs training samples using regions with similar textures in unlabeled surrounding rock images. A feature extraction model capable of deeply understanding the essential characteristics of the surrounding rock is trained in a self-supervised manner. This model is then fine-tuned using a small amount of labeled data, ultimately resulting in a high-performance small-sample analysis model for surrounding rock structures. This method reduces reliance on manually labeled data, addressing the high cost of labeling in the geological engineering field, while ensuring the model's accuracy and generalization ability in recognizing various surrounding rock structures. Attached Figure Description

[0016] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific 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 from these drawings without creative effort.

[0017] Figure 1 This is a schematic diagram of a small-sample analysis model training method for surrounding rock structures according to an embodiment of the present invention; Figure 2 This is a superpixel segmentation diagram of the surrounding rock structure identification method according to an embodiment of the present invention; Figure 3 This is a structural block diagram of a small sample analysis model training device for surrounding rock structures according to an embodiment of the present invention; Figure 4 This is a structural block diagram of a surrounding rock structure identification device according to an embodiment of the present invention; Figure 5 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0019] It is understood that before using the technical solutions disclosed in the various embodiments of the present invention, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in the present invention and their authorization should be obtained in accordance with relevant laws and regulations through appropriate means.

[0020] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0021] In the development of technologies related to intelligent analysis of geological images, existing supervised deep learning methods face several key bottlenecks, which restrict their large-scale application in engineering practice: First, supervised models based on convolutional neural networks are severely limited by the scale and quality of labeled data. Since the professional interpretation of geological images requires engineers to possess extensive knowledge of rock mechanics and structural geology, accurate labeling of each structural plane and fracture zone consumes significant manpower and time, resulting in high labeling costs. In practical engineering projects such as reverse shaft drilling and tunneling, the number of accurately labeled samples available is often very small, making it difficult to support deep learning models in fully learning complex geological features.

[0022] Second, existing methods have limitations in terms of task adaptability. Most studies focus on end-to-end rock grade classification, that is, outputting a single lithology label for the entire image, which makes it difficult to extract pixel-level structural surfaces and fractures. However, engineering support design requires accurate spatial distribution information of structural surfaces. Although some studies have attempted to introduce semantic segmentation models, their training requires a large number of pixel-level annotations, and the annotation difficulty is orders of magnitude higher than that of classification tasks, which is almost impossible to meet in practice.

[0023] Third, current self-supervised learning methods applied to geological images often directly follow the paradigm of natural image processing, resulting in domain incompatibility. For example, learning methods based on image patch comparison are easily affected by similar textured regions within the same image, causing the model to get stuck in local optima and unable to distinguish regions with similar lithology but different structures. Furthermore, geological images suffer from class imbalance—intact rock masses occupy the majority of pixels, while critical weak engineering structures (such as faults and fracture zones) often account for only a small proportion, making it difficult for conventional self-supervised learning objectives to adequately represent the few categories.

[0024] Fourth, the generalization ability of existing models is generally insufficient. Images collected under different engineering sites, lighting conditions, and lithological backgrounds vary. Models trained on a single dataset experience severe performance degradation when transferred to new scenes. There is a lack of pre-training mechanisms that can learn general rock characteristics from multi-source unlabeled data.

[0025] The aforementioned technical deficiencies lead to the core dilemma faced by current intelligent rock image analysis methods in practical engineering. There is an urgent need for a new learning method that can learn from limited annotations, adapt to both classification and segmentation tasks, and be sensitive to key engineering structures.

[0026] According to an embodiment of the present invention, a method for training a small sample analysis model of surrounding rock structure is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0027] This embodiment provides a method for training a small-sample analysis model of surrounding rock structures, which can be used with the aforementioned computer equipment.Figure 1 This is a flowchart of a small-sample analysis model training method for surrounding rock structures according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps: Step S101: Obtain unlabeled surrounding rock sample images.

[0028] Step S102: Calculate the structural tensor field of the unlabeled surrounding rock sample image, and determine the local principal texture direction of each pixel in the image based on the structural tensor field.

[0029] Step S103: Construct an anisotropic distance metric based on the local main texture direction, and perform superpixel segmentation on the unlabeled surrounding rock sample image according to the anisotropic distance metric to obtain multiple superpixel regions that conform to the texture direction of the surrounding rock. The superpixel regions serve as the smallest semantic units for surrounding rock structure analysis.

[0030] Step S104: Create an initial feature extraction model and extract the region features corresponding to each superpixel region using the initial feature extraction model.

[0031] Step S105: Perform regional-level comparative learning based on regional features to train an inter-class feature extraction model.

[0032] Step S106: Perform unsupervised clustering of the superpixel region based on the region features extracted by the inter-class feature extraction model to obtain multiple cluster sets.

[0033] Step S107: Perform intra-class comparative learning based on the superpixel regions within each cluster set to obtain multiple intra-class expert feature extraction models.

[0034] Step S108: Use the inter-class feature extraction model as the master teacher model, use multiple intra-class expert feature extraction models as expert teacher models, and perform knowledge distillation training on the student model to obtain the target feature extraction model.

[0035] Step S109: Train a small sample analysis model of surrounding rock structure using labeled surrounding rock sample images. The small sample analysis model of surrounding rock structure includes a target feature extraction model and a task head. The task head includes a classification head and / or a segmentation head.

[0036] Specifically, acquiring a batch of unlabeled surrounding rock sample images, such as digital photographs of tunnel faces or borehole cores, which contain texture information such as joints, fissures, or bedding, requires first processing these images. This involves calculating the structure tensor field for each image. The structure tensor field describes the gradient distribution in local regions of the image, and it is used to determine the local principal texture direction at each pixel, i.e., the direction in which the rock texture is most prominent. For example, by analyzing the structure tensor field of an image, we can calculate the main direction in which the texture extends within a small area around each pixel, which serves as the local principal texture direction for that pixel. For instance, near a prominent joint or fissure, the local principal texture direction will follow the direction of the fissure's extension.

[0037] Based on this, an anisotropic distance metric adapted to image texture features is constructed according to the local principal texture direction of each pixel. Conventional image distance calculation is equal in all directions of the plane, but the surrounding rock texture has strong directionality. Along the texture direction, the correlation between pixels is stronger, and they should be easier to classify into the same superpixel; while the direction perpendicular to the texture direction changes more drastically, and they should be less likely to be classified into the same superpixel. Therefore, a metric tensor needs to be constructed for each pixel. The metric tensor reduces the distance weight along the local principal texture direction and increases the distance weight perpendicular to the texture direction. The different weights in different directions constitute the anisotropic distance metric adapted to image texture features.

[0038] Then, the image is segmented into superpixels based on the constructed anisotropic distance metric. The distance metric can adjust the aggregation tendency between pixels according to the texture direction. After the segmentation is completed, many superpixel regions are obtained. The texture direction inside each superpixel region is basically consistent and follows the direction of joints, fissures or bedding. The superpixel region will serve as the smallest semantic unit for subsequent analysis of the surrounding rock structure.

[0039] After obtaining the superpixel regions, an initial feature extraction model needs to be created, such as a lightweight convolutional neural network. This initial model extracts regional features for each superpixel region, obtaining feature vectors that can characterize the texture, structure, and other information of the region. Based on these regional features, region-level contrastive learning is performed to train an inter-class feature extraction model. The idea of ​​contrastive learning is to bring similar samples closer together and push dissimilar samples further apart. Here, region-level contrastive learning enables the model to distinguish superpixel regions with different texture orientations, thereby learning to highlight the differences between various surrounding rock structures.

[0040] Then, the pre-trained inter-class feature extraction model is used to extract regional features from all superpixel regions. These features are then subjected to unsupervised clustering, such as using K-means or spectral clustering. After clustering, multiple cluster sets are obtained. The superpixel regions in each set are close to each other in the feature space and can be regarded as the same type of texture structure. For each cluster set, intra-class contrastive learning is performed separately within it. Each set can train its own intra-class expert feature extraction model. The expert model is good at capturing subtle differences and patterns within the same type of texture.

[0041] Next, a knowledge distillation approach is used to integrate the capabilities of each model. The previously obtained inter-class feature extraction model is used as the master teacher model, responsible for providing global discriminative knowledge. Multiple intra-class expert feature extraction models are used as expert teacher models, with each expert focusing on the fine features of a specific type of surrounding rock structure. A student model is used to simultaneously learn the outputs of both the master teacher and the various expert teachers. Through distillation training, the target feature extraction model is obtained. The student model inherits both the inter-class discriminative ability and absorbs the expert knowledge within each class.

[0042] Finally, labeled surrounding rock sample images are used to train a complete small-sample analysis model for surrounding rock structures. This model includes the target feature extraction model obtained from the previous distillation and a task head. The task head can be a classification head (e.g., determining the type or weathering level of the surrounding rock) or a segmentation head (e.g., marking joint regions pixel by pixel), or both. The entire model is fine-tuned in a supervised manner to enable it to perform accurate structural analysis on new surrounding rock images. For example, after a newly captured image of a tunnel face is input into the model, superpixel regions are first extracted, then the target feature extraction model outputs region features, and finally the classification head determines which joint type each region belongs to, or the segmentation head generates a segmentation map of the surrounding rock structure for the entire image.

[0043] In one example, the feature extraction model obtained through the above multi-stage self-supervised pre-training has a deep understanding of the essential visual patterns of the surrounding rock. In practical engineering, only a small number of labeled samples (e.g., only 5-10 labeled images per type of lithology or structure) are needed to fine-tune the classification or segmentation head at the top of the model, which can then be quickly adapted to the following key tasks: Rock type classification: Based on the characteristics of the entire image, determine its dominant lithology level (such as Class II rock, Class III rock).

[0044] Structural segmentation: Generate pixel-level masks to identify the spatial distribution of key geological structures such as structural planes, fracture networks, and fracture zones in the image.

[0045] Fault / weak zone identification: Specifically extracts weak structures such as faults and weak interlayers that are important for support design, providing visual analysis basis for engineering risk assessment and support scheme design.

[0046] The method for training a small-sample analysis model of surrounding rock structures provided in this embodiment first acquires unlabeled surrounding rock sample images. The local principal texture direction of each pixel is determined by calculating the structural tensor field. Since the structural tensor field directly reflects the natural orientation of joints and fissures in the image, it provides a texture prior without manual annotation for subsequent segmentation. Next, an anisotropic distance metric is constructed based on this direction, and superpixel segmentation is performed. This allows the segmented superpixel regions to naturally conform to the surrounding rock texture orientation. Compared to traditional isotropic segmentation, these superpixel regions have more uniform internal structures and their boundaries fit the geological interface more accurately, thus serving as the smallest semantic units that can be directly used for self-supervised learning without manual delineation. Then, an initial feature extraction model is created, and regional features of each superpixel region are extracted. The inter-class feature extraction model is trained through region-level contrastive learning. Because contrastive learning forcibly brings features closer to the same region and pushes features further away from different regions, this model can automatically learn to distinguish surrounding rock structures of different texture categories without labels. Furthermore, the regional features extracted by the inter-class model are used to perform unsupervised clustering of the superpixel regions, automatically obtaining multiple cluster sets. Each set corresponds to a potential semantic category of the surrounding rock structure (such as intact rock mass, joints, etc.). Based on this, intra-class comparative learning is performed separately for each cluster set, resulting in multiple intra-class expert feature extraction models. Since each expert only focuses on subtle differences within a single category, they can more finely characterize the unique patterns of that category's texture than the general model. Subsequently, the inter-class model is used as the master teacher, and each expert model is used as an expert teacher to train the student model through knowledge distillation. The distillation process allows the student model to simultaneously fit the global discriminative power of the master teacher and the local fine representation of the expert teachers. Therefore, the final target feature extraction model has both macro-classification and micro-identification capabilities, while the student model can usually be designed to be more lightweight and easy to deploy in engineering. Finally, only a small number of labeled surrounding rock sample images are needed to fine-tune the target feature extraction model by adding a classification head or a segmentation head. Because the model has already learned a wealth of general knowledge about surrounding rock structures from unlabeled data, a small number of labels can efficiently adapt to downstream tasks, reducing the reliance on expensive manual labeling. At the same time, it can also obtain high-precision analysis results in practical engineering scenarios such as joint recognition and surrounding rock classification.

[0047] In one optional implementation, step S102 includes: Step a1: Perform Gaussian smoothing on the unlabeled surrounding rock sample image and calculate the image gradient in the horizontal and vertical directions of the smoothed unlabeled surrounding rock sample image.

[0048] Step a2: Construct the gradient outer product matrix corresponding to each pixel based on the image gradient, and perform neighborhood integration or Gaussian weighted smoothing on the gradient outer product matrix to obtain the structure tensor matrix.

[0049] Step a3: Perform eigenvalue decomposition on the structure tensor matrix to obtain the local principal texture direction and the normal direction perpendicular to the local principal texture direction for the corresponding pixel.

[0050] Specifically, when calculating the structural tensor field and determining the local principal texture direction, one approach is to first perform Gaussian smoothing on the unlabeled surrounding rock sample image. This involves convolving the image with a Gaussian kernel to blur the image slightly, aiming to reduce minor noise or overly fragmented texture interference, thus making subsequent calculations more stable. After smoothing, the image gradients in the horizontal (e.g., x-direction) and vertical (e.g., y-direction) directions are calculated. These gradients reflect the rate of change of image brightness in their respective directions.

[0051] Having the horizontal and vertical gradients of each pixel, a gradient outer product matrix is ​​constructed based on these two gradient values. In this embodiment of the invention, the following matrix serves as an example. For a single pixel, assuming the horizontal gradient is I... x The vertical gradient is I y The outer product matrix is:

[0052] It is a 2×2 symmetric matrix, and each pixel corresponds to a matrix. The matrix is ​​smoothed by neighborhood integration or Gaussian weighted smoothing. That is, the average value of each component of the matrix is ​​calculated within a local window (such as a small rectangular area centered on the current pixel), or a weighted average is performed using Gaussian weights. The smoothed result is the structure tensor matrix of that pixel. The structure tensor matrices of all pixels in the whole image are combined to form the structure tensor field.

[0053] After obtaining the structure tensor matrix for each pixel, eigenvalue decomposition is performed on the matrix to obtain two eigenvalues ​​and two corresponding eigenvectors. The eigenvector direction corresponding to the larger eigenvalue is the local principal texture direction of that pixel, which is also the direction in which the image texture extension is most significant. The eigenvector direction corresponding to the smaller eigenvalue is perpendicular to the local principal texture direction and is called the normal direction. For example, on a dark joint crack, the local principal texture direction will follow the crack's direction, while the normal direction will cross the crack perpendicularly. The principal texture direction and the normal direction perpendicular to it are calculated for each pixel, laying the foundation for the subsequent construction of anisotropic distance metrics.

[0054] In this embodiment of the invention, Gaussian smoothing suppresses common noise and fine texture interference in surrounding rock images, making subsequent gradient calculations more stable and reliable. By constructing a gradient outer product matrix based on horizontal and vertical gradients and performing neighborhood integration or Gaussian weighted smoothing, gradient information can be aggregated within a local window of each pixel, resulting in a structural tensor matrix that accurately reflects the primary and secondary texture orientations of the region. Eigenvalue decomposition of the structural tensor matrix is ​​performed, using eigenvectors corresponding to larger eigenvalues ​​to accurately pinpoint the local primary texture direction and eigenvectors corresponding to smaller eigenvalues ​​to determine the normal direction. The entire process is based entirely on the gradient statistical characteristics of the image itself, requiring no manual annotation or prior knowledge. Since the structural tensor matrix can distinguish the intensity of changes in the texture extension direction and the vertical direction, the calculated primary texture direction accurately matches the actual orientation of joints, fissures, or bedding. The normal direction is perpendicular to the texture extension direction. These two directional information provide precise directional constraints for the subsequent construction of anisotropic distance metrics, enabling superpixel segmentation to truly conform to the natural geological structure and avoiding boundary offset or fragmented segmentation problems caused by traditional isotropic methods.

[0055] In one optional implementation, step S103 includes: Step b1: Construct a metric tensor corresponding to the pixel based on the local master texture direction and the normal direction. The metric tensor is used to reduce the distance weight along the local master texture direction and increase the distance weight perpendicular to the local master texture direction.

[0056] Step b2: Based on the color distance, spatial distance, and anisotropic texture distance corresponding to the metric tensor, construct the comprehensive distance between the cluster center and the pixel.

[0057] Step b3: Perform superpixel clustering based on the comprehensive distance, and perform connectivity correction on the clustering results to obtain multiple superpixel regions that conform to the orientation of joints, fissures and / or bedding.

[0058] Specifically, after obtaining the local principal texture direction and the perpendicular normal direction for each pixel, a metric tensor is constructed for that pixel. In this embodiment, the metric tensor is essentially a 2×2 symmetric matrix, and its function is to change the weights in different directions during subsequent distance calculations. Specifically, along the local principal texture direction, the metric tensor shortens the effective distance between pixels, that is, it reduces the distance weight along that direction; while along the normal direction, the metric tensor widens the effective distance between pixels, that is, it increases the distance weight perpendicular to the texture direction. Different pixels will obtain different metric tensors based on their local texture orientation, making the distance measurement anisotropic, unlike Euclidean distance which treats all directions equally.

[0059] After obtaining the metric tensor, it is used to guide distance calculations in superpixel segmentation. Superpixel segmentation requires measuring the comprehensive distance between cluster centers and surrounding pixels. This comprehensive distance consists of three parts: the first part is the color distance, typically using Euclidean distance in the Lab color space; the second part is the spatial distance, representing the planar coordinate differences between pixels; and the third part is the anisotropic texture distance derived from the metric tensor. The anisotropic texture distance is not a simple sum of squared coordinate differences, but rather a quadratic operation between the coordinate difference vector and the metric tensor. Specifically, it calculates the transpose of the coordinate difference vector, multiplies it by the metric tensor, and then multiplies it by the coordinate difference vector again to obtain a scalar value. Through this process, coordinate differences along the texture direction are scaled smaller by the metric tensor, while coordinate differences perpendicular to the texture direction are scaled larger. The three distances are then weighted and summed according to certain coefficients to obtain the total distance between the cluster centers and the pixels.

[0060] Next, superpixel clustering is performed. In one example, a uniform grid of cluster centers is first initialized on the image. Then, for each pixel, the cluster center closest to the previously calculated distance is found within a finite search region around it. The positions of the cluster centers are iteratively updated, and the distances are recalculated until the cluster centers no longer change significantly. After clustering, some small or isolated regions may be generated. These regions usually do not meet the minimum connectivity requirement for superpixels. Therefore, connectivity correction is needed for the clustering results. For example, superpixels with an area smaller than a certain threshold are merged into adjacent superpixels with the most similar features, while ensuring that each superpixel region is connected. After correction, the final superpixel regions can well conform to the direction of joints, fissures, or bedding, with consistent texture inside each superpixel and boundaries that basically match the natural structure lines.

[0061] In one example, the superpixel region is constructed as follows: First, examine the original surrounding rock image. Perform superpixel segmentation to divide the image into... Similar texture areas Each region satisfies local texture similarity:

[0062] in, Superpixels The central feature, is the segmentation threshold; (x,y) is the coordinate of a pixel in the image; Dist(...,ci) is a comprehensive distance function used to calculate the "difference" or "dissimilarity" between a pixel and the center of a superpixel; It is the vector value of pixel (x,y) in the Lab color space. It is a three-dimensional vector [L, a, b], where L: Lightness, from black (0) to white (100), a: color components from green (-128) to red (+127), b: color components from blue (-128) to yellow (+127), and anisotropic texture distance derived from the quantization tensor.

[0063] The formula means that the i-th superpixel region Ri is the set of all such pixels (x, y) in the image, where each pixel is located in the color space (Lab value), the image space (coordinate position x, y), and the anisotropic texture distance derived from the metric tensor, relative to the initial center point of the i-th superpixel. The combined distance Dist is less than a given threshold. Each superpixel region serves as the smallest semantic unit, forming the positive and negative sample pools for subsequent contrastive learning. After the superpixel regions are divided, as shown below... Figure 2 As shown, the original surrounding rock image is processed by anisotropic superpixel segmentation to obtain anisotropic superpixel segmentation results. A and B are local magnification examples.

[0064] This invention constructs a metric tensor based on the local principal texture direction and normal direction, and uses this metric tensor to reduce the distance weight along the texture direction and increase the distance weight perpendicular to the texture direction, so that the distance metric itself has anisotropy consistent with the texture direction of the surrounding rock. Since the metric tensor is directly derived from the principal texture direction obtained by decomposing the structural tensor field, it can adaptively fit the actual extension trend of joints, fissures or bedding in the image, avoiding the problem of traditional isotropic distance easily merging different structural regions at the intersection of texture directions. On this basis, the color distance, spatial distance and anisotropic texture distance derived from the metric tensor are further combined into a comprehensive distance. When calculating the similarity between the cluster center and the pixel, this comprehensive distance not only retains the color and spatial position information, but also reduces the contribution of coordinate difference along the texture direction and increases the contribution of coordinate difference perpendicular to the texture direction through quadratic form operation. During superpixel clustering, the cluster boundaries naturally tend to extend along the texture direction, while the distance perpendicular to the texture direction is forcibly increased to form clear boundaries. The resulting superpixel regions closely follow the direction of joints, fissures, or bedding. The texture within each superpixel is highly consistent, and the boundaries basically match the natural structural lines. Finally, by performing connectivity correction on the clustering results, fragmented regions that are too small or isolated are eliminated, ensuring the integrity and connectivity of the superpixels. This allows each superpixel region to serve as a reliable minimum semantic unit for subsequent comparative learning and feature extraction, improving the refinement and stability of surrounding rock structure analysis.

[0065] In one optional implementation, step S105 includes: Step c1: Perform image enhancement on the superpixel region to obtain the enhancement region corresponding to the superpixel region; Step c2: The same superpixel region and its enhanced region are taken as positive sample pairs, and the superpixel regions in different superpixel regions and / or different unlabeled surrounding rock sample images are taken as negative samples.

[0066] Step c3: Extract the region features of positive and negative samples respectively using the initial feature extraction model.

[0067] Step c4: Adjust the model parameters of the initial feature extraction model based on the region-level contrast loss function to increase the regional feature similarity between positive sample pairs and decrease the regional feature similarity between negative samples, thus obtaining the inter-class feature extraction model.

[0068] Specifically, to perform region-level comparative learning, the first step is to enhance the image of the superpixel region. Various enhancement methods can be used, such as random rotation, scaling, color dithering, Gaussian blur, or adding a small amount of noise. After a certain enhancement operation, each superpixel region will have a corresponding enhanced region. The enhanced region and the original superpixel region share the same texture structure in terms of content, only their appearance has changed slightly.

[0069] Next, positive and negative sample pairs need to be constructed. The same superpixel region and the enhanced region obtained after its enhancement are regarded as a pair of positive samples because they are completely semantically corresponding and their features should be as similar as possible. The negative samples come from different superpixel regions, which can be different superpixel regions in the same unlabeled surrounding rock sample image, or superpixel regions randomly selected from other unlabeled surrounding rock sample images. The negative samples are usually different from the current superpixel region in terms of texture direction and structural features, so their features should be far apart from each other.

[0070] After obtaining the positive and negative sample pairs, an initial feature extraction model is used to extract the regional features of these samples. The initial feature extraction model can be any untrained feature extraction network, such as a simple convolutional neural network. The model receives image patches of the original superpixel region, the corresponding enhanced region image patch, and other negative sample image patches, and computes their respective feature vectors forward.

[0071] Finally, the parameters of the initial feature extraction model are adjusted based on a region-level contrastive loss function. The core idea of ​​the contrastive loss function is to bring positive sample pairs closer together in the feature space, in other words, to make the features of the original superpixel region as similar as possible to the features of its enhanced region; at the same time, to increase the distance between negative sample pairs, that is, to make the features of the current superpixel region as dissimilar as possible to the features of any negative sample. Commonly used contrastive loss functions such as InfoNCE or NT-Xent calculate the ratio of the similarity of positive samples to the similarity of all negative samples, and update the model parameters through gradient descent. After multiple rounds of iterative training, the model learns to distinguish between intra-class and inter-class feature distributions. The similarity of positive sample pairs continuously increases, while the similarity of negative sample pairs continuously decreases. The final model is the inter-class feature extraction model, which can distinguish superpixel regions with different texture orientations.

[0072] In one example, region-level contrastive learning is performed as follows: For each image, extract the feature vectors of all superpixel regions. ,in It is a CNN feature extraction network. This represents all the adjustable parameters of this model. : is the feature vector extracted by the model from the input region Ri. It maps an image patch into a d-dimensional high-dimensional space. The d-dimensional vector is the "digital ID card" of the region, containing its visual semantic information.

[0073] The region-level contrastive loss (i.e., the first objective loss function) is constructed as follows:

[0074] in: Positive sample regions belonging to the same semantic category (from augmented views or pseudo-label clustering); Negative samples from different regions or different images; Cosine similarity; Temperature coefficient; This represents the number of negative samples.

[0075] molecular : Calculate the current sample Its positive samples The similarity is calculated and converted into an "attraction" value using the exponential function exp() and the temperature coefficient τ. sim(zi, The larger the number (the more similar the number), the larger the value.

[0076] Denominator Σ[ ]: Calculate the current sample With all M negative samples { The similarity of the options is calculated and then summed after being converted into an "attractiveness" value, representing the total attractiveness of all incorrect options to the current sample.

[0077] The entire fraction represents the ratio of "the attractiveness of positive samples" to "the total attractiveness of negative samples". To minimize the loss, the numerator should be increased and the denominator decreased.

[0078] Through regional comparative learning, the model can capture the discriminative semantics of different structural regions in surrounding rock images.

[0079] This invention, through the aforementioned region-level contrastive learning method, firstly enhances the image of each superpixel region to obtain enhanced regions that are identical in content but have changed appearance. The same superpixel region and its enhanced region are then paired as positive samples. Since the enhancement operation only changes the subtle appearance of the image (such as rotation, color jitter, etc.) without altering the surrounding rock texture structure and semantic category contained in the superpixel region, the positive sample pairs naturally possess the same semantic label. Simultaneously, different superpixel regions (whether from the same image or different images) are used as negative sample pairs. These negative samples typically exhibit significant differences in texture orientation, joint morphology, or structural features. Based on this positive-negative sample construction strategy, the initial feature extraction model is forced to bring different enhanced views of the same superpixel region closer together in the feature space during training, while simultaneously pushing views of different superpixel regions further apart. Thus, discriminative features that distinguish different surrounding rock texture categories can be automatically learned without any manual annotation. Specifically, by optimizing the region-level contrastive loss function, the model maximizes the feature similarity between positive sample pairs while minimizing the feature similarity between negative sample pairs. After multiple iterations, the model gradually grasps the essential differences in visual attributes such as texture and structure between different superpixel regions. The resulting inter-class feature extraction model can clearly separate joints with different orientations, fissures with different densities, or rock mass regions with different integrity in the feature space. This approach fully utilizes the large amount of unlabeled data in surrounding rock images, relying solely on the consistency and differences of the image content to drive learning. This avoids the cost of expensive manual annotation and allows the model to focus on the discriminative semantics of the surrounding rock structure itself from the beginning, laying a high-quality foundation for subsequent unsupervised clustering, expert model training, and knowledge distillation.

[0080] In one optional implementation, step S106 includes: Step d1: Input each superpixel region into the inter-class feature extraction model to obtain the region embedding features corresponding to each superpixel region.

[0081] Step d2: Based on the region embedding features, an unsupervised clustering algorithm is used to cluster each superpixel region to obtain multiple cluster sets. Each cluster set is used to represent a potential surrounding rock structure semantic category, which includes at least one of intact rock mass, jointed region, fractured region, fracture zone and mudstone interlayer.

[0082] Specifically, after training the inter-class feature extraction model, the next step is to use this model to extract features from all the previously segmented superpixel regions. The image patch corresponding to each superpixel region is input into the inter-class feature extraction model, which then computes a fixed-dimensional feature vector, called the region embedding feature. The region embedding feature compresses the texture, color, and structural information in the original image patch into a compact numerical representation. The distance between different superpixel regions in the feature space reflects the similarity of their texture structures.

[0083] After obtaining the region embedding features of all superpixel regions, unsupervised clustering is performed on the superpixel regions using these features. The clustering algorithm does not require prior knowledge of the labels; instead, it automatically divides data points into several groups based on the similarity between feature vectors. Commonly used unsupervised clustering algorithms include K-means, DBSCAN, or spectral clustering. In this embodiment, each superpixel region is considered a sample point, and its location is uniquely determined by the region embedding feature vector. The clustering algorithm divides these points into multiple cluster sets based on the Euclidean distance or cosine similarity between them. The features within each cluster set are close to each other, indicating that the surrounding rock structures of these superpixel regions are similar. Therefore, each cluster set can be considered a potential semantic category of the surrounding rock structure. For example, in images of tunnel faces, the texture of intact rock masses is relatively uniform and flat, jointed areas have obvious linear extensions, fissures are finely or irregularly distributed, fracture zones exhibit chaotic granular textures, and muddy interlayers are often darker in color and have blurred boundaries. Through unsupervised clustering, different types of regions automatically cluster into different sets. For example, cluster set A may correspond to intact rock masses, cluster set B to jointed regions, cluster set C to fractured regions, and so on. Thus, meaningful rock structure categories can be extracted from the original image without manual annotation.

[0084] In this embodiment of the invention, each superpixel region is input into a pre-trained inter-class feature extraction model to obtain the region embedding features of each superpixel region. Since the inter-class feature extraction model has already learned to distinguish rock regions with different texture orientations and structural features through region-level contrastive learning, its output region embedding features can cluster superpixel regions with similar textures and the same structural category together in the feature space, while pushing regions of different categories apart. Based on this, unsupervised clustering (such as Ki) is directly performed on these region embedding features. (Mean or spectral clustering) requires no manual labeling. It automatically divides superpixel regions into multiple clusters based solely on Euclidean distance or cosine similarity between feature vectors. Because clustering algorithms ensure that features within the same cluster are close to each other while features in different clusters are far apart, each cluster naturally corresponds to a potential semantic category of the surrounding rock structure, such as intact rock mass, jointed region, fractured region, fracture zone, or mudstone interlayer. Without manually delineating each structure in the surrounding rock image, it can automatically extract geologically significant category classifications from raw, unlabeled data, providing accurate grouping criteria for subsequent training of expert feature extraction models within each cluster. Furthermore, this unsupervised clustering method is scalable. When new surrounding rock sample images are added, simply re-clustering or using existing cluster centers continuously enriches and refines the semantic categories of the surrounding rock structure without repeating manual labeling work.

[0085] In one optional implementation, step S107 includes: Step e1: For any cluster set, obtain multiple superpixel regions belonging to that cluster set.

[0086] Step e2: Create a corresponding independent initial expert feature extraction model for the cluster set.

[0087] Step e3: Perform two different data augmentations on each superpixel region within the cluster set to obtain the first augmented view and the second augmented view corresponding to the same superpixel region.

[0088] Step e4: Input the first enhanced view and the second enhanced view into the independent initial expert feature extraction model to obtain the corresponding intra-class region representation.

[0089] Step e5: Based on the representational consistency between different enhanced views of the same superpixel region, construct the intra-class contrastive learning loss.

[0090] Step e6: Based on the intra-class contrastive learning loss, train an independent initial expert feature extraction model from the initial state, so that it learns the exclusive structural representation corresponding to the cluster set, and obtains the intra-class expert feature extraction model corresponding to the cluster set.

[0091] Specifically, for each cluster set obtained, a dedicated intra-cluster expert feature extraction model needs to be trained separately. First, for a certain cluster set, all superpixel regions belonging to that set are extracted. These superpixel regions are close to each other in the feature space and are considered to represent the same semantic category of surrounding rock structure, such as all jointed regions or all intact rock masses.

[0092] Next, an independent initial expert feature extraction model is created for this cluster set. The structure of this model can be any neural network suitable for extracting regional features. Its capacity, architecture, and initialization method can be set independently according to actual needs. The parameters are randomly initialized or start from a certain basic pre-trained model. Each cluster set has its own independent model and does not share parameters with each other.

[0093] Then, each superpixel region within the cluster is subjected to two different data augmentations. Data augmentation can be operations such as random rotation, flipping, color dithering, scaling, and Gaussian blurring. The two augmentations are performed in different ways; for example, the first augmentation performs random rotation and color dithering, while the second performs horizontal flipping and Gaussian blurring. After the same superpixel region undergoes two different augmentation transformations, two different views are obtained, called the first augmented view and the second augmented view. Although the two views differ at the pixel level, they essentially originate from the same superpixel region, and therefore they should be given similar feature representations.

[0094] Each pair of first and second augmented views is input into the previously created independent initial expert feature extraction model. The model will forward compute the feature vector corresponding to each view, which is called the intra-class region representation. For two augmented views of the same superpixel region, the model will output two feature vectors; for two views of different superpixel regions, the model will also output their respective feature vectors.

[0095] Next, an intra-class contrastive learning loss is constructed based on the representational consistency between different augmented views within the same superpixel region. Specifically, for two augmented views within the same superpixel region, the two feature vectors output by the model constitute a positive sample pair. The training objective is to make these two feature vectors as close as possible, for example, by calculating their cosine similarity and maximizing that similarity. Views from different superpixel regions (whether from different superpixel regions within the same cluster or from other clusters) are considered negative sample pairs. The training objective is to make the feature vectors of these negative sample pairs far apart. The intra-class contrastive learning loss function can, for example, take the form of InfoNCE, which includes both positive and multiple negative sample pairs in a batch. The probability of a positive sample pair match is calculated using a temperature-scaled softmax, and then the negative logarithm is taken as the loss value.

[0096] Finally, the model parameters are updated using intra-class contrastive learning loss, and the independent initial expert feature extraction model is trained from the initial state. As training progresses, the model gradually learns to focus only on the common patterns of superpixel regions within the current cluster set, while ignoring subtle differences between different superpixel regions. The model learns the specific structural representation corresponding to that cluster set. After training is complete, the intra-class expert feature extraction model corresponding to that cluster set is obtained. The entire process is repeated for each cluster set, ultimately resulting in multiple intra-class expert feature extraction models, each adept at representing the fine features of a certain type of surrounding rock structure.

[0097] In one example, comparisons within each cluster are performed as follows: This embodiment of the invention uses unsupervised clustering (such as DBSCAN) to cluster all superpixel regions, resulting in multiple cluster sets. Then, for each cluster set, an initial feature extraction model is used to extract high-dimensional features for all superpixel regions within the set. For example, the high-dimensional features within each cluster set can be divided into... Categories:

[0098] The algorithm will include all N superpixel regions. They are divided into C clusters. It is a function that represents the region The cluster labels obtained after performing the clustering algorithm are, i.e. C is a set of sets, where each subset C (distinguished by the subscript c) contains all regions labeled as class c. For example, C_1={R3,R7,R100} means that the first cluster contains regions 3, 7, and 100.

[0099] For each class of high-dimensional features, train an independent intra-class contrastive loss:

[0100] The intra-class contrastive loss is specifically used to train the c-th cluster. Anchor samples : Features of a region randomly selected from the c-th cluster C_c. Positive sample They also come from the same cluster C_c, specifically, usually the anchor region. A data augmentation view (e.g., for) (The new image patch is obtained by rotating and cropping). Because any two regions within the same cluster are considered "of the same kind," another region can also be randomly selected as... .

[0101] sample This indicates that the sample originates from within the current cluster C_c, excluding anchor point samples. itself (using) Other regional samples (represented).

[0102] The goal of the loss function is to make the anchor samples With the selected positive samples The goal is to maximize the feature similarity between samples, meaning that the initial feature extraction model should extract features from superpixels of the same class but different regions that are as similar as possible. Simultaneously, the denominator represents the anchor sample's similarity to other samples. The sum of feature similarities between them should be as small as possible. That is, even if the initial feature extraction model extracts features for superpixels of the same class but different regions, there still needs to be a difference between them, and they cannot be completely consistent.

[0103] This invention creates an independent initial expert feature extraction model for each cluster set and performs intra-class contrastive learning within each set, enabling each expert model to focus on learning the specific representation of a single surrounding rock structure semantic category. Specifically, each superpixel region within the same cluster set undergoes two different data augmentations to obtain a first augmented view and a second augmented view. Due to the different augmentation methods (such as random rotation, color jitter, Gaussian blur, etc.), the two views differ at the pixel level, but essentially originate from the same superpixel region, and are therefore treated as positive sample pairs. Simultaneously, views of different superpixel regions within the same cluster set (as well as views from other cluster sets) are treated as negative sample pairs. Through the intra-class contrastive learning loss function, the model is forced to narrow the distance between the two augmented views of the same superpixel region in the feature space, thereby enabling the model to learn the texture invariance of this type of surrounding rock structure under various transformations. At the same time, the distance between views of different superpixel regions within the same cluster set is widened, preventing the model from compressing all similar samples into identical points, thus preserving the subtle discriminative ability within the class. Since each expert model is trained only within its corresponding cluster set and is not affected by textures from other categories, the model parameters can focus on fitting the unique structural patterns of that category (such as the extension patterns of joints, the density distribution of fractures, and the uniformity of intact rock masses). The resulting in-category expert feature extraction model has extremely high sensitivity and fine characterization ability for that type of surrounding rock structure. Multiple expert models are independent of each other and can be trained in parallel. Furthermore, the capacity of each model can be flexibly designed according to the internal complexity of the category, which not only ensures training efficiency but also provides highly specialized teacher knowledge for subsequent knowledge distillation. This improves the adaptability and recognition accuracy of the small sample analysis model for surrounding rock structures to complex geological textures.

[0104] In one optional implementation, step S108 includes: Step f1: Create a student model.

[0105] Step f2: The inter-class feature extraction model is used as the master teacher model, and the intra-class expert feature extraction model corresponding to each cluster set is used as the expert teacher model.

[0106] Step f3: Determine the target cluster set to which the input superpixel region belongs, and input the input superpixel region into the expert teacher model corresponding to the target cluster set to obtain the expert teacher features.

[0107] Step f4: Input the input superpixel region into the dominant teacher model to obtain the dominant teacher projection features; Step f5: Input the superpixel region into the student model to obtain student features.

[0108] Step f6: Construct expert distillation loss based on the differences between student characteristics and expert teacher characteristics.

[0109] Step f7: Input the student features into the projection module corresponding to the dominant teacher model to obtain the student projection features, and construct the dominant distillation loss based on the difference between the student projection features and the dominant teacher projection features. Step f8: Construct a comprehensive distillation loss based on expert distillation loss and dominant distillation loss, and train a student model based on the comprehensive distillation loss. Use the trained student model as the target feature extraction model.

[0110] Specifically, in the knowledge distillation stage, a student model is first created. The structure of the student model can be the same as the initial feature extraction model, or it can be designed according to actual needs. Next, the previously trained inter-class feature extraction model is used as the master teacher model, while the intra-class expert feature extraction models trained for each cluster set are used as a set of expert teacher models. The master teacher model is responsible for providing global discriminative knowledge, while each expert teacher model is only good at fine-grained representation of a certain type of surrounding rock structure.

[0111] For any input superpixel region, it's necessary to first determine which cluster it belongs to. Multiple clusters have already been obtained through unsupervised clustering, and each superpixel region has a corresponding cluster affiliation. Based on this affiliation, the expert teacher model corresponding to that cluster is found, and the input superpixel region is then fed into the expert teacher model. The feature vector output by this model is called the expert teacher feature. Simultaneously, the same superpixel region is also input into the dominant teacher model. The dominant teacher model outputs another feature vector, but instead of directly outputting the original features, it passes through an additional projection module (e.g., a small fully connected layer) to obtain the dominant teacher projected features. Similarly, the input superpixel region is fed into the student model, and the student model outputs student features.

[0112] In constructing the loss function, the student model needs to learn from two types of teachers simultaneously. On one hand, the difference between student features and expert teacher features is calculated, for example using mean squared error or cosine distance. The resulting loss is called expert distillation loss. By minimizing this loss, the student model can mimic the expert teacher model's ability to finely characterize specific texture categories. On the other hand, student features are also fed into the projection module corresponding to the dominant teacher model (student models share the same projection module or use a copied identical projection structure) to obtain student projection features. Then, the difference between student projection features and dominant teacher projection features is calculated to obtain the dominant distillation loss. This loss allows the student model to learn the global discriminative ability provided by the dominant teacher model.

[0113] Finally, the expert distillation loss and the dominant distillation loss are weighted and summed to obtain the comprehensive distillation loss. This comprehensive loss is used for backpropagation and parameter updates of the student model. During training, the student model continuously fits the feature outputs of the two teacher models. After training, the student model possesses both the inter-class discriminative power of the dominant teacher model and the intra-class fine-grained perception ability of each expert teacher model. At this point, the trained student model is used as the target feature extraction model for subsequent surrounding rock structure analysis tasks.

[0114] Knowledge distillation is a technique that allows a compact student model to mimic the “behavior” of a complex teacher model, enabling the student to learn the “soft targets” output by the teacher model (such as activation values ​​of intermediate feature layers, feature maps, or softened probability distributions), rather than just the final hard classification label.

[0115] In one example, distillation fusion optimization is performed as follows: To integrate the feature representation capabilities of inter-class and intra-class comparison models, a distillation mechanism is introduced to compress multiple sub-models (teachers) into a lightweight, unified representation model (students):

[0116] in: For teacher networks (intra-class + inter-class model fusion); For the student network (final deployment model); This indicates softmax normalization; The Kullback-Leibler divergence is used to force the student network to produce a "feature confidence distribution" for the same region that is as consistent as possible with the distribution produced by the teacher network. The final loss function combination is as follows:

[0117] λ1, λ2, and λ3 represent the loss functions, respectively. region (regional comparison loss), Σ intra(sum of intra-cluster comparison losses across all clusters) and Distill (knowledge distillation loss) is a weighting coefficient in the joint optimization process. The three hyperparameters are used to balance the model's emphasis on three different levels of learning objectives: inter-class discrimination ability, intra-class feature refinement ability, and multi-expert knowledge inheritance and compression.

[0118] : Ensure that the student model itself can learn basic inter-class discrimination ability from the data.

[0119] : Ensure that the student model itself can also notice the subtle differences within each category.

[0120] The student model was strongly guided to imitate the "thinking style" that incorporated all the teacher models.

[0121] Through joint optimization, the model learns robust semantic features applicable to both classification and segmentation tasks, supporting subsequent few-shot transfer.

[0122] This invention constructs a multi-teacher knowledge distillation framework by creating a student model and using an inter-class feature extraction model as the lead teacher and intra-class expert feature extraction models corresponding to each cluster set as expert teachers. Since the lead teacher model excels at distinguishing rock structures with different texture categories, while each expert teacher model focuses only on the fine features within a specific texture category, the two complement each other at the knowledge level. By determining the target cluster set to which the input superpixel region belongs, the region is simultaneously fed into the corresponding expert teacher model (resulting in expert teacher features) and the lead teacher model (resulting in lead teacher projected features via a projection module). The student model then outputs student features and student projected features, respectively constructing expert distillation loss and lead distillation loss. Expert distillation loss forces the student model to mimic the expert teacher's fine-grained characterization of the structure at the feature level, thus allowing the student model to inherit expert-level intra-class sensitivity. Lead distillation loss, on the other hand, allows the student's projected features to approximate the lead teacher's projected features, thereby preserving global discriminative ability. By weighted summing of the two losses to form a comprehensive distillation loss, and jointly optimizing the student model, the resulting lightweight target feature extraction model not only reduces the size of multiple teacher models, facilitating engineering deployment, but also possesses the dual advantages of inter-class discrimination and intra-class refinement. Compared to directly using a single teacher or only using the dominant teacher, this distillation method enables the student to maintain or even improve recognition accuracy while significantly reducing computational overhead, providing a high-quality and efficient feature extraction foundation for subsequent small-sample fine-tuning and real-time application of the surrounding rock structure small-sample analysis model.

[0123] This embodiment provides a method for identifying surrounding rock structures, which can be used with the aforementioned computer equipment. Figure 3 This is a flowchart of a surrounding rock structure identification method according to an embodiment of the present invention, such as... Figure 3 As shown, the process includes the following steps: Step S301: Obtain the image of the surrounding rock to be identified.

[0124] Step S302: Calculate the structural tensor field of the surrounding rock image to be identified, and determine the local principal texture direction in the surrounding rock image based on the structural tensor field.

[0125] Step S303: Based on the local main texture direction, perform anisotropic superpixel segmentation on the image of the surrounding rock to be identified to obtain multiple superpixel regions to be identified.

[0126] Step S304: Input each superpixel region to be identified into the small sample analysis model of the surrounding rock structure in the embodiments of the present invention and its corresponding optional embodiments.

[0127] Step S305: Obtain the surrounding rock structure identification results corresponding to each superpixel region to be identified; Step S306: Based on the identification results of the surrounding rock structure corresponding to each superpixel region to be identified, perform structural annotation on the surrounding rock image to be identified, and obtain the lithology classification result and the structural surface segmentation result.

[0128] Specifically, an image of the surrounding rock to be identified is obtained. This image can be a digital photograph taken on-site, a scanned core image, or a digital image from other sources. The image typically contains geological information such as the natural texture of the rock surface, joint lines, and fracture zones.

[0129] Next, the structure tensor field of the image of the surrounding rock to be identified is calculated. The structure tensor field can describe the primary and secondary distribution of gradients within local regions of the image. By analyzing the gradient changes within small windows around each pixel, the local principal texture direction at that pixel can be determined, which is the direction in which the rock texture extends most significantly. For example, near a clear joint or crack, the local principal texture direction will follow the crack's direction; in areas with well-developed bedding, the principal texture direction will be parallel to the bedding plane. This step requires no manual annotation and is entirely driven by the image's own grayscale changes.

[0130] After obtaining the local principal texture orientation of each pixel in the entire image, anisotropic superpixel segmentation is performed on the surrounding rock image to be identified based on this directional information. Unlike conventional uniform superpixel segmentation, anisotropic segmentation adjusts the weight of the distance metric according to the texture orientation at each pixel: along the texture orientation, the aggregation tendency between pixels is enhanced, making it easier to classify them into the same superpixel; while in the direction perpendicular to the texture orientation, the aggregation tendency is weakened, forming a clear boundary. In this way, each superpixel region to be identified has a basically consistent texture orientation, and its boundaries highly match the natural orientation of joints, fissures, or bedding, making each superpixel region a semantically clear minimum analytical unit.

[0131] Subsequently, these superpixel regions to be identified are input into a pre-trained small sample analysis model of the surrounding rock structure. This model is trained using any of the small sample analysis model training methods in the embodiments of this invention and their corresponding optional embodiments. It includes a target feature extraction model and a task head (classification head and / or segmentation head). The model extracts depth features for each superpixel region and outputs the corresponding recognition result according to the settings of the task head.

[0132] Next, the model will output the surrounding rock structure identification result for each superpixel region to be identified. If the task head is a classification head, it will output the lithology category to which the region belongs, such as "intact rock mass", "joint zone", "fractured zone" or "clay interlayer", etc.; if the task head is a segmentation head, it will output the probability of each pixel in the region belonging to a certain structure, or output the category label of the structure.

[0133] Finally, based on the identification results of all superpixel regions to be identified, the overall structure of the surrounding rock image is annotated, generating an intuitive lithology classification map and structural plane segmentation map. The lithology classification result can be the dominant lithology grade of the entire image or a pseudo-color map of the category of each superpixel region; the structural plane segmentation result is represented by pixel-level masks, accurately depicting structural planes such as joint lines, fracture networks, and faults. The final output can be directly used by engineering technicians to assess the stability of the surrounding rock, design support schemes, or analyze geological structures.

[0134] The surrounding rock structure identification method provided in this invention utilizes anisotropic superpixel segmentation guided by a structural tensor field. This ensures that the segmented superpixel regions naturally conform to the texture direction of the surrounding rock, resulting in precise boundaries. This avoids boundary offsets and fragmented areas generated by traditional superpixel segmentation at joint intersections or texture gradient regions, thus guaranteeing the semantic purity of subsequent feature extraction. Because the small-sample analysis model for surrounding rock structures has undergone multi-stage self-supervised pre-training with unlabeled samples (including inter-class comparative learning and intra-class expert model distillation), the model possesses a deep understanding of the essential characteristics of surrounding rock texture. Therefore, even for unseen images to be identified, it can accurately identify different types of surrounding rock structures and structural surfaces. The entire identification process only requires the input of the original image, without manual intervention or preset parameters, achieving end-to-end automated analysis and greatly reducing the workload and subjectivity of manual interpretation. Finally, the lithological classification results and structural surface segmentation results output by the method have pixel-level accuracy, which can directly serve practical engineering needs such as surrounding rock classification, disaster early warning, and support design, providing fast, objective, and reliable geological information support for geotechnical engineering projects such as tunnels, slopes, and underground caverns.

[0135] This embodiment also provides a training device for a small sample analysis model of surrounding rock structures. This device is used to implement the above embodiments and preferred embodiments, and details already described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0136] This embodiment provides a training device for a small sample analysis model of surrounding rock structures, such as... Figure 4 As shown, it includes: Sample segmentation module 401 is used to acquire unlabeled surrounding rock sample images; The structure tensor calculation module 402 is used to calculate the structure tensor field of the unlabeled surrounding rock sample image and determine the local principal texture direction of each pixel in the image based on the structure tensor field. The superpixel segmentation module 403 is used to construct an anisotropic distance metric based on the local main texture direction, and to perform superpixel segmentation on the unlabeled surrounding rock sample image according to the anisotropic distance metric to obtain multiple superpixel regions that conform to the texture direction of the surrounding rock. The inter-class training module 404 is used to create an initial feature extraction model and perform region-level comparative learning based on the region features corresponding to the superpixel region to train the inter-class feature extraction model. Clustering module 405 is used to perform unsupervised clustering of superpixel regions based on the region features extracted by the inter-class feature extraction model, resulting in multiple cluster sets.

[0137] The intra-class expert training module 406 is used to perform intra-class comparative learning based on the superpixel regions within each cluster set to obtain multiple intra-class expert feature extraction models. Distillation module 407 is used to train the student model by knowledge distillation, using the inter-class feature extraction model as the master teacher model and multiple intra-class expert feature extraction models as expert teacher models, to obtain the target feature extraction model. The task adaptation module 408 is used to train a small sample analysis model of surrounding rock structure using labeled surrounding rock sample images. The small sample analysis model of surrounding rock structure includes a target feature extraction model and a task header.

[0138] The rock mass structure small sample analysis model training device provided in this embodiment of the invention can execute the rock mass structure small sample analysis model training method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method. Further functional descriptions of the above modules and units are the same as in the corresponding embodiments described above, and will not be repeated here.

[0139] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention.

[0140] The following is a detailed reference. Figure 5 The diagram illustrates a structural schematic suitable for implementing an electronic device according to embodiments of the present invention. The electronic device may include a processor (e.g., a central processing unit, graphics processor, etc.) 501, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 502 or a program loaded from memory 508 into random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of the electronic device. The processor 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0141] Typically, the following devices can be connected to I / O interface 505: input devices 506 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 508 including, for example, magnetic tapes, hard disks, etc.; and communication devices 509. Communication device 509 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 5 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown, and more or fewer devices may be implemented or have instead.

[0142] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 509, or installed from a memory 508, or installed from a ROM 502. When the computer program is executed by the processor 501, it performs the functions defined in the rock mass structure small sample analysis model training method and the rock mass structure identification method of the embodiments of the present invention.

[0143] Figure 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of the present invention.

[0144] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the small-sample analysis model training method and the surrounding rock structure identification method shown in the above embodiments are implemented.

[0145] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.

[0146] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A method for training a small-sample analysis model of surrounding rock structures, characterized in that, The method includes: Obtain unlabeled surrounding rock sample images; Calculate the structural tensor field of the unlabeled surrounding rock sample image, and determine the local principal texture direction of each pixel in the image based on the structural tensor field; An anisotropic distance metric is constructed based on the local main texture direction, and the unlabeled surrounding rock sample image is segmented into superpixels according to the anisotropic distance metric to obtain multiple superpixel regions that conform to the texture direction of the surrounding rock. The superpixel regions serve as the smallest semantic units for surrounding rock structure analysis. An initial feature extraction model is created, and the region features corresponding to each superpixel region are extracted using the initial feature extraction model. Based on the aforementioned regional features, a regional-level comparative learning is performed to train an inter-class feature extraction model. Based on the region features extracted by the inter-class feature extraction model, unsupervised clustering is performed on the superpixel region to obtain multiple cluster sets. By performing intra-class comparative learning based on the superpixel regions within each cluster set, multiple intra-class expert feature extraction models are obtained. The inter-class feature extraction model is used as the master teacher model, and the multiple intra-class expert feature extraction models are used as expert teacher models. Knowledge distillation training is performed on the student model to obtain the target feature extraction model. A small sample analysis model of surrounding rock structure is trained by means of labeled surrounding rock sample images. The small sample analysis model of surrounding rock structure includes the target feature extraction model and a task head, wherein the task head includes a classification head and / or a segmentation head.

2. The method according to claim 1, characterized in that, Calculating the structural tensor field of the unlabeled surrounding rock sample image, and determining the local principal texture direction of each pixel in the image based on the structural tensor field, including: The unlabeled surrounding rock sample image is subjected to Gaussian smoothing, and the image gradient of the smoothed unlabeled surrounding rock sample image in the horizontal and vertical directions is calculated. Based on the image gradient, construct the gradient outer product matrix corresponding to each pixel, and perform neighborhood integration or Gaussian weighted smoothing on the gradient outer product matrix to obtain the structure tensor matrix. The structure tensor matrix is ​​subjected to eigenvalue decomposition to obtain the local principal texture direction and the normal direction perpendicular to the local principal texture direction of the corresponding pixel.

3. The method according to claim 2, characterized in that, The step of constructing an anisotropic distance metric based on the local principal texture direction and performing superpixel segmentation on the unlabeled surrounding rock sample image according to the anisotropic distance metric includes: A metric tensor corresponding to a pixel is constructed based on the local main texture direction and the normal direction, wherein the metric tensor is used to reduce the distance weight along the local main texture direction and increase the distance weight perpendicular to the local main texture direction. Based on color distance, spatial distance, and the anisotropic texture distance corresponding to the metric tensor, a comprehensive distance between cluster centers and pixels is constructed. Superpixel clustering is performed based on the comprehensive distance, and the clustering results are corrected for connectivity to obtain multiple superpixel regions that conform to the orientation of joints, fissures and / or bedding.

4. The method according to claim 1, characterized in that, The process of performing region-level contrastive learning based on the region features to train an inter-class feature extraction model includes: Image enhancement is performed on the superpixel region to obtain the enhancement region corresponding to the superpixel region; The same superpixel region and its enhanced region are used as positive sample pairs, and superpixel regions in different superpixel regions and / or different unlabeled surrounding rock sample images are used as negative samples. The region features of the positive sample pairs and the negative samples are extracted respectively using the initial feature extraction model. The model parameters of the initial feature extraction model are adjusted based on the region-level contrast loss function to increase the regional feature similarity between positive sample pairs and decrease the regional feature similarity between negative samples, thus obtaining the inter-class feature extraction model.

5. The method according to claim 1, characterized in that, The superpixel region is unsupervised clustered based on the region features extracted by the inter-class feature extraction model to obtain multiple cluster sets, including: Each superpixel region is input into the inter-class feature extraction model to obtain the region embedding features corresponding to each superpixel region. Based on the region embedding features, an unsupervised clustering algorithm is used to cluster each superpixel region to obtain multiple cluster sets. Each cluster set is used to characterize a potential surrounding rock structure semantic category, which includes at least one of intact rock mass, jointed region, fractured region, fracture zone and mudstone interlayer.

6. The method according to claim 1, characterized in that, The method involves intra-class comparison learning based on superpixel regions within each cluster set, resulting in multiple intra-class expert feature extraction models, including: For any given cluster set, obtain multiple superpixel regions belonging to that cluster set; Create a corresponding independent initial expert feature extraction model for this cluster set; Each superpixel region within the cluster is augmented twice with different data to obtain the first augmented view and the second augmented view corresponding to the same superpixel region. The first enhanced view and the second enhanced view are input into the independent initial expert feature extraction model to obtain the corresponding intra-class region representation; Based on the representational consistency among different enhanced views of the same superpixel region, an intra-class contrastive learning loss is constructed. Based on the intra-class contrastive learning loss, the independent initial expert feature extraction model is trained from the initial state to learn the exclusive structural representation corresponding to the cluster set, thereby obtaining the intra-class expert feature extraction model corresponding to the cluster set.

7. The method according to claim 1, characterized in that, The step of using the inter-class feature extraction model as the master teacher model and the multiple intra-class expert feature extraction models as expert teacher models to train the student model through knowledge distillation to obtain the target feature extraction model includes: Create a student model; The inter-class feature extraction model is used as the dominant teacher model, and the intra-class expert feature extraction model corresponding to each cluster set is used as the expert teacher model. Determine the target cluster set to which the input superpixel region belongs, and input the input superpixel region into the expert teacher model corresponding to the target cluster set to obtain the expert teacher features; The input superpixel region is input into the dominant teacher model to obtain the dominant teacher projection feature; The input superpixel region is input into the student model to obtain student features; Based on the differences between the student characteristics and the expert teacher characteristics, an expert distillation loss is constructed; The student features are input into the projection module corresponding to the dominant teacher model to obtain student projection features, and the dominant distillation loss is constructed based on the difference between the student projection features and the dominant teacher projection features. A comprehensive distillation loss is constructed based on the expert distillation loss and the dominant distillation loss, and the student model is trained according to the comprehensive distillation loss. The trained student model is then used as the target feature extraction model.

8. A method for identifying surrounding rock structures, characterized in that, The method includes: Acquire images of the surrounding rock to be identified; Calculate the structural tensor field of the image of the surrounding rock to be identified, and determine the local principal texture direction in the image of the surrounding rock to be identified based on the structural tensor field; Based on the local main texture direction, the image of the surrounding rock to be identified is segmented into anisotropic superpixels to obtain multiple superpixel regions to be identified. Each superpixel region to be identified is input into the small sample analysis model of the surrounding rock structure as described in any one of claims 1 to 7, and the identification result of the surrounding rock structure corresponding to each superpixel region to be identified is obtained. Based on the identification results of the surrounding rock structure corresponding to each superpixel region to be identified, the surrounding rock image to be identified is structurally annotated to obtain lithological classification results and structural surface segmentation results.

9. A training device for a small sample analysis model of surrounding rock structure, characterized in that, The device includes: The image acquisition module is used to acquire images of unlabeled surrounding rock samples; The structure tensor calculation module is used to calculate the structure tensor field of the unlabeled surrounding rock sample image and determine the local principal texture direction of each pixel in the image based on the structure tensor field. The superpixel segmentation module is used to construct an anisotropic distance metric based on the local main texture direction, and to perform superpixel segmentation on the unlabeled surrounding rock sample image according to the anisotropic distance metric to obtain multiple superpixel regions that conform to the texture direction of the surrounding rock. The inter-class training module is used to create an initial feature extraction model and perform region-level comparative learning based on the region features corresponding to the superpixel region to train the inter-class feature extraction model. The clustering module is used to perform unsupervised clustering of the superpixel region based on the region features extracted by the inter-class feature extraction model, so as to obtain multiple cluster sets; The intra-class contrastive learning module is used to perform intra-class contrastive learning based on the superpixel regions within each cluster set, thereby obtaining multiple intra-class expert feature extraction models. The distillation module is used to train the student model by knowledge distillation, using the inter-class feature extraction model as the master teacher model and the multiple intra-class expert feature extraction models as expert teacher models, to obtain the target feature extraction model. The task adaptation module is used to train a small sample analysis model of surrounding rock structure using labeled surrounding rock sample images. The small sample analysis model of surrounding rock structure includes the target feature extraction model and the task header.

10. An electronic device, characterized in that, include: The system includes a memory and a processor, which are interconnected. The memory stores computer instructions, and the processor executes the computer instructions to perform the small sample analysis model training method for surrounding rock structures as described in any one of claims 1 to 7 or the surrounding rock structure identification method as described in claim 8.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to execute the training method for the small sample analysis model of the surrounding rock structure according to any one of claims 1 to 7 or the identification method of the surrounding rock structure according to claim 8.