Metal material corrosion prediction method and device based on deep learning
By employing deep learning methods and combining multi-type corrosion measurement information with complex rust prediction models, the problem of low efficiency and poor accuracy in rust prediction of metallic materials in existing technologies has been solved. This enables accurate rust prediction under different environments, reducing risks and providing scientific decision-making support.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-29
- Publication Date
- 2026-04-07
AI Technical Summary
Existing technologies are inefficient and subjective in predicting corrosion of metallic materials, and cannot predict the corrosion process dynamically and accurately. Furthermore, existing models are difficult to integrate multiple types of data and adapt to different environments, resulting in inaccurate and unstable prediction results.
A deep learning-based corrosion prediction method is adopted. By acquiring multi-type corrosion measurement information, a complex corrosion prediction model and a carefully optimized loss function are designed. Combined with convolution modules, pooling modules, attention modules, etc., the corrosion characteristics of metallic materials can be deeply mined and accurately predicted.
It enables accurate prediction of the corrosion process of metal materials, effectively predicts corrosion trends under different environments, reduces the risk of equipment damage and safety accidents, provides a scientific basis for decision-making, and has important engineering application value.
Smart Images

Figure CN121808261A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of industrial data processing, experimental evaluation, and data modeling, and specifically to a method and apparatus for predicting corrosion of metallic materials based on deep learning. Background Technology
[0002] Metallic materials, due to their excellent physicochemical properties, are widely used in many fields such as construction, machinery, and aerospace. However, metal corrosion remains a key factor affecting their service life and safety. Traditional methods for predicting metal corrosion often rely on manual experience and simple physicochemical analysis, such as visually observing the surface condition of the metal or measuring local thickness changes to determine the degree of corrosion. This approach is not only inefficient and subjective, but also cannot dynamically and accurately predict the corrosion process of metallic materials.
[0003] With technological advancements, some research has begun to employ sensor-based data acquisition combined with machine learning algorithms for corrosion prediction. However, existing methods still suffer from numerous shortcomings. In terms of data processing, most methods can only process a single type of data, failing to effectively integrate multiple data types such as thickness values, resistivity ratios, and light intensity variations, and thus unable to fully explore the potential relationships between different data points. Regarding model construction, traditional models have simple structures and limited ability to extract complex corrosion features, making them ill-suited to the corrosion patterns of metallic materials under varying environments and working conditions. Furthermore, the loss function design of existing prediction models is often unreasonable, failing to balance different aspects of prediction error, resulting in poor model training performance and low accuracy and stability of prediction results, thus failing to meet the demands of accurate corrosion prediction for metallic materials in practical engineering applications. Summary of the Invention
[0004] This invention primarily addresses the need for accurate prediction of metal corrosion in practical engineering projects. It discloses a method and apparatus for predicting metal corrosion based on deep learning.
[0005] In a first aspect, this invention discloses a deep learning-based method for predicting corrosion of metallic materials, comprising: S1, Obtain a set of corrosion measurement information for metallic materials; the set of corrosion measurement information includes a set of thickness value sequences, a set of resistivity ratio sequences, and a set of light intensity change value sequences; S2, Train the preset corrosion prediction model to obtain the trained corrosion prediction model; S3. Using the trained corrosion prediction model, the corrosion measurement information set is processed to obtain the corrosion prediction value of the metal material.
[0006] The corrosion prediction model includes: a first convolution module, a first pooling module, a second convolution module, a third convolution module, a fourth convolution module, a first normalization module, a first activation module, a second normalization module, a pooling module, a second activation module, a channel splitting module, a channel shuffling module, a multi-head attention module, and a fully connected module. The input of the first convolutional module is configured as the model input of the corrosion prediction model, and the output of the first convolutional module is connected to the input of the first pooling module. The output of the first pooling module is connected to the input of the channel splitting module. The output of the channel splitting module is connected to the inputs of the second convolutional module and the multi-head attention module, respectively. The output of the second convolutional module is connected to the input of the first normalization module. The output of the first normalization module is connected to the input of the third convolutional module. The output of the third convolutional module is connected to the input of the first activation module. The output of the first activation module is connected to the input of the fourth convolutional module. The output of the fourth convolutional module is connected to the input of the second normalization module. The output of the second normalization module is connected to the input of the pooling module. The output of the pooling module is connected to the input of the second activation module. The output of the second activation module is connected to the input of the multi-head attention module. The output of the multi-head attention module is connected to the input of the channel shuffling module. The output of the channel shuffling module is connected to the input of the fully connected module. The output of the fully connected module is configured as the model output of the corrosion prediction model.
[0007] The training process of the corrosion prediction model includes: Obtain a training dataset; the training dataset includes training data and corresponding label information; the training data includes a sequence of thickness values, a sequence of resistivity ratios, and a sequence of light intensity changes collected at the same measurement time; the label information is the corrosion value corresponding to the training data; Initialize the number of training iterations and the parameters of the corrosion prediction model; The training data in the training dataset is used as input data and input into the corrosion prediction model. The input data is processed using the corrosion prediction model to obtain predicted values; The difference between the predicted value and the label information corresponding to the input data is calculated to obtain the difference value. Determine whether the difference value satisfies the convergence condition to obtain the first determination result; When the first judgment result is negative, it is determined whether the training iteration count value is equal to the training count threshold to obtain the second judgment result; When the second judgment result is negative, the model training state is determined to be that the termination training condition is not met. When the second judgment result is yes, it is determined that the model training state meets the termination training condition; When the first judgment result is yes, it is determined that the model training state meets the termination training condition; When the model training state does not meet the termination training condition, the parameters of the corrosion prediction model are updated using the parameter update model, the training iteration count is increased by 1, and the training data in the training dataset is used as input data to the corrosion prediction model. When the model training state meets the termination training condition, the training process of the corrosion prediction model is completed, and the trained corrosion prediction model is obtained.
[0008] The parameter update model is calculated using the following expression: , in, The parameters of the corrosion prediction model are represented. This indicates the update step size of the corrosion prediction model. , Indicates to In Calculate the gradient of the parameters. This represents the loss function of the corrosion prediction model. This represents the updated parameter values of the corrosion prediction model. , indicating the use The parameters of the corrosion prediction model Update.
[0009] The loss function is: , Where YC is the value of the loss function. To predict the value of the i-th training data in the training dataset, The label information for the i-th training data in the training dataset is used, and N1 is the number of training iterations. and These are the preset first deviation coefficient and second deviation coefficient, respectively.
[0010] The process of using the trained corrosion prediction model to process the corrosion measurement information set to obtain the predicted corrosion value of the metallic material includes: S31, using the trained corrosion prediction model, the thickness value sequence, resistivity ratio sequence, and light intensity change value sequence obtained at the same measurement time in the corrosion measurement information set are processed to obtain the predicted value of the measurement time. S32 performs a fusion calculation on the predicted values from all measurement times to obtain the predicted corrosion value of the metallic material.
[0011] The expression for the fusion calculation process is: , Where M is the total number of measurement times, For the predicted value at the i-th measurement time, The mean of the predicted values for all measurement times. This represents the predicted corrosion value for metallic materials.
[0012] A second aspect of this invention discloses a deep learning-based device for predicting corrosion of metallic materials, the device comprising: Memory containing executable program code; A processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the deep learning-based metal corrosion prediction method.
[0013] In a third aspect of this invention, a computer-storable medium is disclosed, wherein the computer-storable medium stores computer instructions, and when the computer instructions are invoked by a computer, they are used to execute the deep learning-based metal material corrosion prediction method.
[0014] In a fourth aspect of this invention, an information data processing terminal is disclosed, which is used to implement the deep learning-based metal material corrosion prediction method.
[0015] The beneficial effects of this invention are as follows: This invention proposes an intelligent prediction method for metal material corrosion, forming a complete and efficient solution from data acquisition and model training to prediction result output. By comprehensively collecting multiple types of corrosion measurement information, such as thickness value sequences, resistivity ratio sequences, and light intensity change sequences, and combining them with a carefully designed corrosion prediction model and loss function, it can deeply explore the complex characteristics and patterns in the corrosion process of metal materials, achieving accurate prediction of metal material corrosion. This method can be widely applied to corrosion prediction scenarios for various metal materials under different environments and working conditions, helping related industries to grasp the corrosion trend of metal materials in advance, take timely protective measures, reduce the risk of equipment damage and safety accidents caused by metal corrosion, and reduce economic losses. It also provides a scientific and reliable decision-making basis for the research and development and maintenance of metal materials, possessing significant engineering application value and substantial economic benefits. Attached Figure Description
[0016] Figure 1 This is a flowchart illustrating the implementation of the method of the present invention. Detailed Implementation
[0017] To better understand the content of this invention, an embodiment is provided here.
[0018] Figure 1 This is a flowchart illustrating the implementation of the method of the present invention.
[0019] In a first aspect, this invention discloses a deep learning-based method for predicting corrosion of metallic materials, comprising: S1, Obtain a set of corrosion measurement information for metallic materials; the set of corrosion measurement information includes a set of thickness value sequences, a set of resistivity ratio sequences, and a set of light intensity change value sequences; S2, Train the preset corrosion prediction model to obtain the trained corrosion prediction model; S3. Using the trained corrosion prediction model, the corrosion measurement information set is processed to obtain the corrosion prediction value of the metal material. The corrosion prediction model includes: a first convolution module, a second convolution module, a third convolution module, a fourth convolution module, a first normalization module, a first activation module, a second normalization module, a second activation module, a channel splitting module, a channel shuffling module, a first pooling module, a multi-head attention module, and a fully connected module. The input of the first convolutional module is configured as the model input of the corrosion prediction model, and the output of the first convolutional module is connected to the input of the first pooling module; the output of the first pooling module is connected to the input of the channel splitting module; the output of the channel splitting module is connected to the input of the second convolutional module and the input of the multi-head attention module, respectively; the output of the second convolutional module is connected to the input of the first normalization module; the output of the first normalization module is connected to the input of the third convolutional module; the output of the third convolutional module is connected to the input of the first activation module; the output of the first activation module is connected to the input of the fourth convolutional module; the output of the fourth convolutional module is connected to the input of the second normalization module; the output of the second normalization module is connected to the input of the second activation module; the output of the second activation module is connected to the input of the multi-head attention module; the output of the multi-head attention module is connected to the input of the channel shuffling module; the output of the channel shuffling module is connected to the input of the fully connected module; the output of the fully connected module is configured as the model output of the corrosion prediction model.
[0020] The corrosion prediction model constructed in this invention significantly enhances the ability to extract and analyze corrosion features of metallic materials through a unique module combination and connection method. The cascading of multiple convolutional modules (first, second, third, and fourth convolutional modules) enables feature extraction from input corrosion measurement information at different scales, gradually capturing subtle feature changes during the corrosion process of metallic materials. The pooling module (first pooling module) effectively reduces data dimensionality, reducing computational load while retaining key features. The combination of the channel splitting module and the channel shuffling module breaks down the information barriers between channels in traditional models, promoting the exchange and fusion of information from different channels. This allows the model to fully utilize the complementary information between multiple data sources, such as sets of thickness value sequences, resistivity ratio sequences, and light intensity change sequences. The multi-head attention module adaptively focuses on the importance of different data features to corrosion prediction, enhancing the model's ability to capture key features and improving prediction accuracy. The fully connected module integrates the extracted features and outputs the final corrosion prediction value. The entire model has a compact structure and powerful functions, which can effectively handle complex metal corrosion prediction tasks. Compared with traditional models, it has stronger feature extraction and generalization capabilities.
[0021] The training process of the corrosion prediction model includes: Obtain a training dataset; the training dataset includes training data and corresponding label information; the training data includes a sequence of thickness values, a sequence of resistivity ratios, and a sequence of light intensity changes collected at the same measurement time; the label information is the corrosion value corresponding to the training data; Initialize the number of training iterations and the parameters of the corrosion prediction model; The training data in the training dataset is used as input data and input into the corrosion prediction model. The input data is processed using the corrosion prediction model to obtain predicted values; The difference between the predicted value and the label information corresponding to the input data is calculated to obtain the difference value. Determine whether the difference value satisfies the convergence condition to obtain the first determination result; When the first judgment result is negative, it is determined whether the training iteration count value is equal to the training count threshold to obtain the second judgment result; When the second judgment result is negative, the model training state is determined to be that the termination training condition is not met. When the second judgment result is yes, it is determined that the model training state meets the termination training condition; When the first judgment result is yes, it is determined that the model training state meets the termination training condition; When the model training state does not meet the termination training condition, the parameters of the corrosion prediction model are updated using the parameter update model, the training iteration count is increased by 1, and the training data in the training dataset is used as input data to the corrosion prediction model. When the model training state meets the termination training condition, the training process of the corrosion prediction model is completed, and the trained corrosion prediction model is obtained.
[0022] The parameter update model is calculated using the following expression: , in, The parameters of the corrosion prediction model are represented. This indicates the update step size of the corrosion prediction model. , Indicates to In Calculate the gradient of the parameters. This represents the loss function of the corrosion prediction model. This represents the updated parameter values of the corrosion prediction model. , indicating the use The parameters of the corrosion prediction model Update.
[0023] The loss function is: , Where YC is the value of the loss function. To predict the value of the i-th training data in the training dataset, The label information for the i-th training data in the training dataset is used, and N1 is the number of training iterations. and These are the preset first deviation coefficient and second deviation coefficient, respectively.
[0024] The design of the loss function fully considers the different properties of prediction errors. Among them, By introducing sine and exponential functions to weight the prediction error, the influence of larger errors can be amplified, making the model pay more attention to data with large prediction deviations during training, effectively avoiding the model from getting trapped in local optima. The absolute values of the prediction errors are then summed to control the overall deviation between the predicted and actual values. This is achieved by adjusting a preset first deviation coefficient. Second deviation coefficient This design allows for a flexible balance of weights between the two error calculation methods, enabling the model to converge quickly during training while maintaining the accuracy and stability of the prediction results. This carefully designed loss function significantly improves the model's training performance; compared to traditional loss functions, it more effectively guides model learning, thereby enhancing the accuracy and reliability of predicting corrosion in metallic materials.
[0025] The difference value satisfies the convergence condition when it is less than a preset convergence threshold; the difference value does not satisfy the convergence condition when it is not less than a preset convergence threshold.
[0026] The difference calculation process can be implemented using a loss function.
[0027] The loss function can be the cross-entropy loss function.
[0028] It should be noted that the above-mentioned channel shuffle module is built based on channel shuffle to ensure that the input of the subsequent group convolution comes from different groups, so that information can flow between different groups. This embodiment of the invention does not limit this.
[0029] It should be noted that the above-mentioned channel splitting module is built based on Channel Split to divide into two branches with the same number of channels, and this embodiment of the invention does not limit this.
[0030] It should be noted that the first and third convolutional modules mentioned above are 1×1 ordinary convolutions, with a stride of 2. Furthermore, the second and fourth convolutional modules are 3×3 depthwise convolutions, with a stride of 2, used to achieve feature dimensionality reduction and reduce computational load. This embodiment of the invention does not impose limitations on these modules.
[0031] It should be noted that the multi-head attention module can be implemented using the multi-head attention model in the Transformer model.
[0032] Based on the Concat operation, this invention aims to double the number of channels and increase the network width, but this embodiment is not limited to any particular method.
[0033] It should be noted that the first pooling module mentioned above is a max pooling layer with a step size of 1, and this embodiment of the present invention does not limit it.
[0034] It should be noted that the first normalization module and the second normalization module mentioned above are constructed based on the batch normalization layer, and this embodiment of the invention does not limit them.
[0035] It should be noted that the first activation module and the second activation module mentioned above are constructed based on the ReLU activation function, and this embodiment of the invention does not limit them.
[0036] The process of using the trained corrosion prediction model to process the corrosion measurement information set to obtain the predicted corrosion value of the metallic material includes: S31, using the trained corrosion prediction model, the thickness value sequence, resistivity ratio sequence, and light intensity change value sequence obtained at the same measurement time in the corrosion measurement information set are processed to obtain the predicted value of the measurement time. S32, perform fusion calculation on the predicted values of all measurement times to obtain the corrosion prediction value of the metal material; the corrosion prediction value is used to characterize the probability of the metal material rusting, and the larger the value, the more easily the metal material rusts.
[0037] The expression for the fusion calculation process is: , Where M is the total number of measurement times, For the predicted value at the i-th measurement time, The mean of the predicted values for all measurement times. This represents the predicted corrosion value for metallic materials.
[0038] This fusion calculation expression effectively improves the accuracy of predicting metal corrosion by combining predicted values from multiple measurement time points. The expression uses sine and exponential functions to weight the predicted values from different measurement times. (Sine function) Predicted values for each measurement time were considered. Mean of all measured time predictions The relative deviation of the predicted value from the mean. When the predicted value deviates significantly from the mean, the sine function will change accordingly, thus appropriately adjusting the predicted value and preventing individual outlier predicted values from having an excessive impact on the final result. Exponential function This further amplifies the differences between different predicted values, enabling the calculation process to more sensitively capture the changing trends of predicted values, highlighting those predicted values that deviate significantly from the mean and contain important information, thus making the final corrosion prediction value more reflective of the true corrosion situation of metal materials.
[0039] The sequence of light intensity changes is obtained by measuring the metal material using a fiber optic corrosion sensor at a preset set of corrosion times. In all embodiments of the present invention, the variables involved in all computational expressions or mathematical functions have been dimensionlessized before computation.
[0040] In all embodiments of the present invention, the values of the independent variables in the input of all computational expressions or mathematical functions meet the reasonable requirements of the input range of the computational expressions or mathematical functions, and can ensure that the computational expressions or mathematical functions can be calculated smoothly without violating physical laws or mathematical rules.
[0041] A second aspect of this invention discloses a deep learning-based device for predicting corrosion of metallic materials, the device comprising: Memory containing executable program code; A processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the deep learning-based metal corrosion prediction method.
[0042] In a third aspect of this invention, a computer-storable medium is disclosed, wherein the computer-storable medium stores computer instructions, and when the computer instructions are invoked by a computer, they are used to execute the deep learning-based metal material corrosion prediction method.
[0043] In a fourth aspect of this invention, an information data processing terminal is disclosed, which is used to implement the deep learning-based metal material corrosion prediction method.
[0044] The above description is merely an embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of the present invention should be included within the scope of the claims of the present invention.
Claims
1. A method for predicting corrosion of metallic materials based on deep learning, characterized in that, include: S1, Obtain a set of corrosion measurement information for metallic materials; the set of corrosion measurement information includes a set of thickness value sequences, a set of resistivity ratio sequences, and a set of light intensity change value sequences; S2, Train the preset corrosion prediction model to obtain the trained corrosion prediction model; S3. Using the trained corrosion prediction model, the corrosion measurement information set is processed to obtain the corrosion prediction value of the metal material.
2. The deep learning-based method for predicting corrosion of metallic materials as described in claim 1, characterized in that, The corrosion prediction model includes: a first convolution module, a first pooling module, a second convolution module, a third convolution module, a fourth convolution module, a first normalization module, a first activation module, a second normalization module, a pooling module, a second activation module, a channel splitting module, a channel shuffling module, a multi-head attention module, and a fully connected module. The input of the first convolutional module is configured as the model input of the corrosion prediction model, and the output of the first convolutional module is connected to the input of the first pooling module. The output of the first pooling module is connected to the input of the channel splitting module. The output of the channel splitting module is connected to the inputs of the second convolutional module and the multi-head attention module, respectively. The output of the second convolutional module is connected to the input of the first normalization module. The output of the first normalization module is connected to the input of the third convolutional module. The output of the third convolutional module is connected to the input of the first activation module. The output of the first activation module is connected to the input of the fourth convolutional module. The output of the fourth convolutional module is connected to the input of the second normalization module. The output of the second normalization module is connected to the input of the pooling module. The output of the pooling module is connected to the input of the second activation module. The output of the second activation module is connected to the input of the multi-head attention module. The output of the multi-head attention module is connected to the input of the channel shuffling module. The output of the channel shuffling module is connected to the input of the fully connected module. The output of the fully connected module is configured as the model output of the corrosion prediction model.
3. The method for predicting corrosion of metallic materials based on deep learning as described in claim 1, characterized in that, The training process of the corrosion prediction model includes: Obtain a training dataset; the training dataset includes training data and corresponding label information; the training data includes a sequence of thickness values, a sequence of resistivity ratios, and a sequence of light intensity changes collected at the same measurement time; the label information is the corrosion value corresponding to the training data; Initialize the number of training iterations and the parameters of the corrosion prediction model; The training data in the training dataset is used as input data and input into the corrosion prediction model. The input data is processed using the corrosion prediction model to obtain predicted values; The difference between the predicted value and the label information corresponding to the input data is calculated to obtain the difference value. Determine whether the difference value satisfies the convergence condition to obtain the first determination result; When the first judgment result is negative, it is determined whether the training iteration count value is equal to the training count threshold to obtain the second judgment result; When the second judgment result is negative, the model training state is determined to be that the termination training condition is not met. When the second judgment result is yes, it is determined that the model training state meets the termination training condition; When the first judgment result is yes, it is determined that the model training state meets the termination training condition; When the model training state does not meet the termination training condition, the parameters of the corrosion prediction model are updated using the parameter update model, the training iteration count is increased by 1, and the training data in the training dataset is used as input data to the corrosion prediction model. When the model training state meets the termination training condition, the training process of the corrosion prediction model is completed, and the trained corrosion prediction model is obtained.
4. The deep learning-based method for predicting corrosion of metallic materials as described in claim 3, characterized in that, The parameter update model is calculated using the following expression: , in, The parameters of the corrosion prediction model are represented. This indicates the update step size of the corrosion prediction model. , Indicates to In Calculate the gradient of the parameters. This represents the loss function of the corrosion prediction model. This represents the updated parameter values of the corrosion prediction model. , indicating the use The parameters of the corrosion prediction model Update.
5. The deep learning-based method for predicting corrosion of metallic materials as described in claim 3, characterized in that, The loss function is: , Where YC is the value of the loss function. To predict the value of the i-th training data in the training dataset, The label information for the i-th training data in the training dataset is used, and N1 is the number of training iterations. and These are the preset first deviation coefficient and second deviation coefficient, respectively.
6. The deep learning-based method for predicting corrosion of metallic materials as described in claim 3, characterized in that, The process of using the trained corrosion prediction model to process the corrosion measurement information set to obtain the predicted corrosion value of the metallic material includes: S31, using the trained corrosion prediction model, the thickness value sequence, resistivity ratio sequence, and light intensity change value sequence obtained at the same measurement time in the corrosion measurement information set are processed to obtain the predicted value of the measurement time. S32 performs a fusion calculation on the predicted values from all measurement times to obtain the predicted corrosion value of the metallic material.
7. The deep learning-based method for predicting corrosion of metallic materials as described in claim 6, characterized in that, The expression for the fusion calculation process is: , Where M is the total number of measurement times, For the predicted value at the i-th measurement time, The mean of the predicted values for all measurement times. This represents the predicted corrosion value for metallic materials.
8. A deep learning-based device for predicting corrosion of metallic materials, characterized in that, The device includes: Memory containing executable program code; A processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the deep learning-based metal corrosion prediction method as described in any one of claims 1 to 7.
9. A computer-storable medium, characterized in that, The computer storage medium stores computer instructions, which, when invoked by the computer, are used to execute the deep learning-based metal material corrosion prediction method as described in any one of claims 1 to 7.
10. An information data processing terminal, characterized in that, The information data processing terminal is used to implement the deep learning-based metal material corrosion prediction method as described in any one of claims 1 to 7.