Green corrosion inhibitors have been widely used as sustainable replacements for synthetic organic inhibitors. The application of adiantum capillusveneris (ACV) extract to mitigate mild steel corrosion in a hydrochloric acid solution was the main focus of this investigation. Corrosion inhibition was studied using electrochemical impedance spectroscopy (EIS) and polarization techniques. EIS curves were modeled using a shallow neural network. Subsequently, a multiobjective genetic algorithm was employed to identify the optimal combination of concentration and time, represented by a Pareto front. EIS revealed an inhibitory efficacy of 88% at the optimal concentration of 800 ppm. Polarization results showed that ACV acted as a mixed inhibitor, and at 800 ppm, the corrosion current density decreased from 105 to 44 μA/ cm 2 . Surface analytical techniques confirmed the corrosion-inhibitory effect of ACV. Results indicated that the sample selected from the lower lobe of the Pareto front, dominated by impedance magnitude, outperformed other tested samples. Furthermore, the machine learning-based corrosion prediction model demonstrated a high accuracy. This work highlighted the viability of machine learning in assessing corrosion resistance and improved the generalization capacity of optimizing corrosion inhibitors.