Pressure vessel defect detection and evaluation method
The pressure vessel image is taken through an industrial camera and automatically detected using a convolutional neural network model, which solves the problems of low manual detection efficiency and large deviation in the prior art, and realizes efficient and accurate pressure vessel defect detection and evaluation.
Patent Information
- Application Number
- CN202411754284.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2025-03-21
AI Technical Summary
The existing pressure vessel defect detection mainly relies on manual experience, with low detection efficiency and large deviations.
An industrial camera is used to take the pressure vessel image and automatically detect it through the convolutional neural network model to generate a defect result set.
Automatic detection of pressure vessels is realized, detection efficiency is improved, manual errors are reduced, and evaluation and analysis of pressure vessels can be carried out.
Smart Images

Figure CN119671998A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of pressure vessel defect detection, and in particular to a pressure vessel defect detection and evaluation method. Background Art
[0002] Pressure vessels are closed equipment used to store or transport gas or liquid, and are widely used in chemical, petroleum, electric power, pharmaceutical and other industries. Because their working environment usually involves extreme conditions such as high temperature and high pressure, the requirements for safety and reliability are very high.
[0003] Defect detection is required during the production process of pressure vessels. However, the existing pressure vessel defect detection is generally performed manually based on experience, with low detection efficiency and large deviation. Therefore, a pressure vessel defect detection and evaluation method is proposed to solve the above problems. Summary of the invention
[0004] 1. Technical issues to be resolved In view of the shortcomings of the prior art, the present invention provides a pressure vessel defect detection and evaluation method, which has the advantages of automatic detection of pressure vessels, etc., and solves the problems that the existing pressure vessel defect detection is generally performed manually based on experience, with low detection efficiency and large deviation.
[0005] (II) Technical solution In order to achieve the above-mentioned purpose of automatically detecting pressure vessels, the present invention provides the following technical solutions: A pressure vessel defect detection method comprises the following steps: S1. Use an industrial camera to take multiple images of the pressure vessel, and crop the images to obtain a complete outer wall image of the pressure vessel; S2. Construct a convolutional neural network model CNN and perform model training to obtain a trained CNN model; S3. Take the image image as input and substitute it into the trained CNN model to obtain the defect result set result.
[0006] Preferably, the step S1 further includes the following sub-steps: S1.1. Use an industrial camera to take an initial image image_0 facing the pressure vessel, where the image includes a side surface of the pressure vessel; S1.2. The pressure vessel is rotated 90 degrees, 180 degrees and 270 degrees respectively and photographed to obtain images image_90, image_180 and image_270; S1.3. grayscale preprocessing of images image_0, image_90, image_180 and image_270; S1.4. According to the actual size of the pressure vessel, cut out the images image_0', image_90', image_180' and image_270' containing the edge of the pressure vessel from the images image_0, image_90, image_180 and image_270; S1.5. Taking the center of the image as the boundary, cut and obtain the left partial images image_0'', image_90'', image_180'' and image_270'', and stitch the images in sequence to form a complete pressure vessel outer wall image image.
[0007] Preferably, the step S2 further includes the following sub-steps: S2.1. Collect a large number of images of pressure vessel production containing defects such as cracks, corrosion, and deformation; S2.2. Use the image annotation tool LabelMe to accurately annotate the defects in the image, including the type and area of the defects; S2.3. Adjust the image to a uniform size and perform image normalization; S2.4. Construct a convolutional neural network model CNN including input layer, convolution layer, pooling layer and fully connected layer; S2.5. Divide the normalized images into a training set and a validation set, use the training set to train the model, and use the validation set to evaluate the performance of the model after each training cycle, and adjust the hyperparameters of the model based on the evaluation results.
[0008] Preferably, the step S2.4 further includes the following sub-steps: S2.4.1. Use multiple layers of convolution and pooling to extract features from images; S2.4.2. After the feature extraction layer, add one or more fully connected layers, and finally a classification layer to output the probability distribution of defect types; S2.4.3. From the feature extraction layer, another sequence of fully connected layers is derived, and finally one or more continuous values are output, representing the area of the defect; S2.4.4. Select an appropriate classification loss function for defect type identification and an appropriate regression loss function for defect size estimation; S2.4.5. Set hyperparameters such as learning rate, batch size, convolution kernel size, and number of training rounds.
[0009] Preferably, the step S3 further comprises the following steps: S3.1. Adjust the model to evaluation mode; S3.2. Convert the image image into a tensor format supported by the deep learning framework, pass the tensor to the CNN model, and perform forward propagation; S3.3. After the model forward propagation is completed, a set C of prediction results of the model for the input image image will be output. The result set C includes the predicted probability, defect type and defect area of all defects in the image image. S3.4. Traverse the prediction result set C and take out the prediction probability of the current result set C. If the prediction probability of the current result set C is greater than the probability threshold ε, jump to S3.5, otherwise jump to S3.6; S3.5. Add the defect type and defect area of the current result set C to the result set; S3.6. Jump back to S3.4 until all prediction result sets C are traversed.
[0010] Preferably, the S2.5 comprises the following steps: S2.5.1. Clarify the range of values of hyperparameters that need to be adjusted; S2.5.2. Select a Gaussian process surrogate model to approximate the relationship between hyperparameters and model performance; S2.5.3. Randomly select several sets of hyperparameters in the hyperparameter space for model training to obtain initial performance data; S2.5.4. Use the initial sampled performance data to train the proxy model and update its understanding of the hyperparameter space. S2.5.5. Based on the prediction of the proxy model, select the next hyperparameter combination that is most likely to improve model performance for training; S2.5.6. Repeat steps S2.5.4 and S2.5.5 until the predetermined number of iterations is reached or the performance improvement is no longer significant; S2.5.7. Select the best performing hyperparameter combination based on the final prediction or actual training results of the proxy model; S2.5.8. Retrain the model on the full training set using the best hyperparameters.
[0011] Another technical problem to be solved by the present invention is to provide an evaluation method for defect detection of a pressure vessel, comprising the following steps: S1. Check if the result set is empty. If the result set is not empty, jump to S2. Otherwise, jump to S4. S2. quickly classify the result set to obtain a classified result set; S3. Process the classification result set to obtain evaluation results.
[0012] Preferably, step S2 further includes the following sub-steps: S2.1. Traverse the result set, store each group of defect types as the key in the dictionary result_dict, and the defect area as the value in the dictionary result_dict; S2.2. Convert the dictionary result_dict to a Pandas data structure - DataFrame; S2.3. Set the small area threshold lower_threshold and the large area threshold upper_threshold; S2.4. Classify defect types into small defects , medium defect , big defects Three categories: S2.5. Use Boolean indexing to filter out small defect result sets _Set, medium defect result set _Set and large defect result set _Set.
[0013] Preferably, step S3 further includes the following sub-steps: S3.1. Setting the threshold for the number of large defects _value, medium defect number threshold M_value, small defect number threshold _value and variance threshold _value; S3.2. Traverse separately _Set, _Set and _Set; S3.3. Use the len() function to get the number of small defects SC, the number of medium defects MC and the number of large defects LC, and use the var() function to get the variance of small defects C; S3.4. If , then return to "pressure vessel inspection failed, many defects, need to be remanufactured" A, otherwise jump to S3.5; S3.5. If SC and C _value, it returns "pressure vessel inspection failed, defect fluctuation is large, manual verification is required, otherwise jump to S3.6; S3.6. "The pressure vessel has passed the inspection and can proceed to the next step."
[0014] (III) Beneficial effects Compared with the prior art, the present invention provides a pressure vessel defect detection and evaluation method, which has the following beneficial effects: The pressure vessel defect detection and evaluation method uses an industrial camera to capture multiple pressure vessel images, crops the images to obtain a complete outer wall image of the pressure vessel, and uses the image as the input of a convolutional neural network model to obtain a defect result set. In this way, the purpose of automatically detecting pressure vessels is achieved. In addition, by classifying the defect result set, the pressure vessel can be evaluated and analyzed, and recommendations can be given to inspectors without the need for manual analysis. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 The present invention is a schematic flow chart of a pressure vessel defect detection and evaluation method proposed by the present invention. DETAILED DESCRIPTION
[0016] The following will be combined with 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.
[0017] A pressure vessel defect detection method comprises the following steps: S1. Use an industrial camera to take multiple images of the pressure vessel, and crop the images to obtain a complete outer wall image of the pressure vessel; S2. Construct a convolutional neural network model CNN and perform model training to obtain a trained CNN model; S3. Take the image image as input and substitute it into the trained CNN model to obtain the defect result set result.
[0018] In this embodiment, step S1 also includes the following sub-steps: S1.1. Use an industrial camera to take an initial image image_0 facing the pressure vessel, where the image includes a side surface of the pressure vessel; S1.2. The pressure vessel is rotated 90 degrees, 180 degrees and 270 degrees respectively and photographed to obtain images image_90, image_180 and image_270; S1.3. grayscale preprocessing of images image_0, image_90, image_180 and image_270; S1.4. According to the actual size of the pressure vessel, cut out the images image_0', image_90', image_180' and image_270' containing the edge of the pressure vessel from the images image_0, image_90, image_180 and image_270; S1.5. Taking the center of the image as the boundary, cut and obtain the left partial images image_0'', image_90'', image_180'' and image_270'', and stitch the images in sequence to form a complete pressure vessel outer wall image image.
[0019] In this embodiment, step S2 also includes the following sub-steps: S2.1. Collect a large number of images of pressure vessel production containing defects such as cracks, corrosion, and deformation; S2.2. Use the image annotation tool LabelMe to accurately annotate the defects in the image, including the type and area of the defects; S2.3. Adjust the image to a uniform size and perform image normalization; S2.3.1. Use the image processing library OpenCV to load the image file into memory and obtain an array representing the image pixel values x; S2.3.2. Traverse the array and for each pixel value x, calculate the normalized value x_norm, the formula is: Among them, Min is the minimum value of the image pixel value, and Max is the maximum value of the image pixel value.
[0020] S2.4. Construct a convolutional neural network model CNN including input layer, convolution layer, pooling layer and fully connected layer; Among them, the input layer accepts the preprocessed image as input; the convolution layer uses multiple convolution layers to extract the features of the image, and each convolution layer contains a set of convolution kernels. These convolution kernels slide on the image to perform convolution operations to extract local features; the pooling layer is after the convolution layer, and the pooling layer is usually used to reduce the resolution of the feature map and reduce the number of parameters. The pooling operation can be performed by maximum pooling or average pooling; the fully connected layer uses the fully connected layer to convert the features extracted by the convolution layer and the pooling layer into classification results. The output layer of the fully connected layer usually uses the softmax function to calculate the probability of each category.
[0021] S2.5. Divide the normalized images into a training set and a validation set, use the training set to train the model, and use the validation set to evaluate the performance of the model after each training cycle, and adjust the hyperparameters of the model based on the evaluation results.
[0022] In this embodiment, step S2.4 also includes the following sub-steps: S2.4.1. Use multiple layers of convolution and pooling to extract features from images; S2.4.2. After the feature extraction layer, add one or more fully connected layers, and finally a classification layer to output the probability distribution of defect types; S2.4.3. From the feature extraction layer, another sequence of fully connected layers is derived, and finally one or more continuous values are output, representing the area of the defect; S2.4.4. Select an appropriate classification loss function for defect type identification and an appropriate regression loss function for defect size estimation; S2.4.5. Set hyperparameters such as learning rate, batch size, convolution kernel size, and number of training rounds.
[0023] In this embodiment, step S3 further includes the following steps: S3.1. Adjust the model to evaluation mode; S3.2. Convert the image image into a tensor format supported by the deep learning framework, pass the tensor to the CNN model, and perform forward propagation; S3.3. After the model forward propagation is completed, a set C of prediction results of the model for the input image image will be output. The result set C includes the predicted probability, defect type and defect area of all defects in the image image. S3.4. Traverse the prediction result set C and take out the prediction probability of the current result set C. If the prediction probability of the current result set C is greater than the probability threshold ε, jump to S3.5, otherwise jump to S3.6; S3.4.1. Set a default threshold to convert the predicted probabilities into class labels; S3.4.2. By drawing the ROC curve and calculating the AUC value, find the changing trend of the model performance under different thresholds; S3.4.3. In scenarios where high precision is required, the threshold can be increased to reduce misjudgments. In scenarios where high recall rate is required, the threshold can be lowered to increase the number of positive samples recognized.
[0024] S3.5. Add the defect type and defect area of the current result set C to the result set; S3.6. Jump back to S3.4 until all prediction result sets C are traversed.
[0025] In this embodiment, S2.5 includes the following steps: S2.5.1. Clarify the range of values of hyperparameters that need to be adjusted; S2.5.2. Select a Gaussian process surrogate model to approximate the relationship between hyperparameters and model performance; S2.5.3. Randomly select several sets of hyperparameters in the hyperparameter space for model training to obtain initial performance data; S2.5.4. Use the initial sampled performance data to train the proxy model and update its understanding of the hyperparameter space. S2.5.5. Based on the prediction of the proxy model, select the next hyperparameter combination that is most likely to improve model performance for training; S2.5.6. Repeat steps S2.5.4 and S2.5.5 until the predetermined number of iterations is reached or the performance improvement is no longer significant; S2.5.7. Select the best performing hyperparameter combination based on the final prediction or actual training results of the proxy model; S2.5.8. Retrain the model on the full training set using the best hyperparameters.
[0026] An evaluation of pressure vessel defect detection includes the following steps: S1. Check if the result set is empty. If the result set is not empty, jump to S2. Otherwise, jump to S4. S2. quickly classify the result set to obtain a classified result set; S3. Process the classification result set to obtain evaluation results.
[0027] In this embodiment, step S2 also includes the following sub-steps: S2.1. Traverse the result set, store each group of defect types as the key in the dictionary result_dict, and the defect area as the value in the dictionary result_dict; S2.2. Convert the dictionary result_dict to a Pandas data structure - DataFrame; S2.3. Set the small area threshold lower_threshold and the large area threshold upper_threshold; S2.4. Classify defect types into small defects , medium defect , big defects Three categories: Minor flaws Medium Defect Big flaw ; S2.5. Use Boolean indexing to filter out small defect result sets _Set, medium defect result set _Set and large defect result set _Set.
[0028] In this embodiment, step S3 also includes the following sub-steps: S3.1. Setting the threshold for the number of large defects _value, medium defect number threshold M_value, small defect number threshold _value and variance threshold _value; S3.2. Traverse separately _Set, _Set and _Set; S3.3. Use the len() function to get the number of small defects SC, the number of medium defects MC and the number of large defects LC, and use the var() function to get the variance of small defects C; S3.4. If , then return to "pressure vessel inspection failed, many defects, need to be remanufactured" A, otherwise jump to S3.5; S3.5. If SC and C _value, it returns "pressure vessel inspection failed, defect fluctuation is large, manual verification is required, otherwise jump to S3.6; S3.6. "The pressure vessel has passed the inspection and can proceed to the next step."
[0029] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A pressure vessel defect detection method, characterized in that: The following steps are involved: S1. Use an industrial camera to take multiple images of the pressure vessel, and crop the images to obtain a complete outer wall image of the pressure vessel; S2. Construct a convolutional neural network model CNN and perform model training to obtain a trained CNN model; S3. Take the image image as input and substitute it into the trained CNN model to obtain the defect result set result.
2. A pressure vessel defect detection method according to claim 1, characterized in that: The step S1 further comprises the following sub-steps: S1.
1. Use an industrial camera to take an initial image image_0 facing the pressure vessel, where the image includes a side surface of the pressure vessel; S1.
2. The pressure vessel is rotated 90 degrees, 180 degrees and 270 degrees respectively and photographed to obtain images image_90, image_180 and image_270; S1.
3. grayscale preprocessing of images image_0, image_90, image_180 and image_270; S1.
4. According to the actual size of the pressure vessel, cut out the images image_0', image_90', image_180' and image_270' containing the edge of the pressure vessel from the images image_0, image_90, image_180 and image_270; S1.
5. Taking the center of the image as the boundary, cut and obtain the left partial images image_0'', image_90'', image_180'' and image_270'', and stitch the images in sequence to form a complete pressure vessel outer wall image image.
3. A pressure vessel defect detection method according to claim 1, characterized in that: The step S2 further comprises the following sub-steps: S2.
1. Collect a large number of images of pressure vessel production containing defects such as cracks, corrosion, and deformation; S2.
2. Use the image annotation tool LabelMe to accurately annotate the defects in the image, including the type and area of the defects; S2.
3. Adjust the image to a uniform size and perform image normalization; S2.
4. Construct a convolutional neural network model CNN including input layer, convolution layer, pooling layer and fully connected layer; S2.
5. Divide the normalized images into a training set and a validation set, use the training set to train the model, and use the validation set to evaluate the performance of the model after each training cycle, and adjust the hyperparameters of the model based on the evaluation results.
4. A pressure vessel defect detection method according to claim 1, characterized in that: The step S2.4 also includes the following sub-steps: S2.4.
1. Use multiple layers of convolution and pooling to extract features from images; S2.4.
2. After the feature extraction layer, add one or more fully connected layers, and finally a classification layer to output the probability distribution of defect types; S2.4.
3. From the feature extraction layer, another sequence of fully connected layers is derived, and finally one or more continuous values are output, representing the area of the defect; S2.4.
4. Select an appropriate classification loss function for defect type identification and an appropriate regression loss function for defect size estimation; S2.4.
5. Set hyperparameters such as learning rate, batch size, convolution kernel size, and number of training rounds.
5. A pressure vessel defect detection method according to claim 1, characterized in that: The step S3 further comprises the following steps: S3.
1. Adjust the model to evaluation mode; S3.
2. Convert the image image into a tensor format supported by the deep learning framework, pass the tensor to the CNN model, and perform forward propagation; S3.
3. After the model forward propagation is completed, a prediction result set C containing the model's prediction of the input image image will be output. The result set C contains the predicted probability, defect type and defect area of all defects in the image image; S3.
4. Traverse the prediction result set C and take out the prediction probability of the current result set C. If the prediction probability of the current result set C is greater than the probability threshold ε, jump to S3.5, otherwise jump to S3.6; S3.
5. Add the defect type and defect area of the current result set C to the result set; S3.
6. Jump back to S3.4 until all prediction result sets C are traversed.
6. A pressure vessel defect detection method, characterized in that: The S2.5 comprises the following steps: S2.5.
1. Clarify the range of values of hyperparameters that need to be adjusted; S2.5.
2. Select a Gaussian process surrogate model to approximate the relationship between hyperparameters and model performance; S2.5.
3. Randomly select several sets of hyperparameters in the hyperparameter space for model training to obtain initial performance data; S2.5.
4. Use the initial sampled performance data to train the proxy model and update its understanding of the hyperparameter space. S2.5.
5. Based on the prediction of the proxy model, select the next hyperparameter combination that is most likely to improve model performance for training; S2.5.
6. Repeat steps S2.5.4 and S2.5.5 until the predetermined number of iterations is reached or the performance improvement is no longer significant; S2.5.
7. Select the best performing hyperparameter combination based on the final prediction or actual training results of the proxy model; S2.5.
8. Retrain the model on the full training set using the best hyperparameters.
7. An evaluation method for pressure vessel defect detection based on any one of claims 1 to 6, characterized in that: The following steps are involved: S1. Check if the result set is empty. If the result set is not empty, jump to S2. Otherwise, jump to S4. S2. quickly classify the result set to obtain a classified result set; S3. Process the classification result set to obtain an evaluation result; S4. Evaluate whether the current pressure vessel is in good condition.
8. A pressure vessel defect detection evaluation method according to claim 7, characterized in that: The step S2 further comprises the following sub-steps: S2.
1. Traverse the result set, store each group of defect types as the key in the dictionary result_dict, and the defect area as the value in the dictionary result_dict; S2.
2. Convert the dictionary result_dict to a Pandas data structure - DataFrame; S2.
3. Set the small area threshold lower_threshold and the large area threshold upper_threshold; S2.
4. Classify defect types into small defects , medium defect , big defects Three categories: S2.
5. Use Boolean indexing to filter out small defect result sets _Set, medium defect result set _Set and large defect result set _Set.
9. A pressure vessel defect detection evaluation method according to claim 8, characterized in that: The step S3 also includes the following sub-steps: S3.
1. Setting the threshold for the number of large defects _value, medium defect number threshold M_value, small defect number threshold _value and variance threshold _value; S3.
2. Traverse separately _Set, _Set and _Set; S3.
3. Use the len() function to get the number of small defects SC, the number of medium defects MC and the number of large defects LC, and use the var() function to get the variance of small defects C; S3.
4. If , then return to "pressure vessel inspection failed, many defects, need to be remanufactured" A, otherwise jump to S3.5; S3.
5. If SC and C _value, it returns "pressure vessel inspection failed, defect fluctuation is large, manual verification is required, otherwise jump to S3.6; S3.
6. "The pressure vessel has passed the inspection and can proceed to the next step."
Citation Information
Patent Citations
Terminal defect detection method and system based on deep learning
CN111275700A
AI + fluorescence permeation small pipe fitting surface defect detection and quality grading method and system
CN112881424A
Intelligent detection method and device for PCB defect category, electronic equipment and medium
CN113781485A
Filter stick end face defect detection method, detection device, equipment and medium
CN116739995A
Surface defect identification method and device for industrial product detection
CN116797602A