Next Article in Journal
Virtual Reality in PCATD-Based Instrument Flight Training: A Quasi-Transfer of Training Study
Previous Article in Journal
Prediction of Sleep Apnea Occurrence from a Single-Lead Electrocardiogram Using Stacking Hybrid Architecture with Gated Recurrent Neural Network Architectures and Logistic Regression
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Communication

Development and Application of an Intelligent Virtual Instrument for Corrosion Characterization in Metallic Materials by Computer Vision, Colorimetry and Fuzzy Logic in the Metalworking Industry of Mexico

by
Mario Curiel
,
Rogelio A. Ramos Irigoyen
*,
Juan Ricardo Salinas Martínez
,
P. M. D. Osuna
and
Judith M. Paz-Delgadillo
Institute of Engineering, Mexicali Campus, Autonomous University of Baja California, Blvd. Benito Juárez, Insurgentes Este, Mexicali 21280, Mexico
*
Author to whom correspondence should be addressed.
Technologies 2026, 14(2), 93; https://doi.org/10.3390/technologies14020093
Submission received: 6 November 2025 / Revised: 10 December 2025 / Accepted: 18 December 2025 / Published: 1 February 2026
(This article belongs to the Section Manufacturing Technology)

Abstract

This paper presents the development of an Intelligent Virtual Instrument (VI) for detecting and characterizing corrosion on aluminum and steel surfaces. Implemented within the LabVIEW® environment, the system utilizes colorimetric computer vision techniques tailored for the metalworking industry. The methodology integrates colorimetric and roughness analysis with Artificial Intelligence, specifically employing Fuzzy Logic for decision-making and Deep Learning algorithms for image processing. This system enables personnel without specialized training to perform rapid, objective diagnostics. The results demonstrate a high correlation between the color spectra of processed images and standard industry patterns, validating the instrument as an efficient and reliable alternative for diverse industrial environments.

1. Introduction

Corrosion is a critical challenge that significantly compromises the physical and mechanical properties of metallic materials, generating substantial global economic losses [1]. Specifically, within the Mexican metalworking industry, structural integrity and operational efficiency are constantly threatened, particularly in environments with adverse weather conditions and high pollution levels. Traditional inspection methods—such as human visual inspection, ultrasound, or destructive testing—are costly, time-consuming, and require highly specialized personnel [2]. These factors hinder their efficient integration into high-volume production lines, directly impacting product quality and machinery downtime, thus creating an urgent need for rapid, non-destructive, and accessible diagnostic solutions.
In this challenging context, this research focuses on Computer Vision systems and Artificial Intelligence (AI) for automated corrosion detection. Related studies have demonstrated the feasibility of using texture analysis or image processing for corrosion detection in pipelines, achieving notable accuracies, such as the 92.81% reported in [3]. Other approaches include the application of Gray-Level Co-occurrence Matrices (GLCM) to evaluate corrosion growth [4,5]. However, these approaches face two key limitations:
  • Technological Fragmentation: Many advanced systems focus on a single method—either texture or color exclusively—and often require multiple proprietary software platforms, thereby increasing integration complexity and cost [6].
  • Decision-Making Rigidity: Most systems rely on fixed thresholds or statistical analyses that struggle to handle the inherent ambiguity and uncertainty of early-stage corrosion, where color and roughness boundaries are non-binary.
Addressing these limitations constitutes the primary gap this work aims to fill. This justifies the need for an integral inspection system that intelligently combines multiple corrosion features (color, roughness) in real-time with a decision-making mechanism that is robust against uncertainty. To achieve this integration, this paper presents the development of a Virtual Instrument (VI) for detecting and characterizing corrosion on carbon steel and aluminum surfaces.
The system utilizes the LabVIEW® platform (version 2021), recognized for its efficacy in creating real-time control and measurement interfaces for manufacturing and quality control applications [7,8]. Virtual instrumentation transforms a standard computer into a versatile diagnostic interface, significantly reducing hardware costs. Furthermore, the use of the Wavelet transform [9] for image preprocessing ensures the clarity of input data.
Consequently, the main contribution of this work lies in the methodological and operational integration of three key components:
  • Computer Vision and Advanced Colorimetry: Analyzing the color spectrum of corroded metals and surface alterations.
  • Roughness Analysis: Using gray-level histograms and texture feature extraction to quantify surface deterioration.
  • Fuzzy Logic: Employing an intelligent inference engine for decision-making under uncertainty, overcoming the rigidity of traditional binary thresholds and characterizing corrosion more precisely than human optical inspection [10].
This hybrid approach, implemented in LabVIEW®, represents a novelty by offering a diagnostic quality equivalent to invasive methods but with the speed and accessibility required by the metalworking industry. In summary, this work presents a system to detect and identify corrosion on metallic surfaces using AI techniques for digital image analysis. The objective is to optimize industrial processes, reduce inspection times, and minimize human error, thereby improving the efficiency and reliability of decision-making in the target sector.

2. Materials and Methods

Methodology
Materials and Sample Preparation
To develop and validate the Virtual Instrument (VI), accelerated corrosion tests were conducted using a salt spray chamber, adhering to ASTM G1-03 (ASTM International, 2003) [11] and ASTM D1654 (ASTM International, 2008) [12]. The experimental sample set consisted of 17 steel coupons (1″ × 3″) and 16 aluminum coupons (0.5″ × 1″). These tests induced both uniform and pitting corrosion, providing a diverse dataset for calibration and validation.
Experimental Setup and Image Acquisition
Images of both corroded and non-corroded surfaces were acquired using an AVEN Cyclops 4K Ultra HD Digital Microscope, Aven Tools, Ann Arbor, MI, USA. This equipment was selected for its ability to provide the necessary resolution, lighting control, and focus depth to capture surface texture and color fidelity. The microscope features a magnification range of 13× to 140× (relative to a 24″ monitor) and a 4× lens, ensuring high-quality 4K digitization.
The core of the system is the Virtual Instrument developed within the LabVIEW® environment. The complete characterization process, illustrated in the system block diagram (Figure 1), follows a sequential pipeline designed to transform raw images into quantitative data—specifically, color spectrum vectors and gray-level histogram standard deviations.
Image Processing Pipeline
The image processing methodology consists of five key stages:
3.
Noise Reduction (Preprocessing): To ensure data integrity, captured images undergo noise attenuation using the Undecimated Wavelet Transform via the LabVIEW Denoise function. A Daubechies (db02) wavelet at level 4 was selected to remove Gaussian white noise, configured with the SURE threshold rule and Single-level rescaling method.
4.
Region of Interest (ROI) Selection: The system enables the user to define a specific area for inspection. Using the IMAQ Convert ROI to Rectangle VI, the user-defined descriptor is converted into a coordinate rectangle, and the selected sub-image is extracted and saved in JPG format for analysis.
5.
Color Spectrum Analysis: The ROI is processed using the IMAQ ColorLearn VI, which employs Deep Learning algorithms to extract color features. The color spectrum is mapped in the HSL space (Hue, Saturation, Luminance), divided into sectors and bins according to sensitivity. This generates an array representing the percentage of pixels associated with dominant hues.
6.
Roughness Quantification: The system computes the gray-level histogram of the processed image. The Standard Deviation (σ) of this histogram is utilized as a proxy for surface roughness; a higher deviation indicates greater contrast variation typical of corroded textures. If the deviation is negligible, the system may discard the image as non-corroded at this early stage.
7.
Color Matching: The IMAQ ColorMatch VI compares the chromatic content of the sample against a library of pre-defined standard patterns (reference images of pristine and corroded metals). This function quantifies the correspondence between the input spectrum and the reference spectra.
Intelligent Decision System: Fuzzy Logic
To handle the uncertainty inherent in early-stage corrosion detection, a Fuzzy Logic inference engine was implemented using the LabVIEW Fuzzy System Designer.
Validation of Critical Thresholds
The determination of detection thresholds and fuzzy set boundaries relied on a knowledge engineering process based on Expert Consensus. A modified Delphi method was employed with a panel of three experts in metal-mechanical corrosion characterization to ensure reliability.
  • Roughness Threshold: Analysis of 50 reference images (25 clean, 25 incipient corrosion), previously characterized via non-contact optical profilometry, revealed that a gray-level histogram Standard Deviation > 10 served as a consistent inflection point. This value showed a Pearson correlation coefficient > 0.85 with expert visual assessment and was adopted as the empirical threshold for the ‘Low’ membership function of the ‘Roughness’ variable.
  • Color Thresholds: Similarly, color spectrum match percentages (0–100%) were mapped from qualitative expert interpretations (e.g., “Low Match” vs. “High Match”) to quantitative ranges to define the trapezoidal membership functions.
Fuzzy Logic Architecture
The system uses a Mamdani model with the following configuration:
  • Input Variables:
    Color: Three trapezoidal membership functions (Low, Medium, High) covering a range of 0–100 (match percentage).
    Roughness: Three trapezoidal membership functions (Low, Medium, High) covering a range of 0–50 (standard deviation values).
  • Output Variable:
    Result: Three trapezoidal membership functions (No Corrosion, Potential Corrosion, Corrosion) ranked 0–10, where 10 indicates high corrosion probability.
Inference Rules and Defuzzification
A total of 9 IF-THEN rules were established to cover all combinations of the input states (3 × 3). These rules model human reasoning by managing “gray areas” more effectively than binary logic. Examples include:
  • IF Color IS High AND Roughness IS Low THEN Result IS No Corrosion.
  • IF Color IS Low AND Roughness IS High THEN Result IS Corrosion.
The Center of Area (CoA) method is used for defuzzification, providing a weighted, representative output value that determines the final diagnostic status: No Corrosion, Potential Corrosion, or Corrosion. sample: has no corrosion, has potential corrosion, or is non-metallic.

3. Results

To quantitatively evaluate the performance of the Virtual Instrument (VI), a dataset comprising 33 metal coupons (17 carbon steel and 16 aluminum) was utilized. To ensure a statistically robust validation, 20 Regions of Interest (ROI) were randomly selected from each coupon, resulting in a total of 660 test images. These images were independently classified by expert personnel to establish the ground truth prior to processing by the VI. The dataset was distributed across the defined classification categories (No Corrosion, Potential Corrosion, and Corrosion) to test the system’s capability across all three states.
The final classification performance, determined by the Fuzzy Logic engine integrating color and roughness, was analyzed using a Confusion Matrix generated from the 660 test images.
System Accuracy
The Virtual Instrument achieved an overall accuracy of 96.1% in classifying the three corrosion states. This result demonstrates the efficacy of the fuzzy model in replicating expert judgments. It is crucial to distinguish this performance metric from the 95% color spectrum similarity mentioned in the preliminary tests; the latter acts solely as an input variable for the fuzzy system, whereas the 96.1% represents the final diagnostic success rate.
Error Analysis (False Positives and False Negatives)
To ensure industrial reliability, error rates were analyzed to determine the system’s operational safety:
  • False Positive Rate (FPR): 2.5%. This indicates a low incidence of Type I errors (unnecessary inspections), where non-corroded samples are incorrectly flagged.
  • False Negative Rate (FNR): 1.4%. This exceptionally low rate is critical, as it minimizes the risk of Type II errors (accepting defective material). This demonstrates the system’s reliability for quality control, as it rarely ignores actual corrosion instances.
The low FNR value is a key indicator that integrating Fuzzy Logic with roughness analysis significantly enhances system sensitivity compared to methods based solely on color, thereby ensuring the detection of incipient corrosion.
Visual and Statistical Validation
Processing tests confirmed the system’s ability to correlate visual features with the fuzzy model inputs effectively.
  • Visual Matching: Figure 2 presents the visual comparison between standard pattern images and test samples. It demonstrates that high chromatic similarity (>95%) remains consistent in detecting different corrosion types (both uniform and pitting) on carbon steel.
  • Roughness Analysis: Figure 3 illustrates the differentiation capability based on the gray-level histogram. The non-corroded image (Figure 3a) presented a Standard Deviation (σ) of 4.20, confirming a uniform surface. In contrast, the corroded image (Figure 3b) showed a σ of 26.33, indicating high contrast and significant surface roughness.
Processing Efficiency: Finally, the average processing time for the complete algorithm was 2 s per image. This speed validates the viability of the Virtual Instrument for real-time inspection applications within industrial production lines.

4. Discussion

The development of this Virtual Instrument (VI) represents a significant advancement by functionally integrating Computer Vision, Colorimetry, Roughness Analysis, and Fuzzy Logic within a unified LabVIEW platform. By leveraging Fuzzy Logic, the system successfully models the uncertainty inherent in the visual analysis of incipient corrosion, thereby reducing human error and enhancing diagnostic objectivity. Furthermore, the processing capability of 2 s per image positions it as a viable tool for rapid online inspection.
Performance Benchmarking
The system achieved an overall classification accuracy of 96.1%. This result, attained through the fusion of colorimetry and roughness data, surpasses the 92.81% accuracy reported by [13] for systems predominantly based on image processing for pipeline corrosion detection. This 3.29 percentage point improvement underscores the efficacy of the Fuzzy Inference Engine in handling the multivariable complexity of corrosion, proving superior to single-variable approaches.
Regarding processing efficiency, while other studies such as [13] have achieved similar accuracy levels, they often rely on complex Deep Learning algorithms that require longer inference times or substantial computational power. The VI’s average of 2 s per image demonstrates an optimal balance between high accuracy and speed, a critical feature for application in high-volume industrial inspection.
Clarification on Metrics: It is important to note that the 95% color match observed in tests is not the final accuracy metric, but rather an input variable feeding the model. The final 96.1% performance arises from the weighted combination of color matching and roughness standard deviation within the Fuzzy Logic system.
Industrial Implications
The implementation of the VI offers substantial advantages in terms of cost, time, and usability for the metalworking industry:
  • Operational Cost Reduction: By operating on the LabVIEW platform with accessible vision hardware, the system eliminates dependency on expensive traditional NDT methods and the constant need for expert personnel for routine inspections.
  • Factory Implementation: The system is designed for seamless integration into production lines. The digital microscope can be mounted on a fixed inspection station or a robotic arm (controlled via LabVIEW) to automatically capture images and transmit a binary diagnosis (Corrosion/No Corrosion) to a SCADA system in under 2 s. This enables immediate sorting and facilitates material traceability.
Limitations and Future Work
Finally, certain limitations were identified that will guide future research. The current system performance was evaluated using high-quality images captured in a controlled environment.
  • Resolution Constraints: Limitations in the resolution of the captured images influenced the detection of micro-scale pitting corrosion.
  • Future Recommendations: Future iterations should incorporate image acquisition devices with higher resolution for digitization. Additionally, the integration of an illumination normalization module is recommended to ensure system robustness under the variable lighting conditions typical of real-world factory environments.

5. Conclusions

The Virtual Instrument (VI) developed in this study has been validated as an effective and objective tool for characterizing corrosion in metallic materials, specifically carbon steel and aluminum. Its implementation, based on the synergy of Computer Vision and Fuzzy Logic within LabVIEW®, enables rapid and reliable diagnostics—achieving a 96.1% accuracy with a 2 s processing latency. These results demonstrate the system’s viability to replace or complement traditional inspection methods, which are often costly, subjective, and slow.
The system’s adaptability to different material types and high-speed processing capability represents a direct contribution to optimizing inspection workflows and mitigating costs associated with corrosion failures in the metalworking industry. Furthermore, this approach aligns with recent advancements in AI-based foundation models and intelligent decision-making [14], contributing empirical evidence to the broader debate on automated industrial diagnostics.
Limitations. Despite its high performance, the current system presents specific limitations that define the scope of this study:
  • Environmental Sensitivity: The inference engine exhibits sensitivity to drastic changes in ambient lighting, as the membership functions were calibrated under controlled laboratory conditions.
  • Optical Resolution: The resolution of the digital microscope used imposed constraints on the ability to classify micro-scale pitting corrosion with absolute certainty, indicating a need for higher pixel density for fine texture analysis.
Future Work. To enhance the robustness and industrial applicability of the Virtual Instrument, future research will focus on three key areas:
  • Hardware and Algorithmic Enhancement: Integrating higher-resolution image acquisition devices and employing Advanced Deep Learning techniques (such as Convolutional Neural Networks) to improve automatic defect segmentation. This will facilitate finer detection of pitting and micro-cracks.
  • Environmental Robustness: Developing an illumination normalization module based on image preprocessing algorithms to render the system immune to the variable lighting conditions typical of real-world factory environments.
  • Rule Base Expansion: Expanding the fuzzy logic rule base to include additional environmental input variables—such as temperature and relative humidity—to evolve the system into a more comprehensive predictive diagnostic model.

6. Patents

In Mexico, computer programs are protected under the legal category of “computer program” by the National Institute of Copyright (INDAUTOR). The work presented here generated two copyrights registered with INDAUTOR under the names Programa de Computo para la Detección Uniforme por Visión Computacional, registration number 03-2021-061110021700-01, and Carcaterizador de Parametros Colorimetricos y de Textura para Acero al Carbono y Aluminio como Indicadores de Corrosión, registration number 03-2023-060813101800-01.

Author Contributions

Conceptualization, M.C. and R.A.R.I.; methodology, R.A.R.I. and M.C.; software, R.A.R.I.; validation, M.C., R.A.R.I., J.R.S.M., P.M.D.O. and J.M.P.-D.; formal analysis, M.C. and R.A.R.I.; investigation, M.C., R.A.R.I., J.R.S.M., P.M.D.O. and J.M.P.-D.; resources, R.A.R.I.; data curation, M.C.; writing—original draft preparation, M.C.; writing—review and editing, R.A.R.I. and M.C.; visualization, M.C.; supervision, R.A.R.I.; project administration, R.A.R.I.; funding acquisition, R.A.R.I. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

The data presented in this study are available on request from the corresponding author. The data are not publicly available due to [especifica una razón, ej: privacy or ethical restrictions].

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Kusmierek, E.; Chrzescijanska, E. Atmospheric corrosion of metals in industrial city environment. Data Brief 2015, 3, 149–154. [Google Scholar] [CrossRef] [PubMed]
  2. Medeiros, F.N.; Ramalho, G.L.; Bento, M.P.; Medeiros, L.C. On the evaluation of texture and color features for nondestructive corrosion detection. Eurasip J. Adv. Signal Process. 2010, 2010, 817473. [Google Scholar] [CrossRef]
  3. Hoang, N.-D.; Tran, V.-D. Image Processing-Based Detection of Pipe Corrosion Using Texture Analysis and Metaheuristic-Optimized Machine Learning Approach. Comput. Intell. Neurosci. 2019, 2019, 8097213. [Google Scholar] [CrossRef] [PubMed]
  4. Fajardo, J.I.; Paltán, C.A.; López, L.M.; Carrasquero, E.J. Textural analysis by means of a gray level co-occurrence matrix method. Case: Corrosion in steam piping systems. Mater. Today Proc. 2021, 49, 149–154. [Google Scholar] [CrossRef]
  5. Pidaparti, R.M.; Hinderliter, B.; Maskey, D. Evaluation of Corrosion Growth on SS304 Based on Textural and Color Features from Image Analysis. ISRN Corros. 2013, 2013, 376823. [Google Scholar] [CrossRef]
  6. Feliciano, F.F.; Leta, F.R.; Mainier, F.B. Texture digital analysis for corrosion monitoring. Corros. Sci. 2015, 93, 138–147. [Google Scholar] [CrossRef]
  7. Zhou, L.; Zhang, L.; Konz, N. Computer Vision Techniques in Manufacturing. IEEE Trans. Syst. Man Cybern. Syst. 2022, 53, 105–117. [Google Scholar] [CrossRef]
  8. Hryniewicz, P.; Banaś, W.; Gwiazda, A.; Foit, K.; Sękala, A.; Kost, G. Technological process supervising using vision systems cooperating with the LabVIEW vision builder. IOP Conf. Ser. Mater. Sci. Eng. 2015, 95, 012086. [Google Scholar] [CrossRef]
  9. Ramos, R.; Valdez-Salas, B.; Zlatev, R.; Wiener, M.S.; Rull, J.M.B. The discrete wavelet transform and its application for noise removal in localized corrosion measurements. Int. J. Corros. 2017, 2017, 7925404. [Google Scholar] [CrossRef]
  10. Ramos, I.R.; Valdez, S.B.; Zlatev, K.R.; Schorr, W.M.; Carrillo, B.M.; Stoytcheva, M.S.; Garcia, I.R.; Martinez, M.M. A Virtual Instrument for Quantitative Assessment of Pitting Corrosion. Anti-Corros. Methods Mater. 2014, 61, 287–292. [Google Scholar] [CrossRef]
  11. ASTM G1-03; Standard Practice for Preparing, Cleaning, and Evaluating Corrosion Test Specimens. ASTM International: West Conshohocken, PA, USA, 2003.
  12. ASTM D1654-08; Standard Test Method for Evaluation of Painted or Coated Specimens Subjected to Corrosive Environments. ASTM International: West Conshohocken, PA, USA, 2008.
  13. Das, A.; Dorafshan, S.; Kaabouch, N. Autonomous Image-Based Corrosion Detection in Steel Structures Using Deep Learning. Sensors 2024, 24, 3630. [Google Scholar] [CrossRef] [PubMed]
  14. Huang, J.; Xu, Y.; Wang, Q.; Wang, Q.; Liang, X.; Wang, F.; Zhang, Z.; Wei, W.; Zhang, B.; Huang, L.; et al. Foundation models and intelligent decision-making: Progress, challenges, and perspectives. Innovation 2025, 6, 100948. [Google Scholar] [CrossRef] [PubMed]
Figure 1. Diagram for the operation and processing stages of the Virtual Instrument (Image Processing Pipeline).
Figure 1. Diagram for the operation and processing stages of the Virtual Instrument (Image Processing Pipeline).
Technologies 14 00093 g001
Figure 2. Comparison between images. (ae) are standard images, while (a’e’) are samples under study. In all cases, detection with a 95% color match.
Figure 2. Comparison between images. (ae) are standard images, while (a’e’) are samples under study. In all cases, detection with a 95% color match.
Technologies 14 00093 g002
Figure 3. Grayscale histograms and standard deviation values for roughness evaluation: (a) non-corroded surface (SD < 10) and (b) corroded surface (SD > 10). The symbol # represents the number of pixels.
Figure 3. Grayscale histograms and standard deviation values for roughness evaluation: (a) non-corroded surface (SD < 10) and (b) corroded surface (SD > 10). The symbol # represents the number of pixels.
Technologies 14 00093 g003
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Curiel, M.; Irigoyen, R.A.R.; Martínez, J.R.S.; Osuna, P.M.D.; Paz-Delgadillo, J.M. Development and Application of an Intelligent Virtual Instrument for Corrosion Characterization in Metallic Materials by Computer Vision, Colorimetry and Fuzzy Logic in the Metalworking Industry of Mexico. Technologies 2026, 14, 93. https://doi.org/10.3390/technologies14020093

AMA Style

Curiel M, Irigoyen RAR, Martínez JRS, Osuna PMD, Paz-Delgadillo JM. Development and Application of an Intelligent Virtual Instrument for Corrosion Characterization in Metallic Materials by Computer Vision, Colorimetry and Fuzzy Logic in the Metalworking Industry of Mexico. Technologies. 2026; 14(2):93. https://doi.org/10.3390/technologies14020093

Chicago/Turabian Style

Curiel, Mario, Rogelio A. Ramos Irigoyen, Juan Ricardo Salinas Martínez, P. M. D. Osuna, and Judith M. Paz-Delgadillo. 2026. "Development and Application of an Intelligent Virtual Instrument for Corrosion Characterization in Metallic Materials by Computer Vision, Colorimetry and Fuzzy Logic in the Metalworking Industry of Mexico" Technologies 14, no. 2: 93. https://doi.org/10.3390/technologies14020093

APA Style

Curiel, M., Irigoyen, R. A. R., Martínez, J. R. S., Osuna, P. M. D., & Paz-Delgadillo, J. M. (2026). Development and Application of an Intelligent Virtual Instrument for Corrosion Characterization in Metallic Materials by Computer Vision, Colorimetry and Fuzzy Logic in the Metalworking Industry of Mexico. Technologies, 14(2), 93. https://doi.org/10.3390/technologies14020093

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop