Deep learning network-based reservoir area hydro-fluctuation belt rock crack image identification method

Through a deep learning network-based method, combined with the U2-Net model and multi-algorithm weighted fusion algorithm, the problem that traditional methods are difficult to identify complex rock fractures is solved, and automatic identification and high-precision extraction of geometric representation information of rock fracture images in the desolation zone are realized.

CN119516363AActive Publication Date: 2025-02-25CHONGQING JIAOTONG UNIV

Patent Information

Application Number
CN202411535516.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-02-25
Estimated Expiration
2044-10-31

AI Technical Summary

Technical Problem

Traditional digital image processing methods are difficult to effectively identify rock cracks on the bank slope of the desolation zone in the reservoir area, especially in complex or blurry image backgrounds, resulting in poor recognition effect.

Method used

Using a deep learning network-based method, the rock fracture segmentation model of U2-Net deep learning network is constructed, and the fracture mask optimization algorithm combined with multi-algorithm weighted fusion is used to identify and extract cracks.

Benefits of technology

Automatic identification of geometric representation information of rock fracture images in the desolation zone has been realized, the intelligence and informatization level of rock fracture detection in the desolation zone shore slopes in the reservoir area has been improved, and the recognition and extraction accuracy has been significantly improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119516363A_ABST
    Figure CN119516363A_ABST
Patent Text Reader

Abstract

The invention discloses a reservoir area hydro-fluctuation belt rock crack image recognition method based on a deep learning network, and the method comprises the steps: S1, constructing a rock crack segmentation model, and training the rock crack segmentation model through employing a pre-processed rock crack image sample set; s2, recognizing a rock crack region in the target image by using a rock crack segmentation model to obtain a first type of recognition result; s3, on the basis of coordinate positions, pixel values and color space attributes of pixel points in the image, optimizing the first type of recognition result through a crack mask optimization algorithm of multi-algorithm weighted fusion to obtain a second type of recognition result; and S4, aiming at the second type of identification result, measuring the width of the rock crack through a maximum inscribed circle method and an orthogonal projection method so as to obtain geometric representation information of the rock crack. According to the invention, automatic identification of the geometric representation information of the rock crack image of the hydro-fluctuation belt can be realized, and the intelligent and informatization level of reservoir area hydro-fluctuation belt bank slope rock crack detection is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of automatic survey and identification, and specifically relates to a method for recognizing rock fracture images in a drawdown zone of a reservoir area based on a deep learning network. Background Art

[0002] Taking into account the ever-changing shapes of cracks on the rock surface of the drawdown zone of the reservoir, the complex image background, the significant changes in rock quality, and the influence of various factors such as rock stratification, crack detection and identification using only traditional digital image processing methods usually have poor recognition effects, mainly manifested in too many extracted elements. However, the most basic and approximate crack shapes can be extracted.

[0003] In recent years, with the widespread application of computer vision in the field of crack detection, it has provided strong technical support for the automatic identification and classification of cracks. Traditional digital image processing technology relies on preset features and rules to identify cracks, which may encounter difficulties when processing complex or blurred images. Therefore, the selection of deep learning networks to identify rock cracks in the drawdown zone can effectively deal with the problems of crack morphological diversity, highly complex image background, rock quality differences and rock mass incompleteness, thereby realizing the accurate identification and extraction of rock cracks in the drawdown zone. The application of deep learning technology in the field of crack detection is mainly concentrated in two types of algorithms, namely crack recognition algorithms and crack segmentation algorithms. The crack recognition and positioning algorithm focuses on identifying the area containing cracks from the overall image, rather than accurately to each pixel. Therefore, the crack recognition algorithm cannot accurately extract crack pixels from the image to obtain crack geometric feature information. Therefore, it is impossible to further analyze and evaluate the crack situation of the bank slope rock in the drawdown zone, while the deep learning crack segmentation algorithm can well segment and extract the cracks in the image from the background. Considering the uniqueness, diversity and data volume of rock crack images on the slope of the reservoir drawdown zone, the deep learning crack segmentation model inevitably cannot accurately extract the cracks in each crack image.

[0004] Traditional image processing technology is often designed for specific types of cracks and specific backgrounds. In addition, due to the diversity of crack shapes and differences in size, traditional methods require complex threshold settings and feature designs. Single use cannot handle crack detection tasks in different scenarios well. By integrating the advantages of traditional image processing technology, taking advantage of each other's strengths and weaknesses, and avoiding the incorrect segmentation of deep learning segmentation models on certain crack images, the accuracy of rock crack recognition and extraction can be greatly improved. Summary of the invention

[0005] In view of this, the present invention proposes a rock crack image recognition method in the drawdown zone of a reservoir area based on a deep learning network. Through the present invention, automatic recognition of geometric representation information of rock crack images in the drawdown zone can be achieved, thereby improving the intelligence and informatization level of rock crack detection on the slope of the drawdown zone of the reservoir area.

[0006] In order to achieve the above object, the present invention provides the following technical solutions:

[0007] The present invention provides a method for recognizing rock crack images in a drawdown zone of a reservoir area based on a deep learning network, comprising:

[0008] Step S1: Based on U 2 -Net deep learning network to build a rock fracture segmentation model, and use the pre-processed rock fracture image sample set to train the rock fracture segmentation model;

[0009] Step S2, using the trained rock crack segmentation model to identify the rock crack area in the target image to be identified, to obtain a first type of identification result;

[0010] Step S3, based on the coordinate position, pixel value and color space attribute of the pixel point in the image, the first type of recognition result is optimized by a crack mask optimization algorithm of multi-algorithm weighted fusion to obtain a second type of recognition result;

[0011] Step S4: for the second type of recognition results, the width of the rock crack is measured by the maximum inscribed circle method and the orthogonal projection method, so as to obtain the geometric representation information of the rock crack.

[0012] Preferably, U 2 -Net deep learning network contains 6 encoding layers, 5 decoding layers, and a fully connected layer as the final output of the network;

[0013] The encoding and decoding parts of each layer are residual U-shaped structures, so that the overall network can extract feature information of different scales at each level;

[0014] In the encoding layer, the model performs downsampling operations. The output of each encoding layer is not only used as the input of the next encoding layer, but also passed to the corresponding decoding layer. At the same time, the encoding layer also calculates its own loss to provide feedback for the end-to-end training of the model.

[0015] The last encoding layer in the network structure does not perform downsampling, but directly passes its encoding results upward to the decoding part to provide information for the global understanding and detail recovery of the image;

[0016] Each decoding layer receives the output from the previous decoding layer and the corresponding encoding layer result. The decoding layer calculates its own loss and passes the decoding result upward, gradually completing the image reconstruction process.

[0017] A saliency probability map is generated at each encoding layer and decoding layer to reflect the saliency of each part of the image.

[0018] The fully connected layer is responsible for aggregating feature information from all encoding and decoding layers, as well as the saliency probability information generated by each layer, and outputting the model's final recognition result for the image. At the same time, it calculates the final loss function to optimize the performance of the model during the training process.

[0019] Preferably, step S2 comprises:

[0020] Step S21, converting the original target image into RGB channel and Lab channel respectively to obtain two types of channel images;

[0021] Step S21, using the Otsu threshold segmentation method to perform threshold segmentation extraction on any type of channel image to obtain a preliminary crack mask;

[0022] Step S22, clustering the preliminary crack masks using K-means++ clustering algorithm to obtain a first type of crack mask;

[0023] Step S23, using the Hu matrix and the Canny operator to perform contour recognition and crack extraction on the preliminary crack mask to obtain a third type of crack mask;

[0024] Step S24, performing denoising, skeleton extraction and expansion processing on the preliminary crack mask to obtain a second type of crack mask;

[0025] Step S25, according to the first type of crack mask, the second type of crack mask and the third type of crack mask corresponding to the RGB channel image, they are merged and outputted by weighted voting to obtain a crack mask-R;

[0026] Step S26, according to the first type of crack mask, the second type of crack mask and the third type of crack mask corresponding to the Lab channel image, they are merged and outputted by weighted voting to obtain a crack mask-L;

[0027] Step S27, converting the original target image into HSV three-channel color components, obtaining a preliminary crack mask image by contrast enhancement and Otsu threshold segmentation method, taking the HSV three-channel mean of the image pixels and the background area pixels in the crack mask image as the reference index for clustering iteration, iteratively extracting the preliminary crack mask image to obtain the crack mask-H;

[0028] Step S28, according to the first type of recognition result, extract the layer determined to be the location of the crack to obtain a crack mask-U;

[0029] Step S29: performing weighted fusion based on the preset weights according to the crack mask-R, the crack mask-L, the crack mask-H and the crack mask-U to obtain a final crack mask map and use it as the second type of recognition result.

[0030] Preferably, step S23 includes:

[0031] In OpenCV, the first three matrices of the Hu matrix are used to perform contour recognition on the preliminary crack mask to determine the target area in the image;

[0032] The critical connected area of ​​the target area is detected by using the breadth-first traversal method, and the points that are not connected, independent, or not judged to be in the crack in the target area are eliminated to obtain the processed crack mask image;

[0033] The Canny operator is used to perform contour recognition and crack extraction on the processed crack mask image to obtain the third type of crack mask.

[0034] Preferably, step S24 includes:

[0035] The connected domain of the preliminary crack mask image is fused, and the isolated island regions are connected to smooth the crack mask;

[0036] The noise and black spots that may be generated by rock fracture stratification in the fracture mask are removed by median filtering;

[0037] The skeleton of the crack mask is extracted using the Zhang-Suen skeleton extraction algorithm;

[0038] The extracted skeleton is filtered and expanded to obtain a second type of crack mask.

[0039] Preferably, step S27 includes:

[0040] Step S271, converting the original crack image pixel values ​​into HSV three-channel values, enhancing the contrast of the image converted into HSV three-channel values, performing threshold segmentation by Otsu threshold segmentation method, generating an initial crack mask, and performing iterative convergence optimization on the crack mask using the average value of the HSV three-channel components as an optimization reference index;

[0041] Step S272, respectively calculating the average values ​​of the HSV three-channel components of the mask part and the background part in the converted image, and respectively converting the average values ​​of the HSV three-channel components of the mask part and the background part to three-dimensional coordinates;

[0042] Step S273, select all pixels covered in the mask image, and convert the HSV three-channel values ​​of all pixels into three-dimensional coordinates;

[0043] Step S274, respectively comparing the shortest distances between the HSV three-channel values ​​of all pixels on the image and the average values ​​of the HSV three-channel components of pixels in the crack area and the background area;

[0044] Step S275: Determine the shortest distance D between the selected pixel and the mean of the three HSV channels of the pixel in the crack area. c , the shortest distance D between the selected pixel and the mean of the three HSV channels of the background area pixel b , the selected pixel point is removed from the crack mask area when the following formula is satisfied:

[0045]

[0046] Wherein, α represents the preset adjustment parameter;

[0047] Step S276: convolve all pixels with the selected specific convolution kernel to achieve expansion of the crack area, and subtract the expanded crack mask from the original mask to obtain a new mask. For all pixels in the new mask, add the pixels that meet the formula conditions to the crack mask area according to step S275;

[0048] Step S277, recalculating the HSV three-channel mean of the pixels in the crack mask area and the HSV three-channel mean of the pixels in the background area;

[0049] Step S278, loop through step S272 to step S277 to continuously iterate the crack mask area. When the average value of the HSV three-channel component of the crack mask part changes less than the preset threshold, convergence is performed and the final crack mask -H is output.

[0050] Preferably, step S29 includes:

[0051] Crack mask-U, crack mask-R, crack mask-L and crack mask-H are respectively denoted as M U 、M R 、M L 、M H , the label mask of the crack image is used as the reference item, denoted as M l , the weighted fusion crack mask is recorded as M, and the corresponding random weight parameter is expressed as:

[0052] θ=[θ R ,θ L ,θ H ,θ U ]

[0053] Where θ is the total fusion weight, θ R is the mask M R Corresponding weight, θ Lis the mask M L Corresponding weight, θ H is the mask M H Corresponding weight, θ U is the mask M U Corresponding weights;

[0054] Perform data normalization on all crack masks:

[0055]

[0056] Among them, A v Represents the data after the standardized operation, x ij is the value of the corresponding pixel on the mask, μ ij is the mean value of each pixel on the mask, σ ij is the standard deviation of each pixel on the mask;

[0057] Convert the crack mask into a matrix for calculation:

[0058] M=[M R , M L , M H , M U ] T

[0059] The label mask M of the crack image dataset l As a reference prediction value, a linear regression model is constructed:

[0060] M l =θ·M+b+ε

[0061] Where ε is the error term, b is the bias term and a constant;

[0062] Define the error term ε as the reference label mask M l Difference from the weighted fusion mask:

[0063] ε=M l -θ·Mb

[0064] The error term ε belongs to the standard normal distribution. l -θ×Mb is independent, then ε is independent;

[0065] The weight parameter θ is optimized by minimizing the sum of squared error terms:

[0066]

[0067] where x ij =M lij -θ kij ×M kij , M lij is the value of the pixel corresponding to the label mask, θkij is the weight of the pixel corresponding to each part of the mask, M kij is the value of the pixel corresponding to each part of the mask, qμ=-b;

[0068] By calculation The minimum value of k :

[0069] θ k =(X k T X k ) -1 X k T Y

[0070] Where X k For each part of the mask involved in the weighting, Y is M l ;

[0071] Finally, by calculating θ k So we can get the required weight θ=[θ R ,θ L ,θ H ,θ U ].

[0072] Preferably, the method further includes calculating the degree of rock damage according to the geometric representation information of the rock fracture, and the calculation process is as follows:

[0073] A uniform weight distribution rule is pre-set for any continuous rock surface, and the weight distribution rule includes the first rule: the weight coefficient corresponding to the geometric center of the rock surface is set as the origin, and the weight coefficients of other positions on the rock surface follow the weight coefficient corresponding to the origin and decrease linearly toward the edge of the rock surface, thus obtaining the first type of weight distribution;

[0074] The second rule: based on the total area of ​​the rock surface, a preset radius threshold that increases with the increase of the total area is obtained. For any position, a circle is delineated with the position as the origin and the radius threshold as the radius, and all the first-class weight distributions within the circle are counted. The first-class weight with the highest weight within the circle is determined and used as the second-class weight distribution of the position. All positions on the rock surface are traversed and calculated to obtain the second-class weight distribution of all positions on the rock surface.

[0075] According to the geometric representation information of the rock fracture, the second type of weight distribution corresponding to each rock fracture position is determined;

[0076] According to the geometric characterization information of the rock fracture, the rock fracture width at any rock fracture position is determined, and a third type of weight distribution is pre-set that diffuses from the rock fracture skeleton axis to the edge of the rock fracture. The fourth type of weight distribution is obtained by multiplying the rock fracture width with the corresponding product of the third type of weight distribution;

[0077] According to the second type of weight distribution and the fourth type of weight distribution corresponding to each of the rock fracture positions, the damage degree of all positions on the rock surface is calculated, and the total damage degree of the rock surface is obtained by accumulation;

[0078] The degree of rock damage is calculated based on the total damage degree of the rock surface and the thickness from the rock surface to the inside.

[0079] The present invention has achieved at least the following beneficial effects:

[0080] 1. The automatic recognition of geometric representation information of rock crack images in the drawdown zone is realized, which improves the intelligence and information level of rock crack detection on the slope of the drawdown zone in the reservoir area.

[0081] 2. Based on U 2 -Net's rock fracture segmentation model has a good recognition and extraction effect on the rock fractures on the slope of the drawdown zone of the reservoir area, and can achieve the expected effect overall.

[0082] 3. A crack mask optimization algorithm based on multi-algorithm weighted fusion is proposed, which can effectively separate rock cracks from the background in most cases. The optimization process can play a role in repairing and pruning, which can make up for the unrecognized areas and remove the corresponding misidentified areas.

[0083] 4. Considering that the position of rock cracks on the rock, the crack depth and the overall thickness of the rock have a certain relationship with the overall loss degree of the rock, the weight distribution law is introduced to express the relationship between the degree of rock damage and the position of the cracks, the crack depth and the overall thickness of the rock to calculate the overall loss degree of the rock.

[0084] Other advantages, objectives and features of the present invention will be described in the following description and will be apparent to those skilled in the art to some extent, or those skilled in the art may be taught from the practice of the present invention. The objectives and other advantages of the present invention may be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0085] In order to make the purpose, technical solution and beneficial effects of the present invention clearer, the present invention provides the following drawings for illustration:

[0086] Figure 1 It is a flow chart of a method for recognizing rock crack images in a drawdown zone of a reservoir area based on a deep learning network in an embodiment of the present invention;

[0087] Figure 2 Schematic diagram of residual U-shaped structure in an embodiment of the present invention;

[0088] Figure 3In the embodiment of the present invention, U 2 -Net deep learning network structure diagram;

[0089] Figure 4 This is a flow chart of extracting crack masks based on Lab space in an embodiment of the present invention;

[0090] Figure 5 This is a flow chart of extracting crack masks based on RGB space in an embodiment of the present invention;

[0091] Figure 6 This is a flow chart of the K-means++ algorithm in an embodiment of the present invention;

[0092] Figure 7 It is a flow chart of the Zhang-Suen skeleton extraction algorithm in an embodiment of the present invention;

[0093] Figure 8 This is a flow chart of extracting crack masks based on HSV spatial images in an embodiment of the present invention;

[0094] Fig. 9 The flowchart is based on the weighted fusion of multiple crack masks in an embodiment of the present invention. DETAILED DESCRIPTION

[0095] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.

[0096] The present invention provides a method for recognizing rock crack images in a reservoir area based on a deep learning network, referring to Figure 1 ,include:

[0097] Step S1: Based on U 2 -Net deep learning network to build a rock fracture segmentation model, and use the pre-processed rock fracture image sample set to train the rock fracture segmentation model;

[0098] Step S2, using the trained rock crack segmentation model to identify the rock crack area in the target image to be identified, to obtain a first type of identification result;

[0099] Step S3, based on the coordinate position, pixel value and color space attribute of the pixel point in the image, the first type of recognition result is optimized by a crack mask optimization algorithm of multi-algorithm weighted fusion to obtain a second type of recognition result;

[0100] Step S4: for the second type of recognition results, the width of the rock crack is measured by the maximum inscribed circle method and the orthogonal projection method, so as to obtain the geometric representation information of the rock crack.

[0101] The working principle and beneficial effects of the above technical solution are: Select U 2 -Net deep learning network is used as the research and application object, and the deep learning model is trained by making processed sample sets. Based on the output results of the deep learning model, HSV and Lab color spaces are used as optimization reference indicators and combined with K-means++ clustering algorithm, Otsu method, Zhang-Suen method, connected domain denoising, edge detection, morphological processing and other methods for weighted fusion, so as to optimize the deep learning recognition and extraction results. Finally, the geometric representation of the cracks is extracted from the optimized crack recognition and extraction results based on the maximum inscribed circle method and orthogonal projection method. Through the present invention, the automatic recognition of the geometric representation information of the rock crack image in the drawdown zone is realized, and the intelligent and information level of rock crack detection on the slope of the drawdown zone in the reservoir area is improved.

[0102] In a preferred embodiment, U 2 -Net deep learning network contains 6 encoding layers, 5 decoding layers, and a fully connected layer as the final output of the network;

[0103] The encoding and decoding parts of each layer are residual U-shaped structures, so that the overall network can extract feature information of different scales at each level;

[0104] In the encoding layer, the model performs downsampling operations. The output of each encoding layer is not only used as the input of the next encoding layer, but also passed to the corresponding decoding layer. At the same time, the encoding layer also calculates its own loss to provide feedback for the end-to-end training of the model.

[0105] The last encoding layer in the network structure does not perform downsampling, but directly passes its encoding results upward to the decoding part to provide information for the global understanding and detail recovery of the image;

[0106] Each decoding layer receives the output from the previous decoding layer and the corresponding encoding layer result. The decoding layer calculates its own loss and passes the decoding result upward, gradually completing the image reconstruction process.

[0107] A saliency probability map is generated at each encoding layer and decoding layer to reflect the saliency of each part of the image.

[0108] The fully connected layer is responsible for aggregating feature information from all encoding and decoding layers, as well as the saliency probability information generated by each layer, and outputting the model's final recognition result for the image. At the same time, it calculates the final loss function to optimize the performance of the model during the training process.

[0109] The working principle and beneficial effects of the above technical solution are as follows: By drawing on the basic design concept of U-Net, U 2-Net model, and further developed into a residual U-shaped structure based on the traditional residual structure. Figure 2 This structural design makes U 2 The U-Net model can capture local details of the image while also using global context information to make decisions, greatly improving the performance of the model in complex image processing tasks. 2 -Net deep learning model contains 6 encoding layers, 5 decoding layers, and a fully connected layer as the final output of the network. Its network structure is as follows Figure 3 As shown. 2 -Net, the encoding and decoding parts of each layer use the residual U-shaped structure to enable the overall network to extract feature information of different scales at each level, thereby effectively transferring gradients and improving the stability and efficiency of the training process. In the encoding layer, the model reduces the size of the feature map through downsampling operations to extract more abstract feature representations. The output of each encoding layer is not only used as the input of the next encoding layer, but also passed to the corresponding decoding layer. At the same time, the encoding layer will calculate its own loss to provide feedback for the end-to-end training of the model. The last encoding layer in the network structure does not perform downsampling, but directly passes its encoding results upward to the decoding part, providing key information for the global understanding and detail recovery of the image. During the decoding process, each decoding layer will receive the output from the previous decoding layer and the corresponding encoding layer result. Similarly, the decoding layer will calculate its own loss and pass the decoding result upward to gradually complete the image reconstruction process. U 2 -Net generates a saliency probability map at each encoding and decoding layer. These probability maps reflect the saliency of each part of the image and are crucial for recognition tasks. At the very end of the model, a fully connected layer is responsible for aggregating feature information from all encoding and decoding layers, as well as saliency probability information generated by each layer. By integrating this rich information, the fully connected layer outputs the model's final recognition result for the image. At the same time, the fully connected layer also calculates the final loss function, which includes losses from various parts of the network and is used to optimize the performance of the model during training.

[0110] In a preferred embodiment, step S2 comprises:

[0111] Step S21, converting the original target image into RGB channel and Lab channel respectively to obtain two types of channel images;

[0112] Step S21, using the Otsu threshold segmentation method to perform threshold segmentation extraction on any type of channel image to obtain a preliminary crack mask;

[0113] Step S22, clustering the preliminary crack masks using K-means++ clustering algorithm to obtain a first type of crack mask;

[0114] Step S23, using the Hu matrix and the Canny operator to perform contour recognition and crack extraction on the preliminary crack mask to obtain a third type of crack mask;

[0115] Step S24, performing denoising, skeleton extraction and expansion processing on the preliminary crack mask to obtain a second type of crack mask;

[0116] Step S25, according to the first type of crack mask, the second type of crack mask and the third type of crack mask corresponding to the RGB channel image, they are merged and outputted by weighted voting to obtain a crack mask-R;

[0117] Step S26, according to the first type of crack mask, the second type of crack mask and the third type of crack mask corresponding to the Lab channel image, they are merged and outputted by weighted voting to obtain a crack mask-L;

[0118] Step S27, converting the original target image into HSV three-channel color components, obtaining a preliminary crack mask image by contrast enhancement and Otsu threshold segmentation method, taking the HSV three-channel mean of the image pixels and the background area pixels in the crack mask image as the reference index for clustering iteration, iteratively extracting the preliminary crack mask image to obtain the crack mask-H;

[0119] Step S28, according to the first type of recognition result, extract the layer determined to be the location of the crack to obtain a crack mask-U;

[0120] Step S29: performing weighted fusion based on the preset weights according to the crack mask-R, the crack mask-L, the crack mask-H and the crack mask-U to obtain a final crack mask map and use it as the second type of recognition result.

[0121] The working principle and beneficial effects of the above technical solution are as follows: the rock crack mask of the bank slope of the drawdown zone of the Three Gorges Reservoir area extracted by the deep learning crack segmentation model roughly reflects its direction and morphology, but there are still some differences from the actual cracks. Some crack areas are not identified and extracted, while some background areas are mistakenly identified and extracted as cracks. In order to improve the ability to accurately extract cracks, these errors need to be corrected. In addition, rock cracks are very different from other types of cracks, that is, there are too many surface elements around rock cracks, there are some vegetation coverage, cracks are frequently bifurcated, there are many branches, the span is large, the morphology is different, and the distinction is large. The pixels of the cracks in the image usually show high color consistency, and the crack area usually absorbs more light and reflects less, so it appears dark or black under lighting conditions. Based on the characteristics of crack pixels close to black, an effective way to optimize the recognition results of the deep learning model is to enhance the accuracy of the crack mask by optimizing the pixel values ​​in the image. Given that the cracks on the bank slope rocks of the drawdown zone of the reservoir area are still very different from the traditional cracks, they cannot be regarded as an idealized crack alone, that is, the distinction between the cracks and the background is not very obvious. It is obviously not enough to use a single image processing technology to extract cracks and then optimize the crack mask. Therefore, the embodiment of the present invention proposes a crack mask optimization algorithm based on multi-algorithm weighted fusion. Through the optimization algorithm, the pixels that are mistakenly identified as cracks and the crack pixels that are missed are excluded and added to the pixel coordinate set of the mask. This process is intended to correct the recognition errors of the model and ensure that the mask accurately covers all real crack areas, while non-crack areas are accurately excluded. When optimizing, the basis for processing the image pixels is usually the attributes of the pixels, including coordinate positions and pixel values. Clustering and image segmentation are extremely effective methods when performing mask optimization processing. The embodiment of the present invention introduces dividing the pixels into different groups according to their color space attributes, thereby distinguishing cracks from background areas. Starting from the three color spaces of RGB, Lab and HSV, three optimized crack masks are obtained respectively, and finally the three optimized crack masks and the above neural network detection results are used together for weighted fusion to finally obtain a credible crack mask map.

[0122] For the identification and extraction of cracks, the Otsu method is used, which shows significant advantages over many traditional image segmentation algorithms in terms of automatically selecting the optimal threshold, reducing the need for preprocessing and parameter adjustment, and improving the accuracy and robustness of crack image segmentation. These advantages make the Otsu method an ideal choice for processing complex or uneven quality rock crack images. The embodiment of the present invention uses the K-means++ clustering algorithm to process the crack images. The K-means++ clustering algorithm is widely used for its simplicity, efficiency and fast computing speed. By improving the selection process of the initial centroid, the algorithm can provide more stable and higher quality clustering results compared to the traditional K-means algorithm.

[0123] In the embodiment of the present invention, the input crack image and the crack image converted to the Lab color space need to be processed by the same multi-image segmentation algorithm. The same description will not be given for the original RGB image, and the crack image segmentation process converted to the Lab color space will be specifically described. The specific process is as follows: Figure 4 , Figure 5 As shown,

[0124] Convert RGB channel images to Lab channels:

[0125] By mapping the RGB color space to the Lab color space and focusing on processing the L channel image, the impact of lighting changes can be effectively reduced, and the accuracy and stability of image processing and analysis can be improved. Before target extraction, the space conversion must be completed first. Because RGB and Lab represent different color spaces, their color gamut ranges are also different. Therefore, the RGB color space cannot be directly converted to the Lab color space, and needs to be converted to the XYZ model first, and then further converted to the Lab color space model. The conversion process can be divided into the following two parts:

[0126] The input original image is converted into a Lab color space image, and the conversion formula is:

[0127]

[0128] Among them, r, g, and b are the original three-channel values ​​of the image:

[0129] Use the function gamma(x) to increase the image contrast:

[0130]

[0131] The conversion relationship between the three-dimensional coordinates and the image R, G, and B channel values ​​is established:

[0132]

[0133] Then, convert the three-dimensional space to Lab color space:

[0134]

[0135] Among them, L, a, and b are the three-channel values ​​after the converted image, and X n =95.047, Y n =100, Z n =108.883:

[0136] The above formula can be used to convert the RGB space of the image to the Lab space.

[0137] Otsu method performs threshold segmentation on crack images:

[0138] The image is processed by Otsu algorithm, using the maximum inter-class variance method of automatic threshold segmentation. The increase in variance means that the difference between the target and the background is greater, and the probability of misclassification is reduced. Therefore, the effect of segmenting the background area and the target area is better.

[0139] Input a crack image of size M×N with a total of L gray levels. Assume that the number of pixels with gray level i (i=0,1,2…L-1) in the image is n i , the probability of existence in the image is p i ,but:

[0140]

[0141] Assume that there is an image threshold T (0≤T≤L-1), using this threshold, all pixels of the image can be divided into the target part C1 with gray value less than or equal to T and the background part C2 with gray value greater than T. In this case, the probability that the pixel is the target C1 part and the background C2 part is P1 and P2 respectively:

[0142]

[0143] At this time, the average gray value m1(T) of the target C1 part of the pixel and the average gray value m2(T) of the background C2 part of the pixel are respectively:

[0144]

[0145] The average gray level of the entire image m G for:

[0146]

[0147] At this time, define the inter-class variance σ of the target C1 part and the background C2 part 2 for:

[0148] σ 2 =P1×(m1-m G ) 2 +P2×(m2-m G ) 2

[0149] We can get m1×P1+m2×P2=m G , substituting it into the above formula, we can get the objective function of Otsu method:

[0150]

[0151] When calculating the Otsu threshold of an image, it is necessary to traverse and calculate the objective function σ corresponding to L = 256 pixel grayscales. 2 (T)(T=0,1,2…L-1), and then find the 2 (T) takes the maximum value, that is, when the image target part c1 and the image background C2 have the largest inter-class variance, the corresponding pixel grayscale T * As the optimal Otsu threshold, that is:

[0152] σ 2 (T * )=max(σ 2 (T)),0≤T≤L-1

[0153] According to the optimal threshold T * Select the target area, less than or equal to T * The qualitative characterization is a crack data set (represented as 255 in the output image value), which is greater than T * is characterized as the background set (represented as 0 in the output image numerically).

[0154] K-means++ clustering of images after threshold segmentation

[0155] If several clusters are input, the output is when the square error reaches the minimum:

[0156]

[0157] Among them, C i is the category of the input cluster, E is the corresponding square error, k is the total number of clusters in the input data set, μ i It is C i The algorithm flow of K-means++ is as follows Figure 6 As shown;

[0158] Perform K-means++ clustering on the input image data set. The specific implementation steps are as follows:

[0159] Input data set D = {x1, x2, ..., x a}, at the beginning, k data sets are randomly selected as cluster centers, denoted as {μ1,μ2,…,μ a}, randomly select a data set μ from it i As the initial cluster center z i .

[0160] Calculate the shortest distance between each sample point and the existing cluster center, denoted as R(μ i ),Right now:

[0161] R(μ i )=min{dis(μ i ,za )}

[0162] Calculate the probability P of each sample point becoming the next cluster center. The calculation formula is as follows:

[0163]

[0164] The next cluster center is selected using the roulette wheel method until K cluster centers are selected.

[0165] Calculate the shortest distance from each sample point to the K cluster centers and classify them:

[0166]

[0167] For different sample points, K distances can be obtained, and the sample points at the corresponding distances are classified into the corresponding categories λ i .

[0168] Reselect new cluster centers based on data points classified into different cluster centers:

[0169]

[0170] Continuously iterate. If the cluster center does not change, the iteration converges, clustering ends and the classified data set is output.

[0171] For the original crack image and the crack image converted to Lab three-channel, it is assumed that the cluster with the least pixel points after clustering iteration converges is the crack mask area. For the crack image converted to HSV three-channel, after threshold segmentation, the final crack mask extraction result is output through mean iteration convergence.

[0172] In a preferred embodiment, step S23 includes:

[0173] In OpenCV, the first three matrices of the Hu matrix are used to perform contour recognition on the preliminary crack mask to determine the target area in the image;

[0174] The critical connected area of ​​the target area is detected by using the breadth-first traversal method, and the points that are not connected, independent, or not judged to be in the crack in the target area are eliminated to obtain the processed crack mask image;

[0175] The Canny operator is used to perform contour recognition and crack extraction on the processed crack mask image to obtain the third type of crack mask.

[0176] The working principle and beneficial effects of the above technical solution are as follows: for the binary image after threshold segmentation by the Otsu method, the Hu matrix is ​​first used to identify the contour of the mask. The Hu matrix is ​​a linear combination of normalized central moments. The Hu matrix can still maintain the invariance of the matrix after operations such as image rotation, scaling and translation. The Hu matrix is ​​often used to identify the features of the image. Here, the embodiment of the present invention is used to identify and judge the contour of the crack mask. In OpenCV, the Hu matrix can be obtained using the function cv2.HuMoments(). This function uses the return value of the cv2.moments() function as a parameter and returns 7 Hu matrix values. The embodiment of the present invention uses the first three moments of the Hu matrix based on actual conditions, and the calculation formula is as follows:

[0177]

[0178] Among them, v 20 Take the second-order partial derivative of the point in the x direction, do not take the derivative in the y direction, v 12 The first-order partial derivative of the point in the x direction is calculated, the second-order partial derivative in the y direction is calculated, and so on. The relevant properties of the crack mask morphology can be obtained through the Hu matrix, and the target area in the image can be judged through this relevant property.

[0179] Then the image is tested for critical connected regions, i.e., breadth-first traversal. The core idea is to take any point on the crack image, which is a crack point on the mask. With this point as the center, spread out to the surroundings, circle by circle, from top to bottom and from left to right. If the surrounding points are initially predicted to be points on the crack, these points are placed in the function container. After traversal, a coherent, holistic and connected crack mask is obtained, and other unconnected, independent and not judged to be in the crack points will be eliminated.

[0180] Then, the processed crack mask image is further identified and judged using the Canny operator. The specific steps are as follows:

[0181] 1. Denoise the image by median filtering.

[0182] 2. Extract the gradient of the image through the Laplace operator.

[0183] 3. Set the upper and lower thresholds (u, d). All images with grayscale values ​​higher than u are retained, and all images with grayscale values ​​lower than d are discarded. In principle, d = t × u, and the value of t is between one-third and one-half according to actual conditions and experiments.

[0184] 4. Finally, perform eight-area connectivity detection on the image (pixels with grayscale values ​​between the upper and lower thresholds). If they are connected to the pixels retained in step 3, they will be retained, otherwise they will be discarded.

[0185] After extracting a contour from the crack mask through the canny operator, it is stored in the contour tree. The area and length of the contour are fitted by the least squares method. If the area and length do not follow the preset ratio, they are removed, otherwise they are included in the crack mask. The ratio is shown in the formula:

[0186] 50 c <8L c

[0187] Where S c is the pixel area of ​​the mask outline, L c is the pixel length of the mask outline.

[0188] In a preferred embodiment, step S24 includes:

[0189] The connected domain of the preliminary crack mask image is fused, and the isolated island regions are connected to smooth the crack mask;

[0190] The noise and black spots that may be generated by rock fracture stratification in the fracture mask are removed by median filtering;

[0191] The skeleton of the crack mask is extracted using the Zhang-Suen skeleton extraction algorithm;

[0192] The extracted skeleton is filtered and expanded to obtain a second type of crack mask.

[0193] The working principle and beneficial effects of the above technical solution are as follows: In order to further optimize the crack mask after prediction and segmentation by the deep learning model, multiple crack masks for subsequent weighted fusion are accurately extracted. The embodiment of the present invention continues to perform skeleton extraction and expansion on the crack image after threshold segmentation. First, the connected domain of the crack mask image is fused, that is, the scattered breakpoints are connected to achieve the effect of a smooth crack mask. Subsequently, a preliminary morphological operation is performed, and the noise and black spots that may exist in the mask due to the stratification of rock cracks are removed through median filtering, and the possible noise is denoised. For the characterization characteristics of rock cracks after the above preliminary processing, the Zhang-Suen method is selected to extract the skeleton of the crack mask. The algorithm flow chart is shown as follows: Figure 7 shown.

[0194] In a preferred embodiment, step S27 includes:

[0195] Step S271, converting the original crack image pixel values ​​into HSV three-channel values, enhancing the contrast of the image converted into HSV three-channel values, performing threshold segmentation by Otsu threshold segmentation method, generating an initial crack mask, and performing iterative convergence optimization on the crack mask using the average value of the HSV three-channel components as an optimization reference index; ​

[0196] Step S272, respectively calculating the average values ​​of the HSV three-channel components of the mask part and the background part in the converted image, and respectively converting the average values ​​of the HSV three-channel components of the mask part and the background part to three-dimensional coordinates;

[0197] Step S273, select all pixels covered in the mask image, and convert the HSV three-channel values ​​of all pixels into three-dimensional coordinates;

[0198] Step S274, respectively comparing the shortest distances between the HSV three-channel values ​​of all pixels on the image and the average values ​​of the HSV three-channel components of pixels in the crack area and the background area;

[0199] Step S275: Determine the shortest distance D between the selected pixel and the mean of the three HSV channels of the pixel in the crack area. c , the shortest distance D between the selected pixel and the mean of the three HSV channels of the background area pixel b , the selected pixel point is removed from the crack mask area when the following formula is satisfied:

[0200]

[0201] Wherein, α represents the preset adjustment parameter;

[0202] Step S276: convolve all pixels with the selected specific convolution kernel to achieve expansion of the crack area, and subtract the expanded crack mask from the original mask to obtain a new mask. For all pixels in the new mask, add the pixels that meet the formula conditions to the crack mask area according to step S275;

[0203] Step S277, recalculating the HSV three-channel mean of the pixels in the crack mask area and the HSV three-channel mean of the pixels in the background area;

[0204] Step S278, loop through step S272 to step S277 to continuously iterate the crack mask area. When the average value of the HSV three-channel component of the crack mask part changes less than the preset threshold, convergence is performed and the final crack mask -H is output.

[0205] The working principle and beneficial effects of the above technical solution are as follows: first, the input crack image is converted into HSV three-channel color components, and a preliminary crack mask image is obtained by contrast enhancement and Otsu threshold segmentation. The HSV three-channel mean of the image pixels in the crack mask and the background area pixels is used as a reference indicator for clustering iteration to further extract the preliminary crack mask. The specific process is as follows: Figure 8 shown.

[0206] Convert the original crack image pixel value to HSV three-channel value

[0207] The specific formula for converting the image RGB three-channel values ​​into HSV three-channel values ​​is as follows:

[0208]

[0209] V=max

[0210] Among them, max is the maximum value of the original three channels of the input image, and min is the minimum value of the original three channels.

[0211] The image converted into HSV three-channel is contrast enhanced and threshold segmented using the above-mentioned Otsu method to generate an initial crack mask. The crack mask is then iteratively converged and optimized using the average value of the HSV three-channel components as an optimization reference indicator.

[0212] Calculate the average value of the HSV three-channel components of the converted image

[0213] First, calculate the average value of the HSV three-channel components of the pixels in the crack area of ​​the image:

[0214]

[0215] in is the average value of the H channel of the pixels in the crack area, is the average value of the S channel, is the average value of the V channel; NUM c is the total number of pixels in the crack area, H ci , S ci 、V ci are the H, S and V channel values ​​of the i-th pixel in the crack area, respectively.

[0216] Similarly, calculate the average value of the HSV three-channel components of the pixels in the background area of ​​the image:

[0217]

[0218]

[0219] in is the average value of the H channel of the pixels in the crack area, is the average value of the S channel, is the average value of the V channel; NUM b is the total number of pixels in the background area, H bi , S bi 、V bi are the H, S and V channel values ​​of the i-th pixel in the crack area, respectively.

[0220] Convert the HSV three-channel values ​​of the input image to three-dimensional coordinates

[0221] Define the height of the cone model as the Z axis. The HSV channel components need to be converted to spatial coordinates. The calculation formula is as follows:

[0222]

[0223] Z c =V c #(4.32)

[0224] Where X c , Y c and Z c It is the three-dimensional coordinate of the average value of the three HSV channels of the pixel points in the crack area of ​​the image after conversion.

[0225]

[0226] Z b =V b

[0227] Where X b , Y b and Z b It is the three-dimensional coordinate of the average value of the three HSV channels of the background area pixel after conversion.

[0228] Delete pixels identified as cracks in the background area of ​​the image

[0229] Select all pixels covered in the mask image and convert the HSV three-channel values ​​of all pixels into three-dimensional coordinates:

[0230]

[0231] Z i =V i

[0232] Compare the shortest distances between the HSV three-channel values ​​of all pixels on the image and the HSV three-channel mean values ​​of pixels in the crack area and background area. The calculation formula is as follows:

[0233]

[0234] Where D c is the shortest distance between the selected pixel and the mean of the three HSV channels of the crack area pixel, D b is the shortest distance between the selected pixel and the mean of the three HSV channels of the background area pixels, X i , Y i , Z i The value of the HSV three-flux converted to the three-dimensional coordinates of the selected pixel.

[0235] D b Multiply by the parameter α set according to experience, if the following relationship is satisfied, the pixel point is removed from the crack mask area:

[0236]

[0237] Add the pixels in the crack area of ​​the image to identify them as background

[0238] The crack area is expanded by applying a specific convolution kernel to each pixel of the crack mask. This expansion operation includes pixels outside the crack edge into the crack mask, thereby increasing the size of the mask. Subtracting the expanded crack mask from the original mask can accurately obtain a new mask that only contains pixels within a certain width outside the crack boundary. Calculate the shortest distance D between the corresponding pixels c With D b , if the following relationship is satisfied, then this pixel point is added to the crack mask area:

[0239]

[0240] Update HSV three-channel mean

[0241] The mask area is obtained by removing and adding pixels, and the HSV three-channel mean of the pixels in the crack area is recalculated. The mean of the three channels of HSV of the background area pixels

[0242] Iteration and Convergence

[0243] Through the above steps, the crack mask area is continuously iterated. When the change of the crack mask part is less than the preset threshold, it converges and outputs the final crack mask. This part of the mask is also used in the subsequent weighted fusion algorithm, denoted as M H .

[0244] In a preferred embodiment, step S29 includes:

[0245] Crack mask-U, crack mask-R, crack mask-L and crack mask-H are respectively denoted as M U 、M R 、M L 、M H , the label mask of the crack image is used as the reference item, denoted as M l , the weighted fusion crack mask is recorded as M, and the corresponding random weight parameter is expressed as:

[0246] θ=[θ R ,θ L ,θ H ,θU ]

[0247] Where θ is the total fusion weight, θ R is the mask M R Corresponding weight, θ L is the mask M L Corresponding weight, θ H is the mask M H Corresponding weight, θ U is the mask M U Corresponding weights;

[0248] Perform data normalization on all crack masks:

[0249]

[0250] Among them, A v Represents the data after the standardized operation, x ij is the value of the corresponding pixel on the mask, μ ij is the mean value of each pixel on the mask, σ ij is the standard deviation of each pixel on the mask;

[0251] Convert the crack mask into a matrix for calculation:

[0252] M=[M R , M L , M H , M U ] T

[0253] The label mask M of the crack image dataset l As a reference prediction value, a linear regression model is constructed:

[0254] M l =θ·M+b+v

[0255] Where ε is the error term, b is the bias term and a constant;

[0256] Define the error term ε as the reference label mask M l Difference from the weighted fusion mask:

[0257] v=M l -θ·Mb

[0258] The error term ε belongs to the standard normal distribution. l -θ×Mb is independent, then ε is independent;

[0259] The weight parameter θ is optimized by minimizing the sum of squared error terms:

[0260]

[0261] where x ij =M lij -θ kij ×M kij , M lij is the value of the pixel corresponding to the label mask, θ kij is the weight of the pixel corresponding to each part of the mask, M kij is the value of the pixel corresponding to each part of the mask, μ = -b;

[0262] By calculation The minimum value of k :

[0263] θ k =(X k T X k ) -1 X k T Y

[0264] Where X k For each part of the mask involved in the weighting, Y is M l ;

[0265] Finally, by calculating θ k So we can get the required weight θ=[θ R ,θ L ,θ H ,θ U ].

[0266] The working principle and beneficial effects of the above technical solution are as follows: pixel-level fusion is often used for the fusion of multiple images, and a specific algorithm is used to fuse two or more images into a new image. After this level of image fusion, the fused image will contain more information features than the image before fusion, achieving information complementarity. The fused image has indeed been improved after comprehensive evaluation, which is more conducive to recognition, judgment and intelligent detection. By directly processing the pixel values ​​of the original image, this method can directly and effectively utilize the collected original pixel information. The image generated by pixel-level image fusion has added more details and content, and the information is accurate and effective, which has been widely studied by some scholars.

[0267] The embodiment of the present invention applies this image fusion method to the crack mask image. Based on the crack mask predicted and segmented by the deep learning model, multiple crack masks extracted based on color space conversion are fused based on preset weights to achieve the purpose of optimizing the crack mask. The specific process is as follows: Fig. 9 As shown in Figure 2, a linear model is constructed by linear regression method to obtain the best weight value for weighted fusion.

[0268] In a preferred embodiment, the method further includes calculating the degree of rock damage according to the geometric representation information of the rock fracture, and the calculation process is as follows:

[0269] A uniform weight distribution rule is pre-set for any continuous rock surface, and the weight distribution rule includes the first rule: the weight coefficient corresponding to the geometric center of the rock surface is set as the origin, and the weight coefficients of other positions on the rock surface follow the weight coefficient corresponding to the origin and decrease linearly toward the edge of the rock surface, thus obtaining the first type of weight distribution;

[0270] The second rule: based on the total area of ​​the rock surface, a preset radius threshold that increases with the increase of the total area is obtained. For any position, a circle is delineated with the position as the origin and the radius threshold as the radius, and all the first-class weight distributions within the circle are counted. The first-class weight with the highest weight within the circle is determined and used as the second-class weight distribution of the position. All positions on the rock surface are traversed and calculated to obtain the second-class weight distribution of all positions on the rock surface.

[0271] According to the geometric representation information of the rock fracture, the second type of weight distribution corresponding to each rock fracture position is determined;

[0272] According to the geometric characterization information of the rock fracture, the rock fracture width at any rock fracture position is determined, and a third type of weight distribution is pre-set that diffuses from the rock fracture skeleton axis to the edge of the rock fracture. The fourth type of weight distribution is obtained by multiplying the rock fracture width with the corresponding product of the third type of weight distribution;

[0273] According to the second type of weight distribution and the fourth type of weight distribution corresponding to each of the rock fracture positions, the damage degree of all positions on the rock surface is calculated, and the total damage degree of the rock surface is obtained by accumulation;

[0274] The degree of rock damage is calculated based on the total damage degree of the rock surface and the thickness from the rock surface to the inside.

[0275] The working principle and beneficial effects of the above technical solution are as follows: considering that the position of rock cracks on the rock, the crack depth and the overall thickness of the rock all have a certain relationship with the overall loss degree of the rock, a weight distribution law is introduced to express the relationship between the degree of rock damage and the position of the cracks, the crack depth and the overall thickness of the rock, wherein the second type of weight distribution is used to express the relationship between the degree of rock damage and the position of the cracks. In comparison, the closer the position of the rock cracks is to the geometric center, the more serious the internal damage of the rock is. Therefore, the first law is proposed: the corresponding weight coefficient is set with the geometric center of the rock surface as the origin, and the weight coefficients of other positions on the rock surface follow the weight coefficient corresponding to the origin and decrease linearly toward the edge of the rock surface, and the first type of weight distribution is obtained. Considering that the rock surface is usually irregular in shape, based only on the first rule, it is very likely that the degree of damage judgment of the geometric protrusions on the rock surface will be lower. For example, the cracks generated at the connection position between the "convex"-shaped rock protrusion and the main body are actually more serious. Therefore, the second rule is proposed: based on the total area of ​​the rock surface, a preset radius threshold that increases with the increase of the total area is obtained (the larger the rock surface area, the larger the radius threshold, so as to synchronously expand the selection range of the first type of weight to adapt to the second type of weight calculation of rocks of different sizes). For any position, a circle is delineated with the position as the origin and the radius threshold as the radius, and all the first type of weight distributions within the circle are counted (the linearly decreasing first type of weight distribution obtained by the first rule, when the rock surface is irregular, the largest first type of weight distribution within a certain range around is selected, which can better reflect the importance of the position point), the first type of weight with the highest weight in the circle is determined and used as the second type of weight distribution of the position, and all positions on the rock surface are traversed and calculated to obtain the second type of weight distribution of all positions on the rock surface. On this basis, considering the relationship between the degree of rock damage and the depth of cracks, it is obvious that the deeper the cracks, the greater the rock damage. Under natural conditions, the crack depth is positively correlated with the crack width to a certain extent, which is reflected in the cracks themselves. The more concentrated the position in the cracks, the deeper the depth of that position on the cracks. The third type of weight distribution proposed by this, comprehensively considers the rock crack width and the third type of weight distribution, and the corresponding product can obtain the fourth type of weight distribution. According to the second type of weight distribution and the fourth type of weight distribution corresponding to any rock crack position, the damage degree of all positions on the rock surface is calculated, and the total damage degree of the rock surface is accumulated to obtain. Finally, according to the total damage degree of the rock surface and the thickness of the rock surface inward, the rock damage degree can be calculated.

[0276] Finally, it should be noted that the above preferred embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail through the above preferred embodiments, those skilled in the art should understand that various changes can be made in form and details without departing from the scope defined by the claims of the present invention.

Claims

1. A method for recognizing rock crack images in a reservoir drawdown zone based on a deep learning network, characterized in that: include: Step S1: Based on U 2 -Net deep learning network to build a rock fracture segmentation model, and use the pre-processed rock fracture image sample set to train the rock fracture segmentation model; Step S2, using the trained rock crack segmentation model to identify the rock crack area in the target image to be identified, to obtain a first type of identification result; Step S3, based on the coordinate position, pixel value and color space attribute of the pixel point in the image, the first type of recognition result is optimized by a crack mask optimization algorithm of multi-algorithm weighted fusion to obtain a second type of recognition result; Step S4: for the second type of recognition results, the width of the rock crack is measured by the maximum inscribed circle method and the orthogonal projection method, so as to obtain the geometric representation information of the rock crack.

2. According to the method for recognizing rock crack images in the drawdown zone of a reservoir area based on a deep learning network in claim 1, it is characterized in that: The U 2 -Net deep learning network contains 6 encoding layers, 5 decoding layers, and a fully connected layer as the final output of the network; The encoding and decoding parts of each layer are residual U-shaped structures, so that the overall network can extract feature information of different scales at each level; In the encoding layer, the model performs downsampling operations. The output of each encoding layer is not only used as the input of the next encoding layer, but also passed to the corresponding decoding layer. At the same time, the encoding layer also calculates its own loss to provide feedback for the end-to-end training of the model. The last encoding layer in the network structure does not perform downsampling, but directly passes its encoding results upward to the decoding part to provide information for the global understanding and detail recovery of the image; Each decoding layer receives the output from the previous decoding layer and the corresponding encoding layer result. The decoding layer calculates its own loss and passes the decoding result upward, gradually completing the image reconstruction process. A saliency probability map is generated at each encoding layer and decoding layer to reflect the saliency of each part of the image. The fully connected layer is responsible for aggregating feature information from all encoding and decoding layers, as well as the saliency probability information generated by each layer, and outputting the model's final recognition result for the image. At the same time, it calculates the final loss function to optimize the performance of the model during the training process.

3. According to the method for recognizing rock crack images in the drawdown zone of a reservoir area based on a deep learning network in claim 1, it is characterized in that: The step S2 comprises: Step S21, converting the original target image into RGB channel and Lab channel respectively to obtain two types of channel images; Step S21, using the Otsu threshold segmentation method to perform threshold segmentation extraction on any type of channel image to obtain a preliminary crack mask; Step S22, clustering the preliminary crack masks using K-means++ clustering algorithm to obtain a first type of crack mask; Step S23, using the Hu matrix and the Canny operator to perform contour recognition and crack extraction on the preliminary crack mask to obtain a third type of crack mask; Step S24, performing denoising, skeleton extraction and expansion processing on the preliminary crack mask to obtain a second type of crack mask; Step S25, according to the first type of crack mask, the second type of crack mask and the third type of crack mask corresponding to the RGB channel image, they are merged and outputted by weighted voting to obtain a crack mask-R; Step S26, according to the first type of crack mask, the second type of crack mask and the third type of crack mask corresponding to the Lab channel image, they are merged and outputted by weighted voting to obtain a crack mask-L; Step S27, converting the original target image into HSV three-channel color components, obtaining a preliminary crack mask image by contrast enhancement and Otsu threshold segmentation method, taking the HSV three-channel mean of the image pixels and the background area pixels in the crack mask image as the reference index for clustering iteration, iteratively extracting the preliminary crack mask image to obtain the crack mask-H; Step S28, according to the first type of recognition result, extract the layer determined to be the location of the crack to obtain a crack mask-U; Step S29: performing weighted fusion based on the preset weights according to the crack mask-R, the crack mask-L, the crack mask-H and the crack mask-U to obtain a final crack mask map and use it as the second type of recognition result.

4. According to the method for recognizing rock crack images in the drawdown zone of a reservoir area based on a deep learning network according to claim 3, it is characterized in that: The step S23 comprises: In OpenCV, the first three matrices of the Hu matrix are used to perform contour recognition on the preliminary crack mask to determine the target area in the image; The critical connected area of ​​the target area is detected by using the breadth-first traversal method, and the points that are not connected, independent, or not judged to be in the crack in the target area are eliminated to obtain the processed crack mask image; The Canny operator is used to perform contour recognition and crack extraction on the processed crack mask image to obtain the third type of crack mask.

5. According to the method for recognizing rock crack images in the drawdown zone of a reservoir area based on a deep learning network in claim 3, it is characterized in that: The step S24 comprises: The connected domain of the preliminary crack mask image is fused, and the isolated island regions are connected to smooth the crack mask; The noise and black spots that may be generated by rock fracture stratification in the fracture mask are removed by median filtering; The skeleton of the crack mask is extracted using the Zhang-Suen skeleton extraction algorithm; The extracted skeleton is filtered and expanded to obtain a second type of crack mask.

6. The method for recognizing rock crack images in the drawdown zone of a reservoir area based on a deep learning network according to claim 3 is characterized in that: The step S27 comprises: Step S271, converting the original crack image pixel values ​​into HSV three-channel values, enhancing the contrast of the image converted into HSV three-channel values, performing threshold segmentation by Otsu threshold segmentation method, generating an initial crack mask, and performing iterative convergence optimization on the crack mask using the average value of the HSV three-channel components as an optimization reference index; Step S272, respectively calculating the average values ​​of the HSV three-channel components of the mask part and the background part in the converted image, and respectively converting the average values ​​of the HSV three-channel components of the mask part and the background part to three-dimensional coordinates; Step S273, select all pixels covered in the mask image, and convert the HSV three-channel values ​​of all pixels into three-dimensional coordinates; Step S274, respectively comparing the shortest distances between the HSV three-channel values ​​of all pixels on the image and the average values ​​of the HSV three-channel components of pixels in the crack area and the background area; Step S275: Determine the shortest distance D between the selected pixel and the mean of the three HSV channels of the pixel in the crack area. c , the shortest distance D between the selected pixel and the mean of the three HSV channels of the background area pixel b , the selected pixel point is removed from the crack mask area when the following formula is satisfied: Wherein, α represents the preset adjustment parameter; Step S276: convolve all pixels with the selected specific convolution kernel to achieve expansion of the crack area, and subtract the expanded crack mask from the original mask to obtain a new mask. For all pixels in the new mask, add the pixels that meet the formula conditions to the crack mask area according to step S275; Step S277, recalculating the HSV three-channel mean of the pixels in the crack mask area and the HSV three-channel mean of the pixels in the background area; Step S278, loop through step S272 to step S277 to continuously iterate the crack mask area. When the average value of the HSV three-channel component of the crack mask part changes less than the preset threshold, convergence is performed and the final crack mask -H is output.

7. The method for recognizing rock crack images in the drawdown zone of a reservoir area based on a deep learning network according to claim 3 is characterized in that: The step S29 comprises: Crack mask-U, crack mask-R, crack mask-L and crack mask-H are respectively denoted as M U 、M R 、M L 、M H , the label mask of the crack image is used as the reference item, denoted as M l , the weighted fusion crack mask is recorded as M, and the corresponding random weight parameter is expressed as: θ=[θ R ,the L ,the H ,the U ] Where θ is the total fusion weight, θ R The mask M R Corresponding weight, θ L The mask M L Corresponding weight, θ H The mask M H Corresponding weight, θ U The mask M U Corresponding weights; Perform data normalization on all crack masks: Among them, A v Represents the data after the standardized operation, x ij is the value of the corresponding pixel on the mask, μ ij is the mean value of each pixel on the mask, σ ij is the standard deviation of each pixel on the mask; Convert the crack mask into a matrix for calculation: M=[M R ,M L ,M H ,M U ] T The label mask M of the crack image dataset l As a reference prediction value, a linear regression model is constructed: M l =θ·M+b+ε Where ε is the error term, b is the bias term and a constant; Define the error term ε as the reference label mask M l Difference from the weighted fusion mask: e=M l -θ·Mb The error term ε belongs to the standard normal distribution. l -θ×Mb is independent, then ε is independent; The weight parameter θ is optimized by minimizing the sum of squared error terms: where x ij =M lij -θ kij ×M kij , M lij is the value of the pixel corresponding to the label mask, θ kij is the weight of the pixel corresponding to each part of the mask, M kij is the value of the pixel corresponding to each part of the mask, μ = -b; By calculation The minimum value of k : θ k =(X k T X k ) -1 X k T Y Where X k For each part of the mask involved in the weighting, Y is M l ; Finally, by calculating θ k So we can get the required weight θ=[θ R ,θ L ,θ H ,θ U ].

8. The method for recognizing rock crack images in the drawdown zone of a reservoir area based on a deep learning network according to claim 1 is characterized in that: It also includes calculating the degree of rock damage based on the geometric representation information of the rock fracture. The calculation process is as follows: A uniform weight distribution rule is pre-set for any continuous rock surface, and the weight distribution rule includes the first rule: the weight coefficient corresponding to the geometric center of the rock surface is set as the origin, and the weight coefficients of other positions on the rock surface follow the weight coefficient corresponding to the origin and decrease linearly toward the edge of the rock surface, thus obtaining the first type of weight distribution; The second rule: based on the total area of ​​the rock surface, a preset radius threshold that increases with the increase of the total area is obtained. For any position, a circle is delineated with the position as the origin and the radius threshold as the radius, and all the first-class weight distributions within the circle are counted. The first-class weight with the highest weight within the circle is determined and used as the second-class weight distribution of the position. All positions on the rock surface are traversed and calculated to obtain the second-class weight distribution of all positions on the rock surface. According to the geometric representation information of the rock fracture, the second type of weight distribution corresponding to each rock fracture position is determined; According to the geometric characterization information of the rock fracture, the rock fracture width at any rock fracture position is determined, and a third type of weight distribution is pre-set that diffuses from the rock fracture skeleton axis to the edge of the rock fracture. The fourth type of weight distribution is obtained by multiplying the rock fracture width with the corresponding product of the third type of weight distribution; According to the second type of weight distribution and the fourth type of weight distribution corresponding to each of the rock fracture positions, the damage degree of all positions on the rock surface is calculated, and the total damage degree of the rock surface is obtained by accumulation; The degree of rock damage is calculated based on the total damage degree of the rock surface and the thickness from the rock surface to the inside.

Citation Information

Patent Citations

  • Pavement crack segmentation and recognition method based on deep learning

    CN110502972A

  • Dam crack detection method based on multi-migration learning model fusion

    CN110544251A

  • Concrete dam crack segmentation method and system based on edge information fusion

    CN118014973A

Cited By

  • Rock slope linear structural plane identification method, device, equipment and medium

    CN120544051A

  • Hydraulic engineering dam body image monitoring method

    CN120853112A