To develop a robust approach for detecting regions susceptible to corrosion within the nanometric passive layer, we selected RM coupled with electrochemistry (Figure ), which initiates the layer's formation and subsequent rupture. In this work, we used a mirror-polished SS 316L sample with a surface area of 50 mm 2 under strong anodic polarization of +1.6 V vs. Ag/AgCl to induce the formation of a passive layer and subsequent pit initiation within a single experiment. The passive layer initially forms at open circuit potential (OCP) after the reduction of the native oxide, while its further growth continues under strong anodic polarization. A 1 mm 2 area of this sample was dynamically monitored optically, with a spatial resolution of 0.48 µm. This field of view was large enough to observe the simultaneous formation of dozens of pits. This section focuses on the correlation of the chronoamperometry (CA) curve curve and raw optical images at a 50 mM NaCl concentration to describe the overall observed trends in the film formation and subsequent rupture. The following sections explore a detailed analysis of pit locations in relation to passive film properties, employing unsupervised ML on the entire set of optical images from experiments with NaCl concentrations of 5, 10 (repeated twice), 30 (repeated twice), 50, and 100 mM (data available on Zenodo () with further experimental details given in the Supplementary Information (SI-1)).