Small-sample image segmentation method for underground coal mine small target segmentation
By combining the CBAM-Res2Net, DETR and SAM models, and utilizing multi-scale feature extraction and attention enhancement, the problem of poor segmentation of small targets in coal mines is solved, and efficient and accurate image segmentation is achieved.
Patent Information
- Application Number
- CN202510783129.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-12
- Publication Date
- 2025-09-23
AI Technical Summary
Existing technologies have poor performance in segmenting small targets in low-light and dusty environments underground in coal mines. The multi-scale fusion mechanism is insufficient, and the semantic relationship and contextual information between targets are ignored. Manual prompts are ambiguous and time-consuming and inefficient.
The CBAM-Res2Net network model is combined with the DETR and SAM models to improve image quality through bilateral filtering and contrast-limited adaptive histogram equalization enhancement processing. The CBAM module is used for multi-scale feature extraction and attention enhancement. Sparse hints are generated by combining predicted bounding boxes and image key points to achieve efficient decoding.
It improves the accuracy and efficiency of small target segmentation in coal mines, enhances the robustness of the model in harsh environments, reduces the search space, and improves segmentation accuracy and reliability.
Smart Images

Figure CN120689616A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a few-sample image segmentation method for segmenting small targets in coal mines. Background Art
[0002] Accurate segmentation of small objects on underground coal mine railways is crucial for ensuring safety, improving efficiency, and reducing safety risks in autonomous driving. However, due to the limited datasets related to underground coal mine railways, achieving a balance between efficiency and accuracy in small dataset scenarios presents significant challenges.
[0003] With the continuous advancement of neural network architectures, image-based semantic segmentation techniques have greatly developed, significantly improving the accuracy of pixel-level classification. These advanced methods can accurately assign categories to all elements in an image, significantly improving the accuracy and reliability of image analysis. To effectively capture contextual information, architectures such as U-Net and SegNet integrate features across different layers, from low-level to high-level. The proposed framework enables hierarchical feature integration across all structural components of the neural model, thereby better capturing and utilizing contextual information and further improving segmentation results.
[0004] Few-shot segmentation techniques aim to segment objects in an image using only a small number of labeled samples, which is of great significance in real-world applications. For example, PANet improves few-shot segmentation performance by leveraging support set information in the embedding space to create improved category prototypes. DPCN introduces a dynamic prototype convolutional network, in which convolution kernels are generated from the foreground of the support image and then operate on the query set. This approach captures specific details of objects of interest in the query image, enhancing the ability to extract and understand subtle details.
[0005] Among existing few-shot segmentation methods, the Segment Anything Model (SAM) has attracted widespread attention due to its versatility and ability to handle a variety of segmentation tasks using cues. SAM is a powerful image segmentation tool that generates high-resolution masks of desired objects and adapts to various human cues, including text descriptions, boxes, and points. DETR, on the other hand, utilizes a Transformer architecture to directly model global features, thereby enhancing its ability to capture semantic relationships and contextual information between objects. DETR employs an end-to-end training strategy using an ensemble loss function that precisely aligns accurately predicted bounding boxes with ground-truth annotations through bipartite matching. The model first extracts features using a CNN backbone network, which are then fed into a Transformer-based encoder-decoder. To enable efficient input processing, the decoder generates a low-resolution activation map. The decoder then uses the encoder output and the object query as a cross-attention mechanism. Furthermore, the decoder input also incorporates this low-resolution encoded information.
[0006] However, existing technologies still have some shortcomings in the small target segmentation scenario in coal mines. Existing technologies are based on images acquired in normal lighting environments. For small samples in low-light and dusty environments in coal mines, the segmentation effect is average. Existing few-shot segmentation methods have not fully explored the multi-scale fusion mechanism, and the accuracy of small target segmentation is limited. At the same time, existing few-shot segmentation methods ignore the ability to capture semantic relationships and contextual information between targets, and the accuracy of small target segmentation still needs to be improved. In addition, the existing SAM model relies on manually created prompts, but manual prompts can be ambiguous, resulting in insufficient context understanding and consuming a lot of time. Summary of the Invention
[0007] The present invention aims to solve the problems existing in the above-mentioned prior art and provides a few-sample image segmentation method for small target segmentation in coal mines.
[0008] The technical solutions adopted in the present invention are:
[0009] A few-sample image segmentation method for small target segmentation in coal mines, characterized by comprising the following steps:
[0010] S1: Acquire the downhole small target source image and perform preprocessing to generate the downhole small target image;
[0011] S2: Input the downhole small target image into the image encoder module, encode the image and convert it into an image embedding represented by a vector;
[0012] S3: Generates a one-dimensional learnable vector Mask of length 256. After convolution transformation, the Mask is added one by one to the image embedding generated by the image encoder module to generate the final features extracted from the image encoder module.
[0013] S4: The downhole small target image generated by S1 is input into the CBAM-Res2Net network model to extract features. The downhole small target image is first subjected to convolution and pooling for initial feature extraction, and then sequentially input into four bottleneck structures. Each bottleneck structure constructs a multi-scale residual connection and introduces the CBAM module. After processing each bottleneck structure, the corresponding feature map is obtained;
[0014] S5: Pool and normalize the feature map output by the fourth bottleneck structure in S4 to generate the CBAM-Res2Net network extraction feature map;
[0015] S6: The generated CBAM-Res2Net network extracted feature map is converted into an image sequence through image embedding and position encoding operations to generate a predicted bounding box;
[0016] S7: Use SIFT algorithm to extract image key points from the generated predicted bounding box;
[0017] S8: The predicted bounding box generated by S6 and the image key points extracted by S7 are input into the hint encoder as sparse hints to generate a mask;
[0018] S9: The generated mask information and the final features extracted in S3 are simultaneously input into the mask decoder to achieve efficient decoding and output the segmentation result.
[0019] Furthermore, the pre-processing in S1 includes: bilateral filtering processing and contrast-limited adaptive histogram equalization enhancement processing.
[0020] Furthermore, the contrast-limited adaptive histogram equalization enhancement process includes:
[0021] (1) Divide the source image to be equalized and enhanced into several source image sub-blocks, generate a grayscale histogram for each source image sub-block, and limit the frequency of grayscale levels based on the generated grayscale histogram;
[0022] (2) After frequency limitation, a mirror grayscale mapping process is performed to generate a mapped grayscale histogram;
[0023] (3) Finally, the corresponding contrast-limited sub-blocks are generated based on the mapped grayscale histogram, and any two contrast-limited sub-blocks are merged using linear interpolation.
[0024] Furthermore, the source image to be subjected to equalization enhancement processing is divided into a number of source image sub-blocks, and the size of each source image sub-block is:
[0025]
[0026] Where (b1, b2) is the size of each source image sub-block, (H, W) is the size of the source image to be balanced and enhanced, K is the number of sub-blocks of the source image, and the balanced and enhanced source image is the downhole track source image or the downhole track filtered image generated by bilateral filtering.
[0027] For the source image sub-block T, a grayscale histogram of the source image sub-block T is generated, and the frequency of the i-th grayscale level is restricted based on the generated grayscale histogram. Then, we have:
[0028]
[0029] Among them, DB is the frequency limit threshold, H T (i) is the frequency of the source image sub-block T at the i-th grayscale level, and L is the number of grayscale levels of the source image to be balanced and enhanced;
[0030] After frequency limitation, mirror grayscale mapping is performed:
[0031]
[0032] in, is the grayscale mapping of the i-th grayscale level; is the cumulative distribution function of the i-th gray level;
[0033] After the mirror grayscale mapping process, a mapped grayscale histogram is generated based on the grayscale mapping information, and a corresponding contrast-limited sub-block is generated based on the mapped grayscale histogram;
[0034] Any two contrast-limited sub-blocks are merged using linear interpolation to generate an underground small target image.
[0035] Furthermore, the image encoder module is a Vision Transformer basic encoder.
[0036] Furthermore, the CBAM-Res2Net network model includes four bottleneck structures: first, second, third and fourth, each bottleneck structure includes multiple branches, each branch includes a convolutional layer and a CBAM module, and the CBAM module is used to enhance channel and spatial attention of features.
[0037] Furthermore, the processing process of the CBAM-Res2Net network model is as follows:
[0038] (1) Input the downhole small target image into the initial feature extraction part to perform preliminary feature extraction;
[0039] (2) The feature map generated by the initial feature extraction part is input into the first bottleneck structure, processed by the convolution and CBAM modules, and the first bottleneck structure feature map is output;
[0040] (3) The first bottleneck structure feature map is input into the second bottleneck structure, processed by the convolution and CBAM modules, and the second bottleneck structure feature map is output;
[0041] (4) The second bottleneck structure feature map is input into the third bottleneck structure, processed by the convolution and CBAM modules, and the third bottleneck structure feature map is output;
[0042] (5) Input the third bottleneck structure feature map into the fourth bottleneck structure, process it through convolution and CBAM modules, and output the fourth bottleneck structure feature map;
[0043] (6) The fourth bottleneck structure feature map is input into the average pooling layer for pooling, and finally normalized using the Softmax function to generate the CBAM-Res2Net network extraction feature map;
[0044] Furthermore, S6 specifically includes:
[0045] Perform image embedding operations on the feature maps extracted by the CBAM-Res2Net network and convert them into low-dimensional vector representations;
[0046] Perform position encoding on the converted vectors to add position information to each vector;
[0047] The vector sequence with position information is input into the Transformer model to generate the predicted bounding box.
[0048] Furthermore, S7 specifically includes:
[0049] Use Gaussian functions to construct scale-space representations of images;
[0050] Key points are identified by finding local maxima and minima of the Difference of Gaussian function, where the Difference of Gaussian function is defined as:
[0051] D(x,y,σ)=(G(x,y,kσ)-G(x,y,σ))×I(x,y)
[0052] Where I(x, y) is the input image; σ represents the scale, which is set to 5; k is a constant multiplication factor, which is set to 10.
[0053] Furthermore, S8 is specifically as follows: the predicted bounding box and the image key points are sent as input prompts to the prompt encoder; the prompt encoder distinguishes the background and foreground labels according to the important elements of the input prompt, and generates a mask for segmentation according to the distinguished label information.
[0054] Furthermore, S9 specifically includes: taking the mask information generated by the prompt encoder and the features extracted by the image encoder as input and sending them to the mask decoder; the mask decoder uses two cross-attention mechanisms and one self-attention mechanism to decode the input mask information and the final features; updating the label embedding through the multi-layer perceptron to achieve efficient decoding, and finally outputting the segmentation result.
[0055] The present invention has the following beneficial effects:
[0056] (1) This paper can effectively capture the multi-scale features of small targets in coal mines and use the attention mechanism to highlight key areas, thereby improving segmentation accuracy. The CBAM module performs channel and spatial attention enhancement on features, enabling the model to focus on the key parts of the target, thereby improving segmentation accuracy.
[0057] (2) Through bilateral filtering and contrast-limited adaptive histogram equalization enhancement processing, the image quality is improved and the robustness of the model in harsh environments is enhanced.
[0058] (3) The global feature modeling of the DETR model and the flexible segmentation capability of the SAM model are combined. The bounding box information provided by the DETR model is used to reduce the search space of the SAM model, thus achieving efficient object segmentation. This combination fully utilizes the advantages of both models and improves segmentation efficiency and accuracy.
[0059] (4) The CBAM-Res2Net network model extracts features layer by layer through multiple bottleneck structures and introduces the CBAM module in each structure for feature enhancement, ensuring the comprehensiveness of feature extraction and detail retention, thereby improving the reliability of the segmentation results. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 This is the network model diagram of the present invention.
[0061] Figure 2 This is the CBAM-Res2Net network model diagram. DETAILED DESCRIPTION
[0062] The present invention will be further described below with reference to the accompanying drawings.
[0063] like Figure 1, the present invention aims at the problem of low accuracy of small target segmentation in the few-sample dataset scenario in coal mines. The present invention proposes a few-sample image segmentation method for small target segmentation in coal mines based on the MGS-DETR model. The DETR model and the SAM model are combined using a residual branch structure and a multi-scale fusion strategy to enhance the few-sample segmentation task. By providing a specific bounding box from DETR, the search space of the SAM model is reduced. The two algorithms used to generate points and bounding boxes at the same time anchor the segmentation network and focus on the area of interest, thereby speeding up the generation of high-quality segmentation output. The MGS-DETR network model is as follows Figure 1 As shown, the following steps are included:
[0064] 1) Image preprocessing: The acquired downhole small target source image is subjected to bilateral filtering and contrast-limited adaptive histogram equalization enhancement processing.
[0065] 2) Feature extraction: Use the Vision Transformer basic encoder and CBAM-Res2Net network model to extract image features.
[0066] 3) Feature fusion and decoding: Combining the DETR model and the SAM model, sparse hints are generated by predicting bounding boxes and image key points, and efficient decoding is achieved using the hint encoder and mask decoder.
[0067] Each step is described in detail below.
[0068] Image preprocessing stage:
[0069] 1.1 Acquire the image of the small target source underground.
[0070] Images containing small targets are collected from underground coal mine environments. These images may be affected by low light and dust, resulting in unclear target objects and low contrast.
[0071] 1.2 Preprocessing operations.
[0072] The acquired downhole small target source image is preprocessed to generate a downhole small target image after preprocessing, wherein the preprocessing of the downhole small target source image includes bilateral filtering and contrast-limited adaptive histogram equalization enhancement processing. The contrast-limited adaptive histogram equalization enhancement processing includes:
[0073] Obtain a source image to be balanced and enhanced, and divide the source image to be balanced and enhanced into a plurality of source image sub-blocks. For any source image sub-block, the following is true:
[0074]
[0075] Wherein, (b1, b2) is the size of each source image sub-block, (H, W) is the size of the source image to be balanced and enhanced, K is the number of sub-blocks of the source image, and the balanced and enhanced source image is the downhole track source image or the downhole track filtered image generated by bilateral filtering.
[0076] Contrast limiting processing is performed on each source image sub-block. The contrast limiting processing includes: generating a grayscale histogram of the source image sub-block T, and limiting the frequency of the i-th grayscale level based on the generated grayscale histogram. Then,
[0077]
[0078] Among them, DB is the frequency limit threshold, H T (i) is the frequency of the source image sub-block T at the i-th grayscale level, and L is the number of grayscale levels of the source image to be balanced and enhanced;
[0079] After frequency limitation, the mirror grayscale mapping process is performed, and then:
[0080]
[0081] in, is the grayscale mapping of the i-th grayscale level; is the cumulative distribution function of the i-th gray level.
[0082] After the mirror grayscale mapping process, a mapped grayscale histogram is generated based on the grayscale mapping information, and the corresponding contrast-limited sub-block is generated based on the mapped grayscale histogram. Any two contrast-limited sub-blocks are merged using linear interpolation to generate an underground small target image after merging.
[0083] Feature extraction stage
[0084] 2.1 Image coding and feature extraction.
[0085] Image encoding: The generated downhole small target image is input into the image encoder module, which is the Vision Transformer basic encoder. The Vision Transformer divides the image into multiple fixed-size patches and maps each patch to a low-dimensional vector. The specific steps are as follows:
[0086] (1) Divide the image into patches of size 16×16.
[0087] (2) Each patch is mapped to a D-dimensional vector through a linear transformation.
[0088] (3) Add position embedding to preserve spatial information.
[0089] (4) Extract features through a multi-layer Transformer encoder.
[0090] Generate Mask Vector: This process encodes the image and converts the image data into a continuous, low-dimensional 256*64*64 vector representation, namely the image embedding, so as to extract all the features required for the subsequent part. Mask is a one-dimensional learnable vector of length 256. After the following convolution transformation, the mask is added one by one with the image embedding generated by the image encoder module to generate the final features extracted from the image encoder module:
[0091] (1) The mask vector first enters a 2×2×4 convolutional layer.
[0092] (2) Then enter a 2×2×16 convolutional layer.
[0093] (3) Finally, it enters a 1×1×256 convolutional layer and becomes a 256×64×64 vector representation.
[0094] (4) The converted mask and the image embedding generated by the basic encoder are added one by one through the adder to generate the final features extracted from the encoder.
[0095] 2.2CBAM-Res2Net network model processing
[0096] Initial feature extraction: The downhole small target image generated in the first step is input into the CBAM-Res2Net network to extract features. The model is as follows Figure 2 As shown in the figure, the image is first convolved with 64 7*7 convolution kernels with a step size of 2, and the generated feature map is input into a 3*3 maximum pooling layer with a step size of 2 for initial feature extraction. The mathematical expression of the convolution operation is:
[0097] F=σ(W*I+b)
[0098] Where F represents the feature map after the convolution operation, W represents the convolution kernel, I represents the input image, b represents the bias term, and σ represents the activation function (usually ReLU). The generated feature map is then input into a 3×3 maximum pooling layer with a stride of 2 for initial feature extraction.
[0099] Bottleneck structure processing:
[0100] like Figure 2The first bottleneck structure (stage 1): This structure builds multi-scale residual connections in the traditional ResNet, replacing the traditional single 3*3. At the same time, it introduces the CBAM (Convolutional Block Attention Module) module to improve the model's utilization of multi-scale feature information, thereby capturing multi-scale features with higher granularity and demonstrating better generalization ability. The specific processing process is as follows:
[0101] (11) 1×1 convolution: The feature map generated by the initial feature extraction is evenly divided into 4 feature map subsets after 64 1×1 convolutions. Each feature subset has the same spatial size.
[0102] (12) Multi-scale residual connection and CBAM module: Except for the first feature subset, each feature subset undergoes 64 3×3 convolutions. At the same time, the CBAM module is introduced to enhance the channel and spatial attention of the features. The processing process of the CBAM module is as follows:
[0103] (13) Channel attention: By modeling the inter-channel relationship of the feature map, important channel features are highlighted. The specific operations include global average pooling and global maximum pooling, which compress the feature map into two different feature representations. Then, they are processed by a shared multi-layer perceptron (MLP). Finally, the results are added and the channel attention weights are obtained through the activation function.
[0104] (14) Spatial attention: Focus on the importance of different positions in the feature map and enhance the features of key areas. The specific operation is to obtain a spatial attention map by convolution operation on the feature map after channel attention processing, emphasizing the important spatial areas in the feature map.
[0105] (15) Feature fusion: 3*3 convolution is recorded as K i (), use Y i K i The output of (), this process can be expressed as:
[0106]
[0107] Among them, X i represents the i-th feature subset, CBAM(X i ) indicates that X i The result after applying the CBAM module.
[0108] (16) Feature concatenation and convolution: In order to better integrate information of different scales, the model will connect all output Y i The concatenation is performed, and finally convolution is performed through 256 1*1 convolution kernels to obtain the first bottleneck structure feature map.
[0109] The second bottleneck structure (stage2):
[0110] (21) 1×1 convolution: The first bottleneck structure feature map is evenly divided into 4 feature map subsets after 128 1×1 convolutions.
[0111] (22) Multi-scale residual connection and CBAM module: Except for the first feature subset, each feature subset undergoes 128 3×3 convolutions, and the CBAM module is introduced for channel and spatial attention enhancement.
[0112] (23) Feature concatenation and convolution: Connect all outputs Y i The concatenation is performed, and finally convolution is performed through 512 1×1 convolution kernels to obtain the second bottleneck structure feature map.
[0113] The third bottleneck structure (stage3):
[0114] (21) 1×1 convolution: The second bottleneck structure feature map is evenly divided into 4 feature map subsets after 256 1×1 convolutions.
[0115] (22) Multi-scale residual connection and CBAM module: Except for the first feature subset, each feature subset undergoes 256 3×3 convolutions, and the CBAM module is introduced for channel and spatial attention enhancement.
[0116] (23) Feature concatenation and convolution: Connect all outputs Y i The three layers are concatenated and finally convolved with 1024 1×1 convolution kernels to obtain the third bottleneck structure feature map.
[0117] The fourth bottleneck structure (stage4):
[0118] (21) 1×1 convolution: The third bottleneck structure feature map is evenly divided into 4 feature map subsets after 512 1×1 convolutions.
[0119] (22) Multi-scale residual connection and CBAM module: Except for the first feature subset, each feature subset undergoes 512 3×3 convolutions, and the CBAM module is introduced for channel and spatial attention enhancement.
[0120] (23) Feature concatenation and convolution: Connect all outputs Y i The four bottleneck structure feature maps are obtained by concatenating them and finally convolving them with 2048 1×1 convolution kernels.
[0121] 2.3 Feature map pooling and normalization:
[0122] Pooling operation: The fourth bottleneck structure feature map is input into the average pooling layer for pooling operation to reduce the size of the feature map and extract global features.
[0123] Normalization: Finally, the Softmax function is used for normalization to generate the CBAM-Res2Net network extraction feature map.
[0124] Feature fusion and decoding
[0125] 3.1 Prediction Bounding Box Generation.
[0126] Image embedding and position encoding: The CBAM-Res2Net network extracts feature maps for image embedding, converting them into low-dimensional vector representations. Position encoding is performed on the converted vectors to add position information to each vector.
[0127] Transformer model processing: The vector sequence with position information is input into the Transformer model to generate the predicted bounding box. The encoder-decoder structure of the Transformer model is used to capture the global dependencies between features and generate the final predicted bounding box.
[0128] 3.2 Image key point extraction.
[0129] SIFT algorithm: The SIFT algorithm is used to extract image key points from the generated predicted bounding box to achieve robust matching across scales and directions. The SIFT algorithm first uses the Gaussian function G(x, y, σ) to construct a scale space representation of the image, and then identifies key points by finding the local maximum and minimum values of the Gaussian difference function D(x, y, σ), which is defined as:
[0130] D(x,y,σ)=(G(x,y,ko)-G(x,y,σ))×I(x,y)
[0131] Where I(x, y) is the input image; σ represents the scale, which is set to 5; k is a constant multiplication factor, which is set to 10.
[0132] 3.3 Sparse Hint Generation and Mask Decoding
[0133] Sparse Cue Generation: The predicted bounding box and image keypoints are fed into the Cue Encoder as sparse cues to generate a mask. The Cue Encoder distinguishes the background and foreground labels based on the important elements of the input cues and generates a mask for segmentation.
[0134] Mask decoding: The mask information and the final features are simultaneously input into the mask decoder to achieve efficient decoding and output the segmentation result. The processing process of the mask decoder is as follows:
[0135] Cross-attention mechanism: Two cross-attention mechanisms are used to enable the mask decoder to focus on key areas in the input features and mask information.
[0136] Self-attention mechanism: The mask information is updated through the self-attention mechanism to enhance the model's ability to focus on the target object.
[0137] Multi-layer perceptron: Updates the tag embedding through a multi-layer perceptron to achieve efficient decoding and finally output the segmentation result.
[0138] This paper combines the advantages of the DETR and SAM models and introduces the CBAM-Res2Net network model to effectively improve the accuracy and efficiency of small target segmentation in coal mines. The method shows good generalization and robustness when processing small sample datasets and is applicable to various scenarios in coal mines.
[0139] The above description is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements can be made without departing from the principles of the present invention. These improvements should also be regarded as the scope of protection of the present invention.
Claims
1. A few-sample image segmentation method for small target segmentation in coal mines, characterized by: The following steps are involved: S1: Acquire the downhole small target source image and perform preprocessing to generate the downhole small target image; S2: Input the downhole small target image into the image encoder module, encode the image and convert it into an image embedding represented by a vector; S3: Generates a one-dimensional learnable vector Mask of length 256. After convolution transformation, the Mask is added one by one to the image embedding generated by the image encoder module to generate the final features extracted from the image encoder module. S4: The downhole small target image generated by S1 is input into the CBAM-Res2Net network model to extract features. The downhole small target image is first subjected to convolution and pooling for initial feature extraction, and then sequentially input into four bottleneck structures. Each bottleneck structure constructs a multi-scale residual connection and introduces the CBAM module. After processing each bottleneck structure, the corresponding feature map is obtained; S5: Pool and normalize the feature map output by the fourth bottleneck structure in S4 to generate the CBAM-Res2Net network extraction feature map; S6: The generated CBAM-Res2Net network extracted feature map is converted into an image sequence through image embedding and position encoding operations to generate a predicted bounding box; S7: Use SIFT algorithm to extract image key points from the generated predicted bounding box; S8: The predicted bounding box generated by S6 and the image key points extracted by S7 are input into the hint encoder as sparse hints to generate a mask; S9: The generated mask information and the final features extracted in S3 are simultaneously input into the mask decoder to achieve efficient decoding and output the segmentation result.
2. The few-sample image segmentation method for small target segmentation in coal mines according to claim 1, characterized in that: The preprocessing in S1 includes: bilateral filtering and contrast-limited adaptive histogram equalization enhancement processing.
3. The few-sample image segmentation method for small target segmentation in coal mines according to claim 2, characterized in that: The contrast limiting adaptive histogram equalization enhancement process includes: (1) Divide the source image to be equalized and enhanced into several source image sub-blocks, generate a grayscale histogram for each source image sub-block, and limit the frequency of grayscale levels based on the generated grayscale histogram; (2) After frequency limitation, a mirror grayscale mapping process is performed to generate a mapped grayscale histogram; (3) Finally, the corresponding contrast-limited sub-blocks are generated based on the mapped grayscale histogram, and any two contrast-limited sub-blocks are merged using linear interpolation.
4. The few-sample image segmentation method for small target segmentation in coal mines according to claim 3, characterized in that: The source image to be processed by equalization enhancement is divided into several source image sub-blocks. The size of each source image sub-block is: Where (b1, b2) is the size of each source image sub-block, (H, W) is the size of the source image to be balanced and enhanced, K is the number of sub-blocks of the source image, and the balanced and enhanced source image is the downhole track source image or the downhole track filtered image generated by bilateral filtering. For the source image sub-block T, a grayscale histogram of the source image sub-block T is generated, and the frequency of the i-th grayscale level is restricted based on the generated grayscale histogram. Then, we have: Among them, DB is the frequency limit threshold, H T (i) is the frequency of the source image sub-block T at the i-th grayscale level, and L is the number of grayscale levels of the source image to be balanced and enhanced; After frequency limitation, mirror grayscale mapping is performed: in, is the grayscale mapping of the i-th grayscale level; is the cumulative distribution function of the i-th gray level; After the mirror grayscale mapping process, a mapped grayscale histogram is generated based on the grayscale mapping information, and a corresponding contrast-limited sub-block is generated based on the mapped grayscale histogram; Any two contrast-limited sub-blocks are merged using linear interpolation to generate an underground small target image.
5. The few-sample image segmentation method for small target segmentation in coal mines according to claim 1, characterized in that: The image encoder module is the Vision Transformer basic encoder.
6. The few-sample image segmentation method for small target segmentation in coal mines according to claim 1, characterized in that: The CBAM-Res2Net network model includes four bottleneck structures: the first, second, third and fourth bottleneck structures, each of which includes multiple branches, each branch includes a convolutional layer and a CBAM module, and the CBAM module is used to enhance channel and spatial attention of features.
7. The few-sample image segmentation method for small target segmentation in coal mines according to claim 6, characterized in that: The processing process of the CBAM-Res2Net network model is as follows: (1) Input the downhole small target image into the initial feature extraction part to perform preliminary feature extraction; (2) The feature map generated by the initial feature extraction part is input into the first bottleneck structure, processed by the convolution and CBAM modules, and the first bottleneck structure feature map is output; (3) The first bottleneck structure feature map is input into the second bottleneck structure, processed by the convolution and CBAM modules, and the second bottleneck structure feature map is output; (4) The second bottleneck structure feature map is input into the third bottleneck structure, processed by the convolution and CBAM modules, and the third bottleneck structure feature map is output; (5) Input the third bottleneck structure feature map into the fourth bottleneck structure, process it through convolution and CBAM modules, and output the fourth bottleneck structure feature map; (6) The fourth bottleneck structure feature map is input into the average pooling layer for pooling, and finally normalized using the Softmax function to generate the CBAM-Res2Net network extraction feature map.
8. The few-sample image segmentation method for small target segmentation in coal mines according to claim 1, characterized in that: S6 specifically includes: Perform image embedding operations on the feature maps extracted by the CBAM-Res2Net network and convert them into low-dimensional vector representations; Perform position encoding on the converted vectors to add position information to each vector; The vector sequence with position information is input into the Transformer model to generate the predicted bounding box.
9. The few-sample image segmentation method for small target segmentation in coal mines according to claim 1, wherein: S7 specifically includes: Use Gaussian functions to construct scale-space representations of images; Key points are identified by finding local maxima and minima of the Difference of Gaussian function, where the Difference of Gaussian function is defined as: D(x,y,σ)=(G(x,y,kσ)-G(x,y,σ))×I(x,y) Where I(x,y) is the input image; σ represents the scale, which is set to 5; k is a constant multiplication factor, which is set to 10.
Citation Information
Cited By
Coal mine image segmentation model and method based on VMama and multi-expert hybrid network and construction method thereof
CN121639706A