Water quality index (WQI) is the primary method applied to characterize water quality in the world. The current study employed the statistical analysis and multilayer perceptron (MLP) approaches for predicting groundwater quality in the Ghiss-Nekkor aquifer, northeast of Al Hoceima, Morocco. Fifty sampled groundwater were identified and analyzed for major anions and cations throughout May 2019. Several physicochemical parameters of all the samples were identified in this investigation, such as TDS, pH, EC, Na, K, Ca, Mg, HCO3, NO3, Br, SO4, and Cl. The entropy-weighted groundwater quality index (EWQI) was calculated from these parameters. The WQI procedure determined the suitability of groundwater for consumption. The WQI value varied from 90.98 to 337.28. The EC, TDS, WQI, and Cl- spatial distribution showed that EC and Cl- are associated with poor groundwater quality. A single sample (W16) represented unsuitable water for drinking purposes and offered a WQI value of 337.28, indicating poor drinking quality due to seawater intrusion, overexploitation, and harsh weather conditions. The majority of the values obtained for the parameters exceeded the recommended limit of the World Health Organization (WHO)’s guidelines for consumption. The findings show that using parameters is a straightforward method for predicting water quality indexes with sufficient and suitable precision. The MLP model shows good predictive performances in terms of the coefficient of determination R2, mean absolute error (MAE), and root-mean-square error (RMSE) with values of 0.9885, 5.8031, and 4.7211, respectively. The ANN approach was applied to develop a model that can accurately predict WQI utilizing mineralization, TH, NO3, and NO2 as inputs. The MAE for the model’s performance was calculated to be 4.72. A Bland–Altman test was used to validate that the model is suitable. Following the test, it was determined that the model is appropriate for predicting WQI, with an error of just 0.1%.