Defect detection method for industrial ray welding seam image
By calculating the error mean value of experimental welds and processing the actual weld image, the problem of cumbersome error and preprocessing in industrial ray weld image detection is solved, and more efficient and accurate weld defect detection is achieved.
Patent Information
- Application Number
- CN202410397313.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-03
- Publication Date
- 2025-06-06
Smart Images

Figure CN120107148A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of industrial radiation welds, and in particular to a defect detection method for industrial radiation weld images. Background Art
[0002] In industrial production, various problems that may occur during welding may cause defects such as pores and slag inclusions in welds, which may affect product quality. Therefore, defect detection of weld images is particularly important. Traditional industrial X-ray weld images are usually manually inspected for defects, and the accuracy varies from person to person and depends on experience. In addition, the manual workload is large, the labor cost is high, and there is a possibility of missed defects. Therefore, automated inspection of weld images is of great significance to the standardization and normalization of production.
[0003] In this regard, Chinese patent CN108346137B discloses a defect detection method for industrial X-ray weld images. The method preprocesses a number of weld image data, then performs Fourier transform to obtain its amplitude spectrum, and takes the first quadrant of the amplitude spectrum as image feature data; marks the image feature data and divides it into a training set matrix and a test set matrix, which are input into a classifier of a support vector machine, and the accuracy of the classifier in identifying weld defects is obtained by training and testing the classifier; photographs an actual weld, preprocesses the weld image data and performs Fourier transform to obtain its amplitude spectrum, and takes the first quadrant of the amplitude spectrum as image feature data; inputs the image feature data into the classifier, and the classifier identifies the weld defect. If the recognition probability is ≥ the classifier weld defect recognition probability, it is determined that the weld has a defect, otherwise the weld is normal.
[0004] In view of the above defects, Chinese patent CN108346137A discloses a defect detection method for industrial ray weld images. This comparative document discloses a defect detection method for industrial ray weld images. This method preprocesses a number of weld image data, then performs Fourier transform to obtain its amplitude spectrum, and takes the first quadrant of the amplitude spectrum as image feature data; marks the image feature data and divides it into a training set matrix and a test set matrix, and inputs it into the classifier of the support vector machine. The accuracy of the classifier in identifying weld defects is obtained by training and testing the classifier; shoots the actual weld, preprocesses the weld image data and performs Fourier transform to obtain its amplitude spectrum, and takes the first quadrant of the amplitude spectrum as image feature data; inputs the image feature data into the classifier, and the classifier identifies the weld defects. If the recognition probability is ≥ the classifier weld defect recognition probability, it is judged that the weld has defects, otherwise the weld is normal. This method improves the accuracy of weld defect detection, reduces the detection cost, has strong adaptability, and is suitable for most weld image detection and analysis.
[0005] However, the above-mentioned prior art still has the following technical problems in detecting industrial X-ray weld image defects:
[0006] 1. When the weld image is taken by an X-ray machine, the scattered rays from other parts of the inner wall of the workpiece can easily affect the quality of the X-ray machine, thus causing deviations in the final detection results;
[0007] 2. When pre-processing the workpiece, it is necessary to crop the image around the weld and center the weld, which is cumbersome and inefficient.
[0008] To this end, a defect detection method for industrial X-ray weld images is provided. Summary of the invention
[0009] In view of the above-mentioned shortcomings of the prior art, the present invention provides a defect detection method for industrial X-ray weld images, which can effectively solve the problems in the prior art.
[0010] To achieve the above objectives, the present invention is implemented through the following technical solutions:
[0011] The present invention provides a defect detection method for industrial X-ray weld images, which is characterized by comprising the following steps:
[0012] Step 1: Obtain a classifier with the best weld defect recognition accuracy and set the probability value of the classifier for weld defect recognition;
[0013] Step 2: Use an X-ray machine to shoot the experimental weld, collect images and input them into the trained improved NanoDet deep network. After feature enhancement, feature conversion and standardization, the experimental weld image data is obtained and marked as SY i , where i represents different experimental weld data, i = 1, 2, ..., n;
[0014] Step 3: Place a lead plate at the bottom of the experimental weld, use an X-ray machine to shoot the experimental weld, collect images and input them into the trained improved NanoDet deep network. After feature enhancement, feature conversion and standardization, standard experimental weld image data is obtained and marked as BZ p , where p represents different experimental weld data, p = 1, 2, ..., n;
[0015] Step 4: SY 1 , SY 2 ,……SY n With BZ 1 , BZ 2 ,...BZ n Compare them one by one and use the formula: WC n =(SYi -BZ p )k calculates the corresponding error value: WC 1 , WC 2 ...WC n , (where k is the error coefficient) and the resulting WC n Do the mean processing to get JZ,
[0016]
[0017] Step 5: Use an X-ray machine to shoot the actual weld, receive the real-time picture in advance, and connect the outer contour of the picture to obtain the outer contour curve of the static picture to be processed, and then use the edge detection algorithm to detect the contour edge line, so that the X-ray machine shoots the middle position of the real-time picture, that is, the real-time picture is centered;
[0018] Step 6: Collect images and input them into the trained improved NanoDet deep network. After feature enhancement, feature conversion and standardization, the actual experimental weld image data is obtained and marked as SJy, where y represents different actual weld data, y = 1, 2, ..., n;
[0019] Step 7: Subtract the data of JZ from the actual weld image data SJy to obtain the final actual data ZZ y , that is, ZZ y =(SJ y -JZ)h, (where h is the error coefficient value), is input into the classifier, and the classifier identifies the weld defects in the image feature data. If the recognition probability value of the actual weld defect is ≥ the weld defect recognition probability value set by the classifier, it is judged that the actual weld has defects, otherwise the actual weld is normal.
[0020] Furthermore, the specific algorithm of the probability value in step 1 is as follows;
[0021] S1. Selecting a number of weld image data taken by an X-ray machine, and performing preprocessing on the weld image data including image cropping and size normalization;
[0022] S2, performing Fourier transform on the preprocessed weld image data to obtain its amplitude spectrum, and taking the first quadrant part of the Fourier transform amplitude spectrum as image feature data;
[0023] S3, respectively marking defective images and normal images for the image feature data and constituting all samples, randomly selecting a part of all samples to form a training set matrix, and the rest to form a test set matrix;
[0024] S4. Input the training set matrix into the support vector machine algorithm and obtain the weld defect classifier through training. Use the test set matrix to verify the classifier performance. By adjusting the ratio of the training set matrix to the test set matrix in all samples, the classifier with the best weld defect recognition accuracy is obtained for subsequent automatic image classification, and the probability value of the classifier for weld defect recognition is set.
[0025] Furthermore, the NanoDet is a FCOS-style single-stage anchor-free target detection model, which uses ATSS for target sampling and uses the Generated Focal Loss loss function to perform classification and box regression.
[0026] Furthermore, the edge detection algorithm in step five may be one of a differential method, a differential edge detection algorithm, and a Roberts edge detection operator.
[0027] Beneficial Effects
[0028] Compared with the known public technologies, the technical solution provided by the present invention has the following beneficial effects: the present invention calculates the error mean JZ of the X-ray machine in weld detection by performing comparative detection on the experimental welds with and without lead plates, so that when the X-ray machine detects the actual welds, the error mean can be taken into account and compared with the weld defect recognition probability value set by the classifier for judgment, thereby solving the problem in the prior art of avoiding the influence of scattered rays from other parts of the inner wall of the workpiece on the actual detection results when detecting and judging the welds, thereby improving the detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0030] Figure 1 It is the overall flow chart of the present invention;
[0031] Figure 2 It is the overall process algorithm diagram of the present invention. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are 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.
[0033] The present invention will be further described below in conjunction with the embodiments.
[0034] Example:
[0035] Refer to the attached Figure 1 As shown, a defect detection method for industrial X-ray weld images is characterized by comprising the following steps:
[0036] Step 1: Obtain a classifier with the best weld defect recognition accuracy and set the probability value of the classifier for weld defect recognition;
[0037] The specific algorithm of probability value is as follows;
[0038] S1. Selecting a number of weld image data taken by an X-ray machine, and performing preprocessing on the weld image data including image cropping and size normalization;
[0039] S2, performing Fourier transform on the preprocessed weld image data to obtain its amplitude spectrum, and taking the first quadrant part of the Fourier transform amplitude spectrum as image feature data;
[0040] S3, respectively marking defective images and normal images for the image feature data and constituting all samples, randomly selecting a part of all samples to form a training set matrix, and the rest to form a test set matrix;
[0041] S4. Input the training set matrix into the support vector machine algorithm and obtain the weld defect classifier through training. Use the test set matrix to verify the classifier performance. By adjusting the ratio of the training set matrix to the test set matrix in all samples, the classifier with the best weld defect recognition accuracy is obtained for subsequent automatic image classification, and the probability value of the classifier for weld defect recognition is set.
[0042] Step 2: Use an X-ray machine to shoot the experimental weld, collect images and input them into the trained improved NanoDet deep network. After feature enhancement, feature conversion and standardization, the experimental weld image data is obtained and marked as SY i , where i represents different experimental weld data, i = 1, 2, ..., n;
[0043] Step 3: Place a lead plate at the bottom of the experimental weld, use an X-ray machine to shoot the experimental weld, collect images and input them into the trained improved NanoDet deep network. After feature enhancement, feature conversion and standardization, standard experimental weld image data is obtained and marked as BZ p , where p represents different experimental weld data, p = 1, 2, ..., n;
[0044] The NanoDet is a FCOS-style single-stage anchor-free target detection model that uses ATSS for target sampling and uses the Generalized Focal Loss loss function to perform classification and box regression.
[0045] Step 4: SY 1 , SY 2 ,……SY n With BZ 1 , BZ 2 ,...BZ n Compare them one by one and use the formula: WC n =(SY i -BZ p )k calculates the corresponding error value: WC 1 , WC 2 ...WC n , (where k is the error coefficient) and the resulting WC n Do the mean processing to get JZ,
[0046]
[0047] Step 5: Use an X-ray machine to shoot the actual weld, receive the real-time picture in advance, and connect the outer contour of the picture to obtain the outer contour curve of the static picture to be processed, and then use the edge detection algorithm to detect the contour edge line, so that the X-ray machine shoots the middle position of the real-time picture, that is, the real-time picture is centered;
[0048] Step 6: Collect images and input them into the trained improved NanoDet deep network. After feature enhancement, feature conversion and standardization, the actual experimental weld image data is obtained and marked as SJy, where y represents different actual weld data, y = 1, 2, ..., n;
[0049] Step 7: Subtract the data of JZ from the actual weld image data SJy to obtain the final actual data ZZ y , that is, ZZ y =(SJ y-JZ)h, (where h is the error coefficient value), is input into the classifier, and the classifier identifies the weld defects in the image feature data. If the recognition probability value of the actual weld defect is ≥ the weld defect recognition probability value set by the classifier, it is judged that the actual weld has defects, otherwise the actual weld is normal.
[0050] The edge detection algorithm in step five can be one of the differential method, the differential edge detection algorithm, and the Roberts edge detection operator.
[0051] The working principle of the present invention is to obtain a classifier with the best weld defect recognition accuracy and set the probability value of the classifier for weld defect recognition, then test the experimental weld without lead plate and test the experimental weld with lead plate, and compare the tested structures, and calculate the weld mean error value JZ by comparing multiple groups of experimental data. When testing the actual weld, the formula ZZ is used. y =(SJ y -JZ)h obtains the final recognition probability value of the actual weld defect, and then compares the recognition probability value of the actual weld defect with the recognition probability value of the weld defect set by the classifier to determine whether the actual weld has defects.
[0052] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements will not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of the present invention.
Claims
1. A defect detection method for industrial X-ray weld images, characterized in that: The steps include: Step 1: Obtain a classifier with the best weld defect recognition accuracy and set the probability value of the classifier for weld defect recognition; Step 2: Use an X-ray machine to shoot the experimental weld, collect images and input them into the trained improved NanoDet deep network. After feature enhancement, feature conversion and standardization, the experimental weld image data is obtained and marked as SY i , where i represents different experimental weld data, i = 1, 2, ..., n; Step 3: Place a lead plate at the bottom of the experimental weld, use an X-ray machine to shoot the experimental weld, collect images and input them into the trained improved NanoDet deep network. After feature enhancement, feature conversion and standardization, standard experimental weld image data is obtained and marked as BZ p , where p represents different experimental weld data, p = 1, 2, ..., n; Step 4: Set SY1, SY2, ...SY n With BZ1, BZ2, ... BZ n Compare them one by one and use the formula: WC n =(SY i -BZ p )k calculates the corresponding error values: WC1, WC2...WC n , (where k is the error coefficient) and the resulting WC n Do the mean processing to get JZ, Step 5: Use an X-ray machine to shoot the actual weld, receive the real-time picture in advance, and connect the outer contour of the picture to obtain the outer contour curve of the static picture to be processed, and then use the edge detection algorithm to detect the contour edge line, so that the X-ray machine shoots the middle position of the real-time picture, that is, the real-time picture is centered; Step 6: Collect images and input them into the trained improved NanoDet deep network. After feature enhancement, feature conversion and standardization, the actual experimental weld image data is obtained and marked as SJ. y , where y represents different actual weld data, y = 1, 2, ..., n; Step 7: SJ the actual weld image data y Subtract the data of JZ from the data of y , that is, ZZ y =(SJ y -JZ)h, (where h is the error coefficient value), is input into the classifier, and the classifier identifies the weld defects in the image feature data. If the recognition probability value of the actual weld defect is ≥ the weld defect recognition probability value set by the classifier, it is judged that the actual weld has defects, otherwise the actual weld is normal.
2. A defect detection method for industrial X-ray weld images according to claim 1, characterized in that: The specific algorithm of the probability value in step 1 is as follows; S1. Selecting a number of weld image data taken by an X-ray machine, and performing preprocessing on the weld image data including image cropping and size normalization; S2, performing Fourier transform on the preprocessed weld image data to obtain its amplitude spectrum, and taking the first quadrant part of the Fourier transform amplitude spectrum as image feature data; S3, respectively marking defective images and normal images for the image feature data and constituting all samples, randomly selecting a part of all samples to form a training set matrix, and the rest to form a test set matrix; S4. Input the training set matrix into the support vector machine algorithm and obtain the weld defect classifier through training. Use the test set matrix to verify the classifier performance. By adjusting the ratio of the training set matrix to the test set matrix in all samples, the classifier with the best weld defect recognition accuracy is obtained for subsequent automatic image classification, and the probability value of the classifier for weld defect recognition is set.
3. The defect detection method for industrial X-ray weld images according to claim 1 is characterized in that: The NanoDet is a FCOS-style single-stage anchor-free target detection model that uses ATSS for target sampling and the Generalized Focal Loss loss function to perform classification and box regression.
4. The defect detection method for industrial X-ray weld images according to claim 1 is characterized in that: The edge detection algorithm in step five can be one of the differential method, the differential edge detection algorithm, and the Roberts edge detection operator.
Citation Information
Patent Citations
Defect detection method for industrial ray weld joint image
CN108346137A
Defect Detection Method for Industrial Radiographic Weld Images
CN108346137B