Steel bar corrosion degree detection method based on quantum image processing algorithm
Through the combination of quantum image processing algorithm and convolutional neural network, the problems of low efficiency and high cost of traditional steel bar corrosion detection are solved, and efficient and accurate detection of steel bar corrosion degree is achieved.
Patent Information
- Application Number
- CN202510586078.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-08
- Publication Date
- 2025-08-08
AI Technical Summary
Traditional steel bar corrosion detection methods are inefficient, costly, and strong subjective, and the accuracy of feature extraction in complex environments is reduced, making it difficult to meet the needs of large-scale inspections in construction projects.
The method based on quantum image processing algorithm is adopted, including grayscale, median filtering and noise reduction, morphological processing, Otsu threshold segmentation and convolutional neural network, to construct a multidimensional feature set and detect the degree of reinforcement corrosion through the quantum image model and CNN model.
It improves image processing effect and feature extraction accuracy, significantly improves detection efficiency and classification accuracy, adapts to complex environments, and reduces detection costs.
Smart Images

Figure CN120451119A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of engineering detection, and in particular to a method for detecting the degree of steel bar corrosion based on a quantum image processing algorithm. Background Art
[0002] Rebar corrosion detection technology has undergone technological iterations since the mid-20th century: in the early days, it relied on manual tapping, crack observation and other means, which were inefficient and highly subjective; in the mid-term, electrochemical methods such as the half-cell potential method were used to achieve semi-quantitative analysis, but contact measurement was destructive; in the later period, non-destructive testing technologies such as ultrasound and X-rays were used to improve non-destructive capabilities, but still faced problems such as high equipment costs and large environmental interference; traditional manual inspection has long had defects such as low efficiency, high cost, and strong subjectivity.
[0003] In the construction industry, steel bar corrosion detection has long faced technical bottlenecks. Traditional manual inspections rely on visual judgment and require point-by-point inspections in large-scale projects (such as cross-sea bridges and underground tunnels). Each operation can take over eight hours. Furthermore, accessibility to densely packed rebar mesh and hidden locations (such as inside box girders) is poor, resulting in a missed detection rate of up to 30%. While classic image processing technology has achieved partial automation, it performs poorly in complex scenarios. Physical measurement methods (such as electrochemical testing) require drilling and sampling, damaging the concrete cover and increasing repair costs by two to three times. Ultrasonic testing covers less than 60% of arch structures.
[0004] In industry practice, infrastructure health monitoring urgently needs to overcome three major contradictions: the contradiction between detection efficiency and accuracy (traditional methods are less than 1 frame / minute, while CNN single-frame processing takes 2 seconds), insufficient environmental adaptability (feature extraction accuracy drops by more than 40% in salt spray / high temperature environments), and the contradiction between economy and safety (the cost of manual inspection per time is greater than ¥5,000 and road closures are required for construction). Summary of the Invention
[0005] In order to overcome the above problems existing in the prior art, the present invention proposes a method for detecting the degree of steel bar corrosion based on a quantum image processing algorithm.
[0006] The technical solution adopted by the present invention to solve the technical problem is: a method for detecting the degree of steel bar corrosion based on a quantum image processing algorithm, comprising the following steps: Step 1: collect steel bar corrosion images and perform grayscale conversion and median filtering noise reduction on the images; Step 2: construct a quantum image model and perform morphological processing on the image obtained in step 1; Step 3: Perform Otsu threshold segmentation on the image obtained in step 2 based on the PES algorithm; Step 4: Integrate the grayscale histogram and the three-level wavelet decomposition energy of the image obtained in step 3 to construct a multidimensional feature set, standardize the preprocessing and focus on the three-level decomposition, discard redundant position data, and extract features of the quantum image based on the positive exponential relationship between image information entropy and thickness loss; Step 5: Repeat steps 1-4 to obtain a steel bar corrosion degree prediction dataset, and train a convolutional neural network using the steel bar corrosion degree prediction dataset to obtain a convolutional neural network for diagnosing steel bar corrosion types. In step 6, the steel bar corrosion image is collected, and steps 1-4 are repeated. The extracted features are input into the convolutional neural network obtained in step 5 to obtain the degree of steel bar corrosion.
[0007] The above-mentioned method for detecting the degree of steel corrosion based on a quantum image processing algorithm, the grayscale processing in step 1 is specifically as follows: converting the input image from the RGB color space to the linear YPQ color space, using the Gaussian pairing method to sample the color differences between paired pixels in the color image, calculating the color difference of each pair of pixels, and inputting the color difference into the Gaussian kernel function, performing weighted summation on all difference values to generate a probability distribution, and by analyzing the probability distribution, obtaining a brief introduction to the image structure characteristics and color information, and constructing the color contrast between pixel pairs, calculating the contrast loss rate of the color contrast in the PQ color dimension, combining the color data with the contrast loss rate, mapping them to the main color contrast axis, and extracting the color data value; and weightedly fusing the color information and the brightness information ratio to generate a grayscale result.
[0008] The above-mentioned method for detecting the degree of steel corrosion based on quantum image processing algorithm, the median filter noise reduction process in step 1 is specifically as follows: using a size of The window traverses the image pixels, starting from the upper left corner of the image, and moves the window row by row and column by column to ensure that each pixel is covered once by the window. For image edge pixels where the window may exceed the image boundary, the excess part is filled using the filling method; the grayscale values of the pixels in the window are extracted and sorted in order of size to obtain an ordered grayscale value sequence, the median is calculated, and the grayscale value of the pixel in the center of the window is replaced by the calculated median; the above steps are repeated until all pixels of the image are traversed; The median calculation formula is: Indicates the pixel value in the middle position after grayscale value sorting; is the grayscale value of the pixel at the center position; Indicates the size of the selected window; Represents the relative coordinates of each pixel in the neighborhood of the central pixel; is the grayscale value of each pixel.
[0009] The above-mentioned method for detecting the degree of steel corrosion based on quantum image processing algorithm, the morphological processing of step 2 is specifically as follows: using expansion and corrosion operations to find local extreme values to process the grayscale image: The dilation operation is defined as when the center point of the structuring element is Time and The pixels in the images of the overlapping area are added The maximum value after the value at the corresponding position in the formula is: in, express area, Represents a non-flat structuring element The origin symmetry transformation of and Increment by all desired values so that The midpoint of can access every pixel in the original image F; For the original image The corrosion operation is defined as: and Subtract pixels from overlapping areas The minimum value after the corresponding value in is assigned to the center pixel. The formula is as follows: in, Represents a non-flat structuring element The origin symmetry transformation, express area.
[0010] The above-mentioned method for detecting the degree of steel corrosion based on quantum image processing algorithm, the step 3 is specifically: Segment the image, is the number of pixels in the entire image, The gray level is The number of pixels, is the ratio of the total number of pixels; the probability distribution of the image after filtering, denoising and morphological processing is: , , in, Indicates grayscale; The definition of multi-threshold segmentation is: The maximum inter-class variance function f(t) of multiple thresholds is: Among them The function is calculated as follows: Among them Average gray level of the part , the average gray level of the entire image , and Pixel probability of class The fitness function is calculated as follows: ; The threshold selection is optimized by the PES algorithm to find the threshold that maximizes the fitness value.
[0011] The beneficial effects of the present invention are as follows: (1) The present invention improves the image processing effect and makes the image clearer. The image grayscale processing combines color contrast and brightness information, and more intuitively shows the contrast between the corroded area and the normal area of the steel bar in the image. The adaptive median filter not only effectively reduces noise but also intelligently retains key edge details, thereby avoiding the image edge blurring problem that may be caused by traditional filtering methods, thereby ensuring the clarity and detail integrity of the image.
[0012] (2) The quantum algorithm and morphological processing of the present invention improve the efficiency and accuracy of image feature extraction. By establishing a quantum image model (such as NEQR) and utilizing the parallel computing power and quantum superposition characteristics of quantum, it has a stronger feature differentiation ability than the traditional wavelet transform and can efficiently process large-scale data and complex images. Morphological processing uses corrosion and expansion operations to find local extreme values to achieve corresponding operations, thus well adapting to image segmentation under uneven lighting conditions, and further helping to improve image processing efficiency.
[0013] (3) The present invention improves classification efficiency. The constructed convolutional neural network model integrates these steel bar corrosion features through multiple convolutional layers and pooling layers, and uses a fully connected layer to map them to different corrosion type categories. Ultimately, a CNN model is trained to accurately identify and classify steel bar corrosion types, significantly improving the classification accuracy and reliability of steel bar corrosion levels and significantly increasing classification efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 It is a schematic diagram of the process of the present invention; Figure 2 This is a flow chart of image grayscale image processing according to the present invention; Figure 3 is the grayscale histogram of the corroded steel bar image of the present invention; Figure 4 It is the convolutional neural network image processing architecture of the present invention. DETAILED DESCRIPTION
[0015] In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0016] like Figure 1 As shown, this embodiment discloses a method for detecting the degree of steel corrosion based on a quantum image processing algorithm. Based on an image recognition algorithm, the collected steel images are grayscaled, subjected to median filtering for noise reduction, and subjected to morphological processing. Image feature data is quantum-encoded using quantum bit encoding, and a NEQR quantum image model is constructed. The preprocessed classical image is converted into a quantum image. The quantum method leverages the parallel nature of quantum computing to process the quantum superposition pixels of the input image, thereby improving the algorithm's processing speed. The processed image is then processed using the Otsu threshold segmentation algorithm to maximize the inter-class variance and enhance the contrast between foreground and background. The PES algorithm is first used to optimize threshold selection through a layering, promotion, and division of labor mechanism, improving the efficiency of the Otsu optimization search. This method significantly enhances image contrast, clarity, and detail, resulting in a clearer visual effect. Feature extraction is performed on the segmented images: First, the grayscale histogram and three-level wavelet decomposition energy are integrated, and the strong regularity of the three-level horizontal, vertical, and diagonal energy is exploited to construct a multidimensional feature set to enhance corrosion differentiation. Second, standardized preprocessing and focusing on the three-level decomposition discard redundant low-dimensional data, simplifying the calculation process. Finally, based on the positive exponential relationship between image information entropy and thickness loss, a lightweight assessment model is developed. Inputting a corrosion image generates real-time output of the weight loss rate. Using the extracted image feature data, a convolutional neural network (CNN) is used to construct and train a deep learning model, achieving automatic recognition and classification of rebar corrosion types.
[0017] The technical route implementation plan is as follows: 1. Grayscale processing. For the collected classic image, the grayscale information of the image is extracted, and the brightness changes of the object surface are reflected by the grayscale value. This patent adopts a grayscale technology that can map color information to the brightness channel and enhance the contrast. First, the input image is converted from the RGB color space to the linear YPQ color space. The Gaussian pairing method is used to sample the color difference between paired pixels in the color image. The color difference of each pair of pixels is calculated, and the color information and brightness information are weighted and fused in a specific ratio to generate a grayscale result.
[0018] To simplify the image processing process and reduce computing resource consumption, the steel bar corrosion image is first grayscaled. This method can effectively extract the grayscale information of the image and reflect the brightness changes of the object surface through grayscale values, making subsequent image analysis and processing more convenient. In order to obtain a grayscale image with a contrast closer to the original color image, a grayscale conversion technique is used that maps color information to the brightness channel and enhances the contrast. First, the input image is converted from the RGB color space to the linear YPQ color space according to the following formula: in represents the brightness channel, Represents the yellow-blue color opposition color channel, Represents the red-green color opposition channel. and Determine the hue and saturation.
[0019] Using the Gaussian pairing method, the color differences between pairs of pixels in a color image are sampled, the color difference of each pair of pixels is calculated, these difference values are input into the Gaussian kernel function, and all difference values are weighted summed to generate a probability distribution. By analyzing this probability distribution, important insights into the structural characteristics and color information of the image can be obtained and the color contrast between pixel pairs can be constructed. : Calculate color contrast in Contrast loss rate in color dimension and , and the color data and Compared with the loss rate and Combined with the color contrast information and mapped to the main color contrast axis, the main color data values are extracted. Then, the color information and brightness information are weighted and fused in a specific ratio to generate a grayscale result. In order to solve the unnatural phenomena that may appear in the edge area of the steel bar corrosion image, it is necessary to dynamically adjust the color saturation and chromaticity information to ensure that the grayscale result image is within an acceptable distortion range. This algorithm better preserves the contrast characteristics of the steel bar corrosion image by linearly combining the sampled color contrast information with the brightness channel information. In the final grayscale image, the grayscale value of each pixel represents the brightness level of the point, and the high and low grayscale values reflect the brightness difference between the point and the surrounding pixels. The grayscale image can more clearly show the grayscale contrast between the steel bar corrosion area and the normal area, which helps to more accurately analyze and evaluate the degree of steel bar corrosion.
[0020] Median filtering for noise reduction. This patent uses a square window to traverse the image pixels, starting from the upper left corner of the image and moving the window row by row and column by column. For pixels at the edge of the image, the excess is filled using a padding method. The grayscale values are sorted from small to large (or large to small) to obtain an ordered sequence of grayscale values. The median is calculated and the calculated median is used to replace the grayscale value of the pixel at the center of the window. The above steps are repeated until all pixels are processed and the denoised image is output.
[0021] Median filtering is a nonlinear filtering method that removes noise by replacing the current pixel value with the median value of its neighborhood. Its main purpose is to remove noise from an image while preserving edges and details as much as possible.
[0022] The specific algorithm steps are as follows: Select a size The window (usually is an odd number, such as 、 The window size determines the filtering range, and this patent uses a square window.
[0023] Traverse the image pixels, starting from the upper left corner of the image, and move the window row by row and column by column to ensure that each pixel is covered by the window once. For pixels at the edge of the image, the window may exceed the image boundary. In this case, a padding method is required, that is, filling the excess part with a fixed value, a mirrored pixel value, or a boundary pixel value.
[0024] Extract the grayscale values of the pixels in the window and sort them in order from small to large (or from large to small) to obtain an ordered grayscale value sequence.
[0025] Finally, the median is calculated using the following formula: Indicates the pixel value in the middle position after grayscale value sorting; is the grayscale value of the pixel at the center position; Indicates the size of the selected window; Represents the relative coordinates of each pixel in the neighborhood of the central pixel; is the grayscale value of each pixel. Replace the grayscale value of the pixel at the center of the window with the calculated median value, and repeat the above steps until all pixels in the image have been traversed. After all pixels have been processed, the denoised image is output.
[0026] By performing median filtering on the image to reduce noise, random noise such as salt and pepper noise and pepper noise can be effectively eliminated, and the clarity of the image can be improved.
[0027] 3. Image morphological processing. Figure 2 As shown in the figure, in the processed grayscale image, the structuring element is shifted downward through a top-hat transformation, an opening operation is performed, and the image after the opening operation is subtracted from the original image to remove the background. Similarly, the structuring element is shifted upward through a bottom-hat transformation, a closing operation is performed, and the image after the opening operation is subtracted from the original image to remove the background. Although morphological operations can eliminate uneven illumination in an image, classical image processing requires individual processing of each pixel, which consumes a significant amount of computational time when the image is large. Therefore, a quantum image segmentation algorithm based on grayscale morphological theory is proposed to address the computational efficiency issues of classical methods when processing large images. The quantum method exploits the parallel nature of quantum computing to process the quantum superposition state pixels of the input image, thereby improving the algorithm's processing speed. Furthermore, by designing a small number of quantum bits and quantum gates and carefully designing several specific quantum circuit units, including dilation, erosion, and top-hat transformation, these units can be used to construct a complete quantum circuit, effectively segmenting NEQR images.
[0028] A NEQR quantum image model is constructed, converting the previously processed classical image into a quantum image. Quantum methods exploit the parallel nature of quantum computing to process the quantum superposition pixels of the input image. A top-hat transformation is performed by shifting the structuring element downward, performing an opening operation. The image after the opening operation is then subtracted from the original image to remove the background. Similarly, a bottom-hat transformation is performed by shifting the structuring element upward, performing a closing operation, and then subtracting the original image to remove the background.
[0029] A classical image consists of a binary information system consisting of position coordinates and grayscale values. The NEQR (Novel Enhanced Quantum Representation) model uses three sets of entangled quantum bit sequences to construct a digital expression system. , grayscale level is The image system needs to be configured with two sets A sequence of bit quanta encodes spatial coordinates, a set The bit quantum sequence represents the grayscale value. The mathematical expression of this model is: in, represents the grayscale value of the quantum image, , represents the position of the quantum image, According to the NEQR specification, the classical-quantum image conversion process needs to allocate Quantum bit encoding coordinate positioning, The quantum bits store grayscale information. To implement morphological neighborhood operations, four auxiliary quantum registers are introduced to store the neighborhood pixel data covered by the structural elements, and the original image information is copied to a dedicated storage unit through quantum cloning technology. The quantum state of the system can be expressed as: A set of quantum image superposition states is generated through cyclic shift transformation operations, and the original image is quantum-shifted in the four axes of up, down, left, and right in the spatial domain and stored in an auxiliary register. After the processing is completed, a quantum copy of the original image is retained for iterative expansion and corrosion operations, thereby efficiently completing image morphological processing.
[0030] Grayscale morphological processing uses basic operations such as expansion and corrosion to find local extreme values to process grayscale images. The dilation operation can be defined as when the center point of the structural element is Time and The pixels in the images of the overlapping area are added The maximum value after the value at the corresponding position in . The formula is as follows: in, express area, Represents a non-flat structuring element The origin symmetry transformation. and Increment by all desired values so that The midpoint can be accessed Each pixel in. This paper uses a flat structural element to perform grayscale expansion operation. , the expansion operation is simplified to: in Represents a structural element, represents the original image, express The expansion operation is to find and The maximum value of the overlapping area is assigned to the center pixel of the overlapping area.
[0031] Similar to the dilation operation, The corrosion operation can be defined as: and Subtract pixels from overlapping areas The minimum value after the corresponding value in is assigned to the center pixel. The formula is as follows: in express The same flat structural element is used to perform grayscale corrosion operation. , the corrosion operation is simplified to; in represents the original image, Represents a structural element, express In this case, the erosion operation is to find and The minimum value of the overlapping area is assigned to the center pixel of the overlapping area.
[0032] 4. Otsu threshold segmentation based on the PES algorithm. Using Python, we construct a simple PES algorithm, introducing a clear hierarchy, promotion, and division of labor mechanism to find the optimal threshold. This optimal threshold is then fed into the Otsu algorithm, improving its efficiency in finding the optimal threshold. The image is then processed using the Otsu threshold segmentation method to enhance image contrast and clarity, highlighting features and details.
[0033] The image after morphological processing is then processed by the threshold segmentation algorithm, which can greatly improve the accuracy of image segmentation. The Otsu segmentation algorithm is mainly based on the grayscale characteristics of the image, using the threshold to segment the steel bar corrosion image. Split into two parts: target and background . Assume an image Can be divided into common Grayscale, As the threshold, the segmentation of the single threshold can be expressed by the following formula: Similarly, the multi-threshold segmentation can be inferred from the single-threshold segmentation idea, that is, the threshold To segment the image, set is the number of pixels in the entire image, The gray level is The number of pixels, is the ratio of the total number of pixels. The probability distribution of the image after filtering, noise reduction and morphological processing is as follows: , , Therefore, the definition of multi-threshold segmentation can be expressed as follows: Based on the above principles of single threshold and multi-threshold segmentation, quantification is performed. The definition of the maximum inter-class variance function of the multi-threshold can be expressed as follows: Among them The function is calculated as follows: Among them Average gray level of the part , the average gray level of the entire image , and Pixel probability of class The fitness function of the algorithm is calculated by the following formula: .
[0034] This function uses the number of thresholds as the solution dimension, and the function value is reflected as the fitness value. Finally, through the PES algorithm's layering, promotion, and division of labor mechanisms, it optimizes threshold selection to find the threshold that maximizes the fitness value. This overcomes the competition and collaboration shortcomings of traditional intelligent algorithms and improves the efficiency of Otsu's optimization. After processing images using this method, contrast, clarity, and detailed features are significantly enhanced, resulting in clearer visual effects.
[0035] 5. Quantum Image Feature Extraction. The grayscale histogram and three-level wavelet decomposition energy of the segmented image are integrated. The strong regularity of the three-level horizontal, vertical, and diagonal energy (R > 0.97) is utilized to construct a multidimensional feature set. This enhances corrosion discrimination, focuses on the three-level decomposition, discards redundant low-dimensional data, and simplifies the computational process. Based on the positive exponential relationship between image information entropy and thickness loss (R = 0.984), a lightweight assessment model is developed. Taking the corrosion image as input, it outputs real-time features such as weight loss rate, grayscale, texture, and spatial relationships.
[0036] Improve detection efficiency through multi-feature fusion and process optimization. First, the grayscale histogram and three-level wavelet decomposition energy are integrated, and the strong regularity of the three-level horizontal / vertical / diagonal energy is utilized to construct a multidimensional feature set to enhance corrosion discrimination. Second, standardized preprocessing and focusing on the three-level decomposition discard redundant low-dimensional data and simplify the calculation process. Finally, based on the positive exponential relationship between image information entropy and thickness loss, the weight loss rate can be output in real time by inputting the corrosion image. Combined with the error correction algorithm, it reduces reliance on physical measurements and provides efficient and high-precision technical support for the corrosion assessment of hidden structures.
[0037] Grayscale histogram is a basic image analysis tool that represents color features by quantifying grayscale frequency distribution. Figure 3 As shown, Figure 3The horizontal axis in the middle represents the grayscale, ranging from 0 (black) to 255 (white), covering all possible grayscale values of the image. The vertical axis represents the number of pixels or frequency corresponding to each grayscale level (the ratio of the number of pixels to the total number of pixels). Bars: Each grayscale level corresponds to a bar, and its height reflects the frequency of occurrence of pixels of that grayscale level in the image. The grayscale processing of the steel bar corrosion image obtains a grayscale image, in which the grayscale value of each pixel represents the brightness of the point, and the size of the grayscale value reflects the brightness difference between the point and the surrounding pixels. The grayscale image can better show the grayscale difference between the steel bar corrosion area and the normal area, which is convenient for analyzing and judging the corrosion condition of the steel bar. The horizontal axis is 0-255 grayscale, and the vertical axis corresponds to the probability of occurrence of the grayscale value. : Where: is the number of pixels, is the total number of pixels.
[0038] Figure 3 shows the feature extraction process: (a) the original image is cropped and normalized to 256×256 size; (b) the image is grayscaled; (c) median filtering is performed to denoise the image; (d) morphological processing is performed on the grayscale image; (e) the classical image is converted to a quantum image; (f) after threshold segmentation, the image feature values are finally extracted.
[0039] 6. Diagnosis of rebar corrosion types based on convolutional neural networks. Based on the feature data extracted previously, this patent uses a convolutional neural network (CNN)-based rebar corrosion diagnosis method to construct a CNN dataset for training and learning. 200 sets of data were collected. By training a deep learning model, the corrosion mass loss rate of rebar can be divided into five categories based on the mass loss rate: mild corrosion (0%-5%), moderate corrosion (5%-10%), heavy corrosion (10%-15%), severe corrosion (15%-20%), and extreme corrosion (above 20%), thus achieving automatic identification and classification of rebar corrosion types.
[0040] The steel bar corrosion diagnosis method based on convolutional neural network (CNN) can realize automatic identification and classification of steel bar corrosion types by building and training deep learning models. Figure 4As shown in the figure, the core components of a CNN include convolutional layers, pooling layers (also called sampling layers), and fully connected layers. The convolutional layer learns key features of the image by convolving the image with a convolution kernel. This process involves extracting features from a local area of the image and converting the convolution result into an output using an activation function. Each convolution kernel captures a specific feature of the image, which is then mapped into a feature map. In image recognition tasks, the convolution kernel slides across the image from left to right and top to bottom to extract features from the original image and generate a new feature layer. By adding certain nonlinear activation functions to enhance the model's expressive power, adjusting the size of the convolution kernel, and performing the convolution operation, CNN can learn local features without being restricted by image size, obtain activation values for different features, and thus complete the learning of the overall image features.
[0041] The pooling layer effectively reduces the spatial dimension of the image by dividing the feature map generated by the convolutional layer into several small areas, which facilitates subsequent convolution operations. This processing of the pooling layer not only significantly reduces the size of the feature map, but also retains the key features of the image, thereby accelerating the computational efficiency of the convolutional neural network and preventing the model from overfitting. In this embodiment, the convolutional neural networks used all use the maximum pooling method. Finally, based on the results of feature extraction, the fully connected layer can further implement the classification function.
[0042] Experimental results show that this method has high accuracy and reliability in diagnosing corrosion types, and provides a new technical means for steel bar corrosion detection.
[0043] The convolution calculation formula is: Among them Tier neurons to the Tier The linear coefficient of each neuron is expressed as Indicates; Tier The value and bias value of each neuron are used and Indicates; The number of neurons in the layer is m; the activation function is Represents. Common activation functions include ReLU function and softmax function. Among them, softmax function is prone to gradient disappearance phenomenon, while ReLU function can avoid this problem. Therefore, ReLU function is selected, and the specific expression is: In the forward propagation phase of the neural network, the input image data is processed in sequence through multiple convolutional layers, pooling layers, and fully connected layers to ultimately generate a prediction result. In the backpropagation phase, the system uses error backpropagation and gradient descent algorithms to update the weights and bias parameters of the convolutional layer based on the difference between the predicted result and the actual label. In specific operations, backpropagation uses the chain rule to transfer the error from the output layer to the front layer, gradually adjusting the weights and bias parameters of the convolutional layer, so that the output result of the model is closer to the true value and the error gradually decreases. The convolutional layer in the convolutional neural network can be expressed as the following formula: The input data tensor is , the tensor of the convolution kernel (weight) is , the bias term is , the tensor of the output data is used Indicates that the number of channels of the output data is represented by v, and the rows and columns of the convolution kernel are represented by and Indicates that the rows and columns of the output data are represented by and Indicates that the number of channels of input data is , and Represent the number of rows and columns of the convolution kernel respectively.
[0044] The convolutional layer applies multiple convolution kernels to extract local features of the image, capturing key information such as the texture, grayscale, and shape of the corroded area. These features are activated using a nonlinear activation function (ReLU) to generate a feature map. Next, the pooling layer downsamples the feature map to reduce the spatial dimension while retaining key features to improve computational efficiency and prevent overfitting. After multiple convolution and pooling operations, the high-level abstract features of the image are passed to the fully connected layer, which integrates these features and maps them to different corrosion type categories. During training, predictions are calculated through forward propagation, and a backpropagation algorithm is used to adjust network parameters based on the error between the predicted results and the true labels to optimize model performance. Ultimately, the trained CNN model can accurately identify and classify the corrosion types of rebar, providing a reliable basis for the health assessment and maintenance of engineering structures.
[0045] Finally, a CNN dataset was constructed for training and learning, and 200 sets of data were collected. These data divided the steel bar corrosion mass loss rate into five categories based on the mass loss rate: mild corrosion (0%-5%), moderate corrosion (5%-10%), heavy corrosion (10%-15%), severe corrosion (15%-20%) and extreme corrosion (more than 20%).
[0046] The above embodiments are merely exemplary embodiments of the present invention and are not intended to limit the present invention. Those skilled in the art may make various modifications or equivalent substitutions to the present invention within the spirit and scope of protection of the present invention, and such modifications or equivalent substitutions shall also be deemed to fall within the scope of protection of the present invention.
Claims
1. A method for detecting the degree of steel bar corrosion based on quantum image processing algorithm, characterized in that: The steps include: Step 1: collect steel bar corrosion images and perform grayscale conversion and median filtering noise reduction on the images; Step 2: construct a quantum image model and perform morphological processing on the image obtained in step 1; Step 3: Perform Otsu threshold segmentation on the image obtained in step 2 based on the PES algorithm; Step 4: Integrate the grayscale histogram and the three-level wavelet decomposition energy of the image obtained in step 3 to construct a multidimensional feature set, standardize the preprocessing and focus on the three-level decomposition, discard redundant position data, and extract features from the quantum image based on the positive exponential relationship between image information entropy and thickness loss; Step 5: Repeat steps 1-4 to obtain a steel bar corrosion degree prediction dataset, and train a convolutional neural network using the steel bar corrosion degree prediction dataset to obtain a convolutional neural network for diagnosing steel bar corrosion types. In step 6, the steel bar corrosion image is collected, and steps 1-4 are repeated. The extracted features are input into the convolutional neural network obtained in step 5 to obtain the degree of steel bar corrosion.
2. The method for detecting steel bar corrosion degree based on quantum image processing algorithm according to claim 1, characterized in that: The grayscale processing in step 1 is specifically as follows: converting the input image from the RGB color space to the linear YPQ color space, sampling the color differences between paired pixels in the color image using the Gaussian pairing method, calculating the color difference of each pair of pixels, and inputting the color difference into the Gaussian kernel function, performing weighted summation on all difference values to generate a probability distribution, obtaining a brief introduction to the image structure features and color information by analyzing the probability distribution, constructing the color contrast between pixel pairs, calculating the contrast loss rate of the color contrast in the PQ color dimension, combining the color data with the contrast loss rate, mapping them to the main color contrast axis, and extracting the color data value; and weightedly fusing the color information and the brightness information ratio to generate a grayscale result.
3. The method for detecting steel bar corrosion degree based on quantum image processing algorithm according to claim 1, characterized in that: The median filter noise reduction process in step 1 is specifically as follows: The window traverses the image pixels, starting from the upper left corner of the image, and moves the window row by row and column by column to ensure that each pixel is covered once by the window. For image edge pixels where the window may exceed the image boundary, the excess part is filled using the filling method; the grayscale values of the pixels in the window are extracted and sorted in order of size to obtain an ordered grayscale value sequence, the median is calculated, and the grayscale value of the pixel in the center of the window is replaced by the calculated median; the above steps are repeated until all pixels of the image are traversed; The median calculation formula is: Indicates the pixel value in the middle position after grayscale value sorting; is the grayscale value of the pixel at the center position; Indicates the size of the selected window; Represents the relative coordinates of each pixel in the neighborhood of the central pixel; is the grayscale value of each pixel.
4. The method for detecting steel bar corrosion degree based on quantum image processing algorithm according to claim 1, characterized in that: The morphological processing of step 2 is specifically as follows: using dilation and erosion operations to find local extreme values to process the grayscale image: The dilation operation is defined as when the center point of the structuring element is Time and The pixels in the images of the overlapping area are added The maximum value after the value at the corresponding position in the formula is: in, express area, Represents a non-flat structuring element The origin symmetry transformation of and Increment by all desired values so that The midpoint of can access every pixel in the original image F; For the original image The corrosion operation is defined as: and Subtract pixels from overlapping areas The minimum value after the corresponding value in is assigned to the center pixel. The formula is as follows: in, Represents a non-flat structuring element The origin symmetry transformation, express area.
5. The method for detecting steel bar corrosion degree based on quantum image processing algorithm according to claim 1, characterized in that: The step 3 is specifically as follows: Segment the image, is the number of pixels in the entire image, The gray level is The number of pixels, is the ratio of the total number of pixels, ; The probability distribution of the image after filtering, denoising and morphological processing is: , , in, Indicates grayscale; The definition of multi-threshold segmentation is: The maximum inter-class variance function f(t) of multiple thresholds is: Among them The function is calculated as follows: Among them Average gray level of the part , the average gray level of the entire image , and Pixel probability of class The fitness function is calculated as follows: ; The PES algorithm is used to optimize the threshold selection and find the threshold that maximizes the fitness value.
Citation Information
Cited By
Unmanned aerial vehicle power distribution network equipment identification method based on mutual neighbor density peak clustering
CN121010786A
A method for identifying UAV power distribution network equipment based on neighbor-to-neighbor density peak clustering
CN121010786B