Rock mass crack detection method based on image feature recognition

By adding ECA attention mechanism and data enhancement technology to the InceptionV2 model, the detection accuracy and speed problems in rock fracture detection are solved, and more efficient feature extraction and training stability are achieved, and the accuracy of rock fracture detection is improved. and efficiency.

CN119027778APending Publication Date: 2024-11-26QINGHAI UNIV FOR NATITIES
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411006757.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-25
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

The prior art has insufficient detection accuracy and slow calculation speed in rock mass fracture detection. Traditional convolutional neural network models are difficult to fully capture subtle features, resulting in inaccurate detection results and slow processing speed.

Method used

A feature recognition method based on InceptionV2 model is adopted, an ECA attention mechanism is added, and data enhancement is performed through brightness adjustment and rotation operations, combined with standardized processing and optimizer adjustment, to improve the model's feature extraction ability and training stability.

Benefits of technology

It significantly improves the accuracy and speed of rock mass fracture detection, ensures high performance of the model on the training and verification set, avoids the "neuron death" problem, and improves the stability of gradient descent.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119027778A_ABST
    Figure CN119027778A_ABST
Patent Text Reader

Abstract

The invention discloses a rock mass crack detection method based on image feature recognition, and belongs to the field of rock mass crack recognition, and the method comprises the steps: collecting image data sets of different types of rock masses, and carrying out the marking and classification of rock mass images in the image data sets; randomly combining the crack image and the normal image into an initial image data set, carrying out standardization processing, splitting the initial image data set into a training set and a test set, and carrying out data enhancement; the method comprises the following steps: building a feature recognition model InceptionV2 used for recognizing a rock mass crack in a crack image, adding an ECA attention mechanism in the feature recognition model InceptionV2, training the feature recognition model InceptionV2, and outputting an accurate feature recognition model InceptionV2. According to the method, the characteristics of the rock mass crack in the image can be better extracted, and the detection accuracy is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of rock mass crack image recognition, and in particular to a rock mass crack detection method based on image feature recognition. Background Art

[0002] At present, the detection methods of rock cracks mainly include manual detection and image processing technology. Manual detection usually requires on-site inspection by geological professionals, which is very time-consuming and easily affected by subjective factors, and has a high risk of misjudgment and missed judgment. In the past, traditional image processing technology relied on simple feature extraction and classification algorithms, and its detection accuracy and speed were limited, making it difficult to meet the requirements of high efficiency and high accuracy. However, with the development of deep learning technology, rock crack detection methods based on convolutional neural networks (CNN) have gradually been applied; this method can automatically extract features and significantly improve the accuracy and efficiency of detection. However, the following problems still exist:

[0003] 1. Insufficient detection accuracy: Although the convolutional neural network model performs well in general image classification tasks, its detection accuracy still needs to be improved in the complex case of rock crack detection. The rock crack morphology is complex, and the traditional network model may not be able to fully capture the subtle features, resulting in inaccurate detection results;

[0004] 2. Slow calculation speed: The traditional network model has a complex structure and large amount of calculation, which leads to slow detection speed. Especially when processing large data sets of rock mass images, it may be difficult to meet the requirements of detection accuracy. Summary of the invention

[0005] In view of the above-mentioned deficiencies in the prior art, the present invention provides a rock crack detection method based on image feature recognition, which improves the performance in the rock crack identification process and greatly improves the detection accuracy and speed.

[0006] In order to achieve the above-mentioned object of the invention, the technical solution adopted by the present invention is:

[0007] A rock crack detection method based on image feature recognition is provided, which comprises the following steps:

[0008] S1: Collect image datasets of different types of rock masses, annotate and classify the rock mass images in the image dataset, and divide the rock mass images into crack images with cracks and normal images without cracks;

[0009] S2: Crack images and normal images are randomly combined into an initial image dataset, the images in the initial image dataset are cropped into images of the same size, and standardized, and the standardized initial image dataset is split into a training set and a test set in a ratio of 7:3;

[0010] S3: Perform data enhancement on the images in the training set and the test set by adjusting brightness and rotating the images to obtain the processed training set and the test set;

[0011] S4: Build a feature recognition model InceptionV2 for identifying rock cracks in crack images, add the ECA attention mechanism to the feature recognition model InceptionV2, train the feature recognition model InceptionV2 using the processed training set, adjust the parameters of the feature recognition model InceptionV2 to make the feature recognition model InceptionV2 converge, and output the trained feature recognition model InceptionV2;

[0012] S5: Input the training set into the trained feature recognition model InceptionV2, recognize the images in the test set according to the trained feature recognition model InceptionV2, output the recognition accuracy and F1 score, evaluate the performance of the converged feature recognition model InceptionV2, further correct the trained feature recognition model InceptionV2, and output the accurate feature recognition model InceptionV2.

[0013] Furthermore, the method for normalizing the image in step S2 is:

[0014] S21: Calculate the pixel values ​​of the red R, green G, and blue B channels of the pixel in the j-th row and k-th column of the image i in the initial image data set. Calculate the pixel mean μ of the red R, green G, and blue B channels in the image R , μ B , μ G ;

[0015]

[0016] Where W is the number of columns of pixels in image i, H is the number of rows of pixels in image i, and N is the number of images in the initial image dataset;

[0017] S22: According to the pixel mean μ R , μ B , μ G Calculate the standard deviation σ of each pixel in the red R, green G, and blue B channels R , σ G , σ B ;

[0018]

[0019] S23: Calculate the normalized pixel value of each pixel in image i under the red R, green G and blue B channels according to the standard deviation

[0020]

[0021] Further, step S4 includes:

[0022] S41: Build a feature recognition model InceptionV2 for identifying rock cracks in crack images. The feature recognition model InceptionV2 includes a convolution layer, a normalization layer, and an activation function layer. The activation function f(x) of the convolution layer is:

[0023] f(x)=max(0,x)+α×min(0,x);

[0024] Where x is the pixel value of the image in the training set after processing, and α is the slope of the activation function;

[0025] S42: Add the ECA attention mechanism after the convolutional layer and calculate the size k of the convolution kernel in the convolutional layer.

[0026]

[0027] Among them, C is the number of channels of input features in the convolutional layer, β1 and β2 are hyperparameters, |.| odd Indicates an odd number, ensuring that the size of the convolution kernel k is an odd number;

[0028] S43: After the processed images in the training set pass through the convolution operation of the convolution layer, the convolution is applied to the input features to learn the importance of each input feature channel relative to other channels. After the convolution operation of the convolution kernel of size k, the input feature x in Converted to the output feature y of the convolutional layer out ;

[0029] y out =Con1D k (x in );

[0030] Among them, the input feature x in is the pixel value of the input image, Con1D k (.) is the one-dimensional convolution operation of the convolution kernel, and the output feature y out as subtle features extracted from images;

[0031] S44: Input the subtle features into the loss function to classify the subtle features. The loss function is:

[0032]

[0033] Among them, y is the classification label of the subtle feature, To classify the corresponding category of subtle features, only one of the classification labels is a positive class that meets the standard, and the rest are negative classes. L(.) is the loss function, the positive class is the crack image, and the rest are negative classes;

[0034] S45: Setting the optimizer for training the feature recognition model InceptionV2, the mathematical model of the optimizer is;

[0035] m t =β1×m t-1 +(1-β1)×g t ,

[0036]

[0037] Among them, θ t is the parameter of the feature recognition model InceptionV2 in the current training process, θ t+1 is the updated parameter of the feature recognition model InceptionV2, m t is the first-order moment estimate of the current training process, v t is the second-order moment estimate of the current training process, m t-1 is the first-order moment estimate of the previous training process, v t-1 is the second-order moment estimate of the previous training process, t is the time step of the training process, g t is the gradient on the time step, α is the learning rate of the feature recognition model InceptionV2 training process, is the first-order moment estimate after bias correction for the training process, is the second-order moment estimate after bias correction in the training process, ε is the minimum constant, ε=10 -8 ;

[0038] S46: According to the set learning rate α, the gradient g on the time step t The processed images in the training set are input into the feature recognition model InceptionV2. The hyperparameters β1, β2 and the parameters of the feature recognition model InceptionV2 are adjusted in each training process, and the loss function L(.) is calculated until the loss function converges, and the trained feature recognition model InceptionV2 is output.

[0039] Further, step S5 includes:

[0040] S51: Input the images in the test set into the trained feature recognition model InceptionV2, identify and classify the images in the test set, and calculate the accuracy Acc based on the output recognition results;

[0041]

[0042] Among them, TP is the number of positive images correctly identified, TN is the number of negative images correctly identified, FP is the number of negative images identified as positive, and FN is the number of positive images identified as negative.

[0043] S52: Calculate the recall rate Rec and the precision rate Pre, and calculate the binary classification accuracy F1 according to the recall rate Rec and the precision rate Pre;

[0044]

[0045] S53: Setting the accuracy threshold A 阈值 and the threshold F for the binary classification accuracy score 阈值 , calculate the accuracy coefficient f of the trained feature recognition model InceptionV2;

[0046]

[0047] Among them, δ1 is the influence weight of accuracy on precision coefficient, δ2 is the influence weight of binary classification accuracy on precision coefficient, is the coefficient of deviation;

[0048] S54: According to the threshold value f of the accuracy coefficient 阈值 , evaluate the performance of the trained feature recognition model InceptionV2;

[0049] If f ≥ f 阈值 , then the trained feature recognition model InceptionV2 has good performance and is directly output as the accurate feature recognition model InceptionV2;

[0050] If f <f 阈值 , the trained feature recognition model InceptionV2 has poor performance, return to step S46, reset the learning rate α, the gradient g on the time step t , and train the feature recognition model InceptionV2 until an accurate feature recognition model InceptionV2 is output.

[0051] The beneficial effects of the present invention are as follows: the present invention builds an attention mechanism ECA in the feature recognition model InceptionV2, which can better extract the features of the image, and the detection accuracy is greatly improved. The activation function introduces a negative slope, and the "neuron death" problem will not occur due to negative input, thereby improving the stability of gradient descent; it converges faster during training, and the performance on the verification set is not affected. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 This is a flow chart of the rock crack detection method based on image feature recognition. DETAILED DESCRIPTION

[0053] The specific implementation modes of the present invention are described below so that those skilled in the art can understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific implementation modes. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations utilizing the concept of the present invention are protected.

[0054] like Figure 1 As shown, a rock crack detection method based on image feature recognition includes the following steps:

[0055] S1: Collect image datasets of different types of rock masses, and annotate and classify the rock mass images in the image datasets, dividing the rock mass images into crack images with cracks and normal images without cracks.

[0056] S2: Randomly combine the crack images and normal images into an initial image dataset, crop the images in the initial image dataset into images of the same size, so that the image size is consistent, all 299 × 299 pixels, and perform standardization. The initial image dataset should contain images of different types of rock masses in multiple regions. If the dataset acquisition area and type are too single, the generalization ability of the model image recognition will be poor. The standardized initial image dataset is split into a training set and a test set in a ratio of 7:3.

[0057] The method for normalizing the image in step S2 is to reduce the noise interference of the image through normalization:

[0058] S21: Calculate the pixel values ​​of the red R, green G, and blue B channels of the pixel in the j-th row and k-th column of the image i in the initial image data set. Calculate the pixel mean μ of the red R, green G, and blue B channels in the image R , μ B , μ G ;

[0059]

[0060] Where W is the number of columns of pixels in image i, H is the number of rows of pixels in image i, and N is the number of images in the initial image dataset;

[0061] S22: According to the pixel mean μ R, μ B , μ G Calculate the standard deviation σ of each pixel in the red R, green G, and blue B channels R , σ G , σ B ;

[0062]

[0063] S23: Calculate the normalized pixel value of each pixel in image i under the red R, green G and blue B channels according to the standard deviation

[0064]

[0065] S3: Perform data enhancement on the images in the training set and test set by adjusting brightness and rotating them to obtain processed training sets and test sets, thereby enhancing the generalization ability of the model in image recognition.

[0066] S4: Build a feature recognition model InceptionV2 for identifying rock cracks in crack images, add the ECA attention mechanism to the feature recognition model InceptionV2, train the feature recognition model InceptionV2 using the processed training set, adjust the parameters of the feature recognition model InceptionV2 to make the feature recognition model InceptionV2 converge, and output the trained feature recognition model InceptionV2.

[0067] Step S4 specifically includes:

[0068] S41: Build a feature recognition model InceptionV2 for identifying rock cracks in crack images. The feature recognition model InceptionV2 includes a convolution layer, a normalization layer, and an activation function layer. The activation function f(x) of the convolution layer is:

[0069] f(x)=max(0,x)+α×min(0,x);

[0070] Where x is the pixel value of the image in the training set after processing, and α is the slope of the activation function;

[0071] S42: Add the ECA attention mechanism after the convolutional layer and calculate the size k of the convolution kernel in the convolutional layer.

[0072]

[0073] Among them, C is the number of channels of input features in the convolutional layer, β1 and β2 are hyperparameters, |.| odd Indicates an odd number, ensuring that the size of the convolution kernel k is an odd number;

[0074] S43: After the processed images in the training set pass through the convolution operation of the convolution layer, the convolution is applied to the input features to learn the importance of each input feature channel relative to other channels. After the convolution operation of the convolution kernel of size k, the input feature x in Converted to the output feature y of the convolutional layer out ;

[0075] y out =Con1D k (x in );

[0076] Among them, the input feature x in is the pixel value of the input image, Con1D k (.) is the one-dimensional convolution operation of the convolution kernel, and the output feature y out as subtle features extracted from images;

[0077] S44: Input the subtle features into the loss function to classify the subtle features. The loss function is:

[0078]

[0079] Among them, y is the classification label of the subtle feature, To classify the corresponding category of subtle features, only one of the classification labels is a positive class that meets the standard, and the rest are negative classes. L(.) is the loss function, the positive class is the crack image, and the rest are negative classes;

[0080] S45: Setting the optimizer for training the feature recognition model InceptionV2, the mathematical model of the optimizer is;

[0081] m t =β1×m t-1 +(1-β1)×g t ,

[0082]

[0083] Among them, θ t is the parameter of the feature recognition model InceptionV2 in the current training process, θ t+1 is the updated parameter of the feature recognition model InceptionV2, m t is the first-order moment estimate of the current training process, v t is the second-order moment estimate of the current training process, m t-1 is the first-order moment estimate of the previous training process, v t-1 is the second-order moment estimate of the previous training process, t is the time step of the training process, g tis the gradient on the time step, α is the learning rate of the feature recognition model InceptionV2 training process, is the first-order moment estimate after bias correction for the training process, is the second-order moment estimate after bias correction in the training process, ε is the minimum constant, ε=10 -8 ;

[0084] S46: According to the set learning rate α, the gradient g on the time step t The processed images in the training set are input into the feature recognition model InceptionV2. The hyperparameters β1, β2 and the parameters of the feature recognition model InceptionV2 are adjusted in each training process, and the loss function L(.) is calculated until the loss function converges, and the trained feature recognition model InceptionV2 is output.

[0085] S5: Input the training set into the trained feature recognition model InceptionV2, recognize the images in the test set according to the trained feature recognition model InceptionV2, output the recognition accuracy and F1 score, evaluate the performance of the converged feature recognition model InceptionV2, further correct the trained feature recognition model InceptionV2, and output the accurate feature recognition model InceptionV2.

[0086] Step S5 specifically includes:

[0087] S51: Input the images in the test set into the trained feature recognition model InceptionV2, identify and classify the images in the test set, and calculate the accuracy Acc based on the output recognition results;

[0088]

[0089] Among them, TP is the number of positive images correctly identified, TN is the number of negative images correctly identified, FP is the number of negative images identified as positive, and FN is the number of positive images identified as negative.

[0090] S52: Calculate the recall rate Rec and the precision rate Pre, and calculate the binary classification accuracy F1 according to the recall rate Rec and the precision rate Pre;

[0091]

[0092] S53: Setting the accuracy threshold A 阈值 and the threshold F for the binary classification accuracy score 阈值 , calculate the accuracy coefficient f of the trained feature recognition model InceptionV2;

[0093]

[0094] Among them, δ1 is the influence weight of accuracy on precision coefficient, δ2 is the influence weight of binary classification accuracy on precision coefficient, is the deviation coefficient; the performance of the feature recognition model InceptionV2 is calculated and evaluated by introducing the natural exponential function. The natural exponential function is an increasing function. The greater the gap between the two indicators and the threshold, the greater the precision coefficient f, which proves that the performance of the feature recognition model InceptionV2 is better. The threshold A 阈值 is the minimum value allowed by accuracy, the threshold F 阈值 It is the minimum value of the binary classification accuracy score. The coefficient of deviation is used to correct the allowable deviation value to avoid the influence of accidental errors on performance evaluation.

[0095] S54: According to the threshold value f of the accuracy coefficient 阈值 , evaluate the performance of the trained feature recognition model InceptionV2;

[0096] If f ≥ f 阈值 , then the trained feature recognition model InceptionV2 has good performance and is directly output as the accurate feature recognition model InceptionV2;

[0097] If f <f 阈值 , the trained feature recognition model InceptionV2 has poor performance, return to step S46, reset the learning rate α, the gradient g on the time step t , and train the feature recognition model InceptionV2 until an accurate feature recognition model InceptionV2 is output.

[0098] The present invention builds an attention mechanism ECA in the feature recognition model InceptionV2, which can better extract image features and greatly improve the detection accuracy. The activation function introduces a negative slope, and the "neuron death" problem will not occur due to negative input, thereby improving the stability of gradient descent; it converges faster during training, and its performance on the validation set is not affected.

Claims

1. A rock crack detection method based on image feature recognition, characterized in that: The following steps are involved: S1: Collect image datasets of different types of rock masses, annotate and classify the rock mass images in the image dataset, and divide the rock mass images into crack images with cracks and normal images without cracks; S2: Crack images and normal images are randomly combined into an initial image dataset, the images in the initial image dataset are cropped into images of the same size, and standardized, and the standardized initial image dataset is split into a training set and a test set in a ratio of 7:3; S3: Perform data enhancement on the images in the training set and the test set by adjusting brightness and rotating the images to obtain the processed training set and the test set; S4: Build a feature recognition model InceptionV2 for identifying rock cracks in crack images, add the ECA attention mechanism to the feature recognition model InceptionV2, train the feature recognition model InceptionV2 using the processed training set, adjust the parameters of the feature recognition model InceptionV2 to make the feature recognition model InceptionV2 converge, and output the trained feature recognition model InceptionV2; S5: Input the training set into the trained feature recognition model InceptionV2, recognize the images in the test set according to the trained feature recognition model InceptionV2, output the recognition accuracy and F1 score, evaluate the performance of the converged feature recognition model InceptionV2, further correct the trained feature recognition model InceptionV2, and output the accurate feature recognition model InceptionV2.

2. The rock mass crack detection method based on image feature recognition according to claim 1 is characterized in that: The method for performing standardization processing on the image in step S2 is: S21: Calculate the pixel values ​​of the red R, green G, and blue B channels of the pixel in the j-th row and k-th column of the image i in the initial image data set. Calculate the pixel mean μ of the red R, green G, and blue B channels in the image R , μ B , μ G ; Where W is the number of columns of pixels in image i, H is the number of rows of pixels in image i, and N is the number of images in the initial image dataset; S22: According to the pixel mean μ R , μ B , μ G Calculate the standard deviation σ of each pixel in the red R, green G, and blue B channels R , σ G , σ B ; S23: Calculate the normalized pixel value of each pixel in image i under the red R, green G and blue B channels according to the standard deviation 3. The rock mass crack detection method based on image feature recognition according to claim 2 is characterized in that: The step S4 comprises: S41: construct a feature recognition model InceptionV2 for identifying rock cracks in the crack image. The feature recognition model InceptionV2 includes a convolution layer, a normalization layer, and an activation function layer. The activation function f(x) of the convolution layer is: f(x)=max(0,x)+α×min(0,x); Where x is the pixel value of the image in the training set after processing, and α is the slope of the activation function; S42: Add the ECA attention mechanism after the convolutional layer and calculate the size k of the convolution kernel in the convolutional layer. Among them, C is the number of channels of input features in the convolutional layer, and β1 and β2 are both hyperparameters. odd Indicates an odd number, ensuring that the size of the convolution kernel k is an odd number; S43: After the processed images in the training set pass through the convolution operation of the convolution layer, the convolution is applied to the input features to learn the importance of each input feature channel relative to other channels. After the convolution operation of the convolution kernel of size k, the input feature x in Converted to the output feature y of the convolutional layer out ; and out =Con1D k (x in ); Among them, the input feature x in is the pixel value of the input image, Con1D k (.) is the one-dimensional convolution operation of the convolution kernel, and the output feature y out as subtle features extracted from images; S44: Input the subtle features into the loss function to classify the subtle features. The loss function is: Among them, y is the classification label of the subtle feature, To classify the corresponding category of subtle features, only one of the classification labels is a positive class that meets the standard, and the rest are negative classes. L(.) is the loss function, the positive class is the crack image, and the rest are negative classes; S45: Setting the optimizer for training the feature recognition model InceptionV2, the mathematical model of the optimizer is; m t =β1×m t-1 +(1-β1)×g t , Among them, θ t is the parameter of the feature recognition model InceptionV2 in the current training process, θ t+1 is the updated parameter of the feature recognition model InceptionV2, m t is the first-order moment estimate of the current training process, v t is the second-order moment estimate of the current training process, m t-1 is the first-order moment estimate of the previous training process, v t-1 is the second-order moment estimate of the previous training process, t is the time step of the training process, g t is the gradient on the time step, α is the learning rate of the feature recognition model InceptionV2 training process, is the first-order moment estimate after bias correction for the training process, is the second-order moment estimate after bias correction in the training process, ε is the minimum constant, ε=10 -8 ; S46: According to the set learning rate α, the gradient g on the time step t The processed images in the training set are input into the feature recognition model InceptionV2. The hyperparameters β1, β2 and the parameters of the feature recognition model InceptionV2 are adjusted in each training process, and the loss function L(.) is calculated until the loss function converges, and the trained feature recognition model InceptionV2 is output.

4. The rock mass crack detection method based on image feature recognition according to claim 3 is characterized in that: The step S5 comprises: S51: Input the images in the test set into the trained feature recognition model InceptionV2, identify and classify the images in the test set, and calculate the accuracy Acc based on the output recognition results; Among them, TP is the number of positive images correctly identified, TN is the number of negative images correctly identified, FP is the number of negative images identified as positive, and FN is the number of positive images identified as negative. S52: Calculate the recall rate Rec and the precision rate Pre, and calculate the binary classification accuracy F1 according to the recall rate Rec and the precision rate Pre; S53: Setting the accuracy threshold A 阈值 and the threshold F for the binary classification accuracy score 阈值 , calculate the accuracy coefficient f of the trained feature recognition model InceptionV2; Among them, δ1 is the influence weight of accuracy on precision coefficient, δ2 is the influence weight of binary classification accuracy on precision coefficient, is the coefficient of deviation; S54: According to the threshold value f of the accuracy coefficient 阈值 , evaluate the performance of the trained feature recognition model InceptionV2; If f ≥ f 阈值 , then the trained feature recognition model InceptionV2 has good performance and is directly output as the accurate feature recognition model InceptionV2; If f <f 阈值 , the trained feature recognition model InceptionV2 has poor performance, return to step S46, reset the learning rate α, the gradient g on the time step t , and train the feature recognition model InceptionV2 until an accurate feature recognition model InceptionV2 is output.