How to use:
- Download the APK (ASD_Detection_Application.apk) file on you computer
- Transfer the APK to your Android device
- Navigate to the directory where the APK file was transferred to, but on your Android device.
- Click on the APK file. Now, if you haven't installed a file from external sources before, you may have to turn on your device's developer mode
- After this, the APK file will install.
*Note that this application is used only for showcasing RapidML's potential and is not to be used in any manner for real medical diagnosis. For actual ASD (Autism Spectrum Disorder) diagnosis, consult a medical professional.
Autism detection API
I am Ritabrata Maiti, the creator of the Autism Detection API. Find me on LinkedIn here
This project uses the pythonanywhere hosting service to host the API, and run the machine learning model in the cloud. The free tier allows you to host only one web-app (such as a python API), at any given time. However, upto 20 web-apps (APIs) can be hosted by upgrading to the paid tiers. If you consider upgradation, follow this link: https://www.pythonanywhere.com/?affiliate_id=003915da Do note that this is an affiliate link =)
Note: ASD refers to Autism Spectrum Disorder
Using the same API, I have built an android application which serves as an user friendly tool that can be used by caretakers, doctors and patients to determine an ASD case. The application, as well as the Thunkable source (.aia) file can be found here.
Note: This app was built on Thunkable; due to the Hybrid nature of the app, the google form in the initial screen may load slowly(because of embedded webviewer). Your patience is appreciated ^_^
This project has 3 goals:
- To find out the best machine learning pipeline for predicting ASD cases using genetic algorithms, via the RapidML library. (Classification Problem)
- Compare the accuracy of the accuracy of the determined pipeline, with a standard Naive-Bayes classifier.
- Saving the classifier as an external file, and use this file in a Flask API to make predictions in the cloud.
The first 2 goals are achieved via the Builder_Script.py, which cleans the datasets, performs label encoding and finds the best-fitted classifier pipeline using genetic algorithms from the TPOT library. Furthermore, the builder script produces the files d, df, clf,dt and f.
- d: This file contains the pickled dictionary used to label-encode the database.
- df: The file contains the pickled skeletal dictionary of the original database.
- clf: This file contains the pickled classifier pipeline that has the highest accuracy, determined via genetic algorithms.
- f: This file contains a dummy row, as initial input that is later utilized by the API script.
- dt: This is an array storing the data-types of the DataFrame coloumns.
The final goal, implementing the flask API, is achieved by the helper and API scripts. The helper script reads the files created by the builder and uses the saved models to predict an output, from the input obtained from the API request. The API script handles the actual requests and calls the helper script to predict and return an output.
In order to build the project on your own, you require:
- The RapidML library
- A Python 3.6 installation
- The latest scikit learn installation
- The latest TPOT installation
- The latest Flask installation
- The dill Python library
In order to deploy our flask app to the cloud, we use a service called pythonanywhere. At its free tier, it allows one python web app per account. For hosting upto 20 Python web apps or APIs, upgrade your acount here: https://www.pythonanywhere.com/?affiliate_id=003915da
In the files-tab create a new directory, and upload the files d, df, clf, f as well as the API and the helper scripts. Then create a new web application in the web apps tab and create a new virtualenv as well, and link it to the web app. My instructions are compact, and I highly recommend you check this official guide
Note: Before you deploy your web app, go to the directory: /home/"username"/.virtualenvs/"virtualenvname"/bin and delete the file: no-global-site-packages.txt
This allows the web app to use external libraries outside the vitualenv, and proceeding without the above modifications causes a glitch/error.