A coal rock fracture image recognition method based on deep learning and post-processing
By combining deep learning and post-processing methods, and utilizing prior information on fracture width for adaptive threshold binarization and probability gradient field guidance, the problem of high-precision fracture identification in complex coal and rock backgrounds is solved, and efficient extraction and quantitative analysis of fracture geometric parameters are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- LIAONING TECHNICAL UNIVERSITY
- Filing Date
- 2026-01-27
- Publication Date
- 2026-05-29
AI Technical Summary
Existing technologies struggle to achieve high-precision and high-continuity identification of coal and rock fractures in complex coal and rock contexts. Furthermore, the accuracy and reliability of fracture geometric parameter extraction are insufficient. In particular, the output of deep learning models often contains noise and fractures, and the post-processing stage cannot effectively utilize high-dimensional features and confidence information.
By combining deep learning and post-processing methods, an initial segmentation probability map containing prior information about crack width is output through a pre-trained deep learning model. Adaptive threshold binarization, probability-area dual-criterion noise filtering, and probability gradient field-guided fracture repair are then performed to generate a repair region with variable width.
It significantly improves the accuracy and robustness of crack identification, with an F1 score of over 92.5%, and the measurement error of key geometric parameters is controlled within 5%. The physical authenticity and reliability of the quantification results are enhanced, and a perception-optimization intelligent closed-loop system is constructed.
Abstract
Description
Technical Field
[0001] This invention relates to the field of coal and rock fracture image recognition technology, specifically a coal and rock fracture image recognition method based on deep learning and post-processing. Background Technology
[0002] Accurate identification and quantification of fractures in coal and rock masses are crucial for mine safety and engineering geological analysis. Existing technologies mainly fall into two categories: one is based on traditional image processing methods, relying on edge detection and morphological operations. These methods have poor adaptability to complex coal and rock backgrounds, weak ability to handle discontinuous fractures, and are easily affected by noise. The other is based on deep learning semantic segmentation methods. Although these methods improve feature learning capabilities, their outputs often contain noise and breaks, and are usually disconnected from post-processing steps. Subsequent optimization processes (such as denoising and concatenation) are mostly independent and general steps, failing to effectively utilize the high-dimensional features and confidence information obtained during model training, resulting in insufficient accuracy and reliability in extracting fracture geometric parameters.
[0003] Existing solutions have failed to effectively build a framework for deep collaboration between front-end intelligent perception and back-end rule optimization, making it difficult to achieve high-precision, high-continuity identification and high-fidelity quantitative analysis of cracks in complex scenarios. Summary of the Invention
[0004] To solve the above technical problems, the present invention provides the following technical solution: a coal and rock fracture image recognition method based on deep learning and post-processing, comprising the following steps:
[0005] S1: Obtain the original coal and rock fracture image and preprocess it to obtain the standard input image;
[0006] S2: Input the standard input image into a pre-trained deep learning model dedicated to semantic segmentation of coal and rock fractures. The model is configured to output an initial segmentation probability map containing prior information about fracture width, where the probability value not only represents the confidence that a pixel belongs to a fracture, but is also positively correlated with the predicted local width of the fracture.
[0007] S3: Based on the probability distribution and crack width prior information in the initial segmentation probability map, perform a post-processing optimization process adapted to the model output characteristics. This process includes:
[0008] S31: Based on the probability value range and spatial gradient of each region of the probability map, adaptively determine the local binarization threshold and generate an initial binary map;
[0009] S32: For the initial binary graph, based on the area of its connected components and the average probability value of the corresponding region in the probability graph, dynamically determine whether the connected component is a valid crack or noise, and filter out the connected components that are determined to be noise.
[0010] S33: For the noise-filtered binary image, use the continuity of high probability value regions in the probability image as a guide to perform fracture repair based on morphological connectivity.
[0011] S4: Based on the post-processed optimized binary fracture segmentation image, perform quantitative analysis of fracture geometric parameters.
[0012] Preferably, the deep learning model in step S2 is trained using at least one of the following methods so that its output includes prior information about the crack width:
[0013] A regression constraint term is introduced into the loss function to determine the relationship between the predicted probability value of the crack pixel and its actual width.
[0014] Using a multi-task learning framework, one branch outputs the crack category probability, and the other branch outputs a pixel-level width estimate. The width information is then fused into the probability map after training.
[0015] Preferably, in step S32, the rule for dynamic judgment is: for a connected region, if its area is less than the first threshold and the average probability value of its corresponding region in the probability graph is lower than the second threshold, then it is judged as noise; otherwise, it is judged as a valid crack.
[0016] Preferably, in step S33, the fracture repair based on morphological connectivity specifically includes the following steps:
[0017] Fracture analysis and sampling point generation: Identify the fracture endpoints P1 and P2; uniformly sample N intermediate points {S_i|i=1...N} on the line L connecting P1 and P2;
[0018] Path offset guided by probability field: For each sampling point S_i, calculate its probability gradient vector in the initial segmentation probability map; according to the gradient vector, offset S_i along the gradient direction (i.e. towards the higher probability region) by a distance that is inversely proportional to the probability value at point S_i (the higher the probability, the more reliable the position, and the smaller the offset), to obtain the offset point S_i';
[0019] Generate a smooth repair centerline: Use spline curve fitting to fit all offset points {S_i'} and endpoints P1 and P2 to generate a smooth repair centerline C;
[0020] Repair area generation: Along the repair centerline C, based on the prior information of the crack width corresponding to each point on the line, anisotropic expansion is performed to generate a repair area that finally matches the crack width, and then merges it into the binary segmentation map.
[0021] Preferably, the deep learning model in step S2 is an encoder-decoder structure, wherein the encoder uses ResNet or EfficientNet pre-trained on ImageNet as the backbone network, and the decoder integrates an attention mechanism to enhance the ability to capture linear gap features.
[0022] Preferably, the preprocessing in step S1 includes using homomorphic filtering or the CLAHE algorithm to enhance the contrast between the crack and the background, and normalizing the image.
[0023] It has the following beneficial effects:
[0024] Combining a deep learning model capable of outputting prior information about crack width with a deep collaborative post-processing workflow yielded significant beneficial results. Through adaptive threshold binarization, probability-area dual-criterion noise filtering, and fracture repair guided by probability gradient fields, the challenges of complex background interference and crack discontinuity were effectively overcome. On the public test set, the F1 score reached over 92.5%, significantly improving recognition accuracy and robustness. By utilizing width priors to generate repair regions with variable widths, the extraction of key geometric parameters such as crack length, width, and density became closer to physical reality, with measurement errors controlled within 5%. The physical authenticity and reliability of the quantification results were enhanced, constructing an intelligent closed-loop system of "perception-optimization." The adaptive decision-making throughout the process reduced reliance on manual parameters, and the final output was a comprehensive quantitative analysis report that could directly serve engineering safety assessments, achieving a good balance between efficiency and accuracy. Detailed Implementation
[0025] The technical solutions in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0026] In a first embodiment, the present invention provides a technical solution: a coal and rock fracture image recognition method based on deep learning and post-processing, as follows:
[0027] Phase 1: Image preprocessing;
[0028] Step S101: Image acquisition and input; acquire raw coal and rock mass surface images in the mine or laboratory using a digital camera, mining camera or scanning equipment. The images can be RGB color images or grayscale images.
[0029] Step S102: Image Enhancement and Normalization; To improve the sensitivity of subsequent segmentation, the original image is enhanced. In a preferred embodiment, the Limit Contrast Adaptive Histogram Equalization (CLAHE) algorithm is used. Specifically, the image is divided into several small regions (such as 8x8 tiles), histogram equalization is performed on each region, and bilinear interpolation is used to eliminate block boundary artifacts. At the same time, the contrast magnification factor is limited to avoid excessive noise magnification. This step can effectively enhance the micro-contrast between the cracks and the coal and rock background. Subsequently, the enhanced image is normalized in size (such as scaling to 512x512 pixels) and pixel value normalized (such as linearly transforming the pixel value from [0,255] to [0,1]) to form the standard input image I_std.
[0030] Phase Two: Intelligent Segmentation Model and Training;
[0031] This invention uses a semantic segmentation model F_θ (with parameter θ) with an encoder-decoder structure, which is specifically trained to output a gap probability map P_map containing width priors;
[0032] 1. Model Architecture: Encoder: A ResNet-50 pre-trained on ImageNet is used as the backbone network, with its last fully connected layer removed. Its deep feature extraction capabilities are utilized to capture multi-scale contextual information of the image;
[0033] Attention Module: Between the encoder and decoder, a Convolutional Block Attention Module (CBAM) is introduced, which combines spatial attention and channel attention in parallel. This module allows the model to focus more on linear crack features and suppress irrelevant background texture noise.
[0034] Decoder: Employing a symmetric structure similar to U-Net, it gradually recovers spatial details through upsampling and skip connections, ultimately outputting a single-channel probability map P_map of the same size as the input image. The value p(x,y)∈[0,1] of each pixel not only represents the probability that the point belongs to a crack, but is also trained to be positively correlated with the physical width w(x,y) of the crack.
[0035] 2. Model Training: The key to training lies in constructing a suitable loss function L_total to simultaneously optimize segmentation accuracy and width prior.
[0036] Dataset: A dataset of coal and rock fracture images with fine manual annotation. The annotations include two types: (1) pixel-level binary label map Y_seg (fracture is 1, background is 0), and (2) pixel-level width label map Y_width (width is 0 for non-fracture pixels) based on subpixel measurement or estimation.
[0037] Loss function:
[0038] L_total=α*L_seg+β*L_width
[0039] L_seg is the segmentation loss, which uses a weighted sum of BinaryCross-EntropyLoss and DiceLoss to address the class imbalance between the crack and the background and optimize the overlapping region.
[0040] L_seg=BCE(P_map,Y_seg)+λ*(1-Dice(P_map,Y_seg))
[0041] L_width is the width regression loss, which is the core of achieving "width prior". We designed a probability-width consistency loss. For the set of pixels Ω that belong to the crack in the label, we calculate the negative correlation loss (such as mean square error) between its predicted probability value and the true width value, which encourages the model to predict higher probability values for wider crack regions.
[0042] L_width=MSE(p_i*scale,w_i),foriinΩ
[0043] Where scale is a scaling factor used to map probability values to a numerical range similar to the width;
[0044] α, β, λ are hyperparameters, which were set to 1.0, 0.5, and 1.0 respectively in the experiment;
[0045] Training details: The Adam optimizer was used, with an initial learning rate of 1e-4. The cosine annealing learning rate scheduling strategy was adopted. During training, data augmentation techniques such as random rotation, flipping, and brightness jitter were applied to improve the model's generalization ability.
[0046] After training, model F_θ, for input I_std, can output an ideal initial segmentation probability map:
[0047] P_map=F_θ(I_std);
[0048] Phase 3: Collaborative post-processing optimization;
[0049] This stage is the essence of the invention. The post-processing algorithm is not general, but is specially designed to "understand" and utilize the unique information in P_map (high confidence region, width prior, gradient direction).
[0050] Step S301: Adaptive threshold binarization; Instead of using a global fixed threshold, an adaptive threshold T_adaptive(x,y) is calculated based on the local statistical characteristics of P_map. For example, the local Gaussian weighted average method is used: for each pixel, within a window centered on it (such as 15x15), calculate the weighted average and standard deviation of the probability values, and the threshold is set to the average - k * standard deviation (k is a constant, such as 0.5). In this way, the threshold is higher in the region where the probability distribution is smooth, which can suppress low-confidence noise; in the edge region where the probability changes drastically, the threshold is lower, which is beneficial to retaining weak fracture information. Apply this threshold to obtain the initial binary map B_init;
[0051] Step S302: Noise filtering based on probability-area double criteria; Perform connected component analysis on B_init to label all independent connected regions {R_j}. For each connected region R_j, calculate two features:
[0052] Its pixel area Area_j;
[0053] The average probability value MeanProb_j at the corresponding position in the original probability map P_map; Set an area threshold T_area (such as 20 pixels) and a probability threshold T_prob (such as 0.3). The filtering logic is: if Area_j < T_area and MeanProb_j < T_prob, then determine R_j as a small-area noise with low confidence and delete it; otherwise, retain it as an effective fracture region. This double-criteria strategy is more reliable than simply relying on area, can effectively retain small fracture segments with high confidence, and at the same time eliminate artifacts that seem continuous but have extremely low confidence. After filtering, obtain the intermediate binary map B_mid;
[0054] Step S303: Fracture repair guided by probability gradient field; This is the key step to solve the problem of discontinuous fractures. The specific process is as follows:
[0055] Fracture endpoint detection: Perform skeletonization and refinement on B_mid to obtain a single-pixel-wide fracture skeleton map B_skeleton. Search for all endpoints (pixels with only one adjacent pixel) on B_skeleton and record them as the endpoint set {E_k};
[0056] Fracture pair matching: For each endpoint E_a, within a certain Euclidean distance d_max (such as 30 pixels) and angle constraint, find another endpoint E_b such that (E_a, E_b) forms a potential fracture pair. When matching, the continuity of the line direction between the two points and the direction of their respective skeleton ends can be considered;
[0057] Probability gradient field-guided path search:
[0058] a. Constructing probabilistic terrain: Treating the probabilistic map P_map as a two-dimensional scalar field (terrain), calculate its gradient field:
[0059]
[0060] The gradient direction points in the direction of the fastest increase in probability, which is the direction of the "ridge" of the crack;
[0061] b. Path initialization and sampling: For the matched break pair (E_a, E_b), take its straight line connection L_ab as the initial path, and uniformly sample N points (e.g., N=10) on L_ab, denoted as {S_i}.
[0062] c. Path point offset: For each sampling point S_i, find its gradient vector G(S_i) in P_map, and offset S_i along the direction of G(S_i) by a distance δ_i. The design principle of δ_i is: the lower the original probability value p(S_i) at S_i, the farther it may deviate from the actual fracture "ridge", and the larger the offset distance should be; conversely, the larger the original probability value p(S_i), the smaller the offset distance should be. One implementation is:
[0063] δ_i=η*(1-p(S_i))*unit(G(S_i))
[0064] Where η is the maximum offset coefficient (e.g., 5 pixels), and unit() represents normalization, resulting in the offset point set {S_i'}.
[0065] d. Path fitting and generation: Using E_a, {S_i'}, and E_b as control points, a cubic B-spline curve is used for fitting to generate a smooth repair path C_ab. This path is "pulled" towards the high confidence region by the probability gradient field, and is therefore more likely to follow the true crack trajectory that is interrupted by noise or ambiguity.
[0066] Repair Region Generation: The path C_ab is a single-pixel wide line. To generate a repair region with a reasonable width, we need to utilize width priors and sample multiple points along the path C_ab. For each point, based on its position in P_map, we obtain the predicted width value w_est at that point through interpolation (which can be obtained through a mapping function related to probability values, for example:
[0067] w_est=base_width*p(x,y))
[0068] Then, with C_ab as the center line, perform isotropic morphological dilation, and set the dilation radius to w_est / 2 at each point on the path, thus generating a width-varying repair patch Patch_ab.
[0069] Repair and merge: Merge the repair patch Patch_ab into the intermediate binary image B_mid, that is:
[0070] B_final = B_mid ∪ (∪ Patch_ab)
[0071] Repeat this process for all matching break pairs;
[0072] Phase 4: Parameter Analysis and Output;
[0073] Perform parameter calculations on the optimized final binary segmentation image B_final;
[0074] Length calculation: Skeletonize B_final, count the total number of skeleton pixels, and convert it into physical length based on the image resolution (pixels / mm);
[0075] Width calculation: For each point on the skeleton, calculate its local width in the normal direction of the original binary image B_final, and average it to obtain the average width. Alternatively, the width prior information in P_map can be used directly for statistical analysis.
[0076] Density and orientation: The total length of the cracks per unit area is calculated to obtain the crack density. The orientation angle of the skeleton line segments is calculated to draw a crack rose diagram and analyze its orientation distribution.
[0077] Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art and related fields based on the embodiments of the present invention without inventive effort should fall within the scope of protection of the present invention. Structures, devices, and operating methods not specifically described and explained in the present invention, unless otherwise specified or limited, shall be implemented according to conventional means in the art.
Claims
1. A method for recognizing coal and rock fracture images based on deep learning and post-processing, characterized in that, Includes the following steps: S1: Obtain the original coal and rock fracture image and preprocess it to obtain the standard input image; S2: Input the standard input image into a pre-trained deep learning model dedicated to semantic segmentation of coal and rock fractures. The model is configured to output an initial segmentation probability map containing prior information about fracture width, where the probability value not only represents the confidence that a pixel belongs to a fracture, but is also positively correlated with the predicted local width of the fracture. S3: Based on the probability distribution and crack width prior information in the initial segmentation probability map, perform a post-processing optimization process adapted to the model output characteristics. This process includes: S31: Based on the probability value range and spatial gradient of each region of the probability map, adaptively determine the local binarization threshold and generate an initial binary map; S32: For the initial binary graph, based on the area of its connected components and the average probability value of the corresponding region in the probability graph, dynamically determine whether the connected component is a valid crack or noise, and filter out the connected components that are determined to be noise. S33: For the noise-filtered binary image, use the continuity of high probability value regions in the probability image as a guide to perform fracture repair based on morphological connectivity. S4: Based on the post-processed optimized binary fracture segmentation image, perform quantitative analysis of fracture geometric parameters.
2. The coal and rock fracture image recognition method based on deep learning and post-processing according to claim 1, characterized in that, The deep learning model described in step S2 is trained using at least one of the following methods so that its output includes prior information about the crack width: A regression constraint term is introduced into the loss function to determine the relationship between the predicted probability value of the crack pixel and its actual width. Using a multi-task learning framework, one branch outputs the crack category probability, and the other branch outputs a pixel-level width estimate. The width information is then fused into the probability map after training.
3. The coal and rock fracture image recognition method based on deep learning and post-processing according to claim 1, characterized in that, In step S32, the rule for dynamic judgment is as follows: for a connected region, if its area is less than the first threshold and the average probability value of its corresponding region in the probability graph is lower than the second threshold, it is judged as noise; otherwise, it is judged as a valid crack.
4. The coal and rock fracture image recognition method based on deep learning and post-processing according to claim 1, characterized in that, In step S33, the fracture repair based on morphological connectivity specifically includes the following steps: Fracture analysis and sampling point generation: Identify the fracture endpoints P1 and P2; uniformly sample N intermediate points {S_i|i=1...N} on the line L connecting P1 and P2; Path offset guided by probability field: For each sampling point S_i, calculate its probability gradient vector in the initial segmentation probability map; according to the gradient vector, offset S_i along the gradient direction by a distance that is inversely proportional to the probability value at point S_i, to obtain the offset point S_i'; Generate a smooth repair centerline: Use spline curve fitting to fit all offset points {S_i'} and endpoints P1 and P2 to generate a smooth repair centerline C; Repair area generation: Along the repair centerline C, based on the prior information of the crack width corresponding to each point on the line, anisotropic expansion is performed to generate a repair area that finally matches the crack width, and then merges it into the binary segmentation map.
5. The coal and rock fracture image recognition method based on deep learning and post-processing according to claim 1, characterized in that, The deep learning model described in step S2 is an encoder-decoder structure, in which the encoder uses ResNet or EfficientNet pre-trained on ImageNet as the backbone network, and the decoder integrates an attention mechanism to enhance the ability to capture linear gap features.
6. The coal and rock fracture image recognition method based on deep learning and post-processing according to claim 1, characterized in that, The preprocessing in step S1 includes using homomorphic filtering or the CLAHE algorithm to enhance the contrast between the crack and the background, and normalizing the image.