The frequent occurrences of wet and dry in the catchment area of the Gamasiab river located in the west of Iran, in addition to affecting the quantitative status of surface water, has caused changes in the water quality of the basin. Therefore, modeling and prediction of Gamasiab river water quality in wet and dry periods are research priority. In this study, an optimized artificial neural network (ANN) trained with three different optimization algorithms namely; particle swarm optimization (PSO), genetic algorithm (GA) and imperialist competitive algorithm (ICA) was proposed for predicting the Electric Conductivity (EC). For this purpose, water quality data from 1967 to 2017 collected at the hydrometric station in the Gamasiab river were used for developing and testing the models. First, the study program was divided into two periods of wet and dry, this classification based on flow rate in the river. Then, in a preliminary statistical analysis, the effective parameters were determined for EC estimation. The performance of the applied methods showed that the ANN optimized using ICA algorithm was better than the ANN optimized with GA and PSO, and also the standard ANN without optimization. Overall, the ANN optimized with ICA has higher R and lower MARE and RMSE, with values of 11. 56, 19. 63 and 0. 93, during the dry period, and 10. 63, 17. 19 and 0. 97 during the wet period, respectively.