Skip to content
Open access

Corrosion Prediction of AZ31 Mg Alloy Using Machine Learning and Digital Smartphone Images

Oct 2026 · ACS Omega · 0 citations · 40 references

Abstract

This work presents a machine learning approach for analyzing the corrosion behavior of AZ31 magnesium alloy using digital images acquired with a smartphone camera assembled to a homemade studio. A controlled imaging system combined with automated feature extraction enabled the quantification of surface color and texture changes associated with corrosion progression. After removing multicollinearity through correlation-based feature selection, the resulting descriptors were used to develop supervised models for two different complementary tasks. First, classification models were trained to categorize samples according to corrosion exposure time (in days) based solely on image-derived features. The Linear Support Vector Classifier (LinearSVC) achieved the best performance, reaching a test accuracy of 0.906. Second, regression models were developed to quantitatively predict hydrogen evolution during corrosion from the same image descriptors. The optimized k-Nearest Neighbors (KNN) regressor provided the most accurate prediction of hydrogen volume (R2 = 0.914), along with low RMSE (1.76 mL) and MAE (0.94 mL) values, indicating strong agreement between predicted and experimental hydrogen volumes. These results demonstrate that macroscopic image features encode relevant physicochemical information related to corrosion processes, enabling both the classification of corrosion stages and the quantitative prediction of hydrogen generation using a rapid, low-cost, and nondestructive approach.

Read PDF

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.