A critical step to develop artificial neural networks that has considerable effect on network performance is designing architecture of neural networks. In designing the architecture of networks, generally, the number of hidden layers, number of neurons in each layer and transfer functions are determined. Most researchers often use trial and error approach and/or ignore interactive effects between the factors of design. In this research, a model is presented based on the design of experiment (DOE) for optimal architecture of neural networks. The proposed model was applied to determine the optimal architecture of neural network for forecasting the monthly consumption of gas oil of Iran. To evaluate the effectiveness of the proposed model, using the common method of trial and error was used and advantages of the proposed model were shown. In addition, to compare the performance of neural networks by statistical methods, two models based on regression and ARIMA were designed. Comparison of the forecasting results obtained by neural networks and the statistical methods proved that the proposed model produced better forecasts in all performance criteria.