Detection of autism spectrum disorder (ASD) in children and adults using machine learning

Autism spectrum disorder (ASD) presents a neurological and developmental disorder that has an impact on the social and cognitive skills of children causing repetitive behaviours, restricted interests, communication problems and difficulty in social interaction. Early diagnosis of ASD can prevent from its severity and prolonged effects. Federated learning (FL) is one of the most recent techniques that can be applied for accurate ASD diagnoses in early stages or prevention of its long-term effects. In this article, FL technique has been uniquely applied for autism detection by training two different ML classifiers including logistic regression and support vector machine locally for classification of ASD factors and detection of ASD in children and adults. Due to FL, results obtained from these classifiers have been transmitted to central server where meta classifier is trained to determine which approach is most accurate in the detection of ASD in children and adults. Four different ASD patient datasets, each containing more than 600 records of effected children and adults have been obtained from different repository for features extraction. The proposed model predicted ASD with 98% accuracy (in children) and 81% accuracy (in adults).

communication delay and data theft 13 . Therefore, it is the immense need of time that a model should be proposed in which data remain safe with owner organization.
Federated Learning (FL) technique is the most advanced approach of ML in which data remains secure with owner organization and small sized local ML based classifier is trained onsite without moving data over the network 14 . FL is very beneficent in ensuring data security as data are not being shared over the network therefore data privacy, data protection and data security issues are automatically resolved 15 . Moreover, network issues will not be raised as only small sized local data model is travelling over the network towards central server instead of huge data 16 . Many researchers have applied FL for detection of multiple neurological disorders 17 . Ali et al. 18 have applied FL for the detection of colon cancer using pixel level segmentation dataset. Ghosh et al. 19 have applied FL for medical image segmentation. Nigmatullina et al. 17 proposed a digital platform to monitor and support children with ASD using FL. Novelty of our work is the application of FL technique for detection of ASD in both children and adults. Two different ML models including SVM and LR have been trained locally using four different ASD datasets of features containing records about children and adults obtained from free sources and data providing agencies listed in Table 1 for autism detection. We have also compared the results of proposed model with already proposed ASD detection methods and comparable accuracy has been obtained. Major contribution of this work is the combination of different local ML based models for training central FL based meta classifier on features dataset of children and adults to detect ASD risk factors with reasonable accuracy.
Our article is organized in multiple sections. In "Introduction" section presents introduction of the autism detection approaches. Most recent studies conducted on autism detection have been summarized in "Related work" section. Research methodology, experimentation, analysis and results have been presented in "Material and method" section. Results have been discussed in "Discussion" section. Conclusion and future directions have been illustrated in "Conclusion" section.

Related work
Autism spectrum disorder (ASD) is a neuro-developmental disorder that results various impairments in social interaction, communication, and the existence of unvaried patterns of behaviour in children and adults 20 . Alfalasi 21 reported that in United States 1 out of 54 children is affected by autism. Detecting autism earlier in one life can make a big difference than treating it later 22 . According to World Health Organization (WHO) every year one among 160 children is diagnosed with ASD traits all over the world 23 . Treating ASD earlier is always the best option for toddlers as they are still developing 24 .
Different symptoms identified in ASD patients have been considered as features that can be used for ASD detection. Lawan et al. 25 and Cantin-Garside et al. 26 observed behavioural disorder, Beary et al. 27 and Derbali et al. 28 recorded facial expression disorder and Devika et al. 29 observed structural disorder in ASD effected persons. Emotional disorder in ASD affected persons has been studied by Makhnytkina et al. 30 and mental disorder has been analysed in Liu et al. 31 and Lord et al. 32 . Many researchers explored medical imageries for ASD detection including Bilic et al. 33 , Husna et al. 34 , Liu et al. 35 , Nogay and Adeli 36 . Images of brain have been used by Subah et al. 37 , Xu et al. 38 , Yin et al. 39 , Shenouda et al. 40 to detect ASD in patients. Single and cross order strategy for ASD detection has been proposed in Wawer et al. 41 .
Researchers have used wearable devices containing sensors for detection of ASD 42,43 . Application of intelligent approaches present advanced ways to economically detect ASD effected children and adults 44 . Models have been proposed in the literature describing application of different methods and approaches for ASD detection like structural MRI 45 , neural networks 46 , machine learning [47][48][49] , deep learning 50 , transfer learning 51,52 and IoT 53 . All these techniques have been applied to detect ASD with reasonable accuracy in children and adults but faced limitations of data acquisition as hospitals hesitate or refuse to share patient records due to organizational policies and regional data protection legislations. Data security, data privacy and data availability are the huge challenges in developing effective intelligent models. Even if access to data is granted, transferring huge dataset over the network is again challenging, rising a lot of network issues regarding network congestion, latency and data theft.
Federated learning (FL) provides a generous solution to address all above mentioned problems. FL is an advanced ML based approach that never transmits data over the network 54 . Data is kept with its generating organization 55 whereas only a small sized local data model is trained from onsite data and transmitted over the network towards central server where all local models are combined to train meta classifier for determining which ML model is most effective in autism detection 56 . Objective of proposed model is to detect ASD symptoms at different stages of age with minimum time, controlled expense and maximum accuracy. Novelty of our work is the application of federated learning technique for autism detection in children and adults by processing four different datasets by training SVM and LR classifiers locally. Major contribution of this work is the detection

Material and method
ASD indicates a disability in human development due to variations of neurons present in human brain 57 . Practitioners believe that there are multivariate sources that work jointly to cause ASD 58 . Diagnosis of ASD is also very challenging task as no medical test like blood test exists to detect ASD. Doctors usually apply psychological and observational strategies to sense ASD in a patient by analysing multiple aspects of their daily routine as mentioned in Fig. 1.
In this article, a unique federated learning based model has been proposed in which four different datasets of adults and children have been analysed using LR and SVM locally to train local data models. These local models have been transmitted towards central server for training of meta classifier in global model to predict autism in children and adults. Proposed model architecture presented in Fig. 2 comprises of five components including dataset acquisition, data pre-processing, ML models training for ASD detection and performance comparison of different ML models to determine the most effective model that can accurately diagnose autism. The first step was acquisition of data in which publicly available four datasets of children and adults from data sources listed in Table 1 have been obtained. In second step, data pre-processing and normalization was performed for data compression and data cleaning and removal of noisy data. After normalization, in third step, four datasets have been locally processed by SVM and LR classifiers for autism detection. Results of training ML classifiers have been transmitted to central server where meta classifier has been trained to compare results and identify the best  www.nature.com/scientificreports/ model to detect autism. In last step, results of meta classifier were validated by calculating accuracy, precision and F1 score to detect autism disorder with more accuracy as shown in Fig. 2.

Step1: Dataset
Four datasets have been obtained covering two dimensions: children and adults. Source and specifications of each dataset is listed in Table 1.
Step 2: Pre-processing According to Q-Chart-10, ten different features have been unanimously identified for processing of adults and children datasets at same scale for segregation of autism effected patients from normal ones as shown in Table 2.
The Quantitative Checklist for Autism in Children (Q-CHART-10) screening approach approved by Transforming autism project, UK, served as the foundation for the conduction of this research 3 . Thirty questions have been asked to record responses (R1-R10) for features mentioned in Table 2. The value of these responses is assigned to classes as per following criteria for assigning weightage (score) to every response.
If score of class is more than 3, it indicates that ASD feature exits, its weight is incremented by 1 and "Yes" will be stored in response set otherwise value of flag will remain 0 that shows absence of any ASD features and "No" will be stored in the response set. Each class variable corresponds to more than one questions confirming the presence of feature extracted from Q-CHART-10 checklist. Information stored in class response set is in the binary format indicating Yes (stored as 1) and No (stored as 0). Local ML models have been trained on these responses presented in Table 2.
The response dataset contained some noisy and missing records therefore data transformations were needed to carry out prior to train ML classifier for model training and analysis. Category variables are handled using label encoding. To make labels machine-readable, label encoding transforms them into numeric form. Repeated labels receive the same value as those that were previously allocated. The binary label encoding of classes with ten features have been chosen. www.nature.com/scientificreports/ Step 3: Federated Learning process In the proposed architecture, Federated learning process starts from step three in which pre-processed and normalized datasets have been processed for training of SVM and LR classifiers. Workflow of FL process is presented in Fig. 3. Results of these classifiers in terms of accuracy, precision and F1 score have been calculated and transmitted to central server for training of meta classifier at server. Meta classifier will determine which model is more appropriate in detecting autism and will train the global model accordingly. Global model will be disseminated in all clients as a single tool for autism detection.

Experiment.
The children and adult datasets (A, C respectively) presented in Table 1 have been divided into training and test datasets. Training datasets contained 80% records and testing datasets which will be used to test the proposed model contained 20% of total records. Experimental setup. Experiment has been performed in two different dimensions. In first dimension, SVM and LR has been applied on dataset of adults presented in Table 1. In second dimension, SVM and LR has been applied on dataset of children as presented in Fig. 4.
Results obtained after training local models have been transmitted to central server through 4G ethernet gateway where meta classifier is trained to predict which ML model is outperforming in prediction of ASD. Best model is selected for the training of global model that is transmitted back to the clients so that all clients use same efficient model for autism detection.
Analysis and results. Two-dimensional exploratory analysis has been performed on datasets by plotting several graphs to depict different perspectives of the ASD response set. In first dimension, variance between datasets has been analyzed using statistical method ANOVA. ANOVA being a powerful statistical tool compares the mean of datasets and determines that if there is a significant difference between them as summarized in Table 3.
H o (Null hypothesis) = there is no significant difference between the means of datasets being compared. H 1 (alternate hypothesis) = there is a significant difference between the means of datasets being compared. Results of ANOVA have been listed in Table 4. Total variability of data is calculated by sum of squares (SS). Degree of freedom represent the number of independent observations available to estimate every response. F-statistics and associated p-value are significant results obtained from ANOVA test. F-statistics determines the variability between the groups to the variability within the group. p value presents the probability to observe a difference as large as the one observed in response set.
The f-ratio value is 100.8232. The p value is < 0.00001. The result is significant at p < 0.05. There is a significant difference between the means being compared. The p value is less than the commonly used significance level      www.nature.com/scientificreports/ Validation. In response set, data points have been gathered into one of the following four classes to validate ASD diagnosis. Class1: true positive (TP) indicates that the person has autism, and we have correctly recorded autism positivity. Class 2: true negative (TN) means that a person does not has autism and wrongly recorded as negative in response dataset. Class 3: false positive (FP) depicts that response dataset incorrectly recorded that a person had ASD who does not have it. Class 4: false negative (FN) indicates that it was predicted mistakenly that the person does not have ASD, but they have ASD. The confusion matrix of ASD that facilitated in the validation process is given below in Table 6. Precision, recall and F1 score are the measures used to validate performance of LR and SVM classifiers. Precision demonstrates the cases that detected autism and we predicted them correctly. Whereas recall indicates the number of autism cases identified correctly are relevant out of total instances that had autism. Proposed model has been validated using dataset B, D given in Table1. F1 score greater than 0.5 or above is considered Good. It can be observed from Table 7 that SVM is performing more accurately than LR although LR is also giving comparable results. Hence, it can be inferred from results that SVM and LR can detect autism more accurately in comparison of other ML models using features dataset and they can be used for early diagnosis of autism. Figures 6 and 7 present precision and recall curve of SVM and LR respectively. Precision and recall are the measures used to evaluate model's performance. Precision demonstrates   www.nature.com/scientificreports/ the cases that detected autism and we predicted them correctly. Whereas recall indicates how many autism cases model has identified correctly as relevant out of total instances that had autism. After performing detailed analysis, it has been observed that SVM and LR models can be best fit for diagnoses of autism disorder in people of various age groups ranging from children to adults. We have obtained 99% accuracy in prediction of ASD.
The performance of proposed model has also been compared with other models already proposed in the literature. We found three most relevant studies that have proposed models for ASD detection.
Ethical statement. Hereby, I Muhammad Shoaib Farooq consciously assure that for the manuscript "Detection of Autism Spectrum Disorder (ASD) in children and adults using Machine Learning" the following is fulfilled: (1) This material is the authors' own original work, which has not been previously published elsewhere.
(2) The paper is not currently being considered for publication elsewhere. (3) The paper reflects the authors' own research and analysis in a truthful and complete manner. (4) The paper properly credits the meaningful contributions of co-authors. (5) The results are appropriately placed in the context of prior and existing research. (6) All sources used are properly disclosed (correct citation). Literally copying of text must be indicated as such by using quotation marks and giving proper reference. (7) All authors have been personally and actively involved in substantial work leading to the paper, and will take public responsibility for its content. The violation of the Ethical Statement rules may result in severe consequences. I agree with the above statements and declare that this submission follows the policies as outlined in the Guide for Authors and in the Ethical Statement. Table 2 indicates the response set gathered by analysing multiple features extracted during pre-processing of datasets. Figures 8 and 9 have been drawn based upon response R1 that showed the region to which most of ASD patients belong and their ethnicity. It can be observed from the chart that United Kingdom (UK) is the most affected region. Similarly, graph in Fig. 9 presents that mostly White-Europeans have ASD.

Discussion
People infected with jaundice (response R8) are considered as on high risk of ASD. So, it is worthwhile to know that whether a person is born with or without jaundice. There is a high probability that they will screen positive for ASD if born with jaundice as shown in Fig. 10.    www.nature.com/scientificreports/ Application of ML in autism detection has significance due to its reliability, accuracy and quickness 1 . In the proposed model, datasets have been processed to train LR and SVM classifiers locally. Results of these classifiers are transmitted to central server where meta classifier is trained to generate global model for autism detection. The reason for selecting LR is to find a model that most accurately describes the relationship among binary response set and independent variables set 5 . SVMs has been applied in this study as datasets had multiple dimensions and are not linearly separable. SVM use hyperplane that separates ASD dataset into two classes namely ASD effected and Non-ASD to predict target and handle overfitting as well. SVM has separating hyper plane boundary to separate both classes 7 as presented in Fig. 11.
Comparison with other studies. We have compared their work with our proposed model and summarized the strengths and limitations of existing model in relation to our proposed models in Table 8. It has been noted that our proposed model is offering comparable accuracy and effectively applicable to diagnose ASD in patients belonging to different age groups ranging from children to adults. Limitations of proposed model. FL is a ML technique that allows models to be trained on decentralized data sources without transferring the data to a central server. Proposed FL based model for ASD detection offers several advantages of data security and data privacy but it has some limitations too as listed below: Limited model complexity In proposed architecture, FL models are trained on multiple devices with limited processing power and storage. This limitation can make it difficult to use the proposed model for more complex tasks that require deep neural networks or other advanced machine learning models.
Data heterogeneity The proposed model is designed to work with data that is distributed across different devices and locations. However, this can lead to data heterogeneity, where different devices have different types of data, making it challenging to develop models that perform well across all devices. Figure 11. SVM mechanism of ASD Classification. www.nature.com/scientificreports/ Communication overhead In the proposed architecture, models are trained on local devices, and the updated models need to be sent back to a central server for aggregation. This process can create significant communication overhead, especially when dealing with a large number of devices or when the models are updated frequently.
Lack of transparency The proposed model for ASD detection, makes it challenging to understand how models are trained or how they make predictions. This lack of transparency can make it difficult to identify and correct biases or errors in the models.

Conclusion
The assessment of ASD has been associated with multiple disorders recognized as features including, behavioural, emotional, structural and mental disorders that make it difficult to predict due to non-availability of medical tests for all features needed to detect ASD in a person. Practitioners diagnose ASD in patients by using psychological assessments and response observation. Detection process is time-consuming and complex as symptoms are not obvious. Presently, there is no screening method that has been optimized and thoroughly developed to specifically detect the ASD, nor is there a screening test that can accurately diagnose ASD. ML is the most recent development that can facilitate in predicting autism more accurately saving lots of time. ML can be helpful in early diagnosis of ASD in patients of all ages including children and adults. In this work, we have applied two different ML models (SVM, LR) on the dataset containing features of children and adults. It was observed that SVM showed 81% accuracy in detecting ASD in adults and LR gave 98% accuracy in determining ASD in children. In future, different transfer-learning models i.e. MobileNet, ResNet can also be used in ASD detection using images dataset of autistic children for early detection of ASD with improved accuracy. Moreover, severity of disorder can also be measured through deep learning methods in future.