Corrosion type detection method based on electrochemical noise and convolutional neural network

Feature extraction and classification of electrochemical noise signals through convolutional neural networks solves the problem of imperfect electrochemical noise data analysis in the existing technology and improves the accuracy and stability of corrosion type detection.

CN118690252APending Publication Date: 2024-09-24TIANJIN PORT ENG INST LTD OF CCCC FIRST HARBOR ENG +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411162712.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-23
Publication Date
2024-09-24

Smart Images

  • Figure CN118690252A
    Figure CN118690252A
Patent Text Reader

Abstract

The invention relates to a corrosion type detection method based on electrochemical noise and a convolutional neural network, and the method comprises the steps: obtaining a to-be-detected sequence sample of an electrochemical noise signal in metal, carrying out the minimum-maximum normalization of the to-be-detected sequence sample, and obtaining the normalized to-be-detected sequence sample; the normalized sequence sample to be detected is input into a CNN model, the metal corrosion type is output, the CNN model is obtained through training of a training set, the training set comprises sequence sample data and labels marking the corrosion type, and the CNN model adjusts a two-dimensional convolution kernel into a one-dimensional convolution kernel in feature extraction. According to the method, the feature vectors do not need to be manually extracted from the original data and then classified, the established model is simple and direct, and the prediction precision is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of corrosion type detection, and in particular to a corrosion type detection method based on electrochemical noise and convolutional neural network. Background Art

[0002] Metal materials with excellent strength and toughness, excellent electrical and thermal conductivity, good plasticity and machinability play an irreplaceable role in many fields such as aerospace, energy, chemical industry, and construction. However, the inevitable corrosion of metal materials will lead to deterioration, which will seriously affect their functional applications and bring social consequences such as equipment damage, various catastrophic accidents, and environmental pollution. Therefore, identifying and monitoring different types of corrosion can determine the degree of damage to materials caused by corrosion types, further understand the corrosion mechanism, and guide the formulation and application of corrosion prevention and control measures.

[0003] In order to conduct real-time, quantitative and accurate detection and analysis of the corrosion conditions on the surfaces of materials such as industrial equipment and building structures to ensure the safe operation of the equipment and extend its service life, various corrosion monitoring methods have been continuously developed. Common corrosion monitoring methods can be divided into several categories according to the monitoring principle and the type of measurement signal, such as electrochemical method, weight loss method, and non-destructive testing method. Among them, the electrochemical method uses electrochemical reactions to monitor the corrosion process, and electrochemical noise is one of the electrochemical methods. It is a non-destructive, online corrosion monitoring method. When metal materials come into contact with the outside world, various reactions will occur, resulting in different electrochemical noise signals. Therefore, by analyzing the characteristics of the electrochemical noise signal, the corrosion state of the metal surface can be monitored in real time. The electrochemical noise test is simple and convenient for on-site monitoring, but there is still a lack of a unified theoretical framework for electrochemical noise data analysis, which is a key factor limiting its development and application in corrosive environments.

[0004] At present, electrochemical noise data analysis is still in the research stage, and various analysis methods have been proposed and used to study the corrosion process. With the help of various data analysis methods, a variety of characteristic parameters that are intrinsically related to corrosion are extracted. These parameters are very suitable for processing by automated means. Therefore, machine learning, pattern recognition and other methods are introduced into electrochemical noise data processing for the identification of corrosion types. According to experimental results, various algorithms such as cluster analysis, linear discrimination, and neural networks have high accuracy in distinguishing corrosion types, but the method of combining machine learning with electrochemical noise is not yet perfect, and the accuracy and stability of corrosion detection need to be improved.

[0005] Based on this situation, the present invention combines electrochemical noise with convolutional neural network (CNN) to propose a corrosion type detection method based on electrochemical noise and convolutional neural network. According to the electrochemical noise test, the method divides the time series from the original measurement data of electrochemical noise voltage and current, and then uses CNN to automatically extract local features and global features from the time series, and classifies them. The trained model can realize the prediction of corrosion type. Summary of the invention

[0006] The present invention proposes a corrosion type detection method based on electrochemical noise and convolutional neural network, which is used to monitor the type of corrosion of metal materials in real time and take targeted anti-corrosion measures in time. The method divides the time series from the original measurement data of the electrochemical noise voltage and current of the corrosive solution, gradually extracts the local features and global features in the time series samples with the help of the convolution layer in the CNN, and then classifies them according to the highly generalized global features with the fully connected layer in the CNN. The results show that the present invention does not need to manually extract feature vectors from the original data for classification, and the established model is simple and direct, and the prediction accuracy is high.

[0007] To achieve the above object, the present invention provides the following solutions: A corrosion type detection method based on electrochemical noise and convolutional neural network, comprising: Acquire a sequence sample to be detected of an electrochemical noise signal in a metal, perform minimum-maximum normalization on the sequence sample to be detected, and acquire the normalized sequence sample to be detected; The normalized sequence samples to be detected are input into a CNN model, and the metal corrosion type is output, wherein the CNN model is trained using a training set, and the training set includes sequence sample data and labels marking corrosion types. The CNN model adjusts the two-dimensional convolution kernel to a one-dimensional convolution kernel during feature extraction.

[0008] Optionally, obtaining a sequence sample to be detected for obtaining an electrochemical noise signal in a metal includes: An electrochemical noise test is performed on the metal to obtain a time series consisting of potential and current, the time series is segmented according to a preset length, and a DC drift component is eliminated to obtain a sample of the sequence to be tested.

[0009] Optionally, the method for obtaining the normalized sequence sample to be detected is:

[0010] in, is the normalized sequence sample to be detected, is a sequence sample, For sequence The minimum value in For sequence The maximum value in .

[0011] Optionally, the CNN model includes: A first convolution module is used to extract features from the normalized sequence samples to be detected to obtain first feature data; A second convolution module is used to perform feature extraction on the first feature data to obtain second feature data; A flattening module, used for converting the second feature data into a feature vector; The fully connected module is used to obtain the probability distribution according to the feature vector, and take the category corresponding to the position where the probability value in the probability distribution is the largest as the metal corrosion type.

[0012] Optionally, the first convolution module includes: A first convolution unit is used to extract features from the normalized sequence samples to be detected; The first ReLU activation unit is used to process the numerical values ​​in the sequence samples to be detected after feature extraction; The first maximum pooling unit is used to extract the overall average value of the processed samples of the sequence to be detected in a preset dimensional direction to obtain a first vector, that is, the first feature data.

[0013] Optionally, processing the numerical values ​​in the sequence sample to be detected after feature extraction includes: The sign bit of the value in the sample of the sequence to be detected after feature extraction is judged. If the value is greater than 0, the original value is kept; if the value is less than 0, it is replaced with a preset value.

[0014] Optionally, the second convolution module includes: A second convolution unit, used for performing feature extraction on the first feature data; A second ReLU activation unit is used to process the numerical value in the first feature data after feature extraction; The second maximum pooling unit is used to extract the overall average value of the processed first feature data in a preset dimensional direction to obtain a second vector, that is, the second feature data.

[0015] Optionally, the fully connected module includes: A first fully connected unit, used to obtain a first probability distribution according to the feature vector; A first Sigmoid activation function unit, used for smoothing the first probability distribution; The second fully connected unit is used to obtain a second probability distribution according to the smoothed first probability distribution.

[0016] Optionally, the fully connected module further includes: A second Sigmoid activation function unit, used for smoothing the second probability distribution; A third fully connected unit, used for obtaining a third probability distribution according to the second probability distribution after smoothing; The third Sigmoid activation function unit is used to smooth the third probability distribution, and take the category corresponding to the position with the maximum probability value in the smoothed third probability distribution as the metal corrosion type.

[0017] Optionally, the smoothing method is:

[0018] in, is the input of this function, is the output of this function, is a natural constant, is an exponential function with a natural constant as its base.

[0019] The beneficial effects of the present invention are: The present invention proposes a corrosion type detection method based on electrochemical noise and convolutional neural network. Electrochemical noise is a non-destructive, online corrosion monitoring method. Its test is simple and convenient for on-site monitoring. However, there is currently a lack of a unified theoretical framework for electrochemical noise data analysis. The method of combining machine learning with electrochemical noise is still incomplete. Different machine learning algorithms have different characteristics, and the accuracy and stability of corrosion detection need to be improved. The method proposed in the present invention utilizes the classification ability of the CNN algorithm for time series to identify the corrosion type of the time series samples divided in the electrochemical noise signal. The process is direct and simple, which reduces the time required for manual extraction of feature parameters and ensures a high accuracy rate for corrosion type identification. Using the convolution operation of the CNN algorithm, local features and global features in large batches of sequence samples can be automatically extracted and classified based on this, avoiding the disadvantage of wasting a lot of time on preprocessing the original data. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0021] Figure 1 A classification diagram of the electrochemical noise data processing method according to an embodiment of the present invention; Figure 2 Schematic diagram of the convolution calculation process of an embodiment of the present invention; Figure 3 A schematic diagram of matrix conversion according to an embodiment of the present invention; Figure 4 Schematic diagram of three modes of convolution according to an embodiment of the present invention; Figure 5 Schematic diagram of the calculation process of standard convolution according to an embodiment of the present invention; Figure 6 is a structural diagram of a deep convolution according to an embodiment of the present invention; Figure 7 Schematic diagram of maximum / average pooling according to an embodiment of the present invention; Figure 8 A comparison diagram of the network structure before and after deactivation of an embodiment of the present invention; Fig. 9 This is an overall flow chart of a corrosion type detection method based on electrochemical noise and convolutional neural network according to an embodiment of the present invention; Fig.10 This is an actual structural diagram of the CNN algorithm training model of an embodiment of the present invention; Fig.11 The electrochemical noise spectrum of the embodiment of the present invention; (a) is the electrochemical noise spectrum of Q235 steel in the passivation solution system; Fig.11 (b) is the electrochemical noise spectrum of Q235 steel in a uniform corrosion solution system; Fig.11 (c) is the electrochemical noise spectrum of Q235 steel in the pitting solution system; Fig.12 A schematic diagram of a confusion matrix of a CNN algorithm according to an embodiment of the present invention; Fig.13 This is a comparison chart of the accuracy of different machine learning algorithms used in the embodiments of the present invention for corrosion type identification. DETAILED DESCRIPTION

[0022] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0023] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0024] The present embodiment discloses a corrosion type detection method based on electrochemical noise and convolutional neural network, comprising: obtaining a sequence sample to be detected of an electrochemical noise signal in a metal, performing minimum-maximum normalization on the sequence sample to be detected, and obtaining the normalized sequence sample to be detected; inputting the normalized sequence sample to be detected into a CNN model, and outputting the metal corrosion type, wherein the CNN model is trained using a training set, the training set includes sequence sample data and a label marking the corrosion type, and the CNN model adjusts a two-dimensional convolution kernel to a one-dimensional convolution kernel during feature extraction.

[0025] Acquiring a sequence sample to be detected of an electrochemical noise signal in a metal includes: performing an electrochemical noise test on the metal, acquiring a time series consisting of a potential and a current, dividing the time series according to a preset length, and eliminating a DC drift component to acquire a sequence sample to be detected.

[0026] The CNN model includes: a first convolution module, which is used to extract features from the normalized sequence samples to be detected and obtain first feature data; a second convolution module, which is used to extract features from the first feature data and obtain second feature data; a flattening module, which is used to convert the second feature data into a feature vector; and a fully connected module, which is used to obtain a probability distribution based on the feature vector, and take the category corresponding to the position with the maximum probability value in the probability distribution as the metal corrosion type.

[0027] The first convolution module includes: a first convolution unit, used to extract features from the normalized sequence samples to be detected; a first ReLU activation unit, used to process the numerical values ​​in the sequence samples to be detected after feature extraction; and a first maximum pooling unit, used to extract the overall average value of the processed sequence samples to be detected in a preset dimensional direction to obtain a first vector, i.e., the first feature data.

[0028] Processing the numerical value in the sample of the sequence to be detected after feature extraction includes: performing sign bit judgment on the numerical value in the sample of the sequence to be detected after feature extraction, if the numerical value is greater than 0, keeping the original value, if the numerical value is less than 0, replacing it with a preset numerical value.

[0029] The second convolution module includes: a second convolution unit, used to extract features from the first feature data; a second ReLU activation unit, used to process the numerical values ​​in the first feature data after feature extraction; and a second maximum pooling unit, used to extract the overall average value of the processed first feature data in a preset dimensional direction to obtain a second vector, i.e., the second feature data.

[0030] The fully connected module includes: a first fully connected unit, used to obtain a first probability distribution according to a feature vector; a first Sigmoid activation function unit, used to smooth the first probability distribution; and a second fully connected unit, used to obtain a second probability distribution according to the smoothed first probability distribution.

[0031] The fully connected module also includes: a second Sigmoid activation function unit, which is used to smooth the second probability distribution; a third fully connected unit, which is used to obtain a third probability distribution based on the smoothed second probability distribution; a third Sigmoid activation function unit, which is used to smooth the third probability distribution, and take the category corresponding to the position with the maximum probability value in the smoothed third probability distribution as the metal corrosion type.

[0032] The present embodiment discloses a corrosion type detection method based on electrochemical noise and convolutional neural network, comprising: 1) preparing metal samples and different types of corrosion solutions; 2) experimentally measuring the electrochemical noise time domain spectrum of the metal samples in different types of corrosion solutions; 3) eliminating the DC component in the original measurement data by a quintic polynomial fitting method; 4) dividing the time series into sequence samples, taking the appropriate value for minimum-maximum normalization; 5) dividing the training and test data sets; 6) using the CNN algorithm to train the model until the training error and the test error are both less than the set value; 7) executing steps 2) to 4) for the object to be detected for corrosion type to obtain the sequence sample; 8) using the established model to predict the classification of the object to be detected, and its corrosion type is the same as the sample in the same area as it.

[0033] Electrochemical noise data measurement and processing: Electrochemical noise testing is a non-destructive testing technology that can reflect the dynamic changes in the corrosion process and is of great significance for early detection and prevention of corrosion. Electrochemical noise testing is based on the principle of zero-resistance current measurement. The metal sample to be tested is selected to ensure that its surface is clean and free of grease, oxides and other impurities. The prepared sample is immersed in an electrolyte solution (corrosive solution) similar to the actual working conditions, and a three-electrode system is used for measurement, including a reference electrode, a counter electrode and a working electrode. The three electrodes are installed and immersed in the electrolyte according to the prescribed method to ensure that the electrodes are in good contact and the electrolyte fully covers the electrode surface. Set the acquisition frequency, data acquisition time, amplification factor and other parameters on the electrochemical workstation, and start real-time monitoring of electrochemical noise signals. Under constant potential or constant current conditions, the electrochemical workstation begins to record the potential noise and current noise on the metal surface.

[0034] Electrochemical noise signals are usually time series consisting of potential and current. These time series contain rich information about corrosion mechanisms. By segmenting the electrochemical noise data into certain lengths (such as 1024 points), a large number of shorter time series samples can be obtained. Electrochemical noise data analysis is still under research. Currently, the commonly used analysis methods are divided into two categories: time domain analysis and frequency domain analysis, as follows: Figure 1 shown.

[0035] Due to the inconsistency between the noise of the instrument itself and the state of the electrodes during the measurement process, the DC drift phenomenon will be introduced, resulting in significant deviations in the time domain and frequency domain analysis results of the electrochemical noise. In order to ensure the accuracy of the corrosion information, removing the DC drift in the electrochemical noise data becomes a necessary process before data analysis. Commonly used methods for eliminating DC drift include moving average elimination, moving average elimination, wavelet removal of DC component method, and the most commonly used polynomial fitting. The fifth-order polynomial fitting is used to eliminate the DC component of the segmented time series samples.

[0036] The basic concepts of convolutional neural networks: Receptive field: The size of the area where each pixel on the feature map output by each layer of CNN is mapped back to the input image. The size of the receptive field can be calculated according to the following formula for calculating the size of the output feature map: (1) in, is the size of the input feature map, is the filling size, is the convolution kernel size, is the convolution step size. The calculation formula for the receptive field size is: (2) in, is the receptive field size corresponding to the current feature map, is the receptive field size corresponding to the feature map of the previous layer, is the convolution kernel size of the current convolution layer, and the multiplication term represents the stride product of the previous convolution layer.

[0037] The larger the range of the neuron's receptive field, the larger the range of the original image it can access, which also means that it can learn more global and higher semantic feature information; on the contrary, the smaller the range, the more local and detailed the features it contains. Therefore, the range of the receptive field can be used to roughly judge the level of abstraction of each layer. The deeper the network, the larger the receptive field of the neuron. It can be seen that the front layers in the deep CNN have a smaller receptive field and extract local and general features such as the texture and edge of the image; the back layers have a larger receptive field and extract deeper and more concrete features of the image. In transfer learning, the parameters of the front layers are often frozen, that is, they are not involved in training, to save training time and computing power.

[0038] Weight sharing: When a convolution kernel performs a convolution operation with a multi-channel feature map, it can be regarded as using the convolution kernel as a slider to "sweep" the feature map. The number in the convolution kernel is called the weight. Each position of the feature map is "swept" by the same convolution kernel, so the weight is the same, that is, shared. It is based on a reasonable assumption: if a feature is useful in calculating a certain spatial position, then it is also useful in calculating another different position. By using weight sharing in convolution operations, the parameters that need to be solved can be effectively reduced.

[0039] Resolution: The image size of the input model, i.e. the length and width. Usually it is based on the number of times the model is downsampled and the resolution of the feature map after the last downsampling. To determine the size of the input resolution, Too large will increase the amount of subsequent calculations and the level of information abstraction will not be high enough, affecting network performance. If the value is too small, it will cause serious information loss. For example, the effective area of ​​the feature map mapped from the original resolution to the last layer may be less than one pixel, making the training unable to converge.

[0040] Network depth: The design of the backbone network usually adopts a more efficient module (or block) stacking method. Each module is composed of multiple convolutional layers. The number of modules can be the depth of the network. The depth of the neural network determines the expressive power of the network. Generally speaking, the deeper the network, the stronger the expressive power. However, a depth greater than a certain value may bring the opposite effect, so its specific setting needs to be adjusted continuously.

[0041] Network width: The maximum number of channels in CNN is determined by the layer with the largest number of convolution kernels. The width determines the amount of information learned by the network at a certain layer. In the usual structural design, the number of convolution kernels increases with the number of layers until the number of feature maps in the last layer reaches the maximum. This is because the deeper the layer, the smaller the resolution of the feature map, and the higher the level of information contained, so more convolution kernels are needed for learning. The more channels, the better the effect, but the amount of calculation will also increase greatly, so the specific setting is also a parameter adjustment process.

[0042] Downsampling: The downsampling layer has two functions. One is to reduce the amount of calculation and prevent overfitting; the other is to increase the receptive field so that the subsequent convolution kernel can learn more global information. There are two designs for downsampling: ① Use a pooling layer with a step size of 2, such as maximum pooling or average pooling. Maximum pooling is usually used because it is simple to calculate and the maximum response can better preserve texture features; ② Use a convolution layer with a step size of 2. The downsampling process is a process of information loss, and the pooling layer is not learnable. Using a learnable convolution layer with a step size of 2 to replace the pooling layer can achieve better results, but of course it also increases the amount of calculation.

[0043] Upsampling: The operation of mapping an image from a small resolution to a large resolution. Since the output size of the input image often becomes smaller after the features are extracted through CNN, it is sometimes necessary to restore the image to its original size for further calculations. There are three ways to implement upsampling: ① Interpolation, generally using bilinear interpolation, which is more complex than other interpolation methods in terms of calculation, but it is not worth mentioning compared to convolution calculations; ② Transposed convolution, by filling the input feature map with 0s at intervals and then performing standard convolution calculations, the size of the output feature map can be made larger than the input; ③ Maximum unpooling, recording the index position of the maximum value at the symmetrical maximum pooling position, and then placing the corresponding value at the original maximum value position in the unpooling stage, and filling the remaining positions with 0s.

[0044] Parameter quantity: The number of learnable variables in CNN, including convolution kernel weights, batch normalization scaling factors, offset factors, and possible biases in some layers without batch normalization. Learnable parameters are given initial values ​​before model training begins, and are continuously updated iteratively during the training process according to the chain rule. The number of parameters in the entire model is mainly determined by the number of convolution kernel weights. The larger the number of parameters, the higher the memory requirements of the operating platform. The size of the parameter quantity is an important evaluation indicator for lightweight network design.

[0045] Computational Amount: The number of multiplication and addition operations during forward reasoning, usually expressed in floating point operations per second (FLOPs). The greater the computational amount, the longer the model running delay on the same platform, especially on resource-constrained platforms such as mobile / embedded platforms. In order to achieve real-time requirements, the computational amount of the model must be as low as possible, but this is not strictly proportional. It is also related to the computational intensity of the specific operator and the degree of underlying optimization of the operator.

[0046] Convolutional structure type: CNN is an important field in the field of deep learning. It is a neural network based on convolution operations. CNN can be roughly understood as a fully connected network that replaces matrix multiplication with convolution operations. The input matrix and a Convolution kernel, ignoring padding, setting the step size to 1, then their convolution calculation process is as follows Figure 2 shown.

[0047] The input matrix and convolution kernel are transformed as follows, that is, the input matrix is ​​flattened into a one-dimensional vector, and the elements are appropriately copied and zeroed in the convolution kernel to obtain Figure 3 The form shown.

[0048] After this processing, the convolution kernel matrix on the left is actually multiplied by the flattened vector on the right to get the same result as Figure 2 The result is equivalent, that is, the convolution operation of the vector can be expressed as Figure 3 The form of a kernel matrix multiplied by the vector to obtain an output vector obtained by multiplying a parameter matrix by an input vector is exactly the same as that of full connection. Therefore, convolution and full connection are essentially a set of linear transformations, but compared with full connection, the parameter matrix of convolution is more sparse, many of the kernel matrices are zero, and the parameters of the non-zero part are actually shared. These two characteristics allow convolution to greatly reduce the number of parameters, and at the same time, the same set of parameters (convolution kernel) reused in multiple places is more conducive to capturing local features. In contrast, full connection has more parameters, and each parameter is only responsible for a unique connection. It is more difficult to train while increasing the amount of computation and memory requirements.

[0049] Three different convolution modes are usually implemented in deep learning frameworks, namely FULL, VALID, and SAME. The core difference between these three modes is that the convolution kernel moves in different areas during the convolution operation, which results in different output sizes. Figure 4 As shown, with a step size of 1, Input matrix and The convolution kernel is used as an example to show the difference between the three modes.

[0050] In FULL mode, the convolution kernel starts convolution from the place where it intersects with the input at one point. The white part is to ensure that the convolution can be carried out normally. In this mode, the convolution kernel moving area is the largest, and the size of the output after convolution is also the largest; in VALID mode, the convolution kernel starts convolution from the place where it overlaps with the input, and no padding is required. The output size is the smallest in this mode; in SAME mode, the starting position of the convolution kernel is determined by aligning the center of the convolution kernel with the first point of the input, and then corresponding padding is performed to ensure that the size of the output after convolution is consistent with the input size. This mode is the most commonly used mode, and the size of the output is consistent with the size of the input.

[0051] Standard convolution: The most common structure in neural network architecture design. Assume that the dimension of its input feature map is , the dimension of each convolution kernel is , the dimension of a layer of feature map obtained by one convolution filtering is , a total of convolution kernels, the dimension of the output feature map is , the calculation amount is , the calculation process is as follows Figure 5 As shown, the dimension of the input feature map for , the dimension of the convolution kernel for , the number of convolution kernels is 2.

[0052] Deep convolution: In standard convolution, each convolution kernel needs to be calculated with all channels of the feature map, so the number of channels of each convolution kernel is equal to the number of channels of the input feature map. At the same time, the number of channels of the output feature map can be controlled by setting the number of convolution kernels. In deep convolution, each convolution kernel is a single channel with a dimension of , the number of convolution kernels must be consistent with the number of channels of the feature map, that is, The convolution kernel and feature map The channels are subjected to two-dimensional convolution calculation, and the final output dimension is . Depth convolution cannot change the number of channels of the output feature map, so a depth convolution is usually followed by Instead of the standard convolution Or a standard convolution of a larger size, the computational cost is , which is the normal convolution times, while ensuring the same effect, greatly reducing the amount of calculation and parameters. The structure of deep convolution is as follows Figure 6 As shown in Figure 1, it is called depthwise separable convolution and is gradually becoming a standard for lightweight structure design.

[0053] Grouped convolution: When training the model, the feature maps are grouped and processed, and multiple outputs are fused into the final result. The specific calculation process is to first divide the input feature map into groups, each group size is , the size of a convolution kernel in each group is , each group has convolution kernels, so the size of each set of output feature maps is ,final The group outputs are concatenated to obtain a The total amount of computation is , which is the standard convolution , the number of parameters is also the standard convolution Since the feature map groups are independent of each other and there is information barrier, it is proposed to perform a channel shuffle operation on the output feature map to disrupt the original order so that the information between the groups can interact.

[0054] Atrous convolution: A convolution idea proposed to solve the problem of image semantic segmentation where downsampling will reduce image resolution and lose information. There are two ways to implement atrous convolution: 1. Expand the convolution kernel, that is, add 0 in the middle of each row and column of the convolution kernel; 2. Take data from every other row or column on the feature map and convolve it with the convolution kernel. By taking values ​​at intervals to expand the receptive field, the original convolution kernel can have a larger receptive field with the same number of parameters and computational complexity.

[0055] Transposed convolution: Contrary to the idea of ​​dilated convolution, transposed convolution is designed for upsampling and is also used in semantic segmentation. Its calculation is also opposite to that of dilated convolution. It first fills the input feature map with 0s, keeps the convolution kernel unchanged, and then uses standard convolution for calculation to obtain a feature map of larger size.

[0056] Deformable convolution: An additional parameter for offset in width and height is added to each element of the convolution kernel, and then points are dynamically selected on the feature map according to the offset to perform convolution calculations, so that the convolution kernel can be expanded to a large range during training. Deformable convolution is more flexible than other convolution methods and can perceive information at different positions based on each input image, similar to attention, thereby achieving better results.

[0057] 1×1 convolution: When operating on a 3D feature map, it can be regarded as a weighted summation of a certain local area. 1×1 convolution usually has two functions: 1. Dimension increase; 2. Increase the nonlinearity of the network layer.

[0058] Other components: The convolution operation is the core of CNN, and in addition to the convolution layer, CNN has other unique or common components.

[0059] Pooling: Usually a pooling layer is periodically inserted between consecutive convolutional layers. Its function is to gradually reduce the spatial size of the data volume, thereby reducing the number of parameters in the network, making the consumption of computing resources less, and effectively controlling overfitting. Pooling is generally used when upsampling and downsampling. It has no parameters and cannot be learned. Pooling is generally divided into maximum pooling and average pooling. Among them, the most commonly used is maximum pooling, and the common form is to use size The filter of size 2 downsamples each depth slice, discarding 75% of the activation information. Pooling for larger receptive fields requires larger pooling sizes and is often destructive to the network. , a schematic diagram of the average pooling of the maximum pooling kernel with a step size of 2 is shown as follows Figure 7 shown.

[0060] The global average pooling operation is performed on a dimension The feature map of and Take the overall average value in the direction and then output a length of This operation usually appears after the last feature map of the classification model, and then a fully connected layer is connected to complete the output of the classification result. Early classification models flattened the last feature map directly into The vector of , and then the fully connected layer, it can be clearly seen that the amount of calculation is extremely large. In some models, the last fully connected layer even accounts for more than 50% of the total model calculation. Global average pooling plus a fully connected layer can achieve a similar effect, and the amount of calculation is reduced to the original .

[0061] Fully connected layer: As in a regular neural network, the essence is actually matrix multiplication plus bias, input a The data weight is , then the output is , which is often seen in the last layer of multi-layer perceptrons and classification models.

[0062] Activation function: Its nonlinearity is one of the most important factors for the neural network to work. In actual network deployment, the implementation of the activation function is also a very important aspect. Common activation functions are: ① ReLU series, mainly including ReLu, ReLU6 and leaky ReLU. For the ReLU function, the part less than 0 is taken as 0, and the part greater than 0 keeps the original value, that is, only the sign bit needs to be judged; ReLU6 adds a threshold to the positive part compared to ReLU, and the value greater than 6 is taken as 6; leaky ReLU and ReLU have the same positive part, which is equal to the original value when greater than 0, but the negative part takes 1 / 10 of the original value; ② Sigmoid function, its formula is as follows: (3) Its advantages are smoothness and ease of differentiation, but its disadvantages are that the activation function requires large computational effort. When backpropagating to find the error gradient, the derivative involves division, and the gradient can easily vanish during backpropagation, making it impossible to complete the training of deep networks. In order to solve the problem that the Sigmoid function is computationally intensive and unfriendly to low-performance hardware, the approximate hardware-friendly functions h-Sigmoid and h-Swish were proposed and used.

[0063] Inactivation: During the training of a deep network, neurons are temporarily ignored from the network with a certain probability. For stochastic gradient descent, since neurons are randomly ignored, each small batch is training a different network. When testing and reasoning, inactivation will not work. Inactivation is an important method in CNN to prevent overfitting and improve training results. The network structure before and after inactivation is compared. Figure 8 As shown in Figure 1. In the dropout layer, different combinations of neurons are ignored, which represents a different structure. All these different structures are trained in parallel with weights using the same sub-dataset, and the sum of the weights is 1. If the Dropout layer has neurons, then it will form Different substructures are equivalent to integrating these models and taking the average when predicting. This structured model regularization technique helps to avoid overfitting.

[0064] Batch Normalization (BN): There are some systematic problems in model training before the introduction of BN, which will cause many algorithms to converge very slowly or even fail to work at all, especially when using the Sigmoid activation function. The BN layer is usually added between each neural network layer and the activation layer to unify and adjust the data distribution of the neural network layer output to a standard normal distribution with a mean of 0 and a variance of 1, so that the output is located in the non-saturated area of ​​the activation layer, achieving the effect of accelerating convergence. The process of the BN algorithm is as follows: (4) (5) (6) (7) in, is included The input value of a mini-batch of samples; is the output value of the sample after passing through the BN layer; extended parameter and translation parameters are the parameters to be learned, and the model can be modified during training and If the standardized processes (4), (5), and (6) do not optimize the process, and To offset the standardization operation to a certain extent.

[0065] Corrosion type detection method: First, perform an electrochemical noise test on the training samples to obtain the original data sequence of voltage and current signals changing with time. Split the time series into shorter sequence samples according to a certain length, and then use the polynomial fitting method to eliminate the DC drift component in the segmented samples. Take the appropriate minimum and maximum values, and perform minimum-maximum normalization on the voltage and current sequences, that is, scale the data so that it falls into the specified interval, such as [0, 1] or [-1, 1]. The calculation formula is: (8) in, and Sequence The minimum and maximum values ​​in . Minimum-maximum normalization can eliminate the scale differences between features and prevent gradient disappearance or gradient explosion in subsequent CNN model training.

[0066] After the above data preprocessing process, the original electrochemical noise test data is converted into a series of sequence samples with values ​​in the interval [0,1]. Then the sequence sample data extracted from the training samples of different corrosion types are grouped, marked with corresponding labels, and a data set is formed. Some data are randomly selected as training data, and the remaining part is test data. The number of training samples is often greater than the test samples. The CNN model is trained using the training data until the training error and the test error meet the accuracy requirements. The model training can be stopped, thereby establishing a CNN model that can classify the corrosion type of time series samples. Finally, for the electrochemical noise test data of the sample to be identified, the above data preprocessing process is also performed, and the obtained sequence samples are input into the CNN model for classification. The established model uses the convolution operation in the CNN algorithm to automatically extract local and global features in the sequence samples, and then calculates the probability of the object belonging to each corrosion type based on these features. The corrosion type of the object is judged based on the probability of its belonging to each corrosion type, thereby realizing metal corrosion monitoring and identification.

[0067] Fig. 9 The specific structure diagram of the CNN algorithm training model in . Fig.10As shown in the figure, CNN consists of two layers of convolutional networks (convolutional layer-activation layer-pooling layer) and three layers of fully connected networks. The flattening layer converts high-dimensional data into vectors to connect the convolutional network and the fully connected network. The activation function in the convolutional network is the ReLU function, which can avoid problems such as gradient saturation and gradient disappearance, and has low computational complexity. Only one threshold is required to obtain the activation value. In the fully connected network, the activation function of the hidden layer is the Sigmoid function, and the Sigmoid function outputs The output range is limited, the optimization is stable, and it is a continuous function, which is easy to derive; the activation function of the output layer is the Softmax function, and the output of the Softmax function can be interpreted as a probability distribution, which is often used in the output layer of multi-classification problems. The fully connected network has a large amount of calculation. During training, some neurons are randomly inactivated to accelerate optimization and effectively prevent overfitting. Compared with the commonly used CNN structure that uses a two-dimensional convolution kernel, because the processing object is a one-dimensional time series, the convolution kernel (including the convolution kernel of the pooling layer) is adjusted to one dimension, and the entire convolution network is adaptively adjusted to become a one-dimensional CNN. One-dimensional CNN is more conducive to the extraction of local features of time series samples, while reducing the amount of calculation of convolution operations, and using maximum pooling to retain the more significant features.

[0068] The input data is a time series sample with a length of 1024 after minimum-maximum normalization. The model is trained in small batches, and the batch size of a single training is 16, so the input data size is (16,2,1024). After the input data passes through a convolutional layer with an input channel of 2, an output channel of 6, a convolution kernel size of 5, a step size of 1, and a padding of 2, the output data size is (16,6,1024). After passing through the ReLU activation function layer, the data size remains unchanged. After passing through a maximum pooling layer with a convolution kernel size of 2, a step size of 2, and a padding of 0, the output data size is (16,6,512); after passing through a convolutional layer with an input channel of 6, an output channel of 12, a convolution kernel size of 6, a step size of 4, and a padding of 1, the output data size is (16,12 ,128), the data size remains unchanged after the ReLU activation function layer, and the output data size after a maximum pooling layer with a convolution kernel size of 4, a stride of 4, and a padding of 0 is (16,12,32); the multi-channel data is converted into a vector after the flattening layer, and the data size is (16,384); the output data sizes after three layers of fully connected layers are (16,196), (16,48), and (16,3), respectively, and the data size remains unchanged after the Sigmoid activation function layer or the Softmax activation function layer. After the calculation of the above CNN structure, the input data of size (16,2,1024) is converted into output data of size (16,3), 16 represents the batch size of the output data, corresponding to the batch size of the input data, that is, when multiple samples are trained simultaneously, their output results correspond to the input data one by one, and 3 represents the length of the output data, that is, the time series sample of length 1024 is converted into a probability distribution of length 3 after calculation. The length of the output data is 3, which means the classification category is 3. The category corresponding to the position of the maximum value among the three probability values ​​is taken as the classification result predicted by the model. The metal corrosion types corresponding to the three positions of the model are passivation, uniform corrosion, and pitting corrosion. For example, an output result (0.9, 0.025, 0.075) indicates that the metal corrosion type of the sample is predicted to be passivation. The corrosion cases of Q235 steel in the passivation, uniform corrosion and pitting systems are used to compare the beneficial effects.

[0069] The substrate is a Q235 steel sheet cut into a size of φ10mm×3mm, welded with copper wire and encapsulated with epoxy resin. The samples were polished with 400#, 800#, 1200#, 2000#, and 3000# silicon carbide sandpaper in turn, and polished with a polishing machine. The samples were ultrasonically cleaned with deionized water and ethanol, and dried for later use. 1mol / L sodium bicarbonate solution, sulfuric acid solution of different concentrations, and 1mol / L sodium bicarbonate and sodium chloride mixed solution of different concentrations were used as passivation, uniform corrosion, and pitting environments, respectively. For specific solutions corresponding to different types, refer to Table 1, which shows the solutions corresponding to different corrosion types.

[0070] Table 1

[0071] The samples were tested for electrochemical noise in different corrosion types. The typical electrochemical noise time domain spectra of Q235 steel in three solution systems: passivation, uniform corrosion and pitting corrosion are shown in the figure below. Fig.11 As shown in (a)-(c), passivation is manifested as smooth voltage fluctuations and small current oscillations; uniform corrosion is manifested as small voltage oscillations and increased current amplitude; pitting corrosion is manifested as transient peaks, rapid changes, and slow recovery.

[0072] The electrochemical noise data collected in the experiment was divided into 1024 points and processed in batches, and the DC component was eliminated by fitting a fifth-order polynomial. After that, the maximum voltage was taken as 0.03V, the minimum voltage was -0.01V, and the maximum current was taken as The minimum current is , min-max normalization is performed on each sequence sample with a length of 1024 time steps.

[0073] The voltage and current time series samples are constructed into a data set as the training data set of the CNN algorithm. The corrosion type is used as the learning and prediction result of the CNN algorithm. 40% of the data is randomly selected as the learning set for learning and training. The trained model is obtained, and the remaining 60% of the data is used as the prediction set for prediction. After the sequence samples are input into the algorithm model, the prediction results are obtained and compared with the actual results. The CNN algorithm model is evaluated based on the accuracy. When the model training is completed, the accuracy reaches 99.83%. The results are used as follows Fig.12 The confusion matrix shown represents.

[0074] In order to verify the reliability, accuracy and excellence of the CNN algorithm, the CNN algorithm, decision tree algorithm and random forest algorithm were used to train the model with the same data set for comparison. The accuracy of different machine learning algorithms for corrosion type identification is shown in the figure below. Fig.13As shown in the figure. Time series often contain continuous and contextual information. CNN can effectively capture local features and patterns in time series through convolutional layers. When CNN processes time series, the same convolution kernel is reused at all time steps, which reduces the number of parameters required for the model and is conducive to model generalization. CNN can stack multiple layers of convolution and pooling layers to form complex nonlinear feature representations, and can automatically learn abstract and high-level features in time series without manually designing features. The CNN algorithm is combined with electrochemical noise for corrosion monitoring and identification. The process is direct and simple. By utilizing CNN's powerful local feature extraction capabilities and parallel computing advantages in time series classification tasks, this method can extract effective, robust and easy-to-interpret features when processing time series data, thereby improving model performance, reducing the time required to extract data and train models, and ensuring high accuracy in identifying corrosion types.

[0075] The embodiments described above are only descriptions of the preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should all fall within the protection scope determined by the claims of the present invention.

Claims

1. A corrosion type detection method based on electrochemical noise and convolutional neural network, characterized in that: include: Acquire a sequence sample to be detected of an electrochemical noise signal in a metal, perform minimum-maximum normalization on the sequence sample to be detected, and acquire the normalized sequence sample to be detected; The normalized sequence samples to be detected are input into a CNN model, and the metal corrosion type is output, wherein the CNN model is trained using a training set, and the training set includes sequence sample data and labels marking corrosion types. The CNN model adjusts the two-dimensional convolution kernel to a one-dimensional convolution kernel during feature extraction.

2. The corrosion type detection method based on electrochemical noise and convolutional neural network according to claim 1 is characterized in that: Sample sequences to be tested for obtaining electrochemical noise signals in metals include: An electrochemical noise test is performed on the metal to obtain a time series consisting of potential and current, the time series is segmented according to a preset length, and a DC drift component is eliminated to obtain a sample of the sequence to be tested.

3. The corrosion type detection method based on electrochemical noise and convolutional neural network according to claim 1 is characterized in that: The method for obtaining the normalized sequence sample to be detected is: in, is the normalized sequence sample to be detected, is a sequence sample, For sequence The minimum value in For sequence The maximum value in .

4. The corrosion type detection method based on electrochemical noise and convolutional neural network according to claim 1 is characterized in that: The CNN model includes: A first convolution module is used to extract features from the normalized sequence samples to be detected to obtain first feature data; A second convolution module is used to perform feature extraction on the first feature data to obtain second feature data; A flattening module, used for converting the second feature data into a feature vector; The fully connected module is used to obtain the probability distribution according to the feature vector, and take the category corresponding to the position where the probability value in the probability distribution is the largest as the metal corrosion type.

5. The corrosion type detection method based on electrochemical noise and convolutional neural network according to claim 4 is characterized in that: The first convolution module comprises: A first convolution unit is used to extract features from the normalized sequence samples to be detected; The first ReLU activation unit is used to process the numerical values ​​in the sequence samples to be detected after feature extraction; The first maximum pooling unit is used to extract the overall average value of the processed samples of the sequence to be detected in a preset dimensional direction to obtain a first vector, that is, the first feature data.

6. The corrosion type detection method based on electrochemical noise and convolutional neural network according to claim 5 is characterized in that: The processing of the numerical values ​​in the sequence samples to be detected after feature extraction includes: The sign bit of the value in the sample of the sequence to be detected after feature extraction is judged. If the value is greater than 0, the original value is kept; if the value is less than 0, it is replaced with a preset value.

7. The corrosion type detection method based on electrochemical noise and convolutional neural network according to claim 4 is characterized in that: The second convolution module comprises: A second convolution unit, used for performing feature extraction on the first feature data; A second ReLU activation unit is used to process the numerical value in the first feature data after feature extraction; The second maximum pooling unit is used to extract the overall average value of the processed first feature data in a preset dimensional direction to obtain a second vector, that is, the second feature data.

8. The corrosion type detection method based on electrochemical noise and convolutional neural network according to claim 4 is characterized in that: The fully connected module includes: A first fully connected unit, used to obtain a first probability distribution according to the feature vector; A first Sigmoid activation function unit, used for smoothing the first probability distribution; The second fully connected unit is used to obtain a second probability distribution according to the smoothed first probability distribution.

9. The corrosion type detection method based on electrochemical noise and convolutional neural network according to claim 8 is characterized in that: The fully connected module also includes: A second Sigmoid activation function unit, used for smoothing the second probability distribution; A third fully connected unit, used for obtaining a third probability distribution according to the second probability distribution after smoothing; The third Sigmoid activation function unit is used to smooth the third probability distribution, and take the category corresponding to the position with the maximum probability value in the smoothed third probability distribution as the metal corrosion type.

10. The corrosion type detection method based on electrochemical noise and convolutional neural network according to claim 9 is characterized in that: The method for smoothing is: in, is the input of this function, is the output of this function, is a natural constant, is an exponential function with a natural constant as its base.

Citation Information

Patent Citations

  • Method for detecting visually-induced motion sickness based on one-dimensional convolution neural network

    CN110507288A

  • Radar target detection method and system based on convolutional neural network sequence classification

    CN111880158A

  • Corrosion type classification method based on ensemble learning technology

    CN115982656A