Two-stage rail transit vehicle defect detection method and system based on prior knowledge
Through a two-stage detection method based on prior knowledge, combined with deep learning and template matching, it solves the problems of long detection time, low efficiency and missed detection of rail transit vehicles, and achieves efficient and accurate defect detection, which is suitable for rail transit scene.
Patent Information
- Application Number
- CN202210546352.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-16
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2042-05-16
AI Technical Summary
In the existing technology, rail transit vehicle defect detection takes a long time, is not efficient, and is prone to false detections and missed detections. Moreover, defect detection algorithms transplanted from other fields are difficult to fully apply to rail transit scenarios.
A two-stage detection method based on prior knowledge is used to train the parts detection network through the large target feature extraction network and the small target feature extraction network. It combines deep learning and template matching to use the prior knowledge base to detect parts types and defect types, narrowing down the detection range and improve detection accuracy and efficiency.
It improves the efficiency and accuracy of rail transit vehicle defect detection, reduces false detections and missed detections, and enhances the applicability and robustness of the detection method, especially in the detection of defects such as missing and falling parts.
Smart Images

Figure CN114862812B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of defect detection, and more specifically, relates to a two-stage rail transit vehicle defect detection method and system based on prior knowledge. Background Art
[0002] With the continuous development of rail transit, the level of intelligence of rail transit equipment is constantly improving. In the daily inspection tasks of rail transit vehicles, the method of collecting image data of the parts to be inspected through robots and other automated equipment, and then performing defect detection on the images is gradually replacing the traditional manual field visual inspection method. The accuracy of image defect detection has an important impact on the safety of rail transit vehicle operations.
[0003] In the prior art, defect detection in rail transit scenarios is performed through manual inspection by experienced technicians or by transplanting defect detection algorithms that perform well in other fields.
[0004] The average inspection time by technicians is long and inefficient, and the inspection effect is easily affected by human factors, which may lead to false detection and missed detection. It is difficult to fully apply the defect detection algorithm that performs well in other fields to rail transit scenarios, which may lead to missed detection and false alarm, and still requires a lot of manpower to review the inspection results.
[0005] Therefore, the existing technology has technical problems such as long detection time, low efficiency, and easy false detection and missed detection. There is an urgent need for a defect detection method suitable for actual application scenarios of rail transit to solve the above problems. Summary of the invention
[0006] In response to the above defects or improvement needs of the prior art, the present invention provides a two-stage rail transit vehicle defect detection method and system based on prior knowledge, thereby solving the technical problems of the prior art such as long detection time, low efficiency, and easy false detection and missed detection.
[0007] To achieve the above object, according to one aspect of the present invention, a two-stage rail transit vehicle defect detection method based on prior knowledge is provided, comprising:
[0008] The first-level components in rail transit vehicle parts contain second-level components. The relationship between the second-level components belonging to the same first-level component is an adjacent relationship. The components contained in rail transit vehicle parts and their relative spatial position relationship and the set of various types of defects of known components are used as a priori knowledge base;
[0009] The rail transit vehicle parts image set is used as a training set to train the parts detection network. The parts detection network includes a large target feature extraction network and a small target feature extraction network. During the training process, the large target feature extraction network is used to obtain the area where the first-level parts are located, and then the second-level parts contained in the first-level parts are obtained from the prior knowledge base. The area where the second-level parts are located is enlarged and mapped back to the rail transit vehicle parts image, and then input into the small target feature extraction network, and the parts type is output. The training is carried out until convergence to obtain a trained parts detection network;
[0010] The image of the part to be inspected is input into the trained component inspection network to detect the type of component. The defect type of the component type is detected through a priori knowledge base, deep learning or template matching.
[0011] Furthermore, the defect types of parts detected by the prior knowledge base include:
[0012] For the detected parts type, their quantity is counted, and the original quantity of the parts of this type is obtained from the prior knowledge base. The original quantity is compared with the counted quantity. If the counted quantity is less than the original quantity, the defect type of the parts of this type is determined to be missing or falling off.
[0013] Furthermore, the defect types of parts detected by deep learning include:
[0014] Input the image of the part to be inspected of a known component type into the deep learning network to obtain the defect type of the component type;
[0015] The deep learning network is trained in the following way:
[0016] The defect types of various parts of rail transit vehicles are marked to form training samples. The training samples are expanded by rotation, scaling, mirroring, shearing, and adding noise to construct a defect type training data set. The defect type training data set is used to train a deep learning network to obtain a trained deep learning network.
[0017] Furthermore, the defect types of parts detected by template matching include:
[0018] The ORB feature points of the image to be inspected are extracted and matched with the template image. The difference set is calculated by the difference method. The area of the difference set is compared with the preset threshold to determine whether there is a defect. If the area of the difference set is greater than the preset threshold, there is a defect, and the defect type of this type of component is obtained from the prior knowledge base.
[0019] Furthermore, the template image is obtained in the following manner:
[0020] The images of rail transit vehicle parts in normal state are collected as template images, and the collection positions are recorded, which are used as template images at the same positions during defect detection.
[0021] Furthermore, the component detection network training includes:
[0022] Input the rail transit vehicle parts image into the parts detection network, extract the large target features through the large target feature extraction network, and then obtain the prediction results through classification regression. The prediction results include the first-level component, the pixel coordinates of the upper left corner point of the area where the first-level component is located, and the width, height, and confidence of the area where the first-level component is located. The prediction results with confidences that meet the threshold conditions are selected. If the same first-level component is selected by multiple prediction boxes during the prediction process, the multiple prediction boxes are merged into one as the final area where the first-level component is located;
[0023] The secondary components contained in the primary components are obtained from the prior knowledge base, and the area where the secondary components are located is enlarged by bilinear interpolation. Then, the image of rail transit vehicle parts is mapped back to the small target feature extraction network. After the small target features are extracted, they are classified and regressed, and confidence score screening and non-maximum suppression are performed. The component types are output and trained until convergence to obtain a trained component detection network.
[0024] Furthermore, the mapping is achieved in the following manner:
[0025]
[0026] Among them, the bounding box of the area where the secondary component is located before mapping is represented by (x, y, w, h), where x and y are the coordinates of the upper left point of the bounding box, and w and h are the width and height of the bounding box respectively; the corresponding projection of the bounding box mapped back to the rail transit vehicle component image is (x i ,y i ,w i ,h i ), x l ,y l is the coordinate of the upper left point of the cropped area in the rail transit vehicle component image, and k is the scale magnification factor of the area where the secondary component is located before mapping.
[0027] Furthermore, the large target feature extraction network in the component detection network extracts large target features in the same manner as the small target feature extraction network extracts small target features. The large target feature extraction network extracts large target features including:
[0028] Extract three feature layers at different positions of the large target feature extraction network, including the middle layer, the lower middle layer, and the bottom layer;
[0029] After upsampling the bottom feature layer, it is fused with the feature layers of the lower and middle layers through a convolution.
[0030] Then, the result of feature fusion is downsampled and fused with the middle and lower layers and the bottom feature layer in turn through another convolution to obtain enhanced features as large target features.
[0031] According to another aspect of the present invention, a two-stage rail transit vehicle defect detection system based on prior knowledge is provided, comprising:
[0032] A priori knowledge base building module is used to take the components of rail transit vehicle parts and their relative spatial position relationship, and the set of various types of defects of known components as a priori knowledge base;
[0033] A network training module is used to use a set of rail transit vehicle parts images as a training set to train a parts detection network. The parts detection network includes a large target feature extraction network and a small target feature extraction network. During the training process, the area where the primary parts are located is obtained through the large target feature extraction network, and then the secondary parts contained in the primary parts are obtained from the prior knowledge base. The area where the secondary parts are located is magnified and mapped back to the rail transit vehicle parts image, and then input into the small target feature extraction network, and the parts types are output. The training is conducted until convergence to obtain a trained parts detection network.
[0034] The defect detection module is used to input the image of the part to be inspected into the trained component inspection network, detect the type of component, and detect the defect type of the component type through a priori knowledge base, deep learning or template matching.
[0035] Furthermore, the defect detection module includes:
[0036] The prior detection module is used to count the number of detected parts, obtain the original number of parts of this type from the prior knowledge base, and compare the original number with the counted number. If the counted number is less than the original number, the defect type of this type of parts is part loss or falling off;
[0037] A deep learning detection module is used to input the image of the part to be detected of a known component type into the deep learning network to obtain the defect type of the component type;
[0038] The template matching detection module is used to extract the ORB feature points of the image to be detected and match it with the template image, calculate the difference set through the difference method, and judge whether there is a defect based on the comparison of the area of the difference set part and the preset threshold. If the area of the difference set part is greater than the preset threshold, there is a defect, and the defect type of this type of component is obtained from the prior knowledge base.
[0039] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects compared with the prior art:
[0040] (1) In the first stage, the present invention detects the type of components by combining a trained deep learning network with prior knowledge. The deep learning method has a higher performance ceiling, better robustness and generalization, and is relatively easy to implement when there are sufficient sample images of components. However, the traditional image processing method is easily affected by environmental factors such as rust and computer performance, and has great limitations. Compared with manual detection methods, the present invention improves detection efficiency and shortens detection time. The present invention introduces prior knowledge information in detection, which improves detection accuracy compared to directly transplanting other target detection algorithms. In the first stage, the first-level components with large volume and easy detection are first detected, and the area that may contain the second-level components with small volume and difficult detection is inferred, and the area is further detected, thereby improving detection efficiency and detection accuracy. For the second stage defect detection, a variety of detection means are provided for defect detection, which improves the applicability and accuracy of the defect detection method in rail transit scenarios. This solves the problem that the traditional method has a long detection time, low efficiency, and is prone to false detection and missed detection.
[0041] (2) For defect types such as missing or falling parts, defect detection based on the number of prior knowledge is adopted, which is efficient and accurate. Since the number of defect samples in the existing rail transit scenarios is small and it is difficult to cover all defect types, the deep learning method may not converge or overfit during the training process, resulting in poor detection effect. Therefore, at this stage, the deep learning method is used for defect detection for parts with a large number of samples and a relatively single defect type, and the template matching method is used for defect detection for defect types with a small number of defect samples and poor deep learning detection effect. A variety of defect detection methods are used to effectively guarantee the detection efficiency and detection accuracy in various situations. At the same time, the applicability of the method of the present invention is improved.
[0042] (3) The first-level components contain the second-level components. The relationship between the second-level components belonging to the same first-level components is an adjacent relationship. Based on the spatial position relationship of the components, it is easy to infer the possible area of the second-level components, given that the first-level components are known, thereby narrowing the detection range of the algorithm and improving the detection accuracy. Since the volume of the first-level components is often much larger than that of the second-level components, they occupy more pixels in the image, making it easier for the algorithm to extract feature information and therefore easier to detect. The second-level components have a narrower detection range after reasoning based on prior knowledge, and the number of pixels of the second-level components in the image is increased by local scale magnification, making it easier for the detection algorithm to identify them.
[0043] (4) The present invention further improves the accuracy of prediction results through score screening and non-maximum suppression during the training process. In the present application, the secondary components obtained after the image is locally enlarged need to be combined with the detection results of the primary components of the original image, so the bounding box of the secondary component detection needs to be mapped back to the original image. When extracting features, by fusing the three feature layers at different positions of the network multiple times, enhanced features can be obtained, and the prediction results obtained thereby are more accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 is a flow chart of a two-stage rail transit vehicle defect detection method based on prior knowledge provided by an embodiment of the present invention;
[0045] FIG. 2( a ) is a schematic diagram of the structure of components provided by an embodiment of the present invention;
[0046] FIG2( b ) is a schematic diagram of the prior knowledge of the spatial position relationship of components provided by an embodiment of the present invention;
[0047] Figure 3 is a structural diagram of a component detection network provided by an embodiment of the present invention;
[0048] Figure 4 Schematic diagram of bilinear interpolation provided by an embodiment of the present invention;
[0049] Throughout the drawings, the same reference numerals are used to denote the same elements or structures, wherein:
[0050] 10 is the wheel axle, 11 is the brake disc, 12 is the nut, 13 is the brake caliper, 14 is the first bolt, 15 is the brake pad, and 16 is the second bolt. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0052] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "inner", "outer", "front", "back" and the like indicate directions or positional relationships based on the directions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as limiting the present invention. The terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance. In addition, the terms "adjacent", "belonging to", and "including" specifically refer to a simplified description of the component hierarchy and spatial positional relationship, and do not indicate a specific direction.
[0053] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection or a detachable connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, and it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0054] like Figure 1 As shown, a two-stage rail transit vehicle defect detection method based on prior knowledge includes:
[0055] The first-level components in rail transit vehicle parts contain second-level components. The relationship between the second-level components belonging to the same first-level component is an adjacent relationship. The components contained in rail transit vehicle parts and their relative spatial position relationship and the set of various types of defects of known components are used as a priori knowledge base;
[0056] The rail transit vehicle parts image set is used as a training set to train the parts detection network. The parts detection network includes a large target feature extraction network and a small target feature extraction network. During the training process, the large target feature extraction network is used to obtain the area where the first-level parts are located, and then the second-level parts contained in the first-level parts are obtained from the prior knowledge base. The area where the second-level parts are located is enlarged and mapped back to the rail transit vehicle parts image, and then input into the small target feature extraction network, and the parts type is output. The training is carried out until convergence to obtain a trained parts detection network;
[0057] The image of the part to be inspected is input into the trained component inspection network to detect the type of component. The defect type of the component type is detected through a priori knowledge base, deep learning or template matching.
[0058] The relative spatial position relationship is also called the spatial position constraint relationship.
[0059] According to the characteristics of rail transit vehicle parts with standardized production and relatively fixed spatial structural relationships, a priori knowledge graph is constructed by combining the types of parts and the relative spatial position relationship information, and the naming rules of the image data of the rail transit intelligent inspection system are set. The image data name is used as the index of the prior knowledge base, and the implicit prior knowledge information is queried through image naming. The relative spatial structural position relationship includes adjacent, contained (belongs to), etc. As shown in Table 1, the relationship between the first-level components and the second-level components, the first-level components contain the second-level components, and the relationship between the second-level components belonging to the same first-level components is an adjacent relationship. According to the spatial position relationship of the parts, under the premise of knowing the first-level components, it is easy to infer the possible area range of the second-level components, narrow the detection range of the algorithm, and improve the detection accuracy.
[0060] Table 1 Correspondence between some primary components and secondary components
[0061]
[0062]
[0063]
[0064] Since the volume of the first-level components is often much larger than that of the second-level components, they occupy more pixels in the image, and the algorithm can more easily extract feature information, making them easier to detect. The second-level components have a smaller detection range after reasoning with prior knowledge, and the pixel value of the second-level components in the image is increased by local scale magnification, making it easier for the detection algorithm to identify them.
[0065] The possible defect types of parts can be found out according to the operation instructions. The possible defect types of some parts are shown in Table 2.
[0066] The content of Table 2 can be added to the prior knowledge base.
[0067] Table 2 Possible defect types of some parts
[0068]
[0069]
[0070] As shown in Figure 2(a), the bogie components include axle 10, brake disc 11, nut 12, brake caliper 13, first bolt 14, brake pad 15 and second bolt 16. The axle 10, brake disc 11, brake caliper 13 and brake pad 15 are in an adjacent position relationship; the nut 12 and the first bolt 14 are installed on the brake caliper 13, and the second bolt 16 is installed on the brake disc 11, which belongs to the inclusion relationship. Based on this, a priori knowledge graph is established, as shown in Figure 2(b). Using the priori knowledge graph, the relative spatial position relationship of other components can be inferred from the position of a certain component.
[0071] The image file name is used as a prior knowledge index, and the prior knowledge information contained in the image naming query is obtained. The image file name is named according to certain rules, including camera number, train number, car number, bogie number, axle number, wheel number, primary component number, acquisition device number, and acquisition point number. For example, the image data is named T1-CRH2A2411-01-01-03-05-ZD-01-01, and the meanings of each symbol are as follows: T1 represents the camera number, CRH2A2411 represents the train number, the first 01 represents the car number, the second 01 represents the bogie number, 03 represents the axle number, 05 represents the wheel number, ZD represents the primary component number, the third 01 represents the acquisition device number, and the fourth 01 represents the acquisition point number.
[0072] For the component detection network used in the first stage, the network structure is as follows: Figure 3 As shown in the figure, combined with the prior knowledge of the relative spatial position relationship of components in the rail transit scenario, it is possible to first detect targets that are large and easy to detect (primary components), infer the area that may contain targets that are small and difficult to detect (secondary components), and further detect the area.
[0073] For the first stage component detection network, the training component detection network includes:
[0074] Input the rail transit vehicle parts image into the parts detection network, extract the large target features through the large target feature extraction network, and then obtain the prediction results through classification regression. The prediction results include the first-level component, the pixel coordinates of the upper left corner point of the area where the first-level component is located, and the width, height, and confidence of the area where the first-level component is located. The prediction results with confidences that meet the threshold conditions are selected. If the same first-level component is selected by multiple prediction boxes during the prediction process, the multiple prediction boxes are merged into one as the final area where the first-level component is located;
[0075] The secondary components contained in the primary components are obtained from the prior knowledge base, and the area where the secondary components are located is enlarged by bilinear interpolation. Then, the image of rail transit vehicle parts is mapped back to the small target feature extraction network. After the small target features are extracted, they are classified and regressed, and confidence score screening and non-maximum suppression are performed. The component types are output and trained until convergence to obtain a trained component detection network.
[0076] The backbone feature extraction network of the parts detection network is CSPDarknet, which is mainly composed of four residual convolution modules. Each residual convolution module can be divided into two parts. The residual trunk is divided into a 1×1 convolution and a 3×3 convolution. The residual side part is not processed in any way, and the input and output of the residual trunk are directly combined. The enhanced feature extraction part extracts three feature layers (middle layer, lower middle layer, bottom layer) at different positions of the backbone network CSPDarknet, upsamples the bottom feature layer, and fuses the features with the lower middle layer and the middle layer through 1×1 convolution in turn. Then, the result of the fusion of the middle layer features is downsampled, and fused with the lower middle layer and the bottom layer through 3×3 convolution in turn to obtain enhanced features. The enhanced features are classified and regressed to obtain prediction results. The large target feature extraction network and the small target feature extraction network in the parts detection network are trained by image datasets containing primary parts and secondary parts to obtain weight values.
[0077] Score screening is to screen the test results whose confidence meets the threshold conditions. For example, if the threshold is set to 60%, the test results with a confidence of more than 60% in the prediction results are considered valid, and those with a confidence of less than 60% are considered invalid. The test results finally obtained by the algorithm are the test results that meet the threshold conditions.
[0078] Non-maximum suppression is also called the NMS algorithm. In target detection, if the same target is selected by multiple prediction boxes, the algorithm will merge multiple prediction boxes into one as the final detection result.
[0079] The input of the parts detection network is the rail transit vehicle image data collected by the intelligent inspection equipment. The intelligent inspection equipment includes but is not limited to the vehicle fault dynamic image detection system (Trouble of moving EMU Detection System, TEDS) and the intelligent inspection robot. The network output is the predicted part type, the pixel coordinates of the upper left corner of the prediction box, the width and height of the prediction box, and the confidence of the prediction result.
[0080] This method optimizes the detection of small targets (secondary components) through cascaded convolutional neural networks, local area magnification and prior knowledge. The specific implementation method of the cascade is to obtain the location of the primary component through the large target detection network, and then combine the prior knowledge of spatial position relationships (adjacent, containing, etc.) to infer the area where the secondary component may exist. The area is cropped and enlarged and then input into the small target detection network for further detection of the secondary component.
[0081] The specific implementation method of local scale magnification is to obtain the area of the second level in the image by combining prior knowledge, and then use bilinear interpolation to magnify the image in the area by a certain multiple, and then further detect the second level components. Figure 4 As shown, its linear interpolation in the x direction is shown in equations (1) and (2), and its interpolation in the y direction is shown in equation (3).
[0082]
[0083]
[0084]
[0085] Among them, Q 11 , Q 12 The horizontal coordinate of is x1, the horizontal coordinate of R2 and R1 is x, Q 22 , Q 21 The horizontal coordinate of is x2. 12 , R2, Q 22 The vertical coordinate of is y2, the vertical coordinate of P is y, and the vertical coordinate of Q 11 , R1, Q 21 The vertical coordinate is y1, f(P) represents the function value at point P, and the other points are similar. The function represents the mapping relationship between the pixel coordinates and the pixel value.
[0086] The large target detection network and small target detection network mentioned in this application adopt the YOLOvX network. Other network models such as Faster R-CNN, SSD, and RetinaNet can also replace the method of this application.
[0087] In this application, the secondary component detection result obtained after the image is locally enlarged needs to be combined with the primary component detection result of the original image. Therefore, the bounding box of the secondary component detection needs to be mapped back to the original image. The mapping relationship is shown in formula (4). In the formula, the small component detection bounding box is expressed as (x, y, w, h), where x and y are the coordinates of the upper left point of the bounding box, w and h are the width and height of the bounding box respectively, and the corresponding projection of the bounding box in the original image is (x i ,y i ,w i ,h i ), x l ,y l is the coordinate of the upper left point of the cropped area in the original image, and k is the image scale magnification factor.
[0088]
[0089] For the network model used in the second stage of defect detection, the backbone feature extraction network is Darknet-53, which consists of 53 convolutional layers. The obtained feature maps are predicted by (4+1+c)×k convolution kernels of size 1×1, where k is the number of preset bounding boxes (k defaults to 3) and c is the number of categories of the predicted target. The network weights are trained using a data set containing samples of different defect types.
[0090] The network input is the image of the area where the parts are located detected in the first stage, and the network output is the predicted defect type, the pixel coordinates of the upper left corner of the prediction box, the width and height of the prediction box, and the confidence of the prediction result.
[0091] For the defect detection method used in the first stage, three methods, namely, prior knowledge quantity judgment, deep learning, and template matching, are used for targeted detection according to the possible defect types. For types of defects such as component loss and falling off, based on the types and quantities of components detected in the first stage, combined with prior knowledge, the comparison of quantity changes is used to determine whether components are missing or falling off. For example, there should be 8 nuts on the brake disc under normal conditions. If the number of nuts actually detected is less than this number, it can be directly determined that the nuts are missing; for components with a large number of samples and a relatively single type of defects, a deep learning method is used for defect detection. This method is suitable for the detection of most types of defects; for defect types with a small number of defect samples and poor detection results using deep learning methods, the ORB feature points of the image to be detected are extracted and matched with the template image, and the difference set is calculated using the difference method. The area and threshold of the difference set part are used to determine whether there is a defect. The template matching threshold is mainly used to avoid noise interference. For example, if the threshold range is set to predict that the area of the region is greater than 5% as a defect, if the detected area only accounts for 2% of the total area of the image, it is considered to be noise interference and can be ignored. The area greater than 5% is considered to be an area where possible defects are detected as the final detection result.
[0092] The deep learning network used for defect detection in this application is YOLO. Other network models such as Faster R-CNN, SSD, and RetinaNet can also replace the method of this application.
[0093] For the first-stage component detection network, the image data of rail transit vehicles in normal state are collected through intelligent inspection equipment. The intelligent inspection equipment includes but is not limited to the vehicle fault dynamic image detection system (Trouble of moving EMU Detection System, TEDS) and intelligent inspection robots. Based on the collected image data, the labelimg annotation tool is used to use rectangular boxes to annotate the primary and secondary components in the image, and the VOC dataset format is used to store them to create a component dataset, which is used to train the component network.
[0094] For the second-stage defect detection deep learning method, image data of rail transit vehicles with defects are collected through intelligent inspection equipment. The intelligent inspection equipment includes but is not limited to the vehicle fault dynamic image detection system (Trouble of moving EMU Detection System, TEDS) and the intelligent inspection robot. Based on the collected image data, the labelimg annotation tool is used to use rectangular boxes to annotate different defect types in the image to create a defect data set. Since the actual probability of defects in rail transit vehicles is low and the samples are relatively small, this application uses rotation, scaling, mirroring, shearing, adding noise and other methods to expand the defect data set, and uses the expanded defect data set to train the defect detection network.
[0095] For the second-stage defect detection template matching method, the image data of rail transit vehicles in normal state is collected by intelligent inspection equipment. The intelligent inspection equipment includes but is not limited to the vehicle fault dynamic image detection system (Trouble of moving EMU Detection System, TEDS) and the intelligent inspection robot. The collected image in normal state is used as the template image, and the collection position is recorded and used as the matching template at the same position during defect detection.
[0096] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A two-stage rail transit vehicle defect detection method based on prior knowledge, characterized in that: include: The first-level components in rail transit vehicle parts contain second-level components. The relationship between the second-level components belonging to the same first-level component is an adjacent relationship. The components contained in rail transit vehicle parts and their relative spatial position relationship and the set of various types of defects of known components are used as a priori knowledge base; The rail transit vehicle parts image set is used as a training set to train the parts detection network. The parts detection network includes a large target feature extraction network and a small target feature extraction network. During the training process, the large target feature extraction network is used to obtain the area where the first-level parts are located, and then the second-level parts contained in the first-level parts are obtained from the prior knowledge base. The area where the second-level parts are located is enlarged and mapped back to the rail transit vehicle parts image, and then input into the small target feature extraction network, and the parts type is output. The training is carried out until convergence to obtain a trained parts detection network; The image of the part to be inspected is input into the trained component inspection network to detect the type of component. The defect type of the component type is detected through a priori knowledge base, deep learning or template matching.
2. A two-stage rail transit vehicle defect detection method based on prior knowledge as claimed in claim 1, characterized in that: The defect types of parts detected by the prior knowledge base include: For the detected parts type, their quantity is counted, and the original quantity of the parts of this type is obtained from the prior knowledge base. The original quantity is compared with the counted quantity. If the counted quantity is less than the original quantity, the defect type of the parts of this type is determined to be missing or falling off.
3. A two-stage rail transit vehicle defect detection method based on prior knowledge as claimed in claim 1, characterized in that: The defect types of parts detected by deep learning include: Input the image of the part to be inspected of a known component type into the deep learning network to obtain the defect type of the component type; The deep learning network is trained in the following way: The defect types of various parts of rail transit vehicles are marked to form training samples. The training samples are expanded by rotation, scaling, mirroring, shearing, and adding noise to construct a defect type training data set. The defect type training data set is used to train a deep learning network to obtain a trained deep learning network.
4. A two-stage rail transit vehicle defect detection method based on prior knowledge as claimed in claim 1, characterized in that: The defect types of parts detected by template matching include: The ORB feature points of the image to be inspected are extracted and matched with the template image. The difference set is calculated by the difference method. The area of the difference set is compared with the preset threshold to determine whether there is a defect. If the area of the difference set is greater than the preset threshold, there is a defect, and the defect type of this type of component is obtained from the prior knowledge base.
5. A two-stage rail transit vehicle defect detection method based on prior knowledge as claimed in claim 4, characterized in that: The template image is obtained in the following way: The images of rail transit vehicle parts in normal state are collected as template images, and the collection positions are recorded, which are used as template images at the same positions during defect detection.
6. A two-stage rail transit vehicle defect detection method based on prior knowledge as described in any one of claims 1 to 5, characterized in that: The component detection network training includes: Input the rail transit vehicle parts image into the parts detection network, extract the large target features through the large target feature extraction network, and then obtain the prediction results through classification regression. The prediction results include the first-level component, the pixel coordinates of the upper left corner point of the area where the first-level component is located, and the width, height, and confidence of the area where the first-level component is located. The prediction results with confidences that meet the threshold conditions are selected. If the same first-level component is selected by multiple prediction boxes during the prediction process, the multiple prediction boxes are merged into one as the final area where the first-level component is located; The secondary components contained in the primary components are obtained from the prior knowledge base, and the area where the secondary components are located is enlarged by bilinear interpolation. Then, the image of rail transit vehicle parts is mapped back to the small target feature extraction network. After the small target features are extracted, they are classified and regressed, and confidence score screening and non-maximum suppression are performed. The component types are output and trained until convergence to obtain a trained component detection network.
7. A two-stage rail transit vehicle defect detection method based on prior knowledge as claimed in claim 6, characterized in that: The mapping is achieved in the following way: Among them, the bounding box of the area where the secondary component is located before mapping is represented by (x, y, w, h), where x and y are the coordinates of the upper left point of the bounding box, and w and h are the width and height of the bounding box respectively; the corresponding projection of the bounding box mapped back to the rail transit vehicle component image is (x i ,y i , w i ,h i ), x l ,y l is the coordinate of the upper left point of the cropped area in the rail transit vehicle component image, and k is the scale magnification factor of the area where the secondary component is located before mapping.
8. A two-stage rail transit vehicle defect detection method based on prior knowledge as claimed in claim 6, characterized in that: The large target feature extraction network in the component detection network extracts large target features in the same way as the small target feature extraction network extracts small target features. The large target feature extraction network extracts large target features including: Extract three feature layers at different positions of the large target feature extraction network, including the middle layer, the lower middle layer, and the bottom layer; After upsampling the bottom feature layer, it is fused with the feature layers of the lower and middle layers through a convolution. Then, the result of feature fusion is downsampled and fused with the middle and lower layers and the bottom feature layer in turn through another convolution to obtain enhanced features as large target features.
9. A two-stage rail transit vehicle defect detection system based on prior knowledge, characterized in that: include: A priori knowledge base building module is used to take the components of rail transit vehicle parts and their relative spatial position relationship, and the set of various types of defects of known components as a priori knowledge base; A network training module is used to use a set of rail transit vehicle parts images as a training set to train a parts detection network. The parts detection network includes a large target feature extraction network and a small target feature extraction network. During the training process, the area where the primary parts are located is obtained through the large target feature extraction network, and then the secondary parts contained in the primary parts are obtained from the prior knowledge base. The area where the secondary parts are located is magnified and mapped back to the rail transit vehicle parts image, and then input into the small target feature extraction network, and the parts types are output. The training is conducted until convergence to obtain a trained parts detection network. The defect detection module is used to input the image of the part to be inspected into the trained component inspection network, detect the type of component, and detect the defect type of the component type through a priori knowledge base, deep learning or template matching.
10. A two-stage rail transit vehicle defect detection system based on prior knowledge as claimed in claim 9, characterized in that: The defect detection module comprises: The prior detection module is used to count the number of detected parts, obtain the original number of parts of this type from the prior knowledge base, and compare the original number with the counted number. If the counted number is less than the original number, the defect type of this type of parts is part loss or falling off; A deep learning detection module is used to input the image of the part to be detected of a known component type into the deep learning network to obtain the defect type of the component type; The template matching detection module is used to extract the ORB feature points of the image to be detected and match it with the template image, calculate the difference set through the difference method, and judge whether there is a defect based on the comparison of the area of the difference set part and the preset threshold. If the area of the difference set part is greater than the preset threshold, there is a defect, and the defect type of this type of component is obtained from the prior knowledge base.
Citation Information
Patent Citations
Collagen casing defect detection model, method and system based on deep convolutional neural network
CN110111332A
Three-dimensional template automatic matching method of pantograph image
CN111260797A
Weld defect identification and positioning method and system based on deep learning network
CN113034478A
Regularized multi-label classification from partially labeled training data
US10769766B1
