A metal corrosion grade evaluation method based on image processing

Locating corrosion areas through convolutional neural networks and sliding window methods, combined with standard color spectrum information tables and clustering algorithms, solves the problems of slow speed and low accuracy in metal corrosion grade evaluation in the existing technology, and achieves fast and accurate corrosion assessment. Grade assessment reduces the labor intensity of inspection personnel.

CN114708623BInactive Publication Date: 2024-09-24BEIHANG UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202210290019.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-23
Publication Date
2024-09-24
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the existing technology, the evaluation of metal corrosion levels relies on manual inspection, which is slow and highly professional. It is difficult to identify corrosion areas and area percentages early and is greatly affected by experience factors.

Method used

The convolutional neural network combined with the sliding window method is used to classify corrosion characteristics and locate areas, and is combined with the standard color spectrum information table and clustering algorithm to achieve digital and quantitative evaluation of metal corrosion levels.

Benefits of technology

It improves the accuracy and speed of corrosion grade evaluation, reduces the labor intensity of inspection personnel, can objectively and quickly evaluate the degree of metal corrosion, and is suitable for taking timely measures in engineering practice.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114708623B
    Figure CN114708623B
Patent Text Reader

Abstract

The present invention relates to a method for evaluating metal corrosion level based on image processing, comprising the following steps: step 1: training a corrosion classifier using a convolutional neural network; step 2: sampling using a sliding window method; step 3: locating the corrosion area; step 4: color quantization using a clustering algorithm; step 5: training a standard color spectrum information table; step 6: evaluating the corrosion level based on color and area. The present invention uses a convolutional neural network combined with a sliding window method to classify corrosion features and locate corrosion areas based on the differentiated features of pixels before and after metal corrosion, and proposes a method combining color clustering with a standard color spectrum information table to evaluate metal corrosion levels. This method belongs to the technical field of metal corrosion degree evaluation.
Need to check novelty before this filing date? Find Prior Art

Description

(I) Technical field

[0001] The present invention relates to a metal corrosion level evaluation method based on image processing. According to the differentiated features of pixels before and after metal corrosion, a convolutional neural network combined with a sliding window method is used to achieve corrosion feature classification and corrosion area positioning. A method combining color clustering with a standard color spectrum information table is proposed to achieve metal corrosion level evaluation. This method belongs to the technical field of metal corrosion degree evaluation. (II) Background technology

[0002] Metal corrosion can significantly reduce the mechanical properties of metal materials, destroy the geometric shape of metal components, shorten the service life of equipment, and even cause catastrophic accidents. Therefore, it is urgent to solve the problems of economic losses and personal injuries caused by metal corrosion. In the process of studying metal corrosion problems, judging the degree of metal corrosion is an indispensable task. Studying the degree of corrosion development is of great significance for predicting corrosion behavior, understanding corrosion mechanisms, and evaluating product reliability. At present, the corrosion level of metal materials is generally evaluated manually in combination with standards. However, this evaluation method has a slow detection speed, high workload for inspectors, and high professional requirements. Especially in the early stages of corrosion, it is difficult to manually determine the specific area where corrosion occurs, and the corrosion area is generally complex in shape, and the area percentage is difficult to obtain.

[0003] In the process of studying metal corrosion, a large number of metal appearance images are obtained. In metal corrosion images, there is a lot of information related to corrosion, such as the distribution and shape of corrosion pits. In addition, in recent years, machine vision technology, as an emerging technology, has attracted much attention along with the rapid development of artificial intelligence technology. Computer vision can simulate the visual function of the human eye and replace manual judgment through algorithm analysis. It has been widely used in the inspection and detection tasks of various civil infrastructure. These make it possible to detect and evaluate metal corrosion based on image processing.

[0004] To this end, a convolutional neural network based on the sliding window method is first used to locate the corrosion area in the metal appearance image, and then a corrosion level evaluation method based on the standard color spectrum information table is proposed to realize the digitization and quantification of corrosion feature information. Compared with the traditional manual evaluation method, the present invention is not affected by the experience of the evaluator, improves the accuracy and speed of corrosion level evaluation, and also reduces the labor intensity of the inspectors. In addition, with the high-resolution characteristics of machine vision, early images of corrosion can also be identified and the corrosion level can be accurately evaluated. (III) Summary of the invention

[0005] 1. Purpose: The purpose of the present invention is to provide a method for evaluating metal corrosion grade based on image processing. This method uses a convolutional neural network combined with a sliding window method to classify corrosion features and locate corrosion areas based on the differentiated features of pixels before and after metal corrosion, and uses a clustering algorithm to evaluate corrosion grade in combination with a trained standard color spectrum information table. Compared with traditional manual evaluation methods, this method has a fast detection speed, high accuracy and strong objectivity, which helps to evaluate the degree of metal corrosion in a short time in engineering practice and take necessary measures in a timely manner.

[0006] 2. Technical solution: The present invention is a method for evaluating metal corrosion level based on image processing, which comprises the following steps:

[0007] Step 1: Train the corrosion classifier using a convolutional neural network

[0008] In order to locate the corrosion area, it is first necessary to use a convolutional neural network to train the corrosion classifier to classify corrosion features. The structural parameters of the convolutional neural network are trained through training sets and test sets so that it can distinguish the corrosion conditions of the input images, providing a basis for the subsequent corrosion area location.

[0009] Step 2: Sampling using sliding window method

[0010] In order to locate the corrosion area of ​​the entire metal appearance image, it is necessary to use the sliding window method for step-by-step sampling. A window with fixed length and width is used to slide from left to right and from top to bottom on the metal appearance image. After each slide, the image in the window is sampled as the input of the corrosion classifier to determine the corrosion situation. The sliding window method can be used to divide the metal appearance image into small images, providing an input image that meets the requirements for corrosion type determination.

[0011] Step 3: Corrosion area location

[0012] Usually, uneven corrosion will occur on the outer surface of metal materials. In order to extract the characteristic parameters of the corrosion area, it is necessary to locate the corrosion area in the metal appearance image so that the subsequent feature extraction range is more targeted. The corrosion classifier is used to determine the corrosion category of the image sampled by the sliding window method, retain the corroded area, replace the uncorroded area with a pure black background, and traverse the entire metal appearance image to complete the corrosion area positioning.

[0013] Step 4: Use clustering algorithm for color quantization

[0014] In order to distinguish corrosion areas with different corrosion degrees, the color of metal materials will gradually change during corrosion, and a clustering algorithm is used to quantify the color of pixels in the corrosion area. Pixels with similar colors are gathered into the same cluster center to represent areas with similar corrosion degrees. In this way, the entire corrosion area can be divided into small areas with similar corrosion degrees for corrosion grade evaluation, which improves the accuracy of the evaluation results.

[0015] Step 5: Training the standard color spectrum information table

[0016] In order to measure the corrosion degree of different standard colors, it is necessary to train the corresponding relationship between standard colors and corrosion degree factors in the standard color spectrum information table. After the corrosion degree factors in the standard color spectrum information table are randomly initialized, the corrosion degree factors are trained according to the training formula using the pictures of the corrosion level calibrated by the three-dimensional profiler and X-ray energy spectrum analysis in the early stage, and the final standard color spectrum information table can be obtained, which provides a basis for the subsequent corrosion level evaluation.

[0017] Step 6: Corrosion grade evaluation based on color and area

[0018] In order to improve the accuracy of the evaluation results of metal corrosion grade, corrosion area and corrosion color are used as corrosion characteristic parameters at the same time. The color quantification is performed through the clustering algorithm to distinguish corrosion areas with different corrosion degrees. The corrosion degree factors in the standard color spectrum information table are used to characterize the corrosion degrees represented by different standard colors. Finally, the corrosion grade of the metal is obtained comprehensively. Compared with the traditional evaluation method that only uses the percentage of corrosion area as the evaluation index, it is more objective. (IV) Description of the drawings

[0019] Figure 1 Overall process of metal corrosion grade evaluation

[0020] Figure 2 Corrosion classifier training process

[0021] Figure 3 Dataset original image

[0022] Figure 4 After segmentation

[0023] Figure 5 Convolutional Neural Network Architecture

[0024] Figure 6 Training process curve

[0025] Figure 7 Sliding window sampling

[0026] Figure 8 Corrosion Area Location Process

[0027] Fig. 9 Some standard colors

[0028] Fig.10 Grayscale histogram of each component (V) Specific implementation methods

[0029] The metal corrosion grade evaluation method based on image processing of the present invention will be further described in detail below in conjunction with the accompanying drawings. The specific steps are as follows:

[0030] Step 1: Train the corrosion classifier using a convolutional neural network

[0031] To locate the corrosion area using a convolutional neural network, we must first train a corrosion classifier. That is, after inputting an image, the corrosion classifier can determine whether the part of the image is corroded. The process of training a corrosion classifier is as follows: Figure 2 As shown in the figure, the collected images are divided into small images, and then manually classified into corroded and non-corroded types to generate training sets and test sets, and a corrosion classifier is generated by training a convolutional neural network.

[0032] The present invention prepares a data set based on metal corrosion images from previous environmental tests, such as Figure 3 The following figure shows some of the original images before and after corrosion. Then, the original image is segmented into small images of 32×32 pixels as the input of the convolutional neural network. Figure 4 The following is a 32×32 pixel small picture after partial segmentation. After segmenting all the original pictures, a total of 26,228 small pictures were obtained, and then 20,983 pictures were randomly selected as the training set, of which 15,083 pictures were not corroded and 5,900 pictures were corroded. The other 5,245 pictures were used as the test set, of which 3,700 pictures were not corroded and 1,457 were corroded.

[0033] Since the required corrosion classifier is a binary classification, and in order to reduce the number of required training images and speed up the corrosion area positioning, the present invention uses TensorFlow to build the following Figure 5 The relatively simple convolutional neural network structure is shown in Figure 1. The network structure consists of five layers, of which the first two layers are convolutional layers and the last three layers are fully connected layers. In the first two layers, there are two steps of convolution and pooling, and the last three layers are fully connected layers. This structure uses Relu as the activation function, and finally outputs it through the Softmax function to determine whether the input image is corroded. Table 1 shows the detailed structural parameters of each layer of the convolutional neural network.

[0034] Table 1 Detailed structural parameters of each layer of the convolutional neural network

[0035] layer enter Kernel size Number of cores Step Length Output Number of variables Convolutional layer 1 32×32×3 5×5×3 6 1 28×28×6 456 Pooling layer 1 28×28×6 2×2×1 / 2 14×14×6 / Convolutional Layer 2 14×14×6 5×5×6 16 1 10×10×16 2416 Pooling layer 2 10×10×16 2×2×1 / 2 5×5×16 / Fully connected layer 1 5×5×16 / / / 120 48120 Fully connected layer 2 120 / / / 40 4840 Fully connected layer 3 40 / / / 2 82

[0036] like Figure 6 The figure shows the line graph of the accuracy and loss of the training set and the test set during the convolutional neural network training process. It can be seen that the convolutional neural network structure selected by the present invention has achieved a good effect in determining whether the image is corroded or not. After about 10 trainings, an accuracy rate close to 100% and a loss close to 0 can be obtained on the test set.

[0037] Step 2: Sampling using sliding window method

[0038] like Figure 7 The figure shows a schematic diagram of the sliding window sampling method. When sampling, a small window of size a×b is used to slide gradually on the original image for sampling. The initial position of the sampling window is 1, and then the window slides to the right gradually to positions 2 and 3 at a distance c. After each slide, the image in the sampling window is sampled. When the window slides to position 3 at the rightmost end of the original image, it slides down to position 4 at a distance d, and samples again from left to right until the sampling window completes sliding on the entire original image.

[0039] Step 3: Corrosion area location

[0040] like Figure 8 The figure shows the process of using the corrosion classifier and sliding window method to locate the corrosion area. First, a sliding window of 8×8 pixels is used to sample the metal appearance image, and then bilinear interpolation is used to enlarge it to a 32×32 pixel image. The corrosion classifier is then used to determine the corrosion of the enlarged image. If corrosion occurs, the area corresponding to the small image in the metal appearance image is retained, otherwise the corresponding area is converted to a black background. After the sliding window traverses the entire metal appearance image, the corrosion area image can be obtained.

[0041] The effects of some metal appearance images before and after corrosion area positioning are shown in Table 2. The accuracy of corrosion area positioning is measured by using the intersection ratio of union (IoU) and it can be seen that the IoU of all images is greater than 0.95, which has a good corrosion area positioning effect.

[0042] Table 2 Corrosion area positioning effect and intersection ratio

[0043]

[0044]

[0045] Step 4: Use clustering algorithm for color quantization

[0046] In the past, the corrosion level evaluation process only relied on the corrosion area as a characteristic parameter, ignoring the problem of different corrosion degrees in different parts of the corrosion area. Generally, the colors of the same metal material with different corrosion degrees are different, so the present invention uses color as a characteristic parameter to characterize different corrosion degree areas. The K-Means clustering algorithm is used to perform color clustering on the pixels inside the corrosion area, and the pixels with similar colors are gathered into a cluster center, indicating that the corrosion degrees they represent are similar.

[0047] Step 5: Training the standard color spectrum information table

[0048] After clustering all pixels in the eroded area, several cluster centers can be obtained. In order to measure the degree of erosion of each cluster center, it is necessary to obtain a standard color spectrum information table. Some standard colors in the standard color spectrum information table are as follows: Fig. 9 As shown, each standard color has a corresponding corrosion degree factor. The larger the corrosion degree factor, the greater the corrosion degree corresponding to the standard color.

[0049] The training of the standard color spectrum information table first requires the selection of standard colors. In order to select standard colors that are representative of corrosion, the present invention adopts a histogram combined with a clustering algorithm to select standard colors. Fig.10 The figure shows the histogram of each component of a single metal corrosion area image. It can be seen that the histogram of each component basically conforms to the normal distribution, so the quantile is used for standard color selection.

[0050] The present invention selects standard colors every 10%, that is, the grayscale values ​​corresponding to the quantiles of 10%, 20%, ..., 90% of the total number are selected as the standard colors of the corresponding components. Then, 20 pictures of the corrosion area are randomly selected, and the histogram quantile method is used to select the standard color. In order to obtain the standard color that can most accurately describe the corrosion area, the quantile grayscale values ​​of the R, G, and B components of these 20 pictures are clustered into 9 categories by color clustering, and the grayscale values ​​0 and 255 are added as the final standard colors, a total of 11 3 =1331, as shown in Table 3.

[0051] Table 3 Final selected standard colors

[0052]

[0053] Use the pictures with calibrated corrosion levels to train the corrosion degree factors in the standard color spectrum information table. The specific training formula is as follows:

[0054]

[0055] Among them: F x+1is the corrosion degree factor after training; F x is the corrosion factor before training; r is the learning rate, which ranges from 0 to 1; G 0 Corrosion grade marked in the picture; G 1 is the corrosion level evaluated according to the current corrosion degree factor; P is the area percentage of the corroded area in the picture.

[0056] After the corrosion degree factor in the standard color spectrum information table is randomly initialized, the corrosion degree factor is trained according to the training formula using the pictures of the corrosion level calibrated by the three-dimensional profiler and X-ray energy spectrum analysis in the early stage, and the final standard color spectrum information table can be obtained.

[0057] Step 6: Corrosion grade evaluation based on color and area

[0058] After completing the clustering of the pixels in the corrosion area and the training of the standard color spectrum information table, the corrosion level can be evaluated. First, find the standard color corresponding to each cluster center through the minimum Euclidean distance, that is, traverse the standard colors to find the Euclidean distance between all standard colors and the cluster center, and select the standard color corresponding to the minimum Euclidean distance as a substitute for the cluster center color for subsequent corrosion level evaluation. The calculation formula of the Euclidean distance is as follows:

[0059]

[0060] Among them, r 1 , g 1 and b 1 is the color component of the cluster center; r 2 , g 2 and b 2 The color component of the standard color.

[0061] Then, the corrosion grade results are evaluated according to the formula shown below:

[0062]

[0063] Where G is the corrosion grade evaluation result; P i is the percentage of the number of pixels in each cluster center to the number of pixels in the product appearance image; F i is the corrosion degree factor corresponding to the standard color with the closest Euclidean distance to the cluster center.

[0064] The present invention selects 50 pictures with calibrated corrosion levels and uses this method to evaluate the corrosion level. The corrosion level evaluation results and representative evaluation parameters of some pictures are shown in Table 4. The results show that the corrosion level evaluation results of 48 pictures are the same as the calibrated level, and the accuracy rate reaches 96%. Therefore, the accuracy rate of evaluating the corrosion level of metals by image processing is higher, which is more efficient and more objective than the manual evaluation method.

[0065] Table 4 Corrosion grade evaluation results

[0066]

[0067]

Claims

1. A metal corrosion grade evaluation method based on image processing, which uses a convolutional neural network combined with a sliding window method to achieve corrosion feature classification and corrosion area location according to the differentiated features of pixels before and after metal corrosion, and is characterized by: A method combining color clustering with standard color spectrum information table is proposed to realize metal corrosion grade evaluation. The specific steps of this method are as follows: Step 1: Train the corrosion classifier using a convolutional neural network Step 2: Sampling using sliding window method The metal appearance image is sampled using the sliding window method and divided into several small images; Step 3: Corrosion area location Use the corrosion classifier to determine the corrosion category of the small image sampled by the sliding window method, retain the corroded area, replace the uncorroded area with a pure black background, and traverse the entire metal appearance image to complete the corrosion area positioning; Step 4: Use clustering algorithm for color quantization A clustering algorithm is used to quantify the colors of pixels in the corrosion area, and pixels with similar colors are clustered into the same cluster center. Step 5: Training the standard color spectrum information table In order to measure the degree of corrosion of each cluster center, it is necessary to obtain the standard color spectrum information table. First, the standard color is selected by combining the histogram with the clustering algorithm, and then the corrosion degree factor corresponding to each standard color is trained using the pictures with calibrated corrosion levels. The specific training formula is as follows: Among them: F x+1 is the corrosion degree factor after training; F x is the corrosion degree factor before training; r is the learning rate, which takes values ​​between 0 and 1; G0 is the corrosion level calibrated by the image; G1 is the corrosion level evaluated according to the current corrosion degree factor; P is the area percentage of the corroded area in the image; Step 6: Corrosion grade evaluation based on color and area At the same time, the corrosion color and corrosion area are used as characteristic parameters of the corrosion area to comprehensively evaluate the corrosion level. The specific evaluation formula is as follows: Where G is the corrosion grade evaluation result; P i is the percentage of the number of pixels in each cluster center to the number of pixels in the product appearance image; F i is the corrosion degree factor corresponding to the standard color with the closest Euclidean distance to the cluster center.

2. The metal corrosion level evaluation method based on image processing according to claim 1 is characterized in that The pixels in the corrosion area are divided into categories with similar RGB values ​​through the color clustering algorithm, so that the entire corrosion area is divided into small areas with different corrosion degrees. The corrosion color is used as one of the indicators for corrosion grade evaluation to improve the accuracy of corrosion grade evaluation.

Citation Information

Cited By

  • Metal oxygen corrosion product film protectiveness detection method and system based on multispectral and color characteristics

    CN122361318A