Purpose: Heterogeneous mental disorders such as autism spectrum disorder (ASD) are difficult to diagnose, especially in children. The current psychiatric diagnosis process is based solely on the observation of behavioral symptoms. To make a supplementary decision system for a more accurate diagnosis, we can rely on advanced and scalable machine learning methods, namely, deep learning networks. Method: We have developed our model based on resting-state fMRI data from the ABIDE1 database, which includes 17 different imaging sites. After performing a preprocessing pipeline and registering the data onto the atlases, the average time series of brain regions are extracted and the correlation matrix is computed. Then, the most important features of this matrix are identified by using the chi-square feature selection method. A novel architecture of convolutional neural network (CNN) with two-dimensional convolutional layers is proposed to analyze and classify the data. Results: To evaluate the model, three sets of experiments were designed based on different data sets and atlases. Using this method, the highest accuracy obtained in the experiments was 73.53%, which was higher than previous works on classifying ASD from typical controls. Conclusion: This work presented a novel CNN-based model that automatically classifies ASD from healthy controls, showing good classification performance. Most of the previous works done on this database have focused on a limited number of sites. But in this research, the data acquired by all the sites have been used to increase the generalizability of the proposed model. © 2023, The Author(s), under exclusive licence to The Brazilian Society of Biomedical Engineering.