Ship corrosion rapid assessment method based on image recognition

Through image recognition-based methods, including edge detection, circular fitting, brightness correction and random forest classification, the rapid and efficient problem of ship corrosion status assessment is solved, and fine quantification and depth calculation of ship corrosion damage are achieved.

CN119741293AActive Publication Date: 2025-04-01CHINA SHIP DEV & DESIGN CENT

Patent Information

Application Number
CN202411934205.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-04-01
Estimated Expiration
2044-12-26

AI Technical Summary

Technical Problem

The prior art is difficult to quickly and efficiently evaluate ship corrosion status, especially for fine quantification of digital ray image data and depth calculation and area calculation of corrosion damage.

Method used

Using an image recognition-based method, intelligent segmentation and depth calculation of ship corrosion-damaged areas are achieved through steps such as edge detection, circular fitting, brightness correction, feature extraction and random forest classification.

Benefits of technology

It realizes fine quantification of ship corrosion damage, can quickly and efficiently evaluate the corrosion status, and improves ship corrosion protection and maintenance guarantee capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119741293A_ABST
    Figure CN119741293A_ABST
Patent Text Reader

Abstract

The invention discloses a ship corrosion rapid assessment method based on image recognition. The method comprises the following steps: 1) carrying out edge detection on an acquired corrosion digital image to be assessed; the corrosion digital image is a digital ray image obtained by a ship corrosion detection device in nondestructive detection; 2) fitting the edge points into a circle to serve as a reference small ball; 3) segmenting corrosion damage; and 4) performing corrosion damage depth calculation and area calculation on the acquired digital image according to the detection result of the reference ball and the segmentation result of the corrosion damage. According to the ship corrosion rapid assessment method based on the deep learning image recognition technology, artificial intelligence analysis of corrosion defect data in the digital ray image is achieved, the collected corrosion image is assessed, corrosion defects in the image can be recognized from any direction, angle or edge position, and the accuracy of ship corrosion assessment is improved. And the ship corrosion protection and maintenance support capability can be greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a ship corrosion protection technology, and in particular to a ship corrosion rapid assessment method based on image recognition. Background Art

[0002] Marine environmental corrosion has always been a major problem that plagues the construction and maintenance of ships in various countries around the world. The hull structure and seawater piping system are the key and difficult parts of ship corrosion protection. The hull structure is the key to ensuring the safety of ship navigation, but its corrosion hazards are usually difficult to inspect and discover. Seawater pipelines include fire water pipelines, seawater cooling pipelines for various electromechanical equipment, gravity toilet flushing pipelines, bilge drainage pipelines, etc., which are spread all over the ship. Once the seawater pipelines are corroded and damaged, it will affect the normal operation of the equipment and even the safety of the ship.

[0003] Therefore, having a corrosion monitoring system is an important prerequisite and basic guarantee for ships to maintain a good operating state for a long time. According to their different working methods, they can be divided into two categories: one is to track the corrosion behavior of materials in the actual environment in situ, monitor the speed of equipment corrosion caused by the medium, and obtain relevant information about the material corrosion process, which is called on-site corrosion monitoring. The methods that are currently widely used mainly include weight loss hanging pieces, resistance probes, inductance probes, potential probes, and linear polarization resistance probes. The second is to detect whether there are corrosion defects after the equipment has been running for a certain period of time, and obtain corrosion results indirectly, which is called offline corrosion detection (abbreviated as detection). Currently, non-destructive testing (NDT) technologies such as magnetic powder, ultrasound, eddy current, leakage magnetic flux, and radiation are commonly used.

[0004] The portable ship corrosion monitoring and detection system based on pulsed digital X-ray and ultrasonic phased array technology has certain advantages in non-destructive testing (NDT) technology. Its working principle is to emit high-frequency X-ray pulses. After the rays pass through the object to be tested, different photosensitive pixels are presented on the photosensitive plate. The size of the pixel value is positively correlated with the intensity of the rays irradiated on the photosensitive plate. At the same time, the intensity of the rays irradiated on the photosensitive plate is negatively correlated with the thickness of the device under test. Therefore, after the rays pass through the device under test, pixels of different sizes are presented on the photosensitive plate. The pixel information of the photosensitive plate is read by the image acquisition backend and displayed as a two-dimensional image through a digital display method, so as to perform a visual quantitative inspection of the coating defects of the actual ship and obtain corrosion image data. However, there is currently no good technical means for finely quantifying the obtained corrosion image data and quickly and efficiently evaluating its corrosion status. Summary of the invention

[0005] The technical problem to be solved by the present invention is to provide a method for rapid assessment of ship corrosion based on image recognition in view of the defects in the prior art.

[0006] The technical solution adopted by the present invention to solve the technical problem is: a rapid ship corrosion assessment method based on image recognition, comprising the following steps:

[0007] 1) Performing edge detection on the collected corrosion digital image to be evaluated; the corrosion digital image is a digital radiographic image obtained by a ship corrosion detection device during non-destructive testing;

[0008] 2) Fit a circle to the edge points as a reference ball;

[0009] 2.1) Randomly sample edge points and use the sampled points to fit a circle;

[0010] 2.2) Classify all edge points into outer points and inner points according to the fitted circle;

[0011] 2.3) Set a threshold. If the distance between an outer point and the fitted circle is less than the preset threshold, the outer point is considered to be an inner point. Traverse all edge points in the edge detection result graph to obtain an updated set of inner points.

[0012] 2.4) Refit the circular edge according to the latest set of interior points;

[0013] 2.5) Repeat steps 2.2) to 2.4) until the fitted circle no longer changes, and obtain the final fitted circle; count the number of its inner points and outer points;

[0014] 3) Segmentation of corrosion damage;

[0015] The basic process of corrosion damage area segmentation is: first, reduce the interference caused by the uneven brightness field through brightness field non-uniformity correction; then extract features pixel by pixel; finally, classify the pixels according to the extracted features to achieve corrosion damage area segmentation; the details are as follows:

[0016] 3.1) Before segmentation, the image is first corrected for uneven brightness and the uneven background brightness is filtered out;

[0017] Brightness non-uniform field correction includes the following two steps: brightness field calculation and brightness correction;

[0018] 3.1.1) Luminance field calculation

[0019] Obtaining a grayscale image of a digital ray image, and then performing erosion and dilation operations on the grayscale image, wherein the grayscale image after the dilation operation reflects the overall change trend of the brightness in the digital ray image;

[0020] The brightness field is represented as the background grayscale image of the brightness in the digital ray image. The background grayscale image is calculated by the morphological transformation of the image. The specific process includes the erosion of the grayscale image and the expansion of the grayscale image.

[0021] The erosion process of the grayscale image is as follows;

[0022] Step 1: Define a structural element with a set shape;

[0023] Step 2: Place the center of the structure element at a certain pixel position in the grayscale image, where the grayscale values ​​of the pixels at each position have been marked;

[0024] Step 3: Assign the minimum grayscale value within the coverage area of ​​the structural element to the pixel at the center of the structural element;

[0025] Step 4: Repeat the above steps 2 and 3 until all pixels are traversed to obtain the grayscale image after the corrosion operation;

[0026] The expansion process of the grayscale image is as follows:

[0027] Step 1: Define a structural element of a certain shape;

[0028] Step 2: Place the center of the structure element at a certain pixel position in the grayscale image, where the grayscale values ​​of the pixels at each position have been marked;

[0029] Step 3: Assign the maximum grayscale value within the coverage of the structural element to the pixel at the center of the structural element;

[0030] Step 4: Repeat the above steps 2 and 3 until all pixels are traversed to obtain the grayscale image after the dilation operation;

[0031] 3.1.2) Brightness Correction

[0032] That is, brightness correction is performed by subtracting the original image from the background grayscale image;

[0033] 3.2) Extract features and classify pixels to achieve segmentation of the corrosion area;

[0034] The segmentation of the corrosion area is achieved by classifying pixels one by one. The pixel features based on which the pixel classification is performed are divided into two parts: one is the global feature and the other is the local feature.

[0035] The global feature used is the grayscale histogram of the approximate area of ​​corrosion damage circled manually in the digital radiographic image;

[0036] The calculation process of the grayscale histogram is as follows:

[0037] Step 1: Divide the grayscale into K intervals;

[0038] Step 2: Traverse all pixels in the roughly circled corrosion damage area and count the number of pixels whose grayscale values ​​fall into each grayscale interval. Assume that the number of pixels falling into the kth grayscale interval is n. k ;

[0039] Step 3: Calculate the proportion of pixel grayscale values ​​in each grayscale interval in the roughly circled corrosion damage area. Assume that the total number of pixels in the roughly circled corrosion damage area is N. pixel , then the proportion of pixels in the kth grayscale interval is Array {p1,p2,p3,…,p K} That is, the grayscale histogram of the approximate area of ​​corrosion damage;

[0040] The local feature used in the present invention is the mean value of the grayscale value of pixels in a local area formed with the pixel as the center and the manually set threshold as the radius;

[0041] 3.3) Region Segmentation

[0042] Region segmentation is achieved through pixel-by-pixel classification based on the extracted pixel features, and the classifier used is random forest. The basic idea of ​​random forest is to use resampling technology to randomly extract a certain number of samples from the original training sample set with replacement to train decision trees, and repeat the above steps to train a certain number of decision trees to form a random forest. The classification result of random forest is determined by the voting of decision trees.

[0043] The corrosion damage area segmentation is performed by using random forest for classification prediction. Each decision tree in the random forest is used for classification prediction in turn. Then, the voting results of the decision tree classification prediction are used as the classification prediction results of the random forest.

[0044] 4) According to the detection results of the reference ball and the segmentation results of the corrosion damage, the corrosion damage depth and area are calculated for the collected digital image;

[0045] 4.1) Calculation of corrosion damage depth;

[0046] Step 1: Calculate the minimum grayscale value of the reference ball area in the reference ball detection result We believe that the minimum grayscale value of the reference ball area corresponds to the diameter of the reference ball. In practical applications, the actual diameter of the reference ball d ball known;

[0047] Step 2: Based on the corrosion damage segmentation results, calculate the grayscale mean of the non-damaged area around the corrosion damage and will As the gray value that the photographed object should have when it is not damaged;

[0048] Step 3: Based on the corrosion damage segmentation results, the corrosion depth of the corresponding corrosion area is calculated pixel by pixel;

[0049] Assume that the gray value of the i-th pixel in the eroded area is g i , the corrosion depth of the area corresponding to the pixel

[0050] Step 4: Perform basic analysis of the corrosion depth based on the corrosion depth corresponding to the corrosion area pixel calculated in the third step, including calculating the minimum, maximum, and mean of the corrosion depth and calculating the histogram of the corrosion depth. The calculation process of the corrosion depth histogram is consistent with the grayscale histogram calculation process shown in step 3.2);

[0051] 4.2) Calculation of corrosion damage area;

[0052] According to the detection results of the reference sphere, the number of pixels occupied by the reference sphere in the digital radiographic image can be obtained. Since the actual diameter of the reference sphere is known, the area of ​​the maximum cross section of the reference sphere is also known. We believe that the maximum cross section of the reference sphere corresponds to the reference sphere detected in the digital radiographic image. In addition, according to the corrosion damage segmentation results, the number of pixels occupied by the corrosion damage in the digital radiographic image can be obtained, and based on this, the corrosion damage area can be converted proportionally.

[0053] The calculation process of corrosion damage area is as follows:

[0054] Step 1: According to the actual diameter d of the reference ball ball , calculate the actual area of ​​the maximum cross section of the reference ball as

[0055] Step 2: According to the detection results of the reference balls, count the number of pixels N occupied by the reference balls in the digital radiographic image. ball ;

[0056] Step 3: According to the corrosion damage segmentation results, count the number of pixels N occupied by corrosion damage in the digital radiographic image erosion ;

[0057] Step 4: Calculate the corrosion damage area

[0058] The beneficial effects produced by the present invention are:

[0059] The present invention proposes a rapid assessment method for ship corrosion based on deep learning image recognition technology. It can accurately quantify the corrosion damage depth and damage area by carrying out benchmark ball detection, intelligent segmentation of corrosion damage areas and corrosion damage analysis under conditions of weak artificial intervention. It realizes artificial intelligence analysis of corrosion defect data in digital X-ray images, evaluates the collected corrosion images, and can identify corrosion defects in images from any direction, angle or edge position, which can greatly improve the ship corrosion protection and maintenance guarantee capabilities. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which:

[0061] Figure 1 is a method flow chart of an embodiment of the present invention;

[0062] Figure 2 is a schematic diagram of the corrosion process of an embodiment of the present invention;

[0063] Figure 3 is a schematic diagram of the expansion process of an embodiment of the present invention;

[0064] Figure 4 is a schematic diagram of the brightness correction effect of an embodiment of the present invention;

[0065] Figure 5 It is a schematic diagram of the corrosion damage area segmentation effect of an embodiment of the present invention. DETAILED DESCRIPTION

[0066] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0067] like Figure 1 As shown, a rapid assessment method for ship corrosion based on image recognition includes the following steps:

[0068] 1) Performing edge detection on the collected corrosion digital image to be evaluated; the corrosion digital image is a digital radiographic image obtained by a ship corrosion detection device during non-destructive testing;

[0069] Edge detection specifically includes the following steps:

[0070] Step 1: Gaussian filtering

[0071] The noise in the image is generally a high-frequency signal, so it is very easy to be identified as a false edge. In order to reduce the impact of noise on edge detection, Gaussian filtering is used in this embodiment to filter out noise. During the filtering process, a discretized two-dimensional Gaussian window is used to slide the convolution of the entire image. The specific formula is as follows:

[0072] I G =I o *G σ (1)

[0073] Among them, I o represents the original image before Gaussian filtering, G σ represents a discretized two-dimensional Gaussian window, * represents convolution, I G Represents the image after Gaussian filtering.

[0074] Step 2: Calculate the gradient

[0075] At the edge position, the pixel grayscale value generally changes significantly, so calculating the gradient of the pixel grayscale value in the image helps detect the edge.

[0076] When calculating the gradient, first, use the horizontal and vertical discretized one-dimensional Gaussian first-order derivative sequences to convolve the image to obtain the horizontal gradient map and the vertical gradient map. The specific formula is as follows:

[0077] d x =I G *G xσ ′ (2)

[0078] d y =I G *G yσ ′ (3)

[0079] Among them, G xσ ′ and G yσ ′ represents the one-dimensional Gaussian first-order derivative sequence of the horizontal and vertical discretization, respectively, d x and d y Represent the horizontal gradient map and the vertical gradient map respectively.

[0080] Next, calculate the gradient magnitude and direction, the calculation formulas are:

[0081]

[0082] Step 3: Non-maximum suppression

[0083] Non-maximum suppression is an edge thinning method. Usually, the edge width detected by gradient calculation is greater than one pixel. In order to reduce the edge response and make the edge appear as a line with a single pixel width, the gradient needs to be non-maximum suppressed. When performing non-maximum suppression, check pixel by pixel to see if the gradient amplitude of the pixel is the maximum value within a certain range of the neighborhood in the gradient direction. If so, it is retained, otherwise it is discarded.

[0084] Step 4: Dual Threshold Detection

[0085] The dual threshold detection screens the edges according to the gradient amplitude map after non-maximum suppression. The dual threshold includes a preset high threshold and a low threshold. During operation, if the gradient amplitude of the edge pixel is greater than the high threshold, the point is considered a strong edge point and retained; if the gradient amplitude of the edge pixel is less than the low threshold, the point is considered a non-edge point and deleted; if the gradient amplitude of the edge pixel is between the high threshold and the low threshold, the point is considered a weak edge point and waits for the next step.

[0086] Step 5: Hysteresis Edge Tracking

[0087] Hysteresis edge tracking is used to process weak edge points whose gradient amplitude is between the high threshold and the low threshold in the previous step. Weak edge points may be true edge points or pseudo edges caused by noise. Usually, weak edges that are true edges are connected to strong edge points, while pseudo edges caused by noise are not. Based on this, the specific method of hysteresis edge tracking is: search for all connected weak edges, if any point in the weak edge is connected to the strong edge, keep this weak edge, otherwise delete this weak edge. At this point, the edge detection process ends.

[0088] 2) Fit a circle to the edge points as a reference ball;

[0089] 2.1) Randomly sample edge points and use the sampled points to fit a circle;

[0090] A circle can be represented by the following equation:

[0091] a1·x 2 +a2·y 2 +a3+a4·2xy+a5·2x+a6·2y=0 (6)

[0092] Among them, (x, y) is the pixel coordinate, a1, a2, a3, a4, a5, a6 are the parameters in the circle equation. Using random sampling, randomly sample M>6 points from the edge detection result image, the coordinates of the point are (x n ,y n ),n=1,2,…,M. Use the coordinates of the sampling points to fit the circle, that is, solve the following equation:

[0093]

[0094] If symbol B is used M×6 Represents the matrix on the left side of the above equation. The above equation can be rewritten as in This equation can be solved by matrix singular value decomposition. The solution process is as follows: Assume that the matrix B M×6 The singular value decomposition of M×6 =U M×M Σ M×6 V 6×6 T , where U M×M and V 6×6 are all orthogonal matrices, Σ M×6 is the matrix B M×6 The singular values ​​of are arranged in descending order to form a diagonal matrix, equation The optimal solution Equal to V 6×6 The last column vector of V. 6×6 The last column vector of

[0095] 2.2) Classify all edge points into outer points and inner points according to the fitted circle;

[0096] Assume that the coordinates of the i-th edge point in the edge detection result graph are (x i ,y i ), substitute the above coordinates into the following formula to solve the error e i :

[0097]

[0098] If the error is less than the preset threshold e T , then the changed point is considered to be an interior point, otherwise it is considered to be an exterior point.

[0099] 2.3) Set a threshold. If the distance between an outer point and the fitted circle is less than the preset threshold, the outer point is considered to be an inner point. Traverse all edge points in the edge detection result graph to obtain an updated set of inner points.

[0100] 2.4) Refit the circular edge according to the latest set of interior points;

[0101] 2.5) Repeat steps 2.2) to 2.4) until the fitted circle no longer changes, and obtain the final fitted circle; count the number of its inner points and outer points;

[0102] The circular edge enclosed area fitted through the above steps is the detected reference ball area.

[0103] 3) Segmentation of corrosion damage;

[0104] In digital radiographic images, corrosion damage appears as abnormal highlights;

[0105] The basic process of corrosion damage area segmentation is: first, reduce the interference caused by the uneven brightness field through brightness field non-uniformity correction; then extract features pixel by pixel; finally, classify the pixels according to the extracted features to achieve corrosion damage area segmentation.

[0106] 3.1) Perform brightness non-uniform field correction on the image before segmentation. In the present invention, brightness non-uniform field correction includes the following two steps: brightness field calculation and brightness correction.

[0107] 3.1.1) Luminance field calculation

[0108] Obtaining a grayscale image of a digital ray image, and then performing erosion and dilation operations on the grayscale image, wherein the grayscale image after the dilation operation reflects the overall change trend of the brightness in the digital ray image;

[0109] The brightness field represents the overall change trend of the brightness in the digital ray image. Here, we understand the brightness field as the background grayscale image of the digital ray image. The present invention calculates the background grayscale image through the morphological transformation of the image, and the specific process includes the erosion of the grayscale image and the expansion of the grayscale image.

[0110] Erosion of grayscale images;

[0111] Figure 2 A simple example shows the erosion process of a grayscale image:

[0112] Step 1: Define a structure element with a set shape, such as Figure 2 (a);

[0113] Step 2: Place the center of the structure element at a certain pixel position in the grayscale image, such as Figure 2 (b), the grayscale value of each pixel position is marked in the figure;

[0114] Step 3: Assign the minimum grayscale value within the coverage of the structural element to the pixel at the center of the structural element, for example Figure 2 In (b), the grayscale minimum value 0 within the coverage area of ​​the yellow structure element is assigned to the pixel at the center position indicated by the red border.

[0115] Step 4: Repeat the above steps 2 and 3 until all pixels are traversed to obtain the grayscale image after the corrosion operation, such as Figure 2 (c) as shown.

[0116] Dilation of grayscale images

[0117] Down Figure 3 A simple example shows the expansion process of the grayscale image:

[0118] Step 1: Define a structural element of a certain shape, such as Figure 3 -(a);

[0119] Step 2: Place the center of the structure element at a certain pixel position in the grayscale image, such as Figure 3 (b), the grayscale value of each pixel position is marked in the figure;

[0120] Step 3: Assign the maximum grayscale value within the coverage of the structural element to the pixel at the center of the structural element, for example Figure 3 In (b), the maximum grayscale value 0 within the coverage area of ​​the green structure element is assigned to the center pixel indicated by the red border.

[0121] Step 4: Repeat the above steps 2 and 3 until all pixels are traversed to obtain the grayscale image after the expansion operation, such as Figure 3 (c) as shown.

[0122] In summary, Figure 2(b) is the original image to be processed. Figure 3 (c) is the background grayscale image obtained by corrosion and expansion operation. It can be seen that Figure 3 The brightness in (c) can reflect Figure 2 (b) The overall change trend of brightness.

[0123] 3.2) Brightness Correction

[0124] That is, brightness correction is performed by subtracting the original image from the background grayscale image;

[0125] After the above grayscale image is eroded and expanded, Figure 2 (b) shows the original image to be processed. Figure 3 (c) shows the background grayscale image. This embodiment adopts a simple brightness correction method, that is, brightness correction is performed by subtracting the original image from the background grayscale image. Figure 4 As shown, Figure 4 (a) with Figure 2 (b) is the same, which is the original image to be processed; Figure 4 (b) with Figure 3 (c) is the same, which is the background grayscale image; Figure 4 (c) is the image after brightness correction. It can be seen that Figure 4 In (c), the uneven field in the background brightness has been filtered out and the local highlights have been highlighted.

[0126] 3.3) Feature Extraction

[0127] The segmentation of the corrosion area is achieved by classifying pixels one by one. The pixel features based on which the pixel classification is performed are divided into two parts: one is the global feature and the other is the local feature.

[0128] The global feature used is the grayscale histogram of the approximate corrosion damage area circled manually in the digital radiographic image.

[0129] The calculation process of the grayscale histogram is as follows:

[0130] Step 1: Divide the grayscale into K intervals;

[0131] Step 2: Traverse all pixels in the roughly circled corrosion damage area and count the number of pixels whose grayscale values ​​fall into each grayscale interval. Assume that the number of pixels falling into the kth grayscale interval is n. k ;

[0132] Step 3: Calculate the proportion of pixel grayscale values ​​in each grayscale interval in the roughly circled corrosion damage area. Assume that the total number of pixels in the roughly circled corrosion damage area is N. pixel , then the proportion of pixels in the kth grayscale interval is Array {p1,p2,p3,…,pK}That is, the grayscale histogram of the approximate area of ​​corrosion damage.

[0133] The local feature used in the present invention is the average value of the grayscale value of pixels in a local area formed with the pixel as the center and the manually set threshold as the radius.

[0134] 3.4) Region Segmentation

[0135] Region segmentation is achieved through pixel-by-pixel classification based on the extracted pixel features, and the classifier used is random forest. The basic idea of ​​random forest is to use resampling technology to randomly extract a certain number of samples from the original training sample set with replacement to train decision trees, and repeat the above steps to train a certain number of decision trees to form a random forest. The classification result of random forest is determined by the voting of decision trees.

[0136] The training process of the decision tree is as follows:

[0137] Step 1: For the sample set D of the current node (if it is in the initial stage of training, start from the root node), if the number of samples is less than the threshold or there is no feature, the recursion of the current node stops;

[0138] Step 2: Calculate the Gini coefficient of sample set D. The pixels are classified into two categories: normal and corroded. Assuming that the normal subset in sample set D is D1 and the corroded subset is D2, the Gini coefficient calculation formula of sample set D is as follows:

[0139]

[0140] Among them, |D1|, |D2| and |D| represent the number of samples in D, D1 and D2 respectively. If the Gini coefficient is less than the threshold, the current node stops recursion;

[0141] Step 3: Calculate the Gini coefficient of each partition point of each feature of the current node for the sample set D. The calculation method is as follows:

[0142] Arrange the feature values ​​of each sample in the sample set D from small to large according to feature F, f1, f2, f3, ..., f |D| , each dividing point of feature F is the average value of two adjacent eigenvalues. If the dividing point T i The sample set D is divided into two subsets D′ and D″ as the boundary, then the partition point T for feature F i The Gini coefficient calculation formula is:

[0143]

[0144] The calculation formula of the Gini coefficient of subsets D′ and D″ is the same as the calculation method of the Gini coefficient shown in formula (9).

[0145] Step 4: Select the feature with the smallest Gini coefficient and the corresponding partition point from the calculated Gini coefficients of each feature and each partition point for the sample set D. Then divide the sample set D into two subsets based on the selected features and partition points, and create two new child nodes;

[0146] Step 5: Recursively call steps 1 to 4 for the two new child nodes created in step 4 until the recursive stop condition is met.

[0147] When a decision tree makes classification predictions, it uses the features and partition points selected by each node of the decision tree to divide the samples to be classified into a certain terminal node, and then takes the category with the largest number in the subset of training samples that fall into this node during the training process as the predicted category of the sample to be classified.

[0148] The training process of random forest is as follows:

[0149] Step 1: Select a certain number of samples from the training sample set by random sampling with replacement;

[0150] Step 2: Randomly select N features from all features and use these features to build a decision tree for the selected samples;

[0151] Step 3: Repeat the above two steps until M is generated tree decision trees to form a random forest.

[0152] In this embodiment, the corrosion damage area segmentation is performed by using random forest for classification prediction. Each decision tree in the random forest is used for classification prediction in turn, and then the voting result of the classification prediction of the decision tree is used as the classification prediction result of the random forest. Figure 5 shown. Figure 5 middle, Figure 5 (a) is the approximate area of ​​the corrosion damage manually circled with a box. It can be seen that there is an obvious brightness uneven field in the original digital ray image, and the contrast between the corrosion damage and the background is not very obvious; Figure 5 (b) is the effect picture after correction using the brightness non-uniform field correction method. It can be seen that this method significantly corrects the uneven background brightness and increases the brightness contrast between the damaged area and the background area. Figure 5 The area surrounded by red lines in (c) is the segmented corrosion damage area.

[0153] 4) According to the detection results of the reference ball and the segmentation results of the corrosion damage, the corrosion damage depth and area are calculated for the collected digital image;

[0154] 4.1 Calculation of corrosion damage depth;

[0155] In digital radiographic images, the thicker the object is, the smaller the grayscale value of the corresponding area in the image is, and the brighter it is in the image. It is generally believed that corrosion will cause the thickness of the object to become thinner, so corrosion appears as abnormally bright local areas in the image. The depth of corrosion damage can be calculated by converting the grayscale value.

[0156] Step 1: Calculate the minimum grayscale value of the reference ball area in the reference ball detection result We believe that the minimum grayscale value of the reference ball area corresponds to the diameter of the reference ball. In practical applications, the actual diameter of the reference ball d bell known;

[0157] Step 2: Based on the corrosion damage segmentation results, calculate the grayscale mean of the non-damaged area around the corrosion damage and will As the gray value that the photographed object should have when it is not damaged;

[0158] Step 3: Based on the corrosion damage segmentation results, the corrosion depth of the corresponding area is calculated pixel by pixel. Assume that the gray value of the i-th pixel in the corrosion area is g i , the corrosion depth of the area corresponding to the pixel

[0159] Step 4: Perform basic analysis of the corrosion depth based on the corrosion depth corresponding to the corrosion area pixels calculated in the third step, including calculating the minimum, maximum, and mean of the corrosion depth and calculating the histogram of the corrosion depth. The calculation process of the corrosion depth histogram is consistent with the above-mentioned grayscale histogram calculation process.

[0160] 4.2 Calculation of corrosion damage area;

[0161] According to the detection results of the reference sphere, the number of pixels occupied by the reference sphere in the digital radiographic image can be obtained. Since the actual diameter of the reference sphere is known, the area of ​​the maximum cross section of the reference sphere is also known. We believe that the maximum cross section of the reference sphere corresponds to the reference sphere detected in the digital radiographic image. In addition, according to the corrosion damage segmentation results, the number of pixels occupied by the corrosion damage in the digital radiographic image can be obtained, and based on this, the corrosion damage area can be converted proportionally.

[0162] The calculation process of corrosion damage area is as follows:

[0163] Step 1: According to the actual diameter d of the reference ball ball , calculate the actual area of ​​the maximum cross section of the reference ball as

[0164] Step 2: According to the detection results of the reference balls, count the number of pixels N occupied by the reference balls in the digital radiographic image. ball ;

[0165] Step 3: According to the corrosion damage segmentation results, count the number of pixels N occupied by corrosion damage in the digital radiographic image erosion ;

[0166] Step 4: Calculate the corrosion damage area

[0167] It should be understood that those skilled in the art can make improvements or changes based on the above description, and all these improvements and changes should fall within the scope of protection of the appended claims of the present invention.

Claims

1. A rapid assessment method for ship corrosion based on image recognition, characterized in that: The following steps are involved: 1) Performing edge detection on the collected corrosion digital image to be evaluated; the corrosion digital image is a digital radiographic image obtained by a ship corrosion detection device during non-destructive testing; 2) Fit a circle to the edge points as a reference ball; 3) Segmentation of corrosion damage; The basic process of corrosion damage area segmentation is: first, the interference caused by the uneven brightness field is reduced by correcting the uneven brightness field; then, the features are extracted pixel by pixel; Finally, the pixels are classified according to the extracted features to achieve the segmentation of the corrosion damage area; 4) According to the detection results of the reference ball and the segmentation results of the corrosion damage, the corrosion damage depth and area are calculated for the collected digital image; The number of pixels occupied by the reference ball in the digital radiographic image is obtained, and the actual corrosion position, area and thickness are obtained according to the area and diameter of the reference ball.

2. The method for rapid assessment of ship corrosion based on image recognition according to claim 1 is characterized in that: The step 2) is specifically as follows: 2.1) Randomly sample edge points and use the sampled points to fit a circle; 2.2) Classify all edge points into outer points and inner points according to the fitted circle; 2.3) Set a threshold. If the distance between an outer point and the fitted circle is less than the preset threshold, the outer point is considered to be an inner point. Traverse all edge points in the edge detection result graph to obtain an updated set of inner points. 2.4) Refit the circular edge according to the latest set of interior points; 2.5) Repeat steps 2.2) to 2.4) until the fitted circle no longer changes, and obtain the final fitted circle; count the number of its inner points and outer points.

3. The method for rapid assessment of ship corrosion based on image recognition according to claim 1 is characterized in that: The step 3) is specifically as follows: 3.1) Before segmentation, the image is first corrected for uneven brightness and the uneven background brightness is filtered out; 3.2) Extract features; 3.3) Classify pixels according to features to achieve segmentation of the corrosion area.

4. The method for rapid assessment of ship corrosion based on image recognition according to claim 3 is characterized in that: The step 3.1) is specifically as follows: The brightness non-uniform field correction includes the following steps: brightness field calculation and brightness correction; 3.1.1) Luminance field calculation Obtaining a grayscale image of a digital ray image, and then performing erosion and dilation operations on the grayscale image, wherein the grayscale image after the dilation operation reflects the overall change trend of the brightness in the digital ray image; The brightness field is represented as the background grayscale image of the brightness in the digital ray image. The background grayscale image is calculated by the morphological transformation of the image. The specific process includes the erosion of the grayscale image and the expansion of the grayscale image. The erosion process of the grayscale image is as follows; Define a structural element of a set shape; The center of the structural element is placed at a certain pixel position in the grayscale image, and the grayscale value of each pixel position is marked in the grayscale image; Assign the minimum grayscale value within the coverage of the structural element to the pixel at the center of the structural element; Repeat the above process until all pixels are traversed to obtain the grayscale image after the corrosion operation; The expansion process of the grayscale image is as follows: Define a structural element of a certain shape; The center of the structural element is placed at a certain pixel position in the grayscale image, and the grayscale value of each pixel position is marked in the grayscale image; Assign the maximum grayscale value within the coverage of the structural element to the pixel at the center of the structural element; Repeat the above process until all pixels are traversed to obtain the grayscale image after the dilation operation; 3.1.2) Brightness Correction That is, brightness correction is performed by subtracting the original image from the background grayscale image.

5. The method for rapid assessment of ship corrosion based on image recognition according to claim 1 is characterized in that: The step 3.2) is specifically as follows: The corrosion area is segmented by classifying pixels one by one. The pixel features based on which the pixel classification is performed are divided into two parts: one is the global feature and the other is the local feature. The global feature used is the grayscale histogram of the approximate area of ​​corrosion damage circled manually in the digital radiographic image; The local feature is the mean value of the pixel grayscale value in the local area with the pixel as the center and the manually set threshold as the radius.

6. The method for rapid assessment of ship corrosion based on image recognition according to claim 5 is characterized in that: The calculation process of the grayscale histogram is as follows: Step 1: Divide the grayscale into K intervals; Step 2: Traverse all pixels in the roughly circled corrosion damage area and count the number of pixels whose grayscale values ​​fall into each grayscale interval. Assume that the number of pixels falling into the kth grayscale interval is n. k ; Step 3: Calculate the proportion of pixel grayscale values ​​in each grayscale interval in the roughly circled corrosion damage area. Assume that the total number of pixels in the roughly circled corrosion damage area is N. pixel , then the proportion of pixels in the kth grayscale interval is Array {p1,p2,p3,…,p K }That is, the grayscale histogram of the approximate area of ​​corrosion damage.

7. The method for rapid assessment of ship corrosion based on image recognition according to claim 1 is characterized in that: In step 4), the corrosion damage depth is calculated as follows: Step 1: Calculate the minimum grayscale value of the reference ball area in the reference ball detection result The minimum gray value of the reference ball area corresponds to the diameter of the reference ball. The actual diameter of the reference ball is d ball ; Step 2: Based on the corrosion damage segmentation results, calculate the grayscale mean of the non-damaged area around the corrosion damage and will As the gray value that the photographed object should have when it is not damaged; Step 3: Based on the corrosion damage segmentation results, the corrosion depth of the corresponding area is calculated pixel by pixel; assuming that the gray value of the i-th pixel in the corrosion area is g i , the corrosion depth of the area corresponding to the pixel Step 4: Perform basic analysis of the corrosion depth based on the corrosion depth corresponding to the corrosion area pixels calculated in the third step, calculate the minimum, maximum, and mean of the corrosion depth, and calculate the histogram of the corrosion depth.

8. The method for rapid assessment of ship corrosion based on image recognition according to claim 1 is characterized in that: In the step 4), the corrosion damage area is calculated; The calculation process of corrosion damage area is as follows: Step 1: According to the actual diameter d of the reference ball ball , calculate the actual area of ​​the maximum cross section of the reference ball as Step 2: According to the detection results of the reference balls, count the number of pixels N occupied by the reference balls in the digital radiographic image. ball ; Step 3: According to the corrosion damage segmentation results, count the number of pixels N occupied by corrosion damage in the digital radiographic image erosion ; Step 4: Calculate the corrosion damage area 9. An electronic device, characterized in that: include: one or more processors; as well as a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors are caused to perform the method according to any one of claims 1 to 8.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Method for recognizing position of spherical object based on contour

    CN106446894A

  • On-line monitoring IED system for transformer substation insulation equipment

    CN114092430A

  • Screen printing defect detection method and device based on image analysis

    CN115439476A

  • Method and apparatus for scanning corrosion and surface defects

    CN1761871A

  • Corrosion monitoring sensor, corrosion depth calculation system, and metal corrosion speed calculation system

    JP2015180856A

Cited By

  • Electronic device reference point detection method and device and readable storage medium

    CN121526989A

  • A reference point detection method and device for an electronic device and a readable storage medium

    CN121526989B

  • A device surface corrosion identification method and system based on visual analysis

    CN122814614A