Steel weld crack detection method and system based on artificial intelligence
Through thermal imaging and depth image processing based on artificial intelligence, combined with depth gradient symbiosis matrix and superpixel segmentation, a harmonic significant graph is constructed, and a neural network is used to detect steel weld cracks, solving the problems of inefficiency and insufficient accuracy in traditional methods, and achieving efficient and accurate crack recognition.
Patent Information
- Application Number
- CN202310509675.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2022-12-05
- Filing Date
- 2023-05-08
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2043-05-08
AI Technical Summary
In the prior art, crack detection methods for steel welds are inefficient and it is difficult to accurately identify cracks. Especially in the case of irregular texture and reflection of metal surfaces, traditional methods are prone to missed or missed detection, and lack detection methods that combine crack depth information.
Using an artificial intelligence-based method, the thermal imaging and depth map of the steel surface is obtained, the temperature difference ROI region is obtained by using the threshold method, combined with the depth gradient symbiosis matrix and superpixel segmentation, a harmonic significant map is constructed, and a neural network is used for crack detection, and combined with the spatial distribution weight image to improve detection accuracy.
It improves the accuracy and speed of steel weld crack detection, reduces the impact of background noise, enhances the ability to identify cracks, and reduces the error detection rate.
Smart Images

Figure CN116363122B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of defect detection, and in particular to a steel weld crack detection method and system based on artificial intelligence. Background Art
[0002] Welding is a vital component of the steel industry, characterized by ease of processing, simple construction, excellent connection performance, material savings, high rigidity, and the ability to connect and form different shapes and materials, providing greater flexibility in structural design. Under the influence of factors such as long-term alternating loads, severe temperature and humidity fluctuations, and chemical corrosion, metal fatigue cracks can initiate and propagate in welds. Once cracks reach a critical size, they can be the primary cause of major safety accidents. Therefore, regular weld inspections are necessary to prevent crack progression. Most existing inspection methods rely on engineers carrying instruments to conduct spot checks or individual inspections.
[0003] The inherent irregular texture of welds, coupled with reflective and contaminant metal surfaces, makes cracks difficult to detect with the naked eye. Even with standard optical cameras, image recognition is challenging. Due to limitations in manpower, cost, and instrumentation, traditional methods of observing and recording surface defect information are slow and inefficient. Furthermore, visual fatigue and varying expertise among data analysis engineers can lead to missed or false detections. Furthermore, many current detection methods fail to adequately incorporate crack depth information and the electrical and thermal conductivity of metal cracks, resulting in limited detection speed and accuracy. Summary of the Invention
[0004] In order to solve the above technical problems, the purpose of the present invention is to provide a steel weld crack detection method and system based on artificial intelligence. The technical solutions adopted are as follows:
[0005] In a first aspect, an embodiment of the present invention provides a steel weld crack detection method based on artificial intelligence, which includes the following steps: obtaining thermal imaging and depth maps of the steel surface, and obtaining a temperature difference ROI area on the steel surface using a threshold method; obtaining a temperature sequence of the temperature difference ROI area on the steel surface, performing peak detection based on the temperature sequence, obtaining a maximum trough temperature, and obtaining a crack connection area image using the maximum trough temperature; obtaining a crack ROI area based on the crack connection area image; obtaining a thermal imaging image of the crack ROI area based on the crack ROI area; performing a first superpixel segmentation on the thermal imaging image of the crack ROI area to obtain a suspected crack superpixel block; then performing a second superpixel segmentation on the suspected crack superpixel block to obtain a second-order superpixel block; calculating the local saliency value of the pixel point and the global saliency value of the pixel point for each pixel point in the crack ROI area. saliency value; obtain the depth gradient co-occurrence matrix of the crack ROI area, and obtain the entropy and contrast of each pixel according to the depth gradient co-occurrence matrix; obtain the local saliency value weight and global saliency value weight of the pixel according to the entropy and contrast of the pixel; construct a two-dimensional Gaussian distribution based on the crack ROI area, and perform edge detection on the thermal imaging image of the crack ROI area to obtain an edge binary map, perform morphological processing and distance transformation on the edge binary map to obtain an edge distance transformation image; obtain a spatial distribution weight image according to the two-dimensional Gaussian distribution and the edge distance transformation image; calculate the harmonic saliency value of the pixel according to the spatial distribution weight image and the local saliency value and global saliency value of the pixel to obtain a harmonic saliency map of the crack ROI area; construct a crack segmentation neural network, train it based on the harmonic saliency map data of the crack ROI area, and obtain the detection result of the crack.
[0006] Furthermore, the method for obtaining the crack connection area image is as follows: performing image threshold processing on the thermal imaging image to obtain the foreground with a large temperature difference in the image, which is called the steel surface temperature difference ROI area; obtaining the thermal imaging image of the steel surface temperature difference ROI area, and then statistically analyzing the temperature sequence of the ROI area, that is, the relationship between each pixel value and its frequency, each pixel value in the thermal imaging represents the temperature; performing peak and trough detection on the temperature sequence, and finally obtaining the positions of multiple peaks and troughs; then taking the trough position adjacent to the left of the peak with the highest temperature in the peak as the threshold, and using the threshold to extract the largest temperature difference area in the steel surface temperature difference ROI area to obtain the crack connection area image.
[0007] Furthermore, the method for obtaining the suspected crack superpixel block is as follows: obtaining an image of the crack ROI area in thermal imaging, which is called the crack ROI area thermal imaging image, and then evenly spreading first-order seed points in the ROI area, and using the SLIC superpixel segmentation method for pre-segmentation to form a first-order superpixel block; setting a temperature threshold, if the maximum temperature of all pixels in a first-order superpixel block is lower than the temperature threshold, it means that the pixel block is a non-crack area; finally, a superpixel block in which the maximum temperature of all pixels in the first-order superpixel block is greater than the temperature threshold is obtained, and the superpixel block is a suspected crack superpixel block.
[0008] Furthermore, the method for calculating the local saliency value of the pixel point is:
[0009]
[0010] Set a cross template with the pixel to be calculated as the center. Respectively represent the number of horizontal and vertical pixels in the cross; T and D represent the temperature and depth values of the current pixel. and are the temperature and depth values of the pixel with coordinates (p, y), and It is the temperature and depth value of the pixel with coordinates (x,q).
[0011] Furthermore, the method for calculating the global saliency value of the pixel point is:
[0012]
[0013] Respectively represent the average temperature and average depth of the crack ROI area, T and D represent the temperature and depth of the current pixel.
[0014] Furthermore, the weight of the local saliency value is calculated by calculating the depth gradient co-occurrence matrix of the crack ROI area, calculating the entropy and contrast of the pixel according to the depth gradient co-occurrence matrix, and obtaining the weight of the local saliency value of the pixel point:
[0015]
[0016] is the weight ratio, They represent the contrast and entropy of pixels respectively.
[0017] Furthermore, the weight of the global saliency value is calculated as follows:
[0018] Calculate each second-order superpixel block Importance :
[0019]
[0020] for The number of pixels in is the weight ratio of temperature value and depth value, and are the temperature and depth values of the p-th pixel.
[0021] Further, seek The weight of the global saliency value of the pixel in :
[0022]
[0023] is the number of second-order superpixel blocks.
[0024] Furthermore, the method for obtaining the spatial distribution weight image is to construct a two-dimensional Gaussian distribution in the crack ROI area. , the distribution size can just cover the crack ROI area, the two-dimensional Gaussian distribution is used to increase the weight of the center of the crack ROI area and reduce the weight of the boundary of the ROI area; the Canny edge detection operator is used to extract the edge of the thermal imaging image of the crack ROI area to obtain an edge binary map; the edge binary map is expanded to obtain an edge connected area image; the edge connected area image is distance transformed to obtain an edge distance transformed image, in which the pixel value in the image represents the distance from the background. The larger the distance, the more likely it is a crack area; then the edge distance transformed image is multiplied by the Gaussian distribution to obtain a spatial distribution weight image.
[0025] Furthermore, the method for obtaining the input data of the crack segmentation neural network is to obtain the harmonic saliency value of the pixel to be calculated:
[0026]
[0027] is the pixel value of the spatial distribution weight image, k1 and k2 represent the local saliency weight and the global saliency weight, respectively, J and A represent the local saliency value and the global saliency value, respectively; the harmonic saliency value of each pixel is calculated by the above formula to obtain the harmonic saliency map; the harmonic saliency map is input into the semantic segmentation neural network, and the output is the actual crack binary map.
[0028] In the second aspect, another embodiment of the present invention provides an artificial intelligence-based steel weld crack detection system, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor implements the steps of any one of the methods described above when executing the computer program.
[0029] The present invention has the following beneficial effects:
[0030] The harmonic saliency map constructed by the embodiment of the present invention utilizes thermal imaging and depth information, avoids the influence of background and noise through saliency values, and extracts more robust features. At the same time, combined with the spatial distribution weight image, the neural network can effectively learn the spatial distribution characteristics of cracks, thereby improving the accuracy of crack extraction.
[0031] The present invention uses a cross template to center the local saliency value for two reasons: first, fewer pixels are selected for calculation, which improves the calculation speed compared with the traditional method of selecting pixels in the entire area for calculation; second, it takes into account the characteristics of the shape of the crack, which is generally a lightning-shaped line facing a certain direction. Therefore, the pixels in the line are more different from the pixels outside the horizontal or vertical lines, while the differences between lines or color blocks of other shapes and horizontal or vertical pixels are smaller. Therefore, the saliency value of the crack pixel can be increased and the saliency value of other pixels can be reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0033] Figure 1 A flow chart of a steel weld crack detection method based on artificial intelligence provided by one embodiment of the present invention. DETAILED DESCRIPTION
[0034] To further illustrate the technical means and effectiveness of the present invention in achieving its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, describes in detail the specific implementation, structure, features, and effectiveness of an artificial intelligence-based steel weld crack detection method and system proposed by the present invention. In the following description, different references to "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.
[0035] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0036] The following describes in detail a specific solution of a steel weld crack detection method and system based on artificial intelligence provided by the present invention with reference to the accompanying drawings.
[0037] See also Figure 1 , which shows a steel weld crack detection method based on artificial intelligence of the present invention, characterized in that the method comprises the following steps:
[0038] Step S001: Obtain thermal imaging and depth map of the steel surface, and use the threshold method to obtain the temperature difference ROI area of the steel surface;
[0039] First, set up a steel weld crack inspection bench equipped with a D65 standard light source. Use LiDAR (Lidar) and an infrared thermal imaging camera to image the steel surface, with the field of view perpendicular to the inspection bench. Place the steel sample flat on the bench, with the weld facing vertically. Before capturing the image, electromagnetic induction excitation is used. This non-contact excitation method offers high thermal efficiency and is suitable for testing conductive materials. After heating the weld area to be inspected using the excitation coil, immediately remove the sample from the camera's field of view.
[0040] The core of this inspection method is infrared thermography, which uses the difference in infrared radiation energy on the weld surface caused by cracks to detect cracks. Ideally, the magnetic flux lines of the electromagnetic excitation coil can pass more smoothly through the gaps in the cracked area than in the crack-free area, generating higher temperatures, which are displayed as thermal images. This method does not require a coupling agent and is non-contact, fast, accurate, safe, intuitive, with a large single-shot inspection range and high efficiency, making it suitable for metal defect detection.
[0041] The ROI area of the steel surface temperature difference is obtained by the following method:
[0042] The thermal image is thresholded. This method utilizes the Otsu threshold to ultimately capture the foreground image with the largest temperature difference. This large temperature difference indicates the area of steel surface defects, known as the steel surface temperature difference ROI (Region of Interest), which is primarily used to eliminate background artifacts. The following operations are performed on the steel surface temperature difference ROI. A two-dimensional rectangular coordinate system is established at the lower left corner of the steel surface temperature difference ROI, with each pixel having its own coordinate.
[0043] Step S002: obtaining a temperature sequence of the temperature difference ROI region on the steel surface, performing peak detection based on the temperature sequence to obtain a maximum trough temperature, and obtaining a crack connection region image using the maximum trough temperature; obtaining a crack ROI region based on the crack connection region image; and obtaining a thermal imaging image of the crack ROI region based on the crack ROI region.
[0044] To facilitate subsequent processing, the temperature values on the infrared thermal image are normalized, and the depth values on the depth map are normalized. The infrared thermal image and depth map are combined to form a TD image. Each pixel to be calculated has an eigenvalue (T, D), where T is the temperature value and D is the depth value.
[0045] Then, a thermal imaging image of the temperature difference ROI area on the steel surface is obtained, and then the temperature sequence of the ROI area is obtained, that is, the relationship between each pixel value and its frequency. Each pixel value in the thermal imaging represents the temperature. For areas with defects, the temperature distribution contains multiple peaks and troughs. The closer to the crack, the higher the temperature. Therefore, for peak and trough detection of the temperature sequence, a peak detection algorithm can be used. The corresponding function is included in the SCIPY library and can be called directly by the implementer. Finally, the positions of multiple peaks and troughs are obtained, and then the position of the trough adjacent to the left of the peak with the highest temperature among the peaks is taken as the threshold. This threshold can extract the largest temperature difference area in the temperature difference ROI area on the steel surface, that is, the image is thresholded using this threshold to obtain an image of the crack connection area.
[0046] In the crack connection area image, there are two crack connection areas, namely, two areas connected by cracks, and there is a crack in the middle of the two areas. Then, the crack connection area image is extracted to obtain the connected domain of the crack connection area, and then the circumscribed rectangle of the connected domain of the crack connection area is obtained to obtain the circumscribed rectangle of the left connection area of the crack and the circumscribed rectangle of the right connection area of the crack. Then, the coordinates of the two right endpoints of the circumscribed rectangle of the left connection area of the crack and the coordinates of the two left endpoints of the circumscribed rectangle of the right connection area of the crack are connected by upper and lower endpoints respectively to obtain the crack ROI area.
[0047] Then, an image of the crack ROI region in the thermal imaging is obtained, and the image is called the crack ROI region thermal imaging image.
[0048] Step S003: performing a first superpixel segmentation on the thermal imaging image of the crack ROI area to obtain a suspected crack superpixel block; then performing a second superpixel segmentation on the suspected crack superpixel block to obtain a second-order superpixel block;
[0049] Then, the first-order seed points are evenly spread in the ROI area. The number of first-order seed points is:
[0050]
[0051] According to experience , L and W are the length and width of the image in this area.
[0052] Use SLIC superpixel segmentation method to perform pre-segmentation First-order superpixel blocks. Set a temperature threshold , the empirical value is the current ambient temperature plus 2 degrees Celsius. If the maximum temperature of all pixels in a first-order superpixel block is lower than , it means that the pixel block is a non-crack area. Finally, the maximum temperature of all pixels in the first-order superpixel block is greater than The super pixel block is a suspected crack super pixel block.
[0053] Evenly spread the second-order seed points in each suspected crack superpixel block. The number of second-order seed points is 4 according to the empirical value. All second-order seed points are segmented again using the SLIC superpixel segmentation method to obtain the second-order superpixel block. Using secondary superpixel segmentation can make the second-order superpixel block contain cracks with a greater probability.
[0054] Step S004: Calculate the local saliency value and global saliency value of each pixel in the crack ROI area; obtain the depth gradient co-occurrence matrix of the crack ROI area, and obtain the entropy and contrast of each pixel according to the depth gradient co-occurrence matrix; obtain the local saliency value weight and global saliency value weight of the pixel according to the entropy and contrast of the pixel; construct a two-dimensional Gaussian distribution based on the crack ROI area, and perform edge detection on the thermal imaging image of the crack ROI area to obtain an edge binary map, perform morphological processing and distance transformation on the edge binary map to obtain an edge distance transformation image; obtain a spatial distribution weight image according to the two-dimensional Gaussian distribution and the edge distance transformation image; calculate the harmonic saliency value of the pixel according to the spatial distribution weight image and the local saliency value and global saliency value of the pixel to obtain a harmonic saliency map of the crack ROI area;
[0055] Furthermore, the saliency value of each pixel (coordinates (x, y), eigenvalues (T, D), representing temperature and depth respectively) is calculated, and the second-order superpixel block where the pixel value is located is , perform the following operations:
[0056] Calculation of local saliency value of pixel points:
[0057]
[0058] Draw a cross with the pixel to be calculated as the center, and the empirical size of the cross is 5*5. Respectively represent the number of horizontal and vertical pixels in the cross. In a 5*5 template, both are 4. and It is the temperature and depth value of the pixel with coordinates (p,q).
[0059] The cross saliency value is constructed based on two considerations: first, fewer pixels are selected for calculation, which improves the calculation speed compared to the traditional method of selecting pixels in the entire area for calculation; second, it takes into account the characteristics of the crack shape, which is generally a lightning-shaped line facing a certain direction. Therefore, the pixels in the line are more different from the pixels outside the horizontal or vertical lines, while lines of other shapes do not differ much from horizontal or vertical pixels. Therefore, the saliency value of the lightning-shaped line can be increased, while the saliency values of other shapes can be reduced.
[0060] Calculation of the global saliency value A of the pixel:
[0061]
[0062] The A and A values represent the average temperature and depth of the crack ROI region, respectively. For a crack, the majority of the crack ROI region is background, with lower temperature and depth values. The temperature and depth differences between crack pixels and background pixels are large. Therefore, the larger the A value, the more likely it is a crack.
[0063] Calculate the depth gradient co-occurrence matrix of the crack ROI area. Let f(x,y) be the discrete distribution function of the pixel depth value, and use the Sobel operator of a 3x3 window to calculate the gradient value h(x,y) of the pixel p(x,y).
[0064] Depth value normalization:
[0065] Where INT represents the rounding operation, is the maximum depth value in the original image; is the maximum depth value after normalization, and the empirical value is .
[0066] Gradient normalization:
[0067] in is the maximum gradient in the original image; is the maximum gradient after normalization, and the empirical value is .
[0068] Furthermore, after normalization, the depth image And the normalized gradient image In the statistics, The number of pixel points is used as the value of the (i, j)th element of the depth gradient co-occurrence matrix V. The establishment of the co-occurrence matrix is a well-known technology and will not be described in detail here.
[0069] Furthermore, the entropy ENT and contrast CON of the depth gradient co-occurrence matrix are calculated to finally obtain the entropy value and contrast value of each pixel. The calculation process is well known and will not be repeated here.
[0070] Obtain the weight of the local saliency value of the pixel:
[0071]
[0072] The weight ratio is 4, with an empirical value of 4. Entropy reflects the ruggedness of the second-order superpixel. Higher ruggedness leads to greater thermal reflectivity, which can result in falsely high saliency values. In this case, the weight of the local cross saliency value should be reduced. In actual steel structure weld crack detection, uneven thermal emissivity due to interference from factors such as oil stains, oxide layers, and surface roughness can lead to falsely high-temperature areas on the weld surface. Consequently, these saliency values unrelated to cracks are higher, so the weight of these pixels should be reduced.
[0073] Taking ruggedness into consideration, the surfaces of some crack areas are also rugged, and the thermal reflectivity is very high. The contrast of the depth gradient symbiosis matrix is used to reflect the existence of cracks. The deeper the crack, the greater the contrast and the clearer the effect. Conversely, if the contrast is small, the crack is shallow and the effect is blurred.
[0074] Ultimately, The larger the value, the lower the surface roughness and the deeper the cracks.
[0075] Calculate each second-order superpixel block Importance ,
[0076]
[0077] for The number of pixels in is the weight ratio of temperature value and depth value, and the empirical value is 2. and are the temperature and depth values of the p-th pixel respectively.
[0078] Further, obtain The weight of the global saliency value of the pixel to be calculated in:
[0079]
[0080] is the number of second-order superpixel blocks. We focus on the second-order superpixel blocks with higher temperature and deeper depth. If the importance is higher than the average, then the global saliency value of all pixels in this second-order superpixel block is increased.
[0081] Furthermore, a two-dimensional Gaussian distribution is constructed in the crack ROI area The distribution size can just cover the crack ROI area. The role of the two-dimensional Gaussian distribution is to increase the weight of the center of the crack ROI area and reduce the weight of the ROI area boundary. That is, the closer to the center of the crack ROI area, the more likely it is that a crack exists.
[0082] At the same time, the Canny edge detection operator is used to extract the edge of the thermal imaging image of the crack ROI area to obtain an edge binary image.
[0083] The edge binary image is expanded to obtain the edge connected area image. A crack has two edges, which can be turned into one through expansion, which is convenient for subsequent calculations.
[0084] Then, the edge connected area image is subjected to distance transformation to obtain the edge distance transformed image. The pixel value in the image represents the distance between it and the background. The larger the distance, the more likely it is a crack area.
[0085] Then the edge distance transformation image is multiplied by the Gaussian distribution to obtain the spatial distribution weight image, referred to as GM.
[0086] Step S005: constructing a crack segmentation neural network, performing training based on the crack ROI region harmonic saliency map data, and obtaining crack detection results.
[0087] Finally, the harmonic saliency value of the pixel to be calculated is obtained:
[0088]
[0089] Ultimately, the larger the harmonized pixel value S is, the more likely it is a crack location.
[0090] Furthermore, the harmonic saliency value of each pixel is calculated to obtain a harmonic saliency map.
[0091] Then, a depth map and infrared thermal image of the weld with cracks are obtained, and a harmonic saliency map is obtained as a sample. The crack part is annotated, and the crack pixel value in the annotated image is 1, and the other pixel values are 0, to obtain a standard crack binary map with only cracks, which is convenient for subsequent training of the neural network; the same method is used to obtain a small number of weld edge binary maps and harmonic saliency maps of welds without cracks. These are combined into a data set to obtain a small number of harmonic saliency maps without cracks. This step is to improve the network's ability to extract semantics and ensure that the network can learn the characteristics of cracks as much as possible.
[0092] The harmonic saliency map is fed into a U-net semantic segmentation network. The output is a binary image of the actual crack, which is then compared to the standard binary image. The loss function uses a cross-entropy loss function, optimized using the Adam algorithm. Training the U-net semantic segmentation network allows for more accurate weld crack identification and outputs a binary image of the weld crack.
[0093] At this point, the neural network can be used to extract cracks from the harmonic saliency map, which is obtained based on infrared thermal imaging and depth map.
[0094] Based on the same concept as the above-mentioned method embodiment, another embodiment of the present invention further provides an artificial intelligence-based steel weld crack detection system, which includes a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the steps of an artificial intelligence-based steel weld crack detection method provided in any of the above-mentioned embodiments. Among them, an artificial intelligence-based steel weld crack detection method has been described in detail in the above-mentioned embodiments and will not be repeated here.
[0095] It should be noted that the order in which the embodiments of the present invention are described above is for illustrative purposes only and does not represent the superiority or inferiority of the embodiments. The above description is of specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0096] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments.
[0097] 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, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A steel weld crack detection method based on artificial intelligence, characterized in that: The detection method comprises the following steps: Obtain thermal imaging and depth maps of the steel surface, and use the threshold method to obtain the temperature difference ROI area of the steel surface; Acquire a thermal imaging image of the temperature difference ROI area on the steel surface, then calculate the temperature sequence of the ROI area, that is, the relationship between each pixel value and its frequency, where each pixel value in the thermal imaging represents temperature; perform peak and trough detection on the temperature sequence to ultimately obtain the positions of multiple peaks and troughs; then take the position of the trough adjacent to the left of the peak with the highest temperature among the peaks as a threshold, and use this threshold to extract the maximum temperature difference area in the temperature difference ROI area on the steel surface to obtain a crack connection area image; obtain a crack ROI area based on the crack connection area image; and obtain a thermal imaging image of the crack ROI area based on the crack ROI area; Perform the first superpixel segmentation on the thermal imaging image of the crack ROI area to obtain the suspected crack superpixel block; then perform the second superpixel segmentation on the suspected crack superpixel block to obtain the second-order superpixel block; Calculate the local saliency value and global saliency value of each pixel in the crack ROI area; obtain the depth gradient co-occurrence matrix of the crack ROI area, and obtain the entropy and contrast of each pixel based on the depth gradient co-occurrence matrix; obtain the local saliency value weight and global saliency value weight of the pixel based on the entropy and contrast of the pixel; construct a two-dimensional Gaussian distribution based on the crack ROI area, and perform edge detection on the thermal imaging image of the crack ROI area to obtain an edge binary map, perform morphological processing and distance transformation on the edge binary map to obtain an edge distance transformation image; obtain a spatial distribution weight image based on the two-dimensional Gaussian distribution and the edge distance transformation image; calculate the pixel harmonic saliency value based on the spatial distribution weight image and the local saliency value and global saliency value of the pixel to obtain a crack ROI area harmonic saliency map; Constructing a crack segmentation neural network, training it based on the harmonic saliency map data of the crack ROI region, inputting the harmonic saliency map into the crack segmentation neural network, outputting an actual crack binary map, and obtaining crack detection results; The method for obtaining the input data of the crack segmentation neural network is: Obtain the harmonic saliency value of the pixel to be calculated: is the pixel value of the spatial distribution weight image, 、 Represent the local saliency value weight and the global saliency value weight, J and A represent the local saliency value and the global saliency value, respectively. The harmonic saliency value of each pixel is calculated by the above formula to obtain the harmonic saliency map.
2. The steel weld crack detection method based on artificial intelligence according to claim 1, characterized in that: The method for obtaining the suspected crack superpixel block is: Obtain an image of the crack ROI region in thermal imaging, which is called the crack ROI region thermal imaging image. Then, evenly spread the first-order seed points in the ROI region and use the SLIC superpixel segmentation method for pre-segmentation to form first-order superpixel blocks. A temperature threshold is set. If the maximum temperature of all pixels in a first-order superpixel block is lower than the temperature threshold, it means that the pixel block is a non-crack area. Finally, a superpixel block in which the maximum temperature of all pixels in the first-order superpixel block is greater than the temperature threshold is obtained. This superpixel block is a suspected crack superpixel block.
3. The steel weld crack detection method based on artificial intelligence according to claim 1, characterized in that: The calculation method of the local saliency value of the pixel point is: Set a cross template with the pixel to be calculated as the center. 、 Respectively represent the number of horizontal and vertical pixels in the cross; T and D represent the temperature and depth values of the current pixel. and is the temperature and depth value of the pixel with coordinates (p, y), and It is the temperature and depth value of the pixel with coordinates (x,q).
4. The steel weld crack detection method based on artificial intelligence according to claim 1, characterized in that: The calculation method of the global saliency value of the pixel point is: 、 Respectively represent the average temperature and average depth of the crack ROI area, T and D represent the temperature and depth of the current pixel.
5. The steel weld crack detection method based on artificial intelligence according to claim 1, characterized in that: The calculation method of the weight of the local saliency value is: The depth gradient co-occurrence matrix of the crack ROI area is calculated, and the entropy and contrast of the pixels are calculated based on the depth gradient co-occurrence matrix to obtain the weight of the local saliency value of the pixel point: is the weight ratio, They represent the contrast and entropy of pixels respectively.
6. The steel weld crack detection method based on artificial intelligence according to claim 1, characterized in that: The weight of the global saliency value is calculated as follows: Calculate each second-order superpixel block Importance : for The number of pixels in is the weight ratio of temperature value and depth value, and are the temperature and depth values of the p-th pixel; Further, seek The weight of the global saliency value of the pixel in : is the number of second-order superpixel blocks.
7. The steel weld crack detection method based on artificial intelligence according to claim 1, characterized in that: The method for obtaining the spatial distribution weight image is: Construct a two-dimensional Gaussian distribution in the crack ROI area , the distribution size can just cover the crack ROI area, and the two-dimensional Gaussian distribution is used to increase the weight of the center of the crack ROI area and reduce the weight of the ROI area boundary; The Canny edge detection operator is used to extract the edges of the thermal imaging image of the crack ROI area to obtain an edge binary map. The edge binary map is then expanded to obtain an edge connected region image. The edge connected region image is then subjected to distance transformation to obtain an edge distance transformed image. The pixel value in the image represents the distance from the background. The larger the distance, the more likely it is a crack area. The edge distance transformed image is then multiplied by the Gaussian distribution to obtain a spatial distribution weight image.
8. An artificial intelligence-based steel weld crack detection system, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Global and local binary pattern image crack segmentation method based on robot vision
CN114418957A