A Rail Defect Detection Method and System Based on Deep Residual Shrinkage Network
Through the method based on the deep residual shrinking network, the problems of low detection rate, high false alarm rate and high manual intervention rate of rail damage defect detection in the prior art are solved, and more efficient and accurate rail damage defect detection are achieved.
Patent Information
- Application Number
- CN202111120010.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-24
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2041-09-24
AI Technical Summary
In the prior art, the detection of rail damage defects has problems such as low detection rate, high false alarm rate, high manual intervention rate, high labor intensity and easy to miss injury defects.
The rail defect detection method based on the deep residual shrinking network is adopted to achieve efficient detection of rail damage defects through data preprocessing, feature extraction, model training and classification. Specific steps include data preprocessing, feature extraction (such as residual features and soft thresholding), model training and classification.
The detection rate of rail damage defects is improved, the false alarm rate and manual intervention rate are reduced, the robustness and classification accuracy of the model are enhanced, and the impact of noise on detection results is reduced.
Smart Images

Figure CN113888488B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method for detecting steel rails, and in particular to a method and system for detecting steel rail defects based on a deep residual shrinkage network. Background Art
[0002] On the basis that the hardware of large-scale steel rail flaw detection vehicles has gradually matured, the steel rail damage and defect detection technology related to deep learning technology lags behind, resulting in problems such as low damage detection rate, high false alarm rate, high manual intervention rate, high labor intensity, and easy omission of steel rail damage and defects. Summary of the Invention
[0003] To solve the problems existing in the detection of steel rail damage and defects in the prior art, the present invention provides a method and system for detecting steel rail defects based on a deep residual shrinkage network, which can more accurately and efficiently detect steel rail damage and defects through deep learning technology.
[0004] The method for detecting steel rail defects based on a deep residual shrinkage network of the present invention includes the following steps:
[0005] S1: Perform data preprocessing on the damage image data of existing steel rails and clean the data;
[0006] S2: Extract features from the cleaned damage image data to obtain feature vectors of corresponding damages;
[0007] S3: Train and learn the features of the damage image to obtain an optimal classification model;
[0008] S4: Obtain steel rail damage image data, and after classification by the optimal classification model, obtain a list of damage defects.
[0009] The present invention is further improved. In step S1, the method for preprocessing the steel rail damage defect image data includes: image sharpening, image rotation, image random cropping, or / and image mosaic processing. By performing preprocessing operations on the steel rail damage defect image, the influence of salt-and-pepper noise is reduced to a certain extent. At the same time, by increasing different samples, the samples for training are increased, which is convenient for increasing the robustness of the model.
[0010] The present invention is further improved. In step S2, the method for feature extraction is as follows: According to the damage image data of existing steel rails, through the cross-layer identity residual function f(x l , w l ) = x l+1 - h(x l ), perform feature extraction on the damage image data in multiple dimensions. First, obtain the direct mapping function h(x l ) of the damage image data features, and then according to the direct mapping function h(xl ) and deeper network feature x l+1 The obtained residual function f(x l , w l ), for each damaged image data through the residual function f(x l , w l ), the residual features between multiple dimensions of the image can be obtained.
[0011] Another improvement of the present invention is that in step S2, the method adopted for feature extraction is: the soft thresholding function sf(inputM, t) is used to perform noise reduction processing on the damaged image data, and the separation of the damaged features and noise features of the damaged image features in the interval [-t, t] is obtained. The soft thresholding function sf(inputM, t) is:
[0012]
[0013] where inputM is the damaged image data before processing, and sf(inputM, t) represents the damaged image data after noise reduction processing.
[0014] A third improvement of the present invention is that in step S2, the method adopted for feature extraction is: calculating the global feature relationship between the damaged image data of the existing steel rails, performing weighted calculation on each channel of the feature map, enhancing the useful feature channels and weakening the redundant feature channels, and its feature representation is the global description feature.
[0015] A further improvement of the present invention is to use a soft attention mechanism to calculate the global descriptive features between features. The structure of the soft attention mechanism is: global average pooling - fully connected layer - RELU activation function - fully connected layer - Sigmoid activation function - Scale size change operation. The two-layer fully connected layer constructed forms a Bottleneck bottleneck structure, constructing new features by first reducing and then enlarging the size of the feature map to obtain the correlation between channels, and obtaining the damaged feature weights with the same dimension of input and output.
[0016] A further improvement of the present invention is that the method of the soft attention mechanism for data processing is:
[0017] A. Perform a dimensionality reduction operation on the input damaged features through a fully connected layer, that is, each neuron is weighted to the output neuron. Since the number of output neurons is small, the input features are reduced to 1 / 8 of the original;
[0018] B. Obtain non-linear features through the RELU activation function. The non-linear activation function RELU can perform non-linear weighting on the features and can avoid the problem of weight disappearance to a certain extent;
[0019] C. Ascend the damage features back to the original input dimension through a fully connected layer, that is, based on the feature map, the obvious regions in the original input image can be inversely deduced, namely, the features obtained by the attention mechanism are realized;
[0020] D. Obtain a normalized weight between 0 and 1 through a Sigmoid gate, and finally, through a Scale operation, weight the normalized weight to the features of each channel to realize the normalization of the features.
[0021] In the fourth improvement of the present invention, the method for feature extraction is as follows:
[0022] (1) According to the damage image data of the existing rail, through the cross-layer identity residual function f(x l , w l ) = x l+1 - h(x l ) of the residual network, perform feature extraction in multiple dimensions on the damage image data. First, obtain the direct mapping function h(x l ) of the damage image data features, and then, according to the residual function f(x l ) obtained from the direct mapping function h(x l+1 ) and the deeper network features x l , w l ), for each damage image data passing through the residual function f(x l , w l ), the residual features between multiple dimensions of the image can be obtained;
[0023] (2) Based on the residual features obtained in step (1), use the soft thresholding function sf(inputM, t) to perform noise reduction processing on the residual features, and obtain the separation situation of the damage features and noise features of the residual features in the interval [-t, t]. The soft thresholding function sf(inputM, t) is:
[0024]
[0025] Among them, inputM is the data before processing, and sf(inputM, t) represents the data after noise reduction processing;
[0026] (3) Based on the residual features of the damage image data obtained in step (1), use the soft attention mechanism to calculate the global descriptive features between the features, and obtain more non-linear features and complex correlation features between channels.
[0027] In a further improvement of the present invention, in step S3, the specific processing method is: calculate the gradients between each layer of the network, and learn the feature weights through forward propagation and backward feedback to obtain the optimal deep residual shrinkage network damage classification model. The specific steps are as follows:
[0028] a) According to the input data, i.e., the damage characteristics, and the cross-entropy loss function, the loss surface is first automatically initialized;
[0029] b) Calculate the forward propagation weights of the features between each layer of the network through one iteration;
[0030] c) After one forward calculation, calculate the values that the forward propagation weights of each layer of the network need to callback according to the loss function, and after one backpropagation, correct the forward propagation weight parameters of each layer of the network;
[0031] d) Continuously iterate steps b) and c). In each iteration, the loss value always decreases towards the side with a smaller loss value along the direction with the largest gradient of the loss surface until the loss value is small enough, that is, it has been iterated to the global optimal point of the loss surface, and the optimal damage classification model is obtained.
[0032] The present invention also provides a system for implementing the rail defect detection method based on the deep residual shrinkage network, including:
[0033] A preprocessing module: used to perform data preprocessing on the damage image data of the existing rail and clean the data;
[0034] A feature vector extraction module: used to extract features from the cleaned damage image data to obtain the feature vectors of the corresponding damage;
[0035] An optimal classification model creation module: used to train and learn the features of the damage image to obtain the optimal classification model;
[0036] A damage classification module: used to obtain the rail damage image data, and through the classification of the optimal classifier, obtain a list of damage defects.
[0037] Compared with the prior art, the beneficial effects of the present invention are: no manual intervention is required, the labor cost is reduced, and the damage detection rate is high; the trained classification model has high classification accuracy and robustness; by using residual features and soft thresholding to extract features, the influence of noise on damage can be well suppressed, the accuracy of damage features can be improved, and thus the recall rate of damage detection can be increased; the attention mechanism is adopted to extract the global descriptive features between the damage feature channels, which can better extract the non-linear features and the correlation of the feature channels, so as to classify the damage defects more accurately and precisely. Description of the Drawings
[0038] Figure 1 It is a flow chart of the method of the present invention. Detailed Embodiments
[0039] The present invention will be further described in detail below with reference to the drawings and embodiments.
[0040] As shown Figure 1 in the figure, the present invention adopts damage feature extraction and classification processing on the rail damage image data, and finally obtains a list of damage defects. The present invention includes the following steps:
[0041] S1: Based on the existing rail damage image data, data preprocessing is performed to clean the data;
[0042] S2: Feature extraction is performed on the cleaned rail damage image data to obtain the feature vectors of the corresponding damages;
[0043] S3: Training and learning are performed on the features of the rail damage images to obtain an optimal classification model;
[0044] S4: Obtain the rail damage image data, and after classification by the optimal classification model, obtain a list of damage defects.
[0045] In step S1 of this example, the rail damage defect image data preprocessing methods adopted are: image sharpening, image rotation, image random cropping, image mosaic processing, etc. By performing preprocessing operations on the rail damage defect images, the influence of salt-and-pepper noise, etc. can be reduced to a certain extent. At the same time, by increasing the differential samples, the samples for training are increased, which is convenient for increasing the robustness of the model.
[0046] As an embodiment of the present invention, the feature extraction in step S2 is based on the residual characteristics obtained from the rail damage image data. In this example, the damage image data at the rail head, rail web, and rail bottom positions are selected and passed through the residual function f(x l , w l ) = x l+1 - h(x l ) to extract the damage features F 1 between each channel at each position. Its matrix representation is as follows:
[0047]
[0048] Among them, in the matrix representation of F 1 , the matrix element f ij represents the dimensional feature of the j-th row and the i-th column. i = 1, 2, 3,..., h, j = 1, 2, 3,..., w, and h×w represents the dimension of the damage feature F 1 . h represents the longitudinal dimensional feature of the damage image, and w represents the transverse dimensional feature of the damage image.
[0049] As another embodiment of the present invention, the feature extraction in this example is based on the feature distribution obtained from the rail damage image data. The damage image data at the rail head, rail web, and rail bottom positions are passed through the soft threshold function y = y(x, t) to judge the feature distribution F between the damage features and the noise features within the feature interval [-t, t]2 , thus effectively suppressing the influence of noise features on damage features, and its matrix representation is as follows:
[0050]
[0051] Among them, F 2 In the matrix representation of, the matrix element d ij represents the dimensional feature of the j-th row and the i-th column, i = 1, 2, 3,..., h, j = 1, 2, 3,..., w, and h×w represents the feature distribution F 2 's dimension, h represents the longitudinal dimensional feature of the damage image, and w represents the transverse dimensional feature of the damage image.
[0052] As the third embodiment of the present invention, the feature extraction in this example is the global descriptive feature obtained according to the rail damage image data. The damage image data at the rail head, rail waist, and rail bottom positions extract the relationships between the respective feature channels through the global feature relationship, and then obtain the global descriptive feature F 3 , and its matrix representation is as follows:
[0053]
[0054] Among them, F 3 In the matrix representation of, the matrix element r ij represents the dimensional feature of the j-th row and the i-th column, i = 1, 2, 3,..., h, j = 1, 2, 3,..., w, and h×w represents the dimension of the global descriptive feature F 3 , h represents the longitudinal dimensional feature of the damage image, and w represents the transverse dimensional feature of the damage image.
[0055] As a preferred embodiment of the present invention, this example combines the above three embodiments to perform feature extraction on the damage image data. This example includes the following steps:
[0056] 1) Based on the damage image data of the existing rail, perform feature extraction of the convolution and residual function, that is, extract the F 1 feature.
[0057] Specifically, according to the damage image data at the rail head, rail waist, and rail bottom positions, perform feature extraction respectively. Taking one of the damage image data as an example,
[0058] According to the residual function f(x l , w l ) = x l+1 -h(x l ), through recursion, the feature of the deep network layer l + 1 can be obtained, and its expression form is as follows:
[0059]
[0060] Among them, l represents the l-th layer feature unit, and x l+1 represents the feature x of the l-th layer feature unit l plus the residual function, that is to say, there are residual features between the l-th layer feature network and the (l + 1)-th layer feature network for the damaged image data.
[0061] 2) Perform a soft thresholding operation on the features extracted in step 1 for noise reduction, that is, use soft thresholding on the basis of the F 1 features to extract the F 2 features.
[0062] According to the residual features of the damaged image data obtained in step (1), the soft thresholding function sf(inputM,t) is adopted in this example
[0063]
[0064] Among them, sf(inputM,t) represents the distribution of damaged features and noise features of the damaged image features in the interval [-t,t]. Since the form presented by the damage in the ultrasonic B-mode image is always continuous and shows a trend, the important part will gradually stand out in the features after being processed by the residual function. Since the sf(inputM,t) function will set the values within [-t,t] to 0, that is, set the non-prominent noise part without damaged features to 0, thus reducing the noise information contained in the features. inputM represents the matrix representation form of the residual features.
[0065] 3) By scanning the global features of the damaged image, obtain local useful feature information, enhance the useful information and suppress the redundant feature information, that is, obtain the F 3 features.
[0066] According to the residual features of the damaged image data obtained in step (1), the soft attention mechanism is adopted in this example to calculate the global descriptive features between the features, which can obtain more non-linear features and complex correlation features between channels. The structure of the soft attention mechanism is global average pooling (GAP) - fully connected layer (FC) - RELU activation function - fully connected layer (FC) - Sigmoid activation function - Scale size change operation. The two constructed fully connected layers form a Bottleneck structure to obtain the correlation between channels and obtain the damaged feature weights with the same dimension of input and output. The specific steps are as follows:
[0067] a) First, perform a dimensionality reduction operation on the input damage features through a fully connected layer. That is, each neuron is weighted to the output neuron. Since the number of output neurons is small, the input features are reduced to 1 / 8 of the original size.
[0068] b) Then, obtain more non-linear features through the RELU activation function. The non-linear activation function RELU can perform non-linear weighting on the features and can, to a certain extent, avoid the problem of vanishing weights.
[0069] c) Next, raise the damage features back to the original input dimension through a fully connected layer. That is, according to the feature map, the obvious regions in the original input image can be deduced again, which means implementing the attention mechanism to obtain features.
[0070] d) Then, obtain a normalized weight between 0 and 1 through a Sigmoid gate. Finally, perform a Scale operation to weight the normalized weight to the features of each channel to achieve feature normalization.
[0071] In step S3, train and learn based on the damage features constructed according to steps 1) to 3), calculate the gradients between each layer of the network, and learn the feature weights through forward propagation and backward feedback to obtain the optimal damage classification model of the deep residual shrinkage network. The specific steps are as follows:
[0072] a) According to the input data, that is, the damage features and the cross-entropy loss function, first automatically initialize the loss surface.
[0073] b) Calculate the forward propagation weights of the features between each layer of the network through one iteration.
[0074] c) After one forward calculation, calculate the value that needs to be called back for the forward propagation weights of each layer of the network according to the loss function, and correct the forward propagation weight parameters of each layer of the network through one backward propagation.
[0075] d) Continuously iterate steps b) and c). In each iteration, the loss value always decreases towards the direction with a smaller loss value along the direction with the largest gradient of the loss surface until the loss value is small enough, that is, it has been iterated to the global optimal point of the loss surface. Obtain the optimal damage classification model.
[0076] Using the classification model training method of the present invention, the trained model has a high classification accuracy and robustness.
[0077] Compared with the prior art, the advantages of the present invention are:
[0078] 1. By extracting features through residual features and soft thresholding, the influence of noise on damage can be well suppressed, the accuracy of damage features can be improved, and thus the recall rate of damage detection can be enhanced.
[0079] 2. The attention mechanism is adopted to extract the global descriptive features among the damaged feature channels, which can better extract the non-linear features and the correlation of feature channels, so as to classify the damaged defects more favorably and accurately.
[0080] The present invention also provides a system for implementing the rail defect detection method based on the deep residual shrinkage network, including:
[0081] A preprocessing module: used for preprocessing the data based on the damaged image data of the existing rail and cleaning the data;
[0082] A feature vector extraction module: used for extracting features from the cleaned damaged image data to obtain the feature vectors of the corresponding damages;
[0083] An optimal classification model creation module: used for training and learning the features of the damaged images to obtain the optimal classification model;
[0084] A damage classification module: used for obtaining the rail damage image data, classifying it through the optimal classifier, and obtaining a list of damage defects.
[0085] The above specific implementation manners are the preferred implementation manners of the present invention, and do not limit the specific implementation scope of the present invention. The scope of the present invention includes but is not limited to this specific implementation manner. All equivalent changes made in accordance with the present invention are within the protection scope of the present invention.
Claims
1. A method for detecting rail defects based on a deep residual shrinkage network, characterized in that, it includes the following steps: S1: Perform data preprocessing on the existing rail damage image data and clean the data; S2: Extract features from the cleaned rail damage image data to obtain the feature vectors of the corresponding rail damage; S3: Train and learn the features of the rail damage image to obtain the optimal classification model; S4: Obtain the rail damage image data, and after classification by the optimal classification model, obtain the list of rail damage defects. In step S3, the specific processing method is: calculate the gradients between the layers of the network, and learn the feature weights through forward propagation and backward feedback to obtain the optimal deep residual shrinkage network rail damage classification model. The specific steps are as follows: a) According to the input data, that is, the rail damage features, and the cross-entropy loss function, first automatically initialize the loss surface; b) Calculate the forward propagation weights of the features between the layers of the network through one iteration; c) After one forward calculation, calculate the values that need to be called back for the forward propagation weights of each layer of the network according to the loss function, and through one backward propagation, correct the forward propagation weight parameters of each layer of the network; d) Continuously iterate steps b) and c). Each time an iteration is performed, the loss value always decreases towards the side with a smaller loss value along the direction with the largest gradient of the loss surface, and finally the loss value is small enough, that is, it has been iterated to the global optimal point of the loss surface to obtain the optimal rail damage classification model.
2. The method for detecting rail defects based on a deep residual shrinkage network according to claim 1, characterized in that: In step S1, the preprocessing method for the rail damage defect image data adopted includes: image sharpening, image rotation, image random cropping or / and image mosaic processing. By performing preprocessing operations on the rail damage defect image, the influence of salt-and-pepper noise is reduced to a certain extent, and at the same time, by increasing the differential samples, the number of samples for training is increased.
3. The method for detecting rail defects based on a deep residual shrinkage network according to claim 1, characterized in that: In step S2, the method for feature extraction is as follows: Based on the damage image data of existing rails, through the cross-layer identity residual function f(x l ,w l ) = x l+1 - h(x l ), feature extraction in multiple dimensions is performed on the damage image data. First, the direct mapping function h(x l ) of the damage image data features is obtained. Then, according to the residual function f(x l ) obtained from the direct mapping function h(x l+1 ) and the deeper network features x l ,w l ), for each damage image data passing through the residual function f(x l ,w l ), the residual features between multiple dimensions of the image can be obtained.
4. The method for detecting rail defects based on a deep residual shrinkage network according to claim 1, characterized in that: In step S2, the method for feature extraction adopted is: the soft thresholding function sf(inputM,t) is used to perform noise reduction processing on the rail damage image data, and the separation of the rail damage features and noise features in the interval [-t,t] of the rail damage image features is obtained. The soft thresholding function sf(inputM,t) is: where inputM is the rail damage image data before processing, and sf(inputM,t) represents the rail damage image data after noise reduction processing.
5. The method for detecting rail defects based on a deep residual shrinkage network according to claim 1, characterized in that: In step S2, the method for feature extraction adopted is: calculate the global feature relationship between the existing rail damage image data, perform weighted calculation on each channel of the feature map, enhance the useful feature channels and weaken the redundant feature channels, and its feature representation is the global description feature.
6. The method for detecting rail defects based on a deep residual shrinkage network according to claim 5, It is characterized in that: A soft attention mechanism is adopted to calculate the global descriptive features between features. The structure of the soft attention mechanism is: global average pooling - fully connected layer - RELU activation function - fully connected layer - Sigmoid activation function - Scale size change operation. The constructed two-layer fully connected layer forms a Bottleneck bottleneck structure to obtain the correlation between channels, that is, the network output feature size first becomes smaller and then larger, and the damage feature weights with the same dimension of input and output are obtained.
7. The rail defect detection method based on the deep residual shrinkage network according to claim 6, It is characterized in that: The method for the soft attention mechanism to process data is: A. Perform a dimensionality reduction operation on the input damage features through a fully connected layer, that is, each neuron is weighted to the output neuron. Since the number of output neurons is small, the input features are reduced to 1 / 8 of the original; B. Obtain non-linear features through the RELU activation function. The non-linear activation function RELU can perform non-linear weighting on the features and can avoid the problem of weight disappearance to a certain extent; C. Raise the damage features back to the original input dimension through a fully connected layer, that is, according to the feature map, the more obvious regions in the original input image can be deduced back, that is, the features are obtained by implementing the attention mechanism; D. Obtain a normalized weight between 0 and 1 through a Sigmoid gate, and finally perform a Scale size change operation to weight the normalized weight to the features of each channel to achieve feature normalization.
8. The rail defect detection method based on the deep residual shrinkage network according to claim 1, It is characterized in that: The method for feature extraction is: (1)Based on the damage image data of the existing rail, through the cross-layer identity residual function f(x l , w l ) = x l+1 - h(x l ), feature extraction in multiple dimensions is performed on the damage image data. First, the direct mapping function h(x l ) of the damage image data features is obtained. Then, according to the residual function f(x l ) obtained from the direct mapping function h(x l+1 ) and the deeper network features x l , w l ), for each damage image data passing through the residual function f(x l , w l ), the residual features between multiple dimensions of the image can be obtained; (2) Based on the residual features obtained in step (1), use the soft thresholding function sf(inputM,t) to perform noise reduction processing on the residual features, and obtain the separation of the damage features and noise features of the residual features in the interval [-t,t]. The soft thresholding function sf(inputM,t) is: Among them, inputM is the data before processing, and sf(inputM,t) represents the data after noise reduction processing; (3) Based on the residual features of the damage image data obtained in step (1), use the soft attention mechanism to calculate the global descriptive features between features, and obtain more non-linear features and complex correlation features between channels.
9. A rail defect detection system based on the deep residual shrinkage network, used to implement the rail defect detection method based on the deep residual shrinkage network according to any one of claims 1-8, It is characterized in that, Including: Preprocessing module: used to perform data preprocessing on the damage image data of the existing rails and clean the data; Feature vector extraction module: used to extract features from the cleaned damage image data to obtain the feature vectors of the corresponding damage; Optimal classification model creation module: used to train and learn the features of the damage image to obtain the optimal classification model; Damage classification module: used to obtain the rail damage image data, and through the classification of the optimal classifier, obtain the list of damage defects.
Citation Information
Patent Citations
Wafer defect detection method based on convolutional neural network
CN112700406A
PCB surface defect detection device and method
CN112819756A