An innovative numerical method based on a machine learning approach is presented in order to design an Impressed Current Cathodic Protection (ICCP) control for the corrosion prevention of an ASTM $A36$ steel plate immersed in chlorinated solutions (3. 5% wt NaCl, Seawater and NS4). Experimental data collected from the metal structure and environment were used to generate the training set for forward and inverse Artificial Neural Networks (ANNs), enabling the numerical model for the development of control strategies that can adapt to changing conditions. Specifically, using the model data provided by the above-mentioned forward and inverse ANNs, we tuned, using a third ANN, a Proportional Integral Derivative (PID) control to achieve better cathodic protection performance. Numerical examples have been implemented considering the evolution of the substrate composed of steel and immersed media.