A model training method and device and a rock slag feature extraction method and device

By introducing an improved model of multi-scale spatial-frequency fusion enhancement module and a three-branch acquisition and distribution neck network, the problems of low recall and incomplete feature extraction in rock debris detection are solved, achieving high-precision segmentation and comprehensive feature extraction of rock debris, and supporting the analysis of surrounding rock conditions under complex geological conditions.

CN121904516BActive Publication Date: 2026-06-09THE THIRD ENG CO LTD OF CHINA RAILWAY SEVENTH GRP +2

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
THE THIRD ENG CO LTD OF CHINA RAILWAY SEVENTH GRP
Filing Date
2026-03-23
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Existing technologies for rock debris detection suffer from low recall, blurred edges, and the inability to simultaneously extract RGB color features of rock debris, making it difficult to meet the comprehensive early warning needs of surrounding rock conditions under complex geological conditions.

Method used

An improved YOLO11n-seg model based on the fusion of MSFEM and TripleGD-Neck mechanism was adopted. By combining multi-scale spatial-frequency features with cross-layer information interaction, the segmentation accuracy of rock slag particles was improved. Furthermore, the geometric and color features of the rock slag region were extracted using the mask of the improved segmentation model.

Benefits of technology

It achieves high-precision segmentation and automated analysis of rock debris particles, providing rich information on the surrounding rock and supporting further geological analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121904516B_ABST
    Figure CN121904516B_ABST
Patent Text Reader

Abstract

The present application belongs to the technical field of foundation pit engineering construction monitoring, aiming at the problem of low rock slag feature extraction accuracy and not considering the color feature of rock slag, a model training method, a rock slag feature extraction method and device are proposed. Based on the improved YOLO11n-seg model of fusion MSFEM and TripleGD-Neck mechanism, through multi-scale space-frequency feature joint enhancement and cross-layer information interaction, the segmentation accuracy of rock slag particles is improved, and the automatic and high-precision analysis of particle size distribution is realized. And the mask (mask) extracted by the improved YOLO11n-seg model after segmentation provides more abundant surrounding rock information, which can provide strong data support for further geological analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of construction monitoring technology for foundation pit engineering, and in particular to a model training method, a rock debris feature extraction method and device. Background Technology

[0002] Foundation pit engineering is a crucial link in urban construction and underground space development. The characteristics of rock debris during foundation pit excavation are one of the most direct and important bases for assessing the stability of the excavation face and optimizing support parameters. Compared with traditional drilling sampling, image-based rock debris analysis has advantages such as being non-destructive, rapid, and allowing for continuous monitoring; however, its analytical effectiveness has long relied on slow and inefficient traditional methods. Currently, the main methods for analyzing rock debris in engineering sites fall into three categories: sieving, manual observation, and computer vision detection. Sieving is time-consuming and labor-intensive, failing to meet the need for rapid feedback during excavation. Manual observation is monotonous and tedious, consuming a significant amount of time and energy for technical personnel, and is highly subjective, easily leading to misjudgments and missed detections. Therefore, there is an urgent need for automated and accurate detection and segmentation of foundation pit rock debris.

[0003] In recent years, deep learning algorithms, represented by YOLO (You Only Look Once), have demonstrated significant advantages in the field of industrial vision. The YOLO11 model, through its multi-scale detection head design, can simultaneously process targets of different sizes, achieving a balance between speed and accuracy in general object detection tasks. However, directly applying it to rock debris segmentation presents three main problems: First, the backbone network lacks targeted modeling of the spatial structure and texture frequency characteristics of rock debris particles with varying shapes and broken edges, resulting in low recall rates for small-particle-size rock debris. Second, the traditional neck network's unidirectional feature transfer mechanism struggles to establish strong cross-scale feature associations, leading to blurred particle segmentation boundaries and decreased accuracy when rock debris is heavily stacked and occluded. Finally, the segmentation model only outputs mask contours and cannot simultaneously extract the RGB color features of the rock debris, while color is a key indicator reflecting the mineral composition and weathering degree of the rock mass. Existing methods generally only focus on particle size analysis, lacking quantitative extraction of rock debris color information, making it difficult to establish deeper correlations with geological conditions and failing to meet the comprehensive early warning needs of surrounding rock conditions under complex geological conditions. Summary of the Invention

[0004] In view of the above problems, this application provides a model training method, a rock debris feature extraction method, and an apparatus. Based on an improved YOLO11n-seg model that integrates MSFEM and the TripleGD-Neck mechanism, it improves the segmentation accuracy of rock debris particles through multi-scale spatial-frequency feature enhancement and cross-layer information interaction, achieving automated and high-precision analysis of particle size distribution. Furthermore, it utilizes the mask segmented by the improved YOLO11n-seg segmentation model to extract rock debris regions, calculating not only the geometric particle size parameters of the rock debris but also acquiring its color features, thus providing richer information about the surrounding rock and offering strong data support for further geological analysis.

[0005] In a first aspect, embodiments of this application provide a model training method, the method comprising:

[0006] The rock debris images were acquired and preprocessed to obtain preprocessed rock debris images. Each rock mass in the preprocessed rock debris images was labeled to obtain a rock debris image sample set.

[0007] The rock slag image sample set is input into the improved segmentation model based on YOLO11n-seg, and the first classification category of the rock slag and the first classification probability corresponding to each first classification category are output.

[0008] The improved segmentation model based on YOLO11n-seg uses the YOLO11n-seg model as its basic framework. By introducing a spatial frequency fusion enhancement module into the backbone network of the YOLO11n-seg model, a multi-scale spatial frequency fusion enhancement module is obtained. The neck network is replaced with a TripleGD-Neck module, and finally, the improved segmentation model based on YOLO11n-seg is obtained.

[0009] The model parameters of the improved segmentation model based on YOLO11n-seg are adjusted based on the first classification category and the first classification probability until the improved segmentation model based on YOLO11n-seg converges or reaches the maximum number of iterations, thus obtaining the slag segmentation model.

[0010] Furthermore, the multi-scale spatial frequency fusion enhancement module includes a separable convolutional layer, three parallel branches, a spatial frequency enhancement sub-module positioned after each parallel branch, and a feature concatenation layer; wherein:

[0011] Separable convolutional layers are used to extract global contour information from rock debris images;

[0012] Parallel branches extract multi-scale features of rock debris images from global contour information through convolution kernels of different scales, and compress multi-scale features through average pooling operations.

[0013] The spatial frequency enhancement submodule is used to enhance the spatial and frequency domain detail texture features in the multi-scale features output by each parallel branch, resulting in multi-scale spatial frequency enhanced features.

[0014] The feature stitching layer stitches together multi-scale spatial frequency enhancement features through stitching operations to obtain spatial frequency enhancement fusion features.

[0015] Furthermore, the spatial frequency enhancement submodule segments the input multi-scale features through channel segmentation, and inputs the segmented features into the spatial domain branch and the frequency domain branch respectively. In the spatial domain branch, the low-frequency background and high-frequency edges in the rock debris image are separated by average pooling operation to enhance the clarity of the rock debris boundary and obtain spatial features. At the same time, in the frequency domain branch, FFT transformation combined with low-pass filtering is used to separate low-frequency redundancy and extract high-frequency texture features. Finally, the SimAM attention mechanism is introduced to weightedly fuse the spatial features and high-frequency texture features, and the fused enhanced spatial frequency features are output through convolution.

[0016] Furthermore, the TripleGD-Neck module is based on the original GD-Neck framework in the YOLO11n-seg model. After adding the Middle-GD branch, it forms a three-branch structure of Low-GD, Middle-GD, and High-GD, which are used to extract and fuse small-particle-scale rock debris, medium-particle-scale rock debris, and large-particle-scale rock debris, respectively.

[0017] Each branch structure includes a feature alignment module, a feature information fusion module, and a feature information distribution module with identical structures.

[0018] Secondly, embodiments of this application provide a method for extracting rock slag features, the method comprising:

[0019] Real-time acquisition of rock debris images;

[0020] The rock slag image is input into the rock slag segmentation model to obtain the rock slag segmentation result image; the rock slag segmentation model is obtained according to one of the model training methods described above;

[0021] Based on the pixel-to-physical scale coefficient of the image and the reference object, the geometric features of the rock slag segmentation result image are extracted; the geometric features include the actual major axis, actual minor axis, actual perimeter of the contour, and actual area of ​​the rock slag.

[0022] Based on the geometric features of the rock slag segmentation image, calculate the rock slag particle size parameters;

[0023] Calculate the contour sharpness coefficient based on the rock slag segmentation result image;

[0024] Based on the rock slag segmentation results image, the rock slag color features are extracted to obtain the rock slag color feature vector;

[0025] A rock slag feature matrix is ​​established based on the rock slag particle size parameters, the profile sharpness coefficient, and the rock slag color feature vector.

[0026] Further, the step of calculating the rock slag particle size parameters based on the geometric features of the rock slag segmentation result image includes:

[0027] Based on the actual long axis of the rock slag, the rock slag particles in the segmented image are divided into multiple particle size intervals, and the number of rock slag particles in each particle size interval and the area ratio of each particle size interval are counted.

[0028] The maximum particle size of rock slag in each particle size range is obtained by taking the maximum value of the actual long axis of all rock slag particles in each particle size range.

[0029] The actual area of ​​the rock slag particles in each particle size range is arranged in ascending order. Based on the particle size values ​​when the cumulative area ratio is 10%, 30%, and 60%, the first characteristic particle size, the second characteristic particle size, and the third characteristic particle size are obtained. The cumulative area ratio is the area ratio obtained by accumulating the area ratio of each particle size range starting from the smallest particle size range.

[0030] The non-uniformity coefficient of the rock slag is obtained based on the ratio of the third characteristic particle size to the first characteristic particle size.

[0031] The first product is obtained based on the first characteristic particle size and the third characteristic particle size. The curvature coefficient of the rock slag is obtained based on the ratio of the square of the second characteristic particle size to the first product.

[0032] The roughness index of rock slag is determined by accumulating the percentage of the total area of ​​rock slag particles that are greater than the upper limit of each particle size range to the actual area of ​​the entire rock slag region.

[0033] Furthermore, the calculation of the contour sharpness coefficient based on the rock slag segmentation result image includes:

[0034] From the rock debris segmentation result image, obtain the first... The binary mask image of the first rock debris is obtained, and the first rock debris is extracted. The closed contour of the rock debris is obtained, and the set of contour pixels is obtained.

[0035] Adaptive sampling is performed on the contour pixel set to obtain an evenly spaced set of sampling points uniformly distributed on the closed contour;

[0036] The turning angle at each sampling point is determined based on the forward and backward vectors between each sampling point in the equally spaced sampling point set and the two sampling points adjacent to that sampling point.

[0037] Based on the classification of turning angle types, the number of different types of edges in the closed contour of each rock slag is counted, and the number of different types of edges is weighted and summed to obtain the weighted sum of edges. The ratio of the weighted sum of edges to the total number of edges is used as the contour sharpness coefficient of each rock slag particle.

[0038] The overall contour sharpness coefficient of the rock slag segmentation result image is obtained by summing and averaging the contour sharpness coefficients of all rock slag particles.

[0039] Furthermore, the step of extracting rock slag color features from the rock slag segmentation image to obtain a rock slag color feature vector includes:

[0040] Obtain the binary mask image of the rock slag segmentation result image, extract the contours of the rock slag particles, and crop the original unsegmented rock slag image based on the contours to obtain the cropped image containing only rock slag.

[0041] The pixel values ​​of each rock debris region in the cropped image containing only rock debris are statistically analyzed, the brightness value is calculated, and the brightness value is used as the color feature of the rock debris.

[0042] The color features are divided into different color levels using the quantile partitioning method. The proportion of each color level in each rock debris image is counted. The rock debris color feature vector of each initial rock debris image is constructed with the proportion of color level as the dimension.

[0043] Thirdly, embodiments of this application provide a rock slag feature extraction device, the device comprising:

[0044] The acquisition module is used to acquire rock debris images in real time;

[0045] The segmentation module is used to input the rock slag image into the rock slag segmentation model to obtain the rock slag segmentation result image; the rock slag segmentation model is obtained according to one of the model training methods described above;

[0046] The geometric feature calculation module extracts the geometric features of the rock debris segmentation result image based on the pixel-physical scale coefficient of the image and the reference object; the geometric features include the actual major axis, actual minor axis, actual perimeter of the contour, and actual area of ​​the rock debris;

[0047] The rock slag particle size parameter calculation module is used to calculate the rock slag particle size parameters based on the geometric features of the rock slag segmentation result image;

[0048] The sharpness coefficient calculation module is used to calculate the contour sharpness coefficient based on the rock slag segmentation result image;

[0049] The color feature extraction module is used to extract the color features of rock slag based on the rock slag segmentation result image, and obtain the rock slag color feature vector;

[0050] The rock slag feature module is used to establish a rock slag feature matrix based on rock slag particle size parameters, contour sharpness coefficient, and rock slag color feature vector.

[0051] Compared with the prior art, the specific beneficial effects of the present invention are as follows:

[0052] First, at the model architecture level, this invention constructs an improved segmentation model for rock debris images by introducing a multi-scale spatial-frequency fusion enhancement module (MSFEM) and a three-branch acquisition-distribution neck network (TripleGD-Neck), systematically improving segmentation accuracy from the perspectives of feature extraction and fusion mechanisms. The MSFEM module enhances rock debris edge details in the spatial branch and filters out low-frequency background noise while retaining high-frequency textures in the frequency branch, achieving adaptive feature representation for complex rock debris morphologies, particularly improving the recall of small-scale and edge-blurred particles. The TripleGD-Neck, through its three-branch structure of Low-GD, Middle-GD, and High-GD, establishes cross-level feature alignment and distribution mechanisms for small, medium, and large particle scales, respectively, enhancing the boundary clarity and segmentation consistency of multi-scale rock debris in stacked and occluded scenarios. Ablation experiments show that this improved model significantly outperforms the benchmark model in key metrics such as precision, recall, and mAP50-95.

[0053] Secondly, at the feature extraction level, this invention proposes a multi-dimensional rock debris feature quantification system starting from a mask, realizing a structured mapping from image to geological information. This method not only extracts the geometric parameters of the rock debris based on the mask, but also calculates particle size distribution, inhomogeneity coefficient, curvature coefficient, and roughness index. Furthermore, it introduces the contour sharpness coefficient (CSC) as a morphological index, statistically quantifying the sharpness of the rock debris's edges through turning angles, indirectly reflecting the fracturing state of the surrounding rock. Simultaneously, it extracts the color brightness features of the rock debris using the mask region and constructs a color level vector through quantile partitioning, establishing a correlation between color information and the mineral composition and weathering degree of the rock mass. Finally, it integrates geometric, morphological, and color features to form a rock debris feature matrix, overcoming the limitation of existing methods that only focus on a single particle size. Attached Figure Description

[0054] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0055] Figure 1 This is an example diagram of data augmentation processing.

[0056] Figure 2 This is a traditional YOLO11 network architecture diagram.

[0057] Figure 3 This is a structural diagram of the Multi-Scale Spatial Frequency Fusion Enhancement Module (MSFEM) proposed in this invention.

[0058] Figure 4 This is a structural diagram of the Spatial Frequency Enhancement (SFE) module in the MSFEM module.

[0059] Figure 5 This is a structural diagram of the original GD-Neck module.

[0060] Figure 6 This is a structural diagram of the TripleGD-Neck module proposed in this invention.

[0061] Figure 7 This is a simplified architecture diagram of the acquisition-distribution branch of the TripleGD-Neck module.

[0062] Figure 8 This is a structural diagram of the feature information distribution module in the acquisition-distribution branch architecture.

[0063] Figure 9 This is a structural diagram of the improved YOLO11n-seg segmentation model.

[0064] Figure 10 These are comparison images of model segmentation results; Figure 10 In the image: (a) is the original rock debris image, (b) is the YOLO11_seg segmentation result, and (c) is the segmentation result of the improved model.

[0065] Figure 11 This is a distribution diagram of rock slag size gradation.

[0066] Figure 12 A mask image of a single rock fragment.

[0067] Figure 13 This is a closed contour map of the mask image of the extracted individual rock fragments.

[0068] Figure 14 This is a schematic diagram of the sampling point distribution after adaptive sampling of the closed contour map.

[0069] Figure 15 This is a schematic diagram of the contour turning angle calculated based on the distribution of sampling points.

[0070] Figure 16 This is a schematic diagram showing the calculated sharpness of a single rock fragment.

[0071] Figure 17 It is a histogram of the frequency distribution of the turning angles of the rock debris profile.

[0072] Figure 18 This is a schematic diagram of the color feature extraction process.

[0073] Figure 19 It is the histogram of the brightness distribution of rock debris and the quantile boundary.

[0074] Figure 20 This is a color-grading distribution map of rock debris images of different surrounding rock grades. Detailed Implementation

[0075] Exemplary embodiments of this application will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of this application are shown in the drawings, it should be understood that this application may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of this application and to fully convey the scope of this application to those skilled in the art.

[0076] Example 1: This example provides a model training method, including the following steps:

[0077] Step 1: Acquire rock debris images and preprocess them, and label each rock mass in the preprocessed rock debris images to construct a rock debris image sample set;

[0078] Furthermore, step 1 may include the following sub-steps:

[0079] Step 1.1: Acquire multiple images of rock debris using an image acquisition device;

[0080] High-resolution cameras installed near the excavation face, next to the rock debris pile, or along the transportation route at the foundation pit construction site are used to take fixed-point or timed pictures to ensure that the rock debris can be accurately captured, thereby obtaining multiple clear and complete images of the rock debris.

[0081] Step 1.2: Perform preprocessing operations such as invalid image removal, image cropping, image filling, image enhancement, and normalization on all rock debris images to obtain preprocessed rock debris images;

[0082] Specifically, firstly, invalid images due to issues such as blurry captures or insufficient rock debris features are removed to ensure data validity. Then, image cropping and scaling are performed. Reference objects of known size are placed in the image, and the pixel count of these reference objects is calculated to establish a mapping relationship between pixels and actual length, providing a basis for subsequent calculations of the actual size of the rock debris. Next, various image enhancement techniques are employed to simulate image changes under real-world conditions to improve the model's generalization ability. These techniques include brightness adjustment, noise addition, image flipping, and rotation at different angles (such as...). Figure 1(As shown), to improve the model's generalization ability; finally, normalization is performed to unify the image size, resolution, and color channels for subsequent processing.

[0083] Step 1.3: Annotate the rock mass in the preprocessed rock debris images, and establish a rock debris image sample set based on the preprocessed rock debris images and their corresponding labels. Divide the rock debris image sample set into a training set and a validation set according to the proportion.

[0084] Specifically, the Labelme annotation tool was used to draw regions based on the shape of the rock mass, and each rock mass in the preprocessed rock debris image was labeled. The resulting JOSN file was then converted to a YOLO format .txt file for direct use by the YOLO11n-seg model. A rock debris image sample set was established based on the preprocessed rock debris images and their corresponding label files, and divided into training and validation sets with an 80% training set and a 20% validation set ratio.

[0085] Step 2: Input the rock debris image sample set into the improved segmentation model based on YOLO11n-seg to obtain the first classification category of the rock debris and the first classification probability corresponding to each of the first classification categories output by the improved segmentation model based on YOLO11n-seg.

[0086] Furthermore, the network architecture diagram of the latest YOLO11-seg model is as follows: Figure 2 As shown, it includes a backbone network, a neck network, and a head. The input image is processed by the backbone network to extract multi-scale features, and then the neck network is used for feature fusion and enhancement. Finally, the head outputs the target's classification category, the classification probability corresponding to the classification category, the bounding box coordinates, and the confidence score. No candidate region generation is required throughout the process, achieving end-to-end target detection.

[0087] However, existing YOLO11-seg models suffer from insufficient multi-scale particle feature extraction capabilities and edge blurring caused by dust interference when processing rock debris images. Therefore, this invention addresses the limitation of the multi-scale edge enhancement module (MEEM) in the YOLO11-seg model backbone network, which only focuses on spatial domain edge features. Based on the MEEM, a spatial frequency enhancement sub-module is introduced to obtain a multi-scale spatial frequency fusion enhancement module (MSFEM). The structure of MSFEM is as follows... Figure 3 As shown in the figure, MSFEM includes depthwise separable convolutional layers, three parallel branches, a spatial-frequency fusion enhancer (SFE) submodule, and a feature concatenation layer. Specifically:

[0088] The depthwise separable convolutional layer is a 5×5 depthwise separable convolution, which significantly reduces the computational cost while extracting global contour information from the rock debris image. ;

[0089] Three parallel branches are connected to a depthwise separable convolutional layer, and then passed through different scales ( , , The convolutional kernels operate in parallel to accurately capture multi-scale features of rock debris images and utilize... Average pooling reduces the feature map size, thus reducing the computational burden on subsequent operations. Each parallel branch outputs a multi-scale feature map. , , ;

[0090] Each parallel branch is followed by a spatial frequency enhancement submodule, which is used to enhance the spatial and frequency domain details and textures in the multi-scale feature images, resulting in multi-scale spatial-frequency enhanced features. , , ;

[0091] The feature concatenation layer is used to concatenate the multi-scale spatial frequency enhancement features output from the three parallel branches through a Concat operation, integrating information from different dimensions, and then... Convolution adjusts the dimensions and removes redundancy to obtain spatial frequency enhanced fusion features.

[0092] Furthermore, the structure of the Spatial Frequency Enhancement (SFE) submodule in MSFEM is as follows: Figure 4 As shown, the input features are first segmented using channel splitting (Split), and the segmented features are then input into the spatial domain branch and the frequency domain branch respectively. In the spatial domain branch, average pooling (AP) is used to effectively separate the low-frequency background from the high-frequency edges in the image, focusing on enhancing the clarity of the rock debris particle boundaries to obtain spatial features. In the frequency domain branch, low-frequency redundancy is separated by using FFT transform (FFT_LF) combined with low-pass filtering to extract high-frequency texture features. Then, the concat operation is used to concatenate them. and Furthermore, the SimAM attention mechanism is introduced to perform weighted fusion of the stitched spatial-frequency features, highlighting and enhancing key image region information. Finally, the fused and enhanced spatial-frequency features are output through convolution, achieving synergistic enhancement of spatial contours and frequency details.

[0093] Furthermore, the existing YOLO algorithm's Neck network relies on fixed convolutions and upsampling to achieve feature fusion, but it suffers from an inherent flaw of feature dimension imbalance. While shallow features retain high spatial resolution, they lack semantic information, making it difficult to capture the localization information of small rock fragments (3-5 cm) in complex scenes. Conversely, while deep features provide sufficient semantic expression, their spatial resolution is reduced, failing to accurately depict the edge details of large rock fragments (over 15 cm). This ultimately limits the accuracy of multi-scale rock fragment recognition, making it difficult to simultaneously detect and analyze both large and small particles. Therefore, this invention introduces the GD-Neck module, whose structure is as follows: Figure 5 As shown, this module can construct multi-scale feature associations through a collection-distribution process. A traditional GD-Neck module typically includes three sub-modules: Feature Alignment (FAM), Feature Information Fusion (IFM), and Feature Information Distribution (Inject). First, FAM collects feature maps of the backbone at different scales and aligns them using upsampling or downsampling. Then, IFM fuses the aligned features to generate global features, which are then split into two parts and distributed selectively to other scales. Finally, the Inject distribution module uses simple attention operations to enhance branch detection capabilities, splitting the global features and distributing them to various levels, thus strengthening the fusion of local details and global semantics.

[0094] Traditional GD-Neck employs a two-branch architecture of Low-GD and High-GD. When applied to feature extraction of medium-scale cinder particles, it suffers from a large span between shallow and deep feature fusion and the easy loss of medium-scale details. Therefore, this invention improves the traditional GD-Neck module by adding a Middle-GD branch to establish a three-branch architecture of Low-GD, Middle-GD, and High-GD, adapting to small, medium, and large scales of cinder particles respectively. Specifically, the small-scale size range is 0-3 cm, the medium-scale size range is 3-10 cm, and the large-scale size range is over 10 cm. Furthermore, the feature alignment module (FAM) and feature information fusion module (IFM) under each branch in the three-branch architecture (Low / Middle / High) adopt the same structure (e.g., ...). Figure 7 As shown), the TripleGD-Neck module is finally obtained, as follows: Figure 6As shown. Furthermore, compared to FAM, IFM, and IInject in the original GD-Neck, the FAM alignment operation logic in TripleGD-Neck remains unchanged, but the baseline size and the range of input features are adjusted according to the small, medium, and large scales of the rock debris. The IFM of each branch uniformly uses the RepConv-Blocks module to extract features, abandoning the Transformer module to avoid a surge in computational cost; the Inject module structure of each branch remains unchanged.

[0095] TripleGD-Neck continues the "collection-distribution" logic, achieving fine-grained capture and fusion of features across all scales through the collaborative use of FAM, IFM, and Inject modules. Specifically:

[0096] (1) Feature Alignment Module (FAM)

[0097] like Figure 7 As shown, based on the size of the intermediate input feature map input2, the larger feature map input1 is downsampled by average pooling, and the smaller feature map input3 is upsampled by bilinear interpolation to achieve uniformity of feature map size. Then, the merged feature map is obtained by the Concat operation.

[0098] (2) Feature Information Fusion Module (IFM)

[0099] The IFM module includes a convolutional module (Conv), a RepConv-Blocks module, and a split operation. The merged features from the FAM output are input into the RepConv-Blocks module for multi-scale feature semantic association, generating globally fused features. Then, Conv is used to adjust the channels to accommodate different feature levels. Finally, the split operation splits the globally fused features into two global features, Inject_output1 and Inject_output2, on each channel, and then fuses them with features from different levels.

[0100] (3) Feature Information Distribution Module (Inject)

[0101] Information distribution employs a lightweight self-attention mechanism, taking local features x_local (e.g., S2 layer features) at the current scale and global features x_global (e.g., Inject_output1) generated by IFM as input. If sizes are inconsistent during the fusion process, average pooling or bilinear interpolation can be used for processing. After further feature extraction and fusion by RepConv-Blocks, the final output is an enhanced target-scale feature (e.g., B3), achieving the supplementation and enhancement of local details by global semantics. The Inject module architecture diagram is shown below. Figure 8 As shown.

[0102] Combination Figure 9 Assuming the input rock debris image resolution is R, and the feature layers include S1 (1 / 2R), S2 (1 / 4R), S3 (1 / 8R), S4 (1 / 16R), and S5 (1 / 32R), the processing flow of the three-branch structure of this invention is as follows: The Low-GD branch (adapted for small-scale rock debris): Its input is high-resolution features (S1, S2, S3). The FAM module uses S2 (1 / 4R) as the baseline, downsamples S1 to 1 / 4R size and upsamples S3 to 1 / 4R size, and then Concat merges the aligned S1, S2, and S3 features. The IFM module first reduces the number of channels through Conv, then strengthens semantic association through RepConv, then restores the original number of channels through Conv, and finally splits it into two paths through Split, which are distributed to the S2 (1 / 4R) and S3 (1 / 8R) levels respectively. The Inject module injects the global features generated by IFM into S2 to obtain B2 features through attention weighting, and injects them into S3 to obtain B3 features. The Middle-GD branch (adapted for mesoscale rock debris): Its input is a medium-resolution feature (B2, B3, S4). The FAM module uses B3 (1 / 8R) as the baseline, downsamples B2 to 1 / 8R size, and upsamples S4 to 1 / 8R size. Concat merges the aligned features of B2, B3, and S4. The execution flow of the IFM module and the Low-GD branch is as follows: Conv reduces channels, RepConv enhances, Conv restores channels, and Split is split into two paths, which are distributed to the B3 (1 / 8R) and S4 (1 / 16R) levels respectively. The Inject module injects the global features generated by IFM into B3 to obtain the P3 feature through attention weighting, and injects it into S4 to obtain the B4 feature. The High-GD branch (adapted for large-scale rock debris): Its input is low-resolution features (P3, B4, S5). The FAM module uses B4 (1 / 16R) as the baseline, downsamples P3 to 1 / 16R size and upsamples S5 to 1 / 16R size, and then concats the aligned features of P3, B4, and S5. The IFM module has the same execution flow as the Low-GD branch, and Splits it into two paths, which are distributed to the B4 (1 / 16R) and S5 (1 / 32R) levels respectively. The Inject module injects the global features generated by IFM into B4 to obtain P4 features through attention weighting, and injects them into S5 to obtain P5 features.

[0103] Based on the two improved modules (MSFEM and TripleGD-Neck) mentioned above, and using the original YOLO11n-seg model as the basic framework, a spatial frequency fusion enhancement module is introduced into the backbone network, and the neck network is replaced with the TripleGD-Neck module. This results in an improved segmentation model based on YOLO11n-seg, as follows: Figure 9 As shown, by improving the segmentation model based on YOLO11n-seg, operations such as rock debris extraction and instance segmentation can be achieved, and refined rock mass segmentation results can be output.

[0104] Step 3: Adjust the model parameters of the improved segmentation model based on YOLO11n-seg based on the first classification category and the first classification probability until the improved segmentation model based on YOLO11n-seg converges or reaches the maximum number of iterations, to obtain the slag segmentation model.

[0105] Furthermore, in this embodiment, the improved segmentation model based on YOLO11n-seg is trained on the training set obtained in step 1.3, and the model parameters are adjusted so that the improved model meets the engineering requirements in terms of accuracy and real-time performance until the model converges or reaches the preset number of model training times (maximum number of iterations). The improved segmentation model is then validated on the validation set to obtain the trained improved segmentation model, which is used as the rock slag segmentation model.

[0106] Experimental Case: To fully verify the optimization effect of the improved segmentation model based on YOLO11n-seg, a combination of quantitative analysis and qualitative evaluation was used for model verification.

[0107] At the quantitative level, based on the original YOLO11_seg model, ablation experiments were conducted using core indicators such as precision, recall, mAP50 (average precision at IoU=0.5) and mAP50-95 (mean of average precision in the IoU range of 0.5-0.95). The specific experimental results are shown in Table 1.

[0108] Table 1. Ablation test results:

[0109] ;

[0110] As shown in Table 1, the performance indicators of adding the MSFEM and TripleGD-Neck modules are the highest, proving that the MSFEM and TripleGD-Neck modules of this invention can improve the feature representation ability of complex rock debris images and improve the multi-scale rock debris recognition accuracy.

[0111] At the qualitative level, such as Figure 10As shown in (a), (b), and (c), by comparing the original rock debris image, the segmentation results of the original YOLO11_seg model, and the segmentation output of the improved model (YOLO11_seg+MSFEM+TripleGD-Neck), the significant advantages of the improved segmentation model based on YOLO11_seg proposed in this invention in detail processing such as small particle detection and blurred boundary repair are intuitively demonstrated, effectively verifying the improved adaptability of the added module to complex rock debris scenes.

[0112] Example 2: This example provides a method for extracting rock debris features, the method comprising the following steps:

[0113] Step 1: Acquire rock debris images in real time;

[0114] Step 2: Input the rock slag image into the rock slag segmentation model to obtain the rock slag segmentation result image output by the rock slag segmentation model; the rock slag segmentation model is obtained according to the model training method in the above embodiment;

[0115] Step 3: Calculate the rock slag particle size parameters based on the rock slag segmentation result image;

[0116] Optionally, step 3 includes the following sub-steps:

[0117] Step 3.1: Extract the geometric features of the rock slag segmentation result image based on the pixel-physical scale coefficient of the image and the reference object;

[0118] Furthermore, step 3.1 includes the following sub-steps:

[0119] Step 3.1.1: Calculate the number of pixels of the reference object in the image, establish the mapping relationship between pixels and actual size, and thus determine the pixel-physical ratio coefficient of the pixel length and actual physical length of the rock slag segmentation result image;

[0120] By establishing a scale mapping relationship between the pixel length and the actual physical length of the rock debris segmentation image using a pre-defined reference object of known size in the image, the pixel-physical scale coefficient is obtained. for:

[0121] ;

[0122] Assuming the actual length of the reference object is known to be 60cm, corresponding to an image width of 640 pixels, the actual length represented by each pixel in the current rock debris segmentation image can be calculated using the above formula:

[0123] ;

[0124] This pixel-to-physical scale factor serves as the core basis for all subsequent geometric parameter calculations, ensuring that pixel-level measurement results can be accurately converted into physical dimensions.

[0125] Step 3.1.2: Extract the pixel contour information of each slag block in the slag segmentation result image to determine the contour of each slag block;

[0126] Based on the rock slag segmentation result image output by the rock slag segmentation model, pixel-level contour information of each segmented region (slag block) in the image is extracted to fully capture the boundary details of rock slag particles and provide accurate boundaries for subsequent geometric calculations.

[0127] Step 3.1.3: Based on pixel contour information, the minimum bounding rectangle algorithm is used to generate the minimum rectangle that encloses the contour, and the actual axial length of each slag block is determined according to the minimum rectangle and the pixel-physical ratio coefficient.

[0128] For the contour of each slag block (segmentation region) in the slag segmentation result image, the minimum bounding rectangle (MBR) algorithm is used to generate the minimum rectangle that encloses the contour. The long side and short side of the minimum rectangle are used as the major axis and minor axis of the slag block, respectively. The major axis and minor axis are converted from pixel value (i.e. pixel axis length) to actual length (unit: cm) through pixel-physical scaling coefficient to obtain the actual axis length (including the length of the major axis and minor axis) of each slag block.

[0129] The formula for converting actual shaft length is:

[0130] ;

[0131] Step 3.1.4: Count the number of pixels within the outline of each slag block, determine the pixel area of ​​the slag block, and convert the pixel area into the actual area according to the pixel-physical ratio coefficient;

[0132] The pixel area of ​​each slag block can be obtained by counting the number of pixels within its outline. Then, the pixel area can be converted into the actual physical area using the following formula (unit: ):

[0133] ;

[0134] The obtained actual area value is used as a key parameter to characterize the size of the slag block and is used for subsequent gradation analysis;

[0135] Step 3.1.5: Based on the pixel sequence of each slag block outline, obtain the outline pixel perimeter of the slag block, and convert the outline pixel perimeter into the actual outline perimeter according to the pixel-physical ratio coefficient.

[0136] The pixel sequence of each rock debris block contour is recorded by the contour tracking algorithm. After scale conversion, the actual perimeter of the contour (unit: cm) is obtained, which provides basic data for the calculation of shape features such as roughness index.

[0137] .

[0138] Step 3.2: Calculate the rock slag particle size parameters based on the geometric features of the rock slag segmentation result image;

[0139] Optionally, step 3.2 includes the following sub-steps:

[0140] Step 3.2.1: Divide the rock debris particles in the image into multiple particle size intervals according to the actual long axis of the rock debris, and count the number of rock debris in each particle size interval and the area ratio of the particle size interval.

[0141] Based on the actual size of the long axis of the rock slag, the rock slag particles are divided into several particle size intervals, such as [0~2), [2~4), [4~6), [6~8), [8~10), [10~15), [15~20), [20~30) cm. The number of rock slag particles in each particle size interval and the area ratio of the particle size interval are counted. The area ratio of the particle size interval refers to the ratio of the total area of ​​all rock slag particles in the particle size interval to the actual area of ​​the entire rock slag region.

[0142] Step 3.2.2: Calculate the maximum particle size, characteristic particle size, non-uniformity coefficient, curvature coefficient, and roughness index respectively;

[0143] Traditional sieving experiments use sieves to separate rocks, and then calculate the characteristic particle size based on the mass of the rock on different sieves. To adapt to the characteristics of computer vision, this embodiment uses the area of ​​rock debris instead of mass to calculate the characteristic particle size. Step 3.2.2 specifically includes:

[0144] (1) Maximum particle size The maximum value (in cm) of the actual major axis of all slag particles in each particle size range is taken as the maximum particle size of that range, reflecting the maximum particle size boundary of the particle group. ,in, Let be the actual major axis of the i-th rock slag particle.

[0145] (2) Characteristic particle size Arrange the actual area of ​​the slag particles in each particle size range in ascending order, and use the particle size (actual slag long axis) corresponding to the cumulative area percentage of 10%, 30%, and 60% as the first characteristic particle size. Second characteristic particle size and third characteristic particle size .

[0146] Furthermore, the cumulative area percentage refers to the result obtained by successively adding up the area percentages of all particle size intervals, starting from the smallest particle size interval. For example, if [0~2) accounts for 5% + [2~4) accounts for 5% = cumulative 10%, then the particle size interval [2~4) is the first characteristic particle size. .

[0147] (3) Coefficient of non-uniformity The ratio of the third characteristic particle size to the first characteristic particle size is used as the non-uniformity coefficient. , It is used to measure the degree of non-uniformity in particle size distribution. The larger the non-uniformity coefficient, the wider the particle size distribution range.

[0148] (4) Curvature coefficient The curvature coefficient is the ratio of the square of the second characteristic particle size to the product of the first and third characteristic particle sizes. , Used to evaluate the smoothness of the particle size distribution curve, reflecting the proportion of intermediate particle sizes.

[0149] (5) Roughness index The roughness index is determined by accumulating the percentage of the total area of ​​slag particles exceeding the upper limit of each particle size range to the actual area of ​​the entire slag region. The calculation formula is as follows:

[0150] ;

[0151] in, The total area of ​​all rock debris particles (unit: ); The total area of ​​all particles with a diameter greater than or equal to the upper limit of the i-th particle size range (unit: Taking the aforementioned particle size ranges [0~2), [2~4), [4~6), [6~8), [8~10), [10~15), [15~20), [20~30) as an example, when i=1, The total area of ​​all particles whose particle size is greater than or equal to the upper limit 2 of the first particle size range [0~2), i.e. The total area of ​​particles with a diameter ≥ 2 cm, when i = 2, The total area of ​​all particles with a diameter greater than or equal to the upper limit 4 of the second particle size range [2~4), i.e. The total surface area of ​​particles with a diameter ≥ 4 cm; The total number of groups, i.e., the number of particle size intervals, is 8 in this embodiment. Roughness index It is used to reflect the dispersion of particle size distribution. If the roughness index is larger, the proportion of large-diameter particles is higher, and the distribution is more dispersed.

[0152] Figure 11 for Figure 10 Gradation distribution diagram of medium rock slag, through Figure 11 As can be seen from Table 2, the amount of rock debris varies in different intervals. Table 2 shows the calculated rock debris particle size parameters. , , The values ​​4.23, 6.01, and 10.41 represent the characteristic particle sizes at cumulative area percentages of 10%, 30%, and 60%, respectively, and can be used to analyze gradation. Maximum particle size... The value is 16.8, which is the maximum value of the long axis of the rock slag particles, reflecting the upper limit of the particle size distribution. Inhomogeneity coefficient. A value of 2.46 indicates that the particle size distribution of the rock slag is relatively concentrated; the curvature coefficient... The value is 0.82, which deviates from the ideal range, suggesting that the proportion of intermediate particle size may be insufficient; roughness index The value is 372.88, which reflects the high degree of dispersion in the particle size distribution of the rock slag.

[0153] Table 2. Rock slag particle size parameters:

[0154] ;

[0155] Step 3.2.3: Calculate the contour sharpness coefficient of the rock debris based on the rock debris segmentation result image;

[0156] The smoothness of the contour edges of rock debris generated during tunnel excavation or rock fracturing is closely related to the integrity, strength, and other mechanical properties of the surrounding rock. Generally, rock debris particles with sharp edges and irregular heights originate from fractured, jointed surrounding rock; conversely, rock debris with smooth edges and rounded corners often comes from surrounding rock with good integrity and high strength. To objectively quantify the sharpness of the contour edges of rock debris particles and establish its correlation with the characteristics of the surrounding rock, this invention proposes a formula for calculating the Contour Sharpness Coefficient (CSC). This parameter transforms the geometric angular characteristics (morphological features) of the rock debris contour into a calculable quantitative index. The contour sharpness coefficient allows for the inference of the integrity or degree of fracturing of the surrounding rock through morphological analysis of the rock debris.

[0157] Step 3.2.3 may include the following sub-steps:

[0158] Step 3.2.3.1: Obtain the binary mask image of the rock slag segmentation result image, extract the closed contour of each rock slag to obtain the contour pixel point set, and then perform adaptive sampling on the contour pixel point set to obtain the equally spaced sampling point set;

[0159] From the rock debris segmentation result image, obtain the first... A binary mask image of the first rock fragment is obtained; then, the closed contour of the rock fragment is extracted using the Canny edge detection algorithm to obtain the second... The outline pixel set of a rock slag ,in This represents the perimeter in pixels of the rock debris outline. Indicates the perimeter in pixels. The number of pixels. To improve efficiency while maintaining computational accuracy, adaptive sampling of the contour pixel set is required, with the number of sampling points... The calculation formula is:

[0160] ;

[0161] in, This is the floor function. The above formula is for larger rock debris ( Sampling 1 point every 10 pixels, for smaller rock debris ( Twenty sampling points are forcibly retained to fully capture basic morphological features. Using the above method, a set of evenly spaced sampling points uniformly distributed on the closed contour can be obtained. .

[0162] Step 3.2.3.2: Determine the turning angle at each sampling point based on the vector between each sampling point in the equally spaced sampling point set and the vector between each sampling point and its two adjacent preceding and following sampling points;

[0163] For the set of equally spaced sampling points Each sampling point in The angle between two adjacent sides is calculated using adjacent vectors. Define the vectors for two adjacent sides: the forward vector... (from the current sampling point) Point to the previous sampling point ), backward vector (from the current sampling point) Point to the next sampling point Since the contour is closed, special treatment is required for the boundary points: when hour, ;when hour, .

[0164] Sampling points The angle of the outline at the location Calculated using the vector dot product formula:

[0165] ;

[0166] In the formula, For vectors and dot product, They are vectors , The length of the module.

[0167] It should be noted that, For interior angles of the contour, the concavity or convexity is determined by the vector direction during calculation. When the interior angle of a concave angle is greater than 180°, the exterior angle is used. This serves as the actual turning angle, avoiding misjudgment of the angle of the concave contour. Finally, the convex point... and the concave point Unified as , It is a turning angle. The smaller the value, the sharper the inflection point. This is obtained through the method described above. It can directly reflect the degree of edge transition, providing a quantitative basis for subsequent angle judgment.

[0168] Step 3.2.3.3: Based on the classification of turning angle types, count the number of different types of edges in each rock debris profile, and perform a weighted summation of the number of different types of edges. Use the ratio of the weighted sum to the total number of edges as the profile sharpness coefficient of each rock debris.

[0169] To comprehensively characterize the overall sharpness of the edges and corners of a single rock fragment profile, it is necessary to base it on the turning angle. Perform weighted statistics. Based on size, edges are divided into three categories:

[0170] When the included angle When the angle is sharp, the weight is 20, where 20 represents the original point values ​​on the left and right sides of that point; when the angle is... When the angle is relatively sharp, the weight is 10; when the angle is... When the angle is smooth, the weight is 0.

[0171] Define intermediate variables Used for statistics The weighted sum of the sharpness of the edges in each rock debris profile The ratio of the weighted sum of different edge angles to the total number of edge angles is used as the profile sharpness coefficient of a single rock fragment. , and The calculation formulas are as follows:

[0172] ;

[0173] ;

[0174] In the formula, This represents the number of sampling points (i.e., the total number of edges and corners). The larger the value, the more pronounced the contours and the more uneven the edges of the rock debris.

[0175] Step 3.2.3.4: Sum and average the contour sharpness coefficients of all rock fragments in the binary mask image to obtain the overall contour sharpness coefficient of the rock fragment segmentation result image;

[0176] If the binary mask image contains To comprehensively reflect the angular features of the rock fragments in the image, the sharpness coefficient of all rock fragments is averaged to obtain the overall contour sharpness coefficient of the rock fragment segmentation result image:

[0177] ;

[0178] This indicator can be used to compare the differences in the angular features of rock debris in different images, thereby inferring the integrity or degree of fragmentation of the surrounding rock. The higher the value, the more fractured the surrounding rock that produces these rock fragments; conversely, the lower the value, the better the integrity of the surrounding rock.

[0179] Figures 12-16 This is a schematic diagram for calculating the sharpness of a single rock fragment's outline. First, as shown... Figure 12 As shown, a mask image of a single rock fragment is obtained through segmentation; then, as... Figure 13 As shown, its closed contour is extracted using the Canny algorithm; then as... Figure 14 As shown, adaptive sampling is performed on the contour to obtain uniformly distributed sampling points; then as... Figure 15 As shown, the contour turning angle at each location is calculated using sampling points. ;like Figure 16 As shown, according to Determine the type of edge (sharp / sharp / smooth) and calculate. For example Figure 10 The overall contour sharpness coefficient of the original rock debris image shown in (a) is analyzed to obtain the following results: A value of 0.12 indicates that the edges of the rock debris profile are mainly smooth, and the overall edge shape is relatively gentle. Figure 17 The histogram of the frequency distribution of the turning angle of the rock debris outline is used to quantify the distribution pattern of the turning angle of the rock debris outline. The overall bias of the rock debris outline angle can be seen from the figure. For example, if the peak value of the histogram is concentrated in 135°~180°, it indicates that the rock debris outline is mainly smooth edge; if the peak value is concentrated in ≤90°, it indicates that the rock debris has sharp edges and irregular edges.

[0180] Step 4: Based on the rock slag segmentation result image, extract the color features of the rock slag to obtain the rock slag color feature vector.

[0181] Observations of rock fragments revealed a clear correlation between their color and the hardness of the rock mass. For example, the whitish color of the rock fragments is due to the gradual transformation of quartz minerals within the rock into white powder, which then covers the rock surface, creating a whitish appearance. Since rocks with higher quartz content tend to be harder, the color of the rock fragments can be considered an effective parameter reflecting information about the rock mass.

[0182] Optionally, step 4 may include the following sub-steps:

[0183] Step 4.1: Obtain the binarized image of the rock slag segmentation result image and extract the mask contour of the target area;

[0184] Specifically, in combination Figure 18 After inputting the original rock debris image into the improved YOLO segmentation model, a preliminary segmentation result is output (the blue-marked area represents the identified target region), enabling initial differentiation between the target and the background. Binarizing the rock debris segmentation result image converts it into a black-and-white binary form, resulting in a binary image. In this binary image, white pixels correspond to the segmented rock debris, and black pixels correspond to the background, further simplifying the image and highlighting the target outline. A contour detection algorithm is used to extract the mask contour of the target region, which is then marked on the original image with a green contour line, accurately locating the target's edge shape.

[0185] It is worth noting that the methods for extracting rock slag particle size parameters, calculating contour sharpness coefficients, and extracting color features to obtain binarized images and contours are consistent. They are all based on the segmentation results output by the improved YOLO model. A mask image with white rock slag and black background is generated through binarization processing. Then, a contour detection algorithm is used to obtain the pixel-level closed contour of the rock slag, so as to achieve accurate separation of the target area and the background.

[0186] Step 4.2: Based on the mask contour of the target region, crop the original unsegmented initial rock debris image to obtain a cropped image containing only rock debris;

[0187] Based on the extracted mask contour, the original unsegmented image is cropped, retaining the target area within the contour and removing redundant background to obtain a cropped image containing only rock debris.

[0188] Step 4.3: Statistically analyze the pixel values ​​of each rock debris region in the cropped image containing only rock debris, calculate the brightness value, and use the brightness value as the color feature of the rock debris;

[0189] By statistically analyzing the pixel values ​​of each rock debris region and calculating the average value of the R, G, and B channels (i.e., the brightness value) based on the statistical results, a solution is obtained. ,in These represent the pixel values ​​of the red, green, and blue channels of the image, respectively. Finally, this brightness value is used as the color feature of the rock fragment.

[0190] Step 4.4: Use the quantile partitioning method to divide the color features into different color levels, count the proportion of each color level in each rock debris image, and obtain the color feature vector of each rock debris image with the proportion of color level as the dimension.

[0191] Furthermore, to achieve quantitative analysis of color features, a data-driven quantile partitioning method is used to divide the color features into different color levels. In this example, the color features are divided into five levels, and the partitioning results are as follows: Figure 19 As shown, the specific steps for division are as follows:

[0192] 1) Data collection: The brightness values ​​of all surrounding rock grades of rock debris are summarized as the color characteristic benchmark.

[0193] 2) Quantile Calculation: The 20%, 40%, 60%, and 80% quantiles of the luminance data are calculated using the `np.quantile` function in the NumPy library, and the boundaries of the five levels are formed by combining 0 and 255; combined with... Figure 19 It can be seen that the boundary points of the five levels are 0, 100, 125, 145, 170, and 255. Therefore, the five color level intervals are as follows: color level b1: [0, 100); color level b2: [100, 125); color level b3: [125, 145); color level b4: [145, 170); color level b5: [170, 255].

[0194] Dividing color features into different color levels can adapt to the distribution characteristics of rock slag color, making the level division in the middle brightness range more dense and better distinguishing the color features of different levels of rock slag.

[0195] 3) Grade mapping: Map the brightness value of each rock fragment to the corresponding grade to achieve the discretization of color features.

[0196] To comprehensively characterize the color features in the images, the color feature vector of each color grade of rock debris was constructed by statistically analyzing the proportion of rock debris of each color level in a single real-time acquired rock debris image. The specific steps are as follows:

[0197] 1) Color grade frequency statistics: Count the color grades of all rock debris in a single image and calculate the proportion of the number of rock debris of each color grade to the total number of all rock debris. For example, the proportion of color grade b1 = the number of rock debris with color in the b1 range / the total number of rock debris.

[0198] 2) Feature vector construction: Construct the color feature vector of the rock debris image using the proportion of color level as the dimension (e.g., [color level b1 proportion, color level b2 proportion, ..., color level b5 proportion]);

[0199] Figure 20 This image shows the color feature vector distribution results obtained from color feature analysis of five images of rock debris with different surrounding rock grades. Figure 20 As can be seen from the data, the five-level color feature based on quantiles can effectively distinguish the color distribution of rock debris of different surrounding rock grades, indicating that the color feature contains information about rock mass conditions.

[0200] Step 4.6: Based on the rock slag particle size parameters, profile sharpness coefficient, and color feature vector, obtain the rock slag feature matrix to determine the rock mass conditions.

[0201] By combining rock slag particle size parameters, contour sharpness coefficients, and color feature vectors of different levels, a multi-dimensional rock slag feature matrix can be constructed. The resulting rock slag feature matrix is ​​the final extracted rock slag feature, which is used to more comprehensively express the rock slag image features and facilitates more accurate judgment of rock mass conditions in the future.

[0202] Example 3: This example provides a rock slag feature extraction device, the device comprising:

[0203] The acquisition module is used to acquire rock debris images in real time;

[0204] The segmentation module is used to input the rock slag image into the rock slag segmentation model to obtain the rock slag segmentation result image output by the rock slag segmentation model; the rock slag segmentation model is obtained according to the model training method described in Example 1;

[0205] The geometric feature calculation module extracts the geometric features of the rock debris segmentation result image based on the pixel-physical scale coefficient of the image and the reference object; the geometric features include the actual major axis, actual minor axis, actual perimeter of the contour, and actual area of ​​the rock debris;

[0206] The rock slag particle size parameter calculation module is used to calculate the rock slag particle size parameters based on the geometric features of the rock slag segmentation result image;

[0207] The sharpness coefficient calculation module is used to calculate the contour sharpness coefficient based on the rock slag segmentation result image;

[0208] The color feature extraction module is used to extract the color features of rock slag based on the rock slag segmentation result image, and obtain the rock slag color feature vector;

[0209] The rock slag feature module is used to establish a rock slag feature matrix based on rock slag particle size parameters, contour sharpness coefficient, and rock slag color feature vector.

[0210] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.

[0211] Finally, it should be noted that in this text, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0212] The above provides a detailed description of the model training method, rock slag feature extraction method, and apparatus provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A model training method, characterized in that, The method includes: The rock debris images were acquired and preprocessed to obtain preprocessed rock debris images. Each rock mass in the preprocessed rock debris images was labeled to obtain a rock debris image sample set. The rock slag image sample set is input into the improved segmentation model based on YOLO11n-seg, and the first classification category of the rock slag and the first classification probability corresponding to each first classification category are output. The model parameters of the improved segmentation model based on YOLO11n-seg are adjusted based on the first classification category and the first classification probability until the improved segmentation model based on YOLO11n-seg converges or reaches the maximum number of iterations, thus obtaining the slag segmentation model. The improved segmentation model based on YOLO11n-seg uses the YOLO11n-seg model as its basic framework. By introducing a spatial frequency fusion enhancement module into the backbone network of the YOLO11n-seg model, a multi-scale spatial frequency fusion enhancement module is obtained. The neck network is replaced with a TripleGD-Neck module, and finally, the improved segmentation model based on YOLO11n-seg is obtained. The multi-scale spatial frequency fusion enhancement module includes a separable convolutional layer, three parallel branches, a spatial frequency enhancement sub-module positioned after each parallel branch, and a feature concatenation layer; wherein: Separable convolutional layers are used to extract global contour information from rock debris images; Parallel branches extract multi-scale features of rock debris images from global contour information through convolution kernels of different scales, and compress multi-scale features through average pooling operations. The spatial frequency enhancement submodule is used to enhance the spatial and frequency domain detail texture features in the multi-scale features output by each parallel branch, resulting in multi-scale spatial frequency enhanced features. The feature stitching layer stitches together multi-scale spatial frequency enhancement features through stitching operations to obtain spatial frequency enhancement fusion features; The spatial frequency enhancement submodule segments the input multi-scale features through channel segmentation, and inputs the segmented features into the spatial domain branch and the frequency domain branch respectively. In the spatial domain branch, the low-frequency background and high-frequency edges in the rock debris image are separated by average pooling operation to enhance the clarity of the rock debris boundary and obtain spatial features. At the same time, in the frequency domain branch, FFT transformation combined with low-pass filtering is used to separate low-frequency redundancy and extract high-frequency texture features. Finally, the SimAM attention mechanism is introduced to weightedly fuse the spatial features and high-frequency texture features, and the fused enhanced spatial frequency features are output through convolution. The TripleGD-Neck module is based on the original GD-Neck framework in the YOLO11n-seg model. After adding the Middle-GD branch, it forms a three-branch structure of Low-GD, Middle-GD and High-GD, which are used to extract and fuse small-particle-scale rock debris, medium-particle-scale rock debris and large-particle-scale rock debris, respectively. Each branch structure includes a feature alignment module, a feature information fusion module, and a feature information distribution module with identical structures.

2. A method for extracting features from rock slag, characterized in that, The method includes: Real-time acquisition of rock debris images; The rock slag image is input into the rock slag segmentation model to obtain the rock slag segmentation result image; the rock slag segmentation model is obtained according to the model training method described in claim 1. Based on the pixel-to-physical scale coefficient of the rock debris image and the reference object, the geometric features of the rock debris segmentation result image are extracted; the geometric features include the actual major axis, actual minor axis, actual perimeter of the outline, and actual area of ​​the rock debris. Based on the geometric features of the rock slag segmentation image, calculate the rock slag particle size parameters; Calculate the contour sharpness coefficient based on the rock slag segmentation result image; Based on the rock slag segmentation results image, the rock slag color features are extracted to obtain the rock slag color feature vector; A rock slag feature matrix is ​​established based on the rock slag particle size parameters, the profile sharpness coefficient, and the rock slag color feature vector.

3. The method according to claim 2, characterized in that, The step of calculating the rock slag particle size parameters based on the geometric features of the rock slag segmentation image includes: Based on the actual long axis of the rock slag, the rock slag particles in the segmented image are divided into multiple particle size intervals, and the number of rock slag particles in each particle size interval and the area ratio of each particle size interval are counted. The maximum particle size of rock slag in each particle size range is obtained by taking the maximum value of the actual long axis of all rock slag particles in each particle size range. The actual area of ​​the rock slag particles in each particle size range is arranged in ascending order. Based on the particle size values ​​when the cumulative area ratio is 10%, 30%, and 60%, the first characteristic particle size, the second characteristic particle size, and the third characteristic particle size are obtained respectively. The cumulative area ratio is the area ratio obtained by accumulating the area ratio of each particle size range starting from the smallest particle size range. The non-uniformity coefficient of the rock slag is obtained based on the ratio of the third characteristic particle size to the first characteristic particle size. The first product is obtained based on the first characteristic particle size and the third characteristic particle size. The curvature coefficient of the rock slag is obtained based on the ratio of the square of the second characteristic particle size to the first product. The roughness index of rock slag is determined by accumulating the percentage of the total area of ​​rock slag particles that are greater than the upper limit of each particle size range to the actual area of ​​the entire rock slag region.

4. The method according to claim 3, characterized in that, The calculation of the contour sharpness coefficient based on the rock slag segmentation result image includes: From the rock debris segmentation result image, obtain the first... The binary mask image of the first rock debris is obtained, and the first rock debris is extracted. The closed contour of the rock debris is obtained, and the set of contour pixels is obtained. Adaptive sampling is performed on the contour pixel set to obtain an evenly spaced set of sampling points uniformly distributed on the closed contour; The turning angle at each sampling point is determined based on the forward and backward vectors between each sampling point in the equally spaced sampling point set and the two sampling points adjacent to that sampling point. Based on the classification of turning angle types, the number of different types of edges in the closed contour of each rock slag is counted, and the number of different types of edges is weighted and summed to obtain the weighted sum of edges. The ratio of the weighted sum of edges to the total number of edges is used as the contour sharpness coefficient of each rock slag particle. The overall contour sharpness coefficient of the rock slag segmentation result image is obtained by summing and averaging the contour sharpness coefficients of all rock slag particles.

5. The method according to claim 4, characterized in that, The step of extracting rock slag color features from the rock slag segmentation image to obtain a rock slag color feature vector includes: Obtain the binary mask image of the rock slag segmentation result image, extract the contours of the rock slag particles, and crop the original unsegmented rock slag image based on the contours to obtain the cropped image containing only rock slag. The pixel values ​​of each rock debris region in the cropped image containing only rock debris are statistically analyzed, the brightness value is calculated, and the brightness value is used as the color feature of the rock debris. The color features are divided into different color levels using the quantile partitioning method. The proportion of each color level in each rock debris image is counted. The rock debris color feature vector of each initial rock debris image is constructed with the proportion of color level as the dimension.

6. A rock slag feature extraction device, characterized in that, The device includes: The acquisition module is used to acquire rock debris images in real time; A segmentation module is used to input a rock slag image into a rock slag segmentation model to obtain a rock slag segmentation result image; the rock slag segmentation model is obtained according to the model training method described in claim 1. The geometric feature calculation module extracts the geometric features of the rock debris segmentation result image based on the pixel-physical scale coefficient of the image and the reference object; the geometric features include the actual major axis, actual minor axis, actual perimeter of the contour, and actual area of ​​the rock debris; The rock slag particle size parameter calculation module is used to calculate the rock slag particle size parameters based on the geometric features of the rock slag segmentation result image; The sharpness coefficient calculation module is used to calculate the contour sharpness coefficient based on the rock slag segmentation result image; The color feature extraction module is used to extract the color features of rock slag based on the rock slag segmentation result image, and obtain the rock slag color feature vector; The rock slag feature module is used to establish a rock slag feature matrix based on rock slag particle size parameters, contour sharpness coefficient, and rock slag color feature vector.