A train surface scratch analysis system
By designing a train surface scratch analysis system and using semantic segmentation and multi-dimensional feature analysis, the problem in the existing technology that mud stains affect the accuracy of scratch analysis has been solved, and rapid differentiation and accurate judgment of mud stains and scratches have been achieved.
Patent Information
- Application Number
- CN202411354366.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2044-09-27
AI Technical Summary
Existing train surface scratch detection methods rely on image recognition and are susceptible to mud stains, resulting in inaccurate scratch analysis.
A train surface scratch analysis system is designed, including an image acquisition module, a feature analysis module, a scratch analysis module and a scratch verification module. Through semantic segmentation, color analysis strategy and shape analysis strategy, the status of the feature is obtained, and the color difference index and shape difference index are calculated. Combined with the number of features, angle difference index and consistency difference index, the similarity calculation is used to determine whether the feature is for scratches.
It achieves rapid distinction between mud stains and scratches, improves the accuracy of scratch analysis, and reduces misjudgments of mud stains.
Smart Images

Figure CN118887211B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of analysis systems, and more particularly to a train surface scratch analysis system. Background Art
[0002] During the running of a train, due to the changing running environment, it may be hit, rubbed or scratched by external objects, such as foreign objects splashing on the rails, etc. It may also come into contact with branches, movable baffles and the like with rough or uneven surfaces, causing scratches. Scratches may damage the anti-corrosion, anti-wear and other coatings on the surface of the train, causing accelerated corrosion or wear of the train materials, thereby reducing the structural strength and safety of the train. The current method for detecting scratches on the surface of a train mainly relies on image recognition. By taking images of the train surface, the images of the train surface are processed, and abnormal areas on the train surface are obtained, which are then identified as scratches. In the process of scratch judgment, there may be mud stains on the surface of the train during the running of the train, and the presence of mud stains may affect the analysis of scratches. Summary of the invention
[0003] In view of the shortcomings of the prior art, an object of the present invention is to provide a train surface scratch analysis system to overcome the above-mentioned defects in the prior art.
[0004] To achieve the above object, the present invention provides the following technical solutions:
[0005] A train surface scratch analysis system includes an image acquisition module, a feature object analysis module, a scratch analysis module and a scratch verification module;
[0006] The image acquisition module is used to obtain a train surface image as an image to be analyzed;
[0007] The feature object analysis module is used to obtain a feature region by semantic segmentation of the image to be analyzed, obtain a feature object state by a color analysis strategy and a shape analysis strategy, and obtain a color difference index and a shape difference index respectively, wherein the feature object state includes a scratch state and a mud stain state;
[0008] The scratch analysis module, when the state of the feature object is a scratch state, obtains the feature area corresponding to the feature object, extracts the contour line of the feature area according to the contour detection algorithm, and determines the number of feature objects, the angle difference index and the consistency difference index of the feature area according to the outer contour line of the feature area.
[0009] The scratch verification module calculates the similarity values of the characteristic regions judged as scratches in the characteristic object state according to the color difference index, shape difference index, number of characteristic objects, angle difference index and consistency difference index through similarity calculation with the scratch state;
[0010] The result output module compares the similarity value with a preset threshold value, and outputs the result as a scratch feature or a mud stain feature according to the comparison result.
[0011] Preferably, the scratch analysis module is provided with an angle judgment unit, which is used to identify the feature object, obtain the feature object, extract the starting point coordinates and the end point coordinates of the corresponding feature object, calculate the inclination angle of the feature object, and obtain the corresponding angle difference index according to the inclination angle of the feature object.
[0012] Preferably, a diffusion angle judgment subunit is also provided in the angle judgment unit, and the diffusion angle judgment subunit is used to obtain the adjacent feature objects of the feature object, and obtain the distance between the feature object and the adjacent feature objects and the angle similarity value, and obtain the influence value through the influence judgment strategy, and obtain the angle difference index through the angle calculation formula.
[0013] Preferably, the angle calculation formula is:
[0014] ;
[0015] Where n is the number of adjacent features, d is the distance between the adjacent features and the target feature, Q is the influence value of the distance between the adjacent features, q is the angle similarity value of the adjacent features, and θ is the angle value of the target feature. is the first angle weight value, is the second angle weight value.
[0016] Preferably, the impact judgment strategy includes obtaining characteristic parameters of adjacent feature objects and characteristic parameters of target feature objects, wherein the characteristic parameters are reflected in the color and shape of the feature objects, and comparing the similarity between the characteristic parameters of the adjacent feature objects and the characteristic parameters of the target feature objects to obtain the impact value.
[0017] Preferably, the color analysis strategy is to obtain color information of the feature object, and compare the color information through a target color model to obtain an analysis result, wherein the analysis result reflects different states of the feature object; a color difference is calculated for a feature area judged as a scratch in the feature object state, and the color difference between the feature area and the sample image is obtained to obtain a color difference index.
[0018] Preferably, the shape judgment strategy is used to extract the image edge of the feature area, and after extracting the image edge feature, it is judged whether the image edge feature is a strip through a strip recognition model. If not, it is judged to be a mud stain state, and if so, it is judged to be a scratch state; the image edge feature judged as a scratch in the feature object state is subjected to contour geometry analysis, the width of the feature area is calculated, and the shape difference index is obtained based on the uniformity of its width.
[0019] Preferably, a quantity determination unit is provided in the scratch analysis module, and the quantity determination unit is used to mark the feature objects in the feature object image and automatically count and obtain the quantity of the feature objects.
[0020] Preferably, the scratch analysis module is further provided with a consistency judgment unit, which is used to obtain the shape, area, depth, etc. of all feature objects in the feature image, and to obtain a consistency difference index based on the similarity values by comparing the similarities between different feature objects.
[0021] Preferably, the similarity calculation formula is:
[0022] ;
[0023] Among them, P is the similarity value, is the first weight value, is the second weight value, is the third weight value, is the fourth weight value, is the fifth weight value, is the angle difference index, is the shape difference index, is the color similarity index, is the consistency difference index, is the number of features.
[0024] The beneficial effects of the present invention are as follows: through the feature analysis module, feature objects with obvious abnormalities in color and shape features are screened to achieve rapid distinction between mud stains and scratches; and when the state of the feature object is identified as a scratch state, in order to improve the accuracy of the scratch analysis, the scratch analysis module is used to re-analyze the feature object judged to be in a scratch state, and the number of feature objects, angle difference index and consistency difference index are obtained, scratch analysis factors are added, and the accuracy of scratch judgment is improved; the feature object is analyzed from multiple dimensions such as color, shape, angle, number and consistency, to determine whether the feature object is a scratch, thereby achieving rapid distinction between mud stains and scratches. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 It is a module connection diagram of the present invention;
[0026] Figure 2 It is a schematic diagram of train scratches of the present invention;
[0027] Figure 3 It is a comparison diagram of mud stains and scratches on trains of the present invention;
[0028] Figure 4 It is a schematic diagram of train mud stains of the present invention. DETAILED DESCRIPTION
[0029] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0030] It should be noted that when a component is referred to as being "fixed to" another component, it may be directly on the other component or there may also be a component centered. When a component is considered to be "connected to" another component, it may be directly connected to the other component or there may also be a component centered. When a component is considered to be "set on" another component, it may be directly set on the other component or there may also be a component centered. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only.
[0031] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.
[0032] The embodiments of the present invention are further described in detail below with reference to the accompanying drawings:
[0033] like Figure 1-Figure 4 As shown, the present invention provides a train surface scratch analysis system, including an image acquisition module, a feature object analysis module, a scratch analysis module and a scratch verification module;
[0034] The image acquisition module is used to obtain the train surface image captured by the color line scan camera as the image to be analyzed, and use the camera to capture and shoot the train surface image, and use the captured train surface image as the image to be analyzed;
[0035] The feature object analysis module is used to obtain feature regions through semantic segmentation of the image to be analyzed, obtain feature object states through color analysis strategy and shape analysis strategy, and obtain color difference index and shape difference index respectively. The feature object states include scratch state and mud stain state. The semantic segmentation model (deep learning model) is used to use the VGG network trained with the open source semantic segmentation dataset as the backbone network of the semantic segmentation network, i.e., the backbone layer, to extract features, quickly identify and extract feature regions in the image to be analyzed, and extract both color information and shape information. In the VGG network, shallow features are used to capture the edges of feature regions. The edge and color of the feature are used to identify the color. More abstract and advanced features are captured in the deep features to obtain the overall shape of the feature area. By adjusting the network layer depth, the color data and shape data are obtained, and the color analysis strategy is used to determine the color of the feature area. If the color of the feature object is identified as a dark natural soil color, the state of the feature object is determined to be a mud stain state. The image analysis strategy is used to determine the shape of the feature object. If the shape of the feature object is irregular and the edge is blurred, the state of the feature object is determined to be a mud stain state. The feature object analysis module is used to make a preliminary judgment on the feature object, and the feature objects that are obviously mud stains are screened to improve the accuracy of scratch analysis.
[0036] Based on the above-mentioned feature object analysis module, deep learning can be used to quickly screen feature objects with obvious abnormalities in color (natural soil color, such as brown, gray, yellow, black) and shape (such as dots, blocks, flakes or irregular shapes, etc.), thereby reducing subsequent screening and improving screening efficiency.
[0037] The scratch analysis module, when the state of the feature object is a scratch state, obtains the feature area corresponding to the feature object, extracts the contour line of the feature area according to the contour detection algorithm, and judges the number of feature objects, the angle difference index and the consistency difference index of the feature area according to the outer contour line of the feature area; when the state of the feature object is a scratch state, further analyzes the feature object, processes the image through binary image processing to obtain an image with only black and white colors, identifies and obtains the feature area in the binary image, obtains the contour line of the feature area, and judges the shape of the number of feature objects, the angle difference index between adjacent feature objects and the consistency difference index of all feature objects according to the contour line;
[0038] When the state of the feature object is identified as a scratch state, in order to improve the accuracy of the scratch analysis, the scratch analysis module is used to re-analyze the feature object judged as a scratch state, and obtain the number of feature objects, angle difference index and consistency difference index, increase the scratch analysis factors, and improve the accuracy of scratch judgment;
[0039] The scratch verification module, when the feature state is a scratch, obtains the color difference index and the shape difference index respectively through the color analysis strategy and the shape analysis strategy in the feature analysis module, and obtains the number of features, the angle difference index and the consistency difference index in the scratch analysis module, and a similarity calculation formula is set in the scratch analysis module, and the similarity value of the feature is obtained through the similarity calculation formula.
[0040] The similarity calculation formula is:
[0041] ;
[0042] Among them, P is the similarity value, is the first weight value, is the second weight value, is the third weight value, is the fourth weight value, is the fifth weight value, is the angle difference index, is the shape difference index, is the color similarity index, is the consistency difference index, is the number of features.
[0043] The feature objects are analyzed from multiple dimensions such as color, shape, angle, quantity and consistency to determine whether they are scratches, thereby improving the accuracy of the judgment.
[0044] The scratch analysis module is provided with an angle judgment unit, which is used to identify the feature object, obtain the feature object, calculate the inclination angle of the feature object, and obtain the corresponding angle difference index according to the inclination angle of the feature object and the target angle model; in the angle judgment unit, the image to be analyzed is gray-processed to form a gray-scale image, and YOLO V8 is used for target detection, and the bounding box position, confidence and category of the feature object are output, and the Canny algorithm in the openCV library is used to find the minimum circumscribed rectangle of the feature object, and further process to find the center line of the outer rectangle; the line tracking algorithm is used to determine the two intersection points of the center line and the minimum outer rectangle, and the two intersection points are defined as the starting point and the end point respectively, and the complete path of the center line is marked; in the process of tracking the feature object, the starting point and the end point coordinates of the feature object path are recorded, and the starting point coordinates are The end point coordinates are , using the coordinates of the starting point and the end point, calculate the inclination angle of the feature object. The calculation formula is: , θ is the inclination angle; a target angle model is also provided in the angle judgment unit, and the model represents the inclination angle range of the expected feature object, that is, when the inclination angle is within the range of the target angle model, it is judged that the feature object is more inclined to mud stains; the calculated inclination angle is compared with the target angle model, and the difference between the two is calculated, and the angle difference index is calculated according to the difference between the two, the smaller the difference, the greater the angle difference index; by analyzing the inclination angle of the feature object, it is judged whether the current feature object is a mud stain.
[0045] The angle judgment unit is also provided with a diffusion angle judgment subunit, which is used to obtain the adjacent features of the feature object, and obtain the distance between the feature object and the adjacent features and the angle similarity value, and obtain the influence value through the influence judgment strategy, and obtain the angle difference index through the angle calculation formula; in the angle judgment process, there may be continuously set features. After selecting the target feature object, the surrounding features are defined as adjacent features. By obtaining the distance between the adjacent features and the target feature object and the inclination angle similarity value, the angle difference index of the target feature object in the current area is judged, and the features in the current area are centrally processed.
[0046] The angle calculation formula is:
[0047] ;
[0048] Where n is the number of adjacent features, d is the distance between the adjacent features and the target feature, Q is the influence value of the distance between the adjacent features, q is the angle similarity value of the adjacent features, and θ is the angle value of the target feature. is the first angle weight value, is the second angle weight value.
[0049] The influence judgment strategy includes obtaining the characteristic parameters of adjacent features and the characteristic parameters of the target feature, the characteristic parameters are reflected in the color and shape of the feature, etc., comparing the similarity of the characteristic parameters of the adjacent features with the characteristic parameters of the target feature, and obtaining the influence value, by identifying the color, shape, texture and spatial position relationship of the characteristic areas corresponding to different features; and obtaining the feature objects that are relatively close in spatial position as adjacent features, and obtaining their characteristic parameters, comparing the similarity of the characteristic parameters between the target feature and the adjacent feature, so as to obtain the influence value, which reflects the similarity between the target feature and the adjacent feature in a certain area.
[0050] The color analysis strategy is used to obtain the color information of the feature object, and compare the color information with the target color model to obtain the analysis result, and the analysis result reflects the different states of the feature object; the color analysis strategy is used to obtain the feature object image, and the color of the identified feature object is extracted, and the image is converted from the RGB (red, green, blue) color space to other color spaces that are more suitable for color analysis (such as HSV, Lab, etc.), and the color information of the feature object is extracted; the color range of the mud stain is pre-defined in the target color model for comparison with the extracted color information; in the color matching process, the extracted color information and the target color model are converted to the same color space, which helps to eliminate the differences between different color spaces, improve the matching accuracy, and The state of the feature object is obtained based on the analysis results generated by comparing the color information with the target color model; when the color information is yellow, which is close to mud stains, the feature object is judged to be a mud stain feature; the feature area judged as a scratch in the feature object state is subjected to color difference calculation to obtain the color difference between the feature area and the sample image, and obtain the color difference index; the color difference formula is used to calculate the color difference between the color information of the feature area and the sample image of the train body, and the color difference index is generated based on the calculated color difference; when mud stains such as gray that are close to the color of scratches appear on the train, the difference between scratches and mud stains is determined by calculating the color difference index. The higher the color similarity index, the more similar the feature object is to the mud stain, and the easier it is to be judged as a mud stain.
[0051] The shape judgment strategy is used to extract the image edge of the feature area, and after extracting the image edge features, the strip recognition model is used to determine whether the image edge features are strips. If not, it is determined to be in a mud stain state, and if so, it is determined to be in a scratch state. The edge detection algorithm in the shape judgment strategy, such as the Canny edge detector and the Sobel operator, is used to extract the edge features of the feature object, and a strip recognition model is preset. The strip recognition model can be used to quickly identify whether the feature area is a strip or a block, and other shape features. If it is not a strip, the feature area is determined to be in a mud stain state, and if it is a strip, the area is determined to be in a possible scratch state. The image edge features judged as scratches in the feature state are subjected to contour geometry analysis, the width of the feature area is calculated, and the shape difference index is obtained based on its width uniformity. The image edge features
[0052] Geometric analysis includes length, direction, curvature, connectivity, width, etc., obtains the width of the image edge in the length direction, checks whether the width of the feature area is consistent in the length direction, and obtains the shape difference index based on the consistency of the width. When the width consistency is high, the shape difference index is low, and when the width consistency is low, the shape difference index is high. By analyzing the consistency of the feature area, the inconsistent width or the accumulated mud stains at the tail can be identified to remove the influence of mud spots on the judgment.
[0053] The scratch analysis module is provided with a quantity judgment unit, which is used to mark the feature objects in the feature object image and automatically count and obtain the number of feature objects; the quantity judgment unit is used to automatically identify the feature objects in the feature object image, mark the feature objects with a bounding box, and obtain an ID; based on the marking result, the feature object marks in the feature object image are counted, the number of accumulated marked IDs is obtained, and the number of feature objects is generated. The more feature objects there are, the easier it is to be identified as mud stains.
[0054] The scratch analysis module is also provided with a consistency judgment unit, which is used to obtain the shape, area, depth, etc. of all feature objects in the feature image, and obtain the similarity value by comparing the similarities between different feature objects. According to the similarity value, the consistency difference index is obtained. From the consistency point of view, the size and shape of the scratches may vary due to the generation cause and strength, but the scratches on the surface of the train are more consistent, and their shape, area and depth are more consistent. In the consistency judgment unit, the shape, area and depth of the feature objects are collected and the consistency judgment is performed. If the similarity is high, the consistency difference index is low; if the similarity is low, the consistency difference index is high; if the consistency difference index is low, it is easy to be judged as a scratch.
[0055] The result output module is used to obtain the similarity value in the scratch verification module. By comparing the similarity value and the preset threshold, if the similarity value is greater than the threshold, the feature object is judged to be a mud stain, and if the similarity value is less than the threshold, the feature object is judged to be a scratch; the similarity value is calculated by a similarity calculation formula and is used to measure the similarity between the feature object and the mud stain. A threshold is preset in the feature object judgment module. The calculated similarity value is compared with the threshold. If the similarity value is greater than the threshold, the feature object is judged to be a mud stain, and if the similarity value is less than the threshold, the feature object is judged to be a scratch. By comparison, mud stains and scratches can be quickly distinguished to ensure accuracy in the scratch detection process.
[0056] The above are only preferred embodiments of the present invention. The protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
Claims
1. A train surface scratch analysis system, characterized in that: It includes an image acquisition module, a feature object analysis module, a scratch analysis module, a scratch verification module and a result output module; The image acquisition module is used to obtain a train surface image as an image to be analyzed; The feature object analysis module is used to obtain a feature area by semantic segmentation of the image to be analyzed, obtain a feature object state by a color analysis strategy and a shape analysis strategy, and respectively obtain a color difference index and a shape difference index, calculate the color difference between the color information of the feature area and the sample image of the train body, and generate a color difference index based on the calculated color difference, perform contour geometry analysis on the image edge features judged as scratches in the feature object state, calculate the width of the feature area, and obtain a shape difference index based on the uniformity of its width, wherein the feature object state includes a scratch state and a mud stain state; The scratch analysis module, when the state of the feature object is a scratch state, obtains the feature area corresponding to the feature object, extracts the contour line of the feature area according to the contour detection algorithm, determines the number of features, the angle difference index and the consistency difference index of the feature area according to the outer contour line of the feature area, marks the features in the feature object image, and automatically counts and obtains the number of features, determines the angle difference index of the target feature object in the current area by obtaining the distance between the adjacent feature object and the target feature object and the similarity value of the tilt angle, compares the similarity between different feature objects, and obtains the similarity value, and obtains the consistency difference index according to the similarity value; The scratch verification module calculates the similarity value of the scratch state by similarity calculation based on the color difference index, shape difference index, number of features, angle difference index and consistency difference index for several feature areas judged as scratches in the feature state; The result output module compares the similarity value with a preset threshold value, and outputs the result as a scratch feature or a mud stain feature according to the comparison result.
2. A train surface scratch analysis system according to claim 1, characterized in that: The scratch analysis module is provided with an angle judgment unit, which is used to identify the feature object, obtain the feature object, calculate the tilt angle of the feature object, and obtain the corresponding angle difference index according to the target angle model.
3. A train surface scratch analysis system according to claim 2, characterized in that: The angle judgment unit is also provided with a diffusion angle judgment subunit, which is used to obtain the adjacent feature objects of the feature object, and obtain the distance between the feature object and the adjacent feature objects and the angle similarity value, and obtain the influence value through the influence judgment strategy, and obtain the angle difference index through the angle calculation formula.
4. A train surface scratch analysis system according to claim 3, characterized in that: The angle calculation formula is: ; Where n is the number of adjacent features, d is the distance between the adjacent features and the target feature, Q is the influence value of the distance between the adjacent features, q is the angle similarity value of the adjacent features, and θ is the angle value of the target feature. is the first angle weight value, is the second angle weight value.
5. A train surface scratch analysis system according to claim 3, characterized in that: The influence judgment strategy includes obtaining characteristic parameters of adjacent feature objects and characteristic parameters of target feature objects, wherein the characteristic parameters are reflected in the color and shape of the feature objects, and comparing the similarity between the characteristic parameters of the adjacent feature objects and the characteristic parameters of the target feature objects to obtain the influence value.
6. A train surface scratch analysis system according to claim 1, characterized in that: The color analysis strategy is to obtain the color information of the characteristic object, and compare the color information with the target color model to obtain the analysis result, and the analysis result reflects the different states of the characteristic object; The color difference of the characteristic area judged as a scratch in the characteristic object state is calculated, the color difference between the characteristic area and the sample image is obtained, and the color difference index is obtained.
7. A train surface scratch analysis system according to claim 1, characterized in that: The shape judgment strategy is used to extract the image edge of the feature area, and after extracting the image edge feature, it is judged whether the image edge feature is a strip through the strip recognition model. If not, it is judged to be a mud stain state, and if so, it is judged to be a scratch state; the image edge feature judged as a scratch in the feature state is subjected to contour geometry analysis, the width of the feature area is calculated, and the shape difference index is obtained based on its width uniformity.
8. The train surface scratch analysis system according to claim 1, characterized in that: The scratch analysis module is also provided with a consistency judgment unit, which is used to obtain the shape, area and depth of all feature objects in the feature image, and obtain a consistency difference index based on the similarity value by comparing the similarities between different feature objects and obtaining a similarity value.
9. A train surface scratch analysis system according to claim 1, characterized in that: The scratch analysis module is provided with a quantity determination unit, which is used to mark the feature objects in the feature object image and automatically count and obtain the number of the feature objects.
10. The train surface scratch analysis system according to claim 1, characterized in that: The similarity calculation formula is: ; P is the similarity value, is the first weight value, is the second weight value, is the third weight value, is the fourth weight value, is the fifth weight value, is the angle difference index, is the shape difference index, is the color similarity index, is the consistency difference index, is the number of features.
Citation Information
Patent Citations
Lithium battery pole piece defect detection method based on secondary threshold segmentation theory
CN112669295A
Unmanned aerial vehicle visual inspection and recognition method for crane complex steel structure surface defects
CN113744270A