Autism Spectrum Disorders (ASDs) are neurodevelopmental conditions that usually manifest during childhood. It is a multi-symptom disorder, and its symptoms overlap with several other disorders. The early detection of these disorders is conducive to more successful treatment outcomes, as treatment is more effective before the disorder becomes severe. However, the conventional diagnostic procedures are quite time-consuming, with a typical confirmation period of several months with different specialists in speech and neurology. Recent advances in artificial intelligence (AI), specifically machine learning (ML) and deep learning (DL), have demonstrated considerable potential in addressing the diagnostic challenges associated with autism spectrum disorders (ASDs). In this paper, we propose a range of machine learning models, including a support vector machine (SVM), convolutional neural network (CNN), residual networks (ResNet), and vision transformers (ViT), to detect ASDs based on magnetic resonance images (MRI). The SVM model, in terms of accuracy, outperforms the other similar works, achieving a score of 94.03%.