A method and device for detecting defects of rigid busbar
Through the deep learning model YOLOV4 and median filtering technology, combined with the STN spatial domain attention mechanism, the efficiency and accuracy of bending deformation and abrasion detection of electrified railway busbars is solved, efficient fault identification and detection is achieved, and trains are improved Guarantee of safe operation.
Patent Information
- Application Number
- CN202210367179.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-08
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2042-04-08
AI Technical Summary
The prior art is difficult to efficiently and accurately detect the bending deformation and abrasion failure of the rigid contact network busbar in electrified railways, resulting in low maintenance efficiency and easy missed inspection, affecting the flow quality of the train.
The deep learning model YOLOV4 combined with median filtering and STN spatial domain attention mechanism is used to detect the bending deformation and abrasion of buses through image processing and feature extraction. The buses are located using the YOLOV4 model, and the median filtering is used to denoise. Laplace edge detection and Hoffmann line detection algorithm extract features to judge bending deformation and abrasions.
It improves the efficiency and accuracy of busbar defect detection, can quickly identify bending deformation and abrasions, reduces external interference, and provides fault prompts and maintenance references for safe operation of the train.
Smart Images

Figure CN114897778B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing and image recognition, and in particular to a method and device for detecting defects in a rigid busbar. Background Art
[0002] In electrified railways, overhead rigid contact networks are currently widely used in subways in major cities because of their advantages such as no tension on the contact line, fewer parts, low clearance requirements, and less maintenance. Among them, the busbar, as an important component of the rigid contact network, fixes the contact line so that the pantograph can slide freely on the contact line to receive electricity. However, as the operation time of the subway continues to increase, various fault problems on the busbar are gradually exposed. Due to the poor local elasticity of the rigid contact network, there is wear between the pantograph and the busbar, resulting in busbar abrasions, slipping threads on the busbar intermediate joint connection plate, and the busbar and contact line falling off and causing de-slotting. Due to the short interval time during subway operation, when a serious fault occurs in the busbar, it will directly affect the current collection quality of the train. Therefore, the detection of busbar defects is an urgent problem to be solved in the current application and promotion of rigid contact networks.
[0003] At present, the fault detection method for rigid busbar scratches is mainly through line inspection by maintenance personnel, which is inefficient and easy to miss. Therefore, how to efficiently and accurately identify the defects of rigid contact network busbars is of great practical significance. Summary of the invention
[0004] In order to overcome the defects existing in the above-mentioned prior art, the purpose of the present invention is to provide a rigid bus defect detection method and device, which has the advantages of high efficiency and high accuracy in identifying abnormal conditions such as bending deformation and abrasions of the bus, and detecting safety hazards of the contact network, which has great safety significance and practical application value.
[0005] The technical solution of the present invention is as follows:
[0006] A method for detecting defects in a rigid busbar comprises the following steps:
[0007] S1. Using a deep learning model, locate the bus area image of interest from the acquired bus image;
[0008] S2, filtering out noise of the image of the bus region of interest;
[0009] S3, preprocessing the image of the bus region of interest after filtering out noise to obtain a feature map, and extracting bus features from the feature map;
[0010] S4. Perform bus bar defect detection according to the extracted bus bar features, wherein the bus bar defect detection includes bus bar bending deformation detection and / or bus bar scratch detection.
[0011] Furthermore, the step S1 comprises:
[0012] S11, preprocessing the collected bus image and performing YOLOV4 model training;
[0013] S12. Verify the trained YOLOV4 model to determine whether the YOLOV4 model needs to be retrained;
[0014] S13, using the trained YOLOV4 model to locate the bus, select the bus region image of interest, and output the coordinates of the bus region image of interest. The coordinates of the bus region image of interest are used to identify the location of the bus.
[0015] Furthermore, in step S11, the collected bus image is preprocessed and YOLOV4 model training is performed, and the detailed steps are as follows:
[0016] S111, using a linear array camera or an area array camera to acquire a bus image;
[0017] S112, rotating, flipping, and enlarging the acquired bus image to enhance the bus image data;
[0018] S113, annotating the bus image using an image annotation tool, and dividing the annotated bus image into a training set and a validation set using a K (K=10)-fold cross-validation method;
[0019] S114, training the training set, wherein a specific training method is to use a YOLOV4 target detection algorithm to perform YOLOV4 model training for bus positioning.
[0020] Furthermore, in the step S12, the trained YOLOV4 model is verified to determine whether the YOLOV4 model needs to be retrained, specifically: the positioning accuracy of the YOLOV4 model trained in the above step S11 is verified through a verification set;
[0021] If the expected effect is not achieved, repeat step S11;
[0022] If the expected effect is achieved, the YOLOV4 model training is completed.
[0023] Further, filtering out noise of the image of the bus region of interest includes:
[0024] Processing the image of the bus region of interest by median filtering to filter out noise in the region of interest;
[0025] The processing of the image of the bus region of interest by median filtering includes smoothing and filtering.
[0026] Furthermore, the smoothing and filtering process includes:
[0027] By sorting the local pixels of the image of the bus region of interest, calculating the gray value of each pixel in the local pixels, and selecting the median as the gray value of the current pixel, the noise of the image of the bus region of interest can be filtered out, and the bus boundary in the image of the bus region of interest can be well protected.
[0028] Wherein, the median filter calculation formula is:
[0029] ,
[0030] in, Indicates that the local pixel In the area, the gray value corresponding to each pixel is Represents the value after median filtering in the current area, Indicates the horizontal and vertical coordinates of the pixels in the area.
[0031] Furthermore, in step S3, extracting bus features from the feature map includes:
[0032] The busbar bending deformation feature is extracted from the feature map; wherein the busbar bending deformation feature includes busbar contour information.
[0033] Furthermore, extracting the bus contour information specifically includes: using a Laplace edge detection algorithm to calculate the maximum connected area of the input pixels to obtain the bus edge contour information.
[0034] Furthermore, in the step S3, extracting bus features from the feature map further includes:
[0035] The busbar scratch feature is extracted from the feature map, and its main feature is that a region with a large gray value change appears on the busbar.
[0036] Furthermore, the extracting of bus scratch features from the feature map includes, based on the YOLOV4 model, combining the STN spatial domain attention mechanism, training a target detection model, performing secondary processing on the located bus area image, and extracting the bus scratch features.
[0037] That is, the busbar characteristics at least include busbar bending deformation characteristics and busbar scratch characteristics.
[0038] Furthermore, the busbar bending deformation detection in step S4 includes:
[0039] S41. Calculate and obtain bus-related lines based on the bus contour information; then perform a straight line fitting operation on the bus lines to obtain a bus fitting straight line; and determine whether the bus is bent or deformed by calculating the maximum distance from a point on the bus line to the bus fitting straight line and comparing it with a preset distance threshold.
[0040] Furthermore, the step S41 includes:
[0041] S411, using the Laplace edge detection algorithm, calculate the maximum connected area of the input pixels to obtain the edge contour of the bus.
[0042] Furthermore, the Laplace operator is obtained by performing a second-order partial derivative on the image of the bus region of interest after the noise is filtered out, and then the edge information of the bus is calculated by a second-order difference algorithm;
[0043] Wherein, the Laplace edge detection algorithm is calculated as follows:
[0044] ,
[0045] The Laplace operator is calculated as follows:
[0046] ,
[0047] in, They are the horizontal and vertical coordinates in the image, respectively, used to represent the position information of each pixel value.
[0048] Furthermore, a convolution operation is performed to highlight the edge information of the busbar and obtain the busbar contour information.
[0049] The convolution operation specifically includes: performing matrix multiplication operation on the image of the bus region of interest after noise filtering and the Laplacian operator to highlight the edge information of the bus; thereby obtaining the bus contour information.
[0050] S412, using a Huffman line detection algorithm to extract bus lines from the bus contour information, and filtering interference lines according to the length and angle of the bus lines to obtain bus lines.
[0051] Among them, the calculation formula of the Huffman line detection algorithm is:
[0052] ,
[0053] in, The set of all lengths of the extracted lines, Indicates filtering straight lines by angle threshold, Indicates the range of the threshold.
[0054] S413, fitting the bus straight line by weighted least square method to obtain a bus fitting straight line.
[0055] The step of fitting the busbar straight line is as follows:
[0056] Let the equation of the line be: ,in , is the coefficient;
[0057] Initialize the weights using the formula: ,in The value is the threshold, Indicates the distance from a point on the bus to a straight line.
[0058] Furthermore, according to the bus fitting straight line, the least square method is used to calculate the offset of each point on the bus relative to the three directions of x, y, and z, and D xx , D xy , D yy express;
[0059] ,
[0060] ,
[0061] ,
[0062] in, express The mean of Indicates the horizontal and vertical coordinates of the points on the bus line, Indicates the number of points.
[0063] Furthermore, the offset is calculated by the least square method to obtain the fitting straight line equation; the specific calculation formula is:
[0064] ,
[0065] ,
[0066] , , .
[0067] S414: Calculate the maximum distance between a point on the bus line and the bus fitting straight line, and compare it with a preset distance threshold to determine whether the bus is bent or deformed.
[0068] Furthermore, when the maximum distance from the point on the bus line to the bus fitting straight line is greater than or equal to a preset distance threshold, it is determined that the bus is bent and deformed;
[0069] Otherwise, it is determined that the busbar is not bent or deformed.
[0070] The distance calculation formula is: ,in represents the distance threshold, Indicates the distance from a point on the bus line to the straight line, , Indicates the length of the suspension string.
[0071] Furthermore, the busbar scratch detection in step S4 includes:
[0072] S42. Perform secondary processing on the located bus area image, specifically including: based on the trained YOLOV4 model, combining the STN spatial domain attention mechanism, training the target detection model, extracting the bus scratch features, and locating and classifying the bus scratch features through the trained target detection model to complete the detection of bus scratch defects.
[0073] Furthermore, the YOLOV4 model is used as a basis, combined with the STN spatial domain attention mechanism, to train the target detection model and extract the bus scratch features, including:
[0074] S421, using the YOLOV4 model to perform convolution and pooling processing on the feature map to generate a new bus feature map θ, so as to extract the bus feature image and downsample the image to reduce the image size.
[0075] The convolution and pooling processing specifically includes:
[0076] The convolution processing calculation formula is:
[0077] ,
[0078] in, represents the image size of the output feature map V, represents the image size of the input feature map U, represents the size of the convolution kernel, Indicates the step size of the movement during the convolution process;
[0079] The pooling calculation formula is:
[0080] ,
[0081] in, represents the image size of the output feature map V, Indicates the size of the pooling, Indicates the step size of the pooling shift.
[0082] Furthermore, batch normalization is performed on the grayscale value data of each pixel of the bus feature map θ so that the image pixel values are distributed in the range of [0, 1]. A BN operation is added before each layer of the input feature map U to accelerate the convergence of the model.
[0083] Furthermore, through the activation function RELU, the YOLOV4 model becomes sparse, reducing the interdependence of parameters to alleviate the overfitting problem.
[0084] Among them, the specific activation function RELU formula is:
[0085] ,
[0086] When the weight z<0, the activation function RELU output is 0.
[0087] S422, using an affine transformation tool to re-flip and crop the bus feature map θ to improve the richness of the training data set. The affine transformation tool is a generator , or other affine transformation tools.
[0088] S423, using the bilinear interpolation algorithm, the entire YOLOV4 model can be trained end-to-end for back propagation, and the model weights are iterated cyclically to obtain the optimal solution; the calculation formula is:
[0089] ,
[0090] in, They represent the coordinate information of the current image area respectively. P(x,y) represents the pixel value of the point after bilinear interpolation. P(x0,y0) represents the pixel value of the lower left corner coordinate of the area. P(x1,y0) represents the pixel value of the lower right corner coordinate of the area. P(x0,y1) represents the pixel value of the upper left corner coordinate. P(x1,y1) represents the pixel value of the upper right corner coordinate.
[0091] Furthermore, a target detection model is trained through the labeled training data set; the bus scratch features are located and classified using the trained target detection model, the bus scratch detection is completed, and the bus scratch defect position is obtained.
[0092] The present invention also proposes a rigid bus defect detection device applicable to the above rigid bus defect detection method, the rigid bus defect detection device comprises a bus image acquisition module, a bus image processing module, and a bus defect detection module; wherein the bus defect detection module comprises a bus bending deformation detection module and a bus scratch detection module;
[0093] The bus image acquisition module at least includes a line array camera and / or an area array camera, which is used to acquire the bus image;
[0094] The image processing module is used to process and detect bus images, locate the bus and obtain bus features;
[0095] The busbar bending deformation detection module is used to calculate and detect the busbar bending deformation according to the busbar characteristics;
[0096] The bus scratch detection module includes the YOLOV4+STN target detection model, which is used to detect bus scratches based on the located bus and bus feature map.
[0097] Compared with the prior art, the present invention has the following beneficial effects:
[0098] The invention provides a method for detecting bending deformation and scratches of a rigid bus. It proposes a method based on deep learning model YOLOV4 model training to locate the bus and extract bus features, thereby reducing the influence of external interference noise. It further filters out bus noise using median filtering, and smoothes the bus image, thereby protecting the bus boundary well. It proposes a method for detecting bus defects, which can simultaneously detect bus bending deformation and bus scratch defects, and can quickly and accurately detect and determine whether the bus is bent or deformed. Based on YOLOV4 and spatial domain attention mechanism STN, it realizes bus scratch detection and identification, and determines the type of bus scratch defects. It effectively improves the detection accuracy and efficiency of bus defects, can provide bus fault prompts for safe train operation, and provide technical references for bus fault repair. BRIEF DESCRIPTION OF THE DRAWINGS
[0099] Figure 1 The figure is a flow chart of the method of the present invention.
[0100] Figure 2 This is the YOLOV4 model training flow chart of the present invention.
[0101] Figure 3 Extract the schematic diagram for the bus.
[0102] Figure 4 This is a schematic diagram of the bus before straight line filtering.
[0103] Figure 5 This is the schematic diagram after the bus line is filtered out.
[0104] Figure 6 It is the spatial domain attention mechanism STN based on YOLOV4.
[0105] Figure 7 Schematic diagram of the implementation process based on the bilinear interpolation algorithm. DETAILED DESCRIPTION
[0106] The following is a clear and complete description of the concept, specific implementation methods and technical effects of the present invention in combination with the embodiments and drawings, so as to fully understand the purpose, characteristics and effects of the present invention.
[0107] Example 1
[0108] A method for detecting defects in rigid busbars, such as Figure 1 As shown, the following steps are included:
[0109] S1. Using a deep learning model, locate the bus area image of interest from the acquired bus image;
[0110] S2, filtering out noise of the image of the bus region of interest;
[0111] Further, filtering out noise in the bus region of interest includes image smoothing filtering, filtering out interference noise by smoothing the image with poor image quality;
[0112] S3, preprocessing the bus region image of interest after filtering out noise to obtain a feature map, and extracting bus features from the feature map; wherein the bus features include bus bending deformation features and bus scratch features;
[0113] S4. Perform bus bar defect detection according to the bus bar bending deformation characteristics and bus bar scratch characteristics respectively. The bus bar defect detection includes bus bar bending deformation detection and / or bus bar scratch detection.
[0114] The bus bending deformation detection includes: preprocessing the image of the bus area of interest after filtering out noise, extracting bus-related lines, calculating the maximum distance from the line to the straight line by fitting a straight line, and judging whether the bus is bent or deformed.
[0115] The bus scratch detection includes: using the YOLOV4+STN spatial attention mechanism combined model to realize the detection of bus scratch defects.
[0116] Furthermore, based on the YOLOV4 model and combined with the STN spatial domain attention mechanism, the target detection model is trained to extract bus scratch features;
[0117] The busbar scratch features are located and classified through the trained target detection model to complete the detection of busbar scratch defects.
[0118] Example 2
[0119] Based on Example 1, this example uses a deep learning model to locate the image of the bus area of interest from the acquired bus image. Figure 2 As shown, the specific processing steps are as follows:
[0120] S11, preprocessing the collected bus image and performing YOLOV4 model training;
[0121] S12. Verify the trained YOLOV4 model and determine whether the YOLOV4 model needs to be retrained;
[0122] S13, using the trained YOLOV4 model to locate the bus, select the bus region image of interest, and output the coordinates of the bus region image of interest. The coordinates of the bus region image of interest are used to identify the location of the bus.
[0123] Furthermore, the detailed steps in step S11 are:
[0124] S111, using a linear array camera or an area array camera installed on the roof to acquire a bus image;
[0125] S112, rotating, flipping, and enlarging the acquired bus image to enhance the bus image data;
[0126] S113, annotating the bus image using an image annotation tool, and dividing the annotated bus image into a training set and a validation set using a K (K=10)-fold cross-validation method;
[0127] The picture annotation tool in this solution uses Labelimg annotation tool, and other annotation tools can also be used, which will not be described in detail here; the ratio of the training set to the validation set is 9:1, or the ratio of the training set to the validation set is 8:2;
[0128] S114, training the training set, wherein a specific training method is to use the YOLOV4 target detection algorithm to perform YOLOV4 model training.
[0129] Example 3
[0130] On the basis of Example 2, the image of the bus region of interest output by the trained YOLOV4 model is smoothed and filtered to remove the noise in the region of interest. Figure 3 As shown, the specific steps are as follows:
[0131] Processing the image of the bus region of interest by median filtering to filter out noise in the region of interest;
[0132] The processing of the image of the bus region of interest by median filtering includes smoothing and filtering.
[0133] Furthermore, the smoothing and filtering process includes:
[0134] By sorting the local pixels of the image of the bus region of interest, calculating the gray value of each pixel in the local pixels, and selecting the median as the gray value of the input image pixel, the noise of the image of the bus region of interest can be filtered out, and the bus boundary in the image of the bus region of interest can be well protected.
[0135] Wherein, the median filter calculation formula is:
[0136] ,
[0137] in, Indicates that the local pixel In the area, the gray value corresponding to each pixel is Represents the value after median filtering in the current area. Indicates the horizontal and vertical coordinates of the pixels in the area.
[0138] Example 4
[0139] Based on Embodiment 3, this embodiment extracts bus features from the feature map, including:
[0140] Extracting busbar bending deformation features from the feature map; wherein the busbar bending deformation features include busbar contour information;
[0141] Furthermore, extracting the bus contour information specifically includes: using a Laplace edge detection algorithm to calculate the maximum connected area of the input pixels to obtain the bus edge contour information.
[0142] Furthermore, in the step S3, extracting bus features from the feature map further includes:
[0143] Extracting busbar scratch features from the feature map, the main feature of which is that a region with a large gray value change appears on the busbar;
[0144] Furthermore, the extracting of bus scratch features from the feature map includes, based on the YOLOV4 model, combining the STN spatial domain attention mechanism, training a target detection model, performing secondary processing on the located bus area image, and extracting the bus scratch features.
[0145] That is, the busbar characteristics at least include busbar bending deformation characteristics and busbar scratch characteristics.
[0146] Example 5
[0147] This embodiment, based on the fourth embodiment, proposes a method for detecting bending deformation of a rigid busbar, which specifically includes the following steps:
[0148] S41. Calculate the bus-related lines according to the bus contour information; then perform a straight line fitting operation on the bus to obtain the straight line equation of the bus; and determine whether the bus is bent or deformed by extracting the maximum distance from a point on the bus line to the bus straight line equation and comparing it with a preset distance threshold.
[0149] Furthermore, the step S41 includes:
[0150] S411, using the Laplace edge detection algorithm to calculate the maximum connected area of the input image pixels to obtain the edge contour of the bus;
[0151] Furthermore, the Laplace operator is obtained by performing a second-order partial derivative on the image of the bus region of interest after the noise is filtered out, and then the bus edge information is calculated by a second-order difference algorithm;
[0152] Wherein, the Laplace edge detection algorithm is calculated as follows:
[0153] ,
[0154] The Laplace operator is calculated as follows:
[0155] ,
[0156] in, They are the horizontal and vertical coordinates in the image, respectively, used to represent the position information of each pixel value.
[0157] Further, through a convolution operation, the edge information of the bus is highlighted, and the bus contour information is obtained;
[0158] The convolution operation specifically includes: performing matrix multiplication operation on the image of the bus region of interest after noise filtering and the Laplacian operator to highlight the edge information of the bus; thereby obtaining the bus contour information.
[0159] S412, extracting bus lines from the bus contour information using a Huffman line detection algorithm;
[0160] According to the length and angle of the bus line, the interference lines are filtered to obtain the bus straight line, as shown in the figure before the bus straight line is filtered out. Figure 4 Schematic diagram after filtering out the busbar straight line Figure 5 shown.
[0161] Among them, the calculation formula of the Huffman line detection algorithm is:
[0162] ,
[0163] in, The table represents the set of all lengths of the extracted lines. Indicates filtering straight lines by angle threshold. Indicates the range of the threshold.
[0164] S413: Use weighted least square method to fit the busbar straight line to obtain a busbar fitting straight line.
[0165] The step of fitting the busbar straight line is as follows:
[0166] Let the equation of the line be: ,in, , is the coefficient;
[0167] Initialize the weights using the formula: ,
[0168] in, The value is the threshold, Indicates the distance from a point on the bus to a straight line.
[0169] Furthermore, according to the bus fitting straight line, the least square method is used to calculate the offset of each point on the bus relative to the x, y, and z directions, and D xx , D xy , D yy The specific formula is:
[0170] ,
[0171] ,
[0172] ,
[0173] in, express The mean of Indicates the horizontal and vertical coordinates of the points on the bus line, Indicates the number of points.
[0174] Furthermore, the offset is calculated by the least square method to obtain the fitting straight line equation: ; The specific calculation formula is:
[0175] ,
[0176] ,
[0177] , , .
[0178] S414: Calculate the maximum distance between the extracted point on the bus line and the bus fitting line, and compare it with a preset distance threshold to determine whether the bus is bent or deformed.
[0179] Furthermore, when the maximum distance from the point on the bus line to the bus fitting straight line is greater than or equal to a preset distance threshold, it is determined that the bus is bent and deformed;
[0180] Otherwise, it is determined that the busbar is not bent or deformed.
[0181] Furthermore, the distance calculation formula from the point on the bus line to the bus fitting straight line is: ,
[0182] in, represents the distance threshold, Indicates the distance from a point on the bus line to the straight line, , Indicates the length of the suspension string.
[0183] Example 6
[0184] This embodiment, based on the fourth embodiment, proposes a method for detecting abrasions of a rigid busbar, which specifically includes the following steps:
[0185] S42, performing secondary processing on the located bus area image, such as Figure 6 The schematic diagram shown specifically includes:
[0186] Based on the YOLOV4 model and combined with the STN spatial domain attention mechanism, the target detection model is trained to extract bus scratch features;
[0187] The busbar scratch features are located and classified through the trained target detection model to complete the detection of busbar scratch defects.
[0188] Furthermore, the YOLOV4 model is used as a basis, combined with the STN spatial domain attention mechanism, to train the target detection model and extract the bus scratch features, including:
[0189] S421, using the YOLOV4 model to perform convolution and pooling processing on the feature map to generate a new bus feature map θ, so as to extract the bus feature image and downsample the image to reduce the image size.
[0190] The convolution process is calculated as follows:
[0191] ,
[0192] in represents the image size of the output feature map V, represents the image size of the input feature map U, represents the size of the convolution kernel, Indicates the step size during the convolution process.
[0193] The pooling process is calculated as follows:
[0194] ,
[0195] represents the image size of the output feature map V, Indicates the size of the pooling, Indicates the step size of the pooling shift.
[0196] Furthermore, batch normalization is performed on the grayscale value data of each pixel of the bus feature map θ so that the image pixel values are distributed in the range of [0, 1]. A BN operation is added before each layer of the input feature map U to accelerate the convergence of the model.
[0197] Furthermore, through the activation function RELU, the YOLOV4 model becomes sparse, reducing the interdependence of parameters to alleviate the overfitting problem.
[0198] Among them, the specific activation function RELU formula is:
[0199] ,
[0200] When the weight z<0, the activation function RELU output is 0.
[0201] S422, using an affine transformation tool to re-flip and crop the bus feature map θ to improve the richness of the training data set. The affine transformation tool is a generator , or other affine transformation tools.
[0202] S423, using the bilinear interpolation algorithm, the entire YOLOV4 model can be trained end-to-end through back propagation, and the model weights are iterated cyclically to obtain the optimal solution, such as Figure 7 As shown, the specific formula is:
[0203] ,
[0204] Wherein they are the coordinate information of the current image area, P(x,y) represents the pixel value of the point after bilinear interpolation, P(x0,y0) represents the pixel value of the lower left corner coordinate of the area, P(x1,y0) represents the pixel value of the lower right corner coordinate of the area, P(x0,y1) represents the pixel value of the upper left corner coordinate, and P(x1,y1) represents the pixel value of the upper right corner coordinate.
[0205] Furthermore, a target detection model is trained through the labeled training data set; the bus scratch features are located and classified using the trained target detection model, the bus scratch detection is completed, and the bus scratch defect position is obtained.
[0206] Example 7
[0207] This embodiment proposes a rigid bus defect detection device applicable to the above-mentioned rigid bus defect detection method, wherein the rigid bus defect detection device comprises a bus image acquisition module, a bus image processing module, and a bus defect detection module; wherein the bus defect detection module comprises a bus bending deformation detection module and a bus scratch detection module;
[0208] The bus image acquisition module at least includes a line array camera and / or an area array camera, which is used to acquire the bus image;
[0209] The image processing module is used to process and detect bus images, locate the bus and obtain bus features;
[0210] The busbar bending deformation detection module is used to calculate and detect the busbar bending deformation according to the busbar characteristics;
[0211] The bus scratch detection module includes the YOLOV4+STN target detection model, which is used to detect bus scratches based on the located bus and bus feature map.
[0212] The invention provides a method for detecting bending deformation and scratches of a rigid bus. It proposes a method based on deep learning model YOLOV4 model training to locate the bus and extract bus features, thereby reducing the influence of external interference noise. It further filters out bus noise using median filtering, and smoothes the bus image, thereby protecting the bus boundary well. It proposes a method for detecting bus defects, which can simultaneously detect bus bending deformation and bus scratch defects, and can quickly and accurately detect and determine whether the bus is bent or deformed. Based on YOLOV4 and spatial domain attention mechanism STN, it realizes bus scratch detection and identification, and determines the type of bus scratch defects. It effectively improves the detection accuracy and efficiency of bus defects, can provide bus fault prompts for safe train operation, and provide technical references for bus fault repair. It has great safety significance and practical application value.
[0213] The above is a specific description of the implementation mode of the present invention, but the present invention is not limited to the described embodiments. Those skilled in the art may make various equivalent modifications or substitutions without violating the spirit of the present invention, and these equivalents or substitutions are all included in the scope defined by the claims of the present invention.
Claims
1. A method for detecting defects in a rigid busbar, characterized in that: include: S1. Using a deep learning model, locate the bus area image of interest from the acquired bus image; S2, smoothing and filtering the image of the bus region of interest by median filtering to remove noise from the image of the bus region of interest; the smoothing and filtering process includes: sorting local pixels of the image of the bus region of interest, calculating the gray value of each pixel in the local pixels, selecting the median as the gray value of the current input pixel, and removing noise interference; S3, preprocessing the bus region image of interest after filtering out noise to obtain a feature map, and extracting bus features from the feature map; wherein the bus features at least include bus bending deformation features and bus scratch features; S4, performing bus bar defect detection according to the bus bar bending deformation characteristics and bus bar scratch characteristics respectively, wherein the bus bar defect detection includes bus bar bending deformation detection and bus bar scratch detection; The busbar bending deformation characteristics include: busbar profile information; The bus bending deformation detection includes: using the bus contour information to calculate the bus related lines; then fitting the bus lines to obtain the bus fitting straight line; comparing the maximum distance from the point on the bus line to the bus fitting straight line with a preset distance threshold to determine whether the bus is bent or deformed; The busbar scratch detection comprises: Based on the trained YOLOV4 model and combined with the STN spatial domain attention mechanism, the bus scratch features are extracted; the target detection model is trained through the labeled training samples; the bus scratch features are located and classified through the trained target detection model; Based on the trained YOLOV4 model and combined with the STN spatial domain attention mechanism, bus scratch features are extracted, including: Using the YOLOV4 model, the feature map is convolved and pooled to generate a new bus feature map θ; batch normalization is performed on the grayscale value data of each pixel of the bus feature map θ so that the image pixel values are distributed in the range of [0, 1]; The YOLOV4 model becomes sparse by activating the RELU function; Using an affine transformation tool to re-flip and crop the bus feature map θ to improve the richness of the training data set; Using the bilinear interpolation algorithm, the entire YOLOV4 model can perform end-to-end back-propagation training, continuously iteratively update the model weights, and obtain the optimal solution for the weights.
2. The method for detecting defects in a rigid busbar according to claim 1, characterized in that: In step S1, the deep learning model is used to locate the image of the bus area of interest from the acquired bus image, which specifically includes: S11, preprocessing the collected bus image and performing YOLOV4 model training; S12. Verify the trained YOLOV4 model to determine whether the YOLOV4 model needs to be retrained; S13. Using the trained YOLOV4 model, locate the bus, select an image of the bus region of interest, and output the coordinates of the image of the bus region of interest.
3. The method for detecting defects in a rigid busbar according to claim 2, characterized in that: In step S11, the collected bus image is preprocessed and YOLOV4 model training is performed, including: S111, using a linear array camera or an area array camera installed on the roof to acquire a bus image; S112, rotating, flipping and enlarging the acquired bus image to enhance the bus image data; S113, annotating the bus image using an image annotation tool, and dividing the annotated bus image into a training set and a validation set using a K-fold cross validation method; S114: Train the training set to obtain a trained YOLOV4 model.
4. The method for detecting defects in a rigid busbar according to claim 3, characterized in that: The step S12 verifies the trained YOLOV4 model to determine whether the YOLOV4 model needs to be retrained, including: Verify the positioning accuracy of the trained YOLOV4 model through the verification set; If the expected effect is not achieved, repeat step S11; If the expected effect is achieved, the YOLOV4 model training is completed.
5. The method for detecting defects in a rigid busbar according to claim 1, characterized in that: The Laplace edge detection algorithm is used to calculate the maximum connected area of the input pixels and obtain the edge contour information of the bus.
6. The method for detecting defects in a rigid busbar according to claim 5, characterized in that: The bus lines are extracted from the bus contour information by using the Huffman line detection algorithm, and interference lines are screened according to the length and angle of the bus lines to obtain the bus straight lines; the bus straight lines are fitted by the weighted least squares method to obtain the bus fitting straight lines.
7. The method for detecting defects in rigid busbars according to claim 5, characterized in that: When the maximum distance between the point on the bus line and the bus fitting straight line is greater than or equal to a preset distance threshold, it is determined that the bus is bent and deformed.
8. A rigid busbar defect detection device applicable to the rigid busbar defect detection method according to any one of claims 1 to 7, characterized in that: It includes an image acquisition module, an image processing module, and a bus defect detection module; wherein the bus defect detection module includes a bus bending deformation detection module and a bus scratch detection module; The image acquisition module at least includes a linear array camera and / or an area array camera, which is used to acquire bus images; The image processing module is used to process the bus image acquired by the image acquisition module to locate the bus and obtain bus features; The busbar bending deformation detection module is used to calculate and detect the busbar bending deformation according to the busbar characteristics; The bus scratch detection module includes a YOLOV4+STN target detection model, which is used to detect bus scratches based on the located bus and bus feature map.
