Linear and non-linear quantitative structure–property relationship (QSPR) models were developed to predict corrosion inhibition efficiency for a series of 41 pyridine and quinoline N-heterocycles. Out of 20 physicochemical and quantum chemical variables related to the surface adsorption behaviour of the inhibitors, consensus models were constructed using the genetic algorithm-partial least squares (GA-PLS) and genetic algorithm-artificial neural network (GA-ANN) methods. The consensus GA-PLS model comprised of eight variables (exponential of the calculated adsorption energy, LUMO, van der Waals surface area and volume, polarizability, electron affinity, electrophilicity, electron donor capacity) exhibited an %RMSECV of 16.5% and mean %RMSE of 14.9%. Such a model moderately captured the complex relationships between inhibition efficiency and the quantum chemical variables. The consensus GA-ANN model comprised of nine input variables (exponential of the calculated adsorption energy, HOMO, LUMO, HOMO-LUMO Gap, electronegativity, softness, electrophilicity, electron donor capacity and N atomic charge) exhibited an %RMSECV of 16.7 ± 2.3% and mean %RMSE (training/testing/validation) of 8.8%, performing better than its linear counterpart in terms of predictive ability. Both models revealed the importance of adsorption to the metal surface, and electronic parameters quantifying electron acceptance/donation to/from the iron surface, suggesting key corrosion inhibition design principles.