{"id":23093047,"url":"https://github.com/crispengari/s2dc","last_synced_at":"2026-05-09T00:08:43.847Z","repository":{"id":158238385,"uuid":"633885116","full_name":"CrispenGari/S2DC","owner":"CrispenGari","description":"😷💉💊🤮🤒 Symptoms to Disease Classifier (S2DC), is an Artificial Intelligent (AI) mobile tool that is used to classify diseases from people based on the textual symptoms the person provides.","archived":false,"fork":false,"pushed_at":"2024-03-07T12:18:31.000Z","size":34531,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-27T17:02:42.983Z","etag":null,"topics":["artificial-intelligence","expo","flask","machine-learning","natural-language-processing","reactnative"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CrispenGari.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-28T14:01:53.000Z","updated_at":"2024-03-06T05:41:43.000Z","dependencies_parsed_at":"2024-12-16T21:59:45.729Z","dependency_job_id":null,"html_url":"https://github.com/CrispenGari/S2DC","commit_stats":null,"previous_names":["crispengari/s2dc"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrispenGari%2FS2DC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrispenGari%2FS2DC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrispenGari%2FS2DC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrispenGari%2FS2DC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CrispenGari","download_url":"https://codeload.github.com/CrispenGari/S2DC/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247061231,"owners_count":20877166,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["artificial-intelligence","expo","flask","machine-learning","natural-language-processing","reactnative"],"created_at":"2024-12-16T21:46:22.403Z","updated_at":"2026-05-09T00:08:38.808Z","avatar_url":"https://github.com/CrispenGari.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"### S2DC (Symptoms to Disease Classifier)\n\n😷💉💊🤮🤒 Symptoms to Disease Classifier, is an Artificial Intelligent (AI) mobile tool that is used to classify diseases from people based on the textual symptoms the person provides.\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"logo.png\" width=\"400\" alt=\"logo\"/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/crispengari/S2DC/actions/workflows/server-ci.yml\"\u003e\u003cimg src=\"https://github.com/crispengari/S2DC/actions/workflows/server-ci.yml/badge.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-green\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n### Table of Contents\n\n- [S2DC (Symptoms to Disease Classifier)](#s2dc-symptoms-to-disease-classifier)\n- [Table of Contents](#table-of-contents)\n- [Problem Statement](#problem-statement)\n- [Data](#data)\n- [Demo](#demo)\n- [Testing `S2DC` app](#testing-s2dc-app)\n- [Model Training and Evaluation](#model-training-and-evaluation)\n  - [Training time and last saved epoch.](#training-time-and-last-saved-epoch)\n  - [Training time per epoch](#training-time-per-epoch)\n  - [Training \\\u0026 Validation Accuracies.](#training--validation-accuracies)\n  - [Training \\\u0026 Validation Losses.](#training--validation-losses)\n  - [Best model accuracy and loss](#best-model-accuracy-and-loss)\n  - [Confusion matrix.](#confusion-matrix)\n  - [Classification report](#classification-report)\n- [Notebooks](#notebooks)\n- [License](#license)\n\n### Problem Statement\n\n\u003e \"Most people have certain symptoms and they fail to identify wether they are sick or not. Sometimes others even ignore the symptoms because they lack knowledge. Using Deep Learning techniques we want to implement an AI tool that will be able to identify the possible disease based on description of the symptoms by someone who's feeling sick.\"\n\nIn this project I will create a simple classification model that will be able to classify the `disease` based on symptoms from text.\n\nOur AI tool will be able to diagnose `24` diseases which are:\n\n- `Psoriasis`\n- `Varicose Veins`\n- `Typhoid`\n- `Chicken pox`\n- `Impetigo`\n- `Dengue`\n- `Fungal infection`\n- `Common Cold`\n- `Pneumonia`\n- `Dimorphic Hemorrhoids`\n- `Arthritis`\n- `Acne`\n- `Bronchial Asthma`\n- `Hypertension`\n- `Migraine`\n- `Cervical spondylosis`\n- `Jaundice`\n- `Malaria`\n- `urinary tract infection`\n- `allergy`\n- `gastroesophageal reflux disease`\n- `drug reaction`\n- `peptic ulcer disease`\n- `diabetes`\n\n### Data\n\nThe dataset was obtained on [kaggle](https://www.kaggle.com/datasets/niyarrbarman/symptom2disease) and was loaded from google drive from a `csv` file and the examples were split into `3` set's out of `2, 400` examples that we had.\n\n| Set          | Example(s) |\n| ------------ | ---------- |\n| `training`   | `1200`     |\n| `validation` | `480`      |\n| `testing`    | `720`      |\n| `total`      | `2400`     |\n\nThe following pie chat represents the data distribution in those sets.\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"images/pie-chat.png\" width=\"200\" alt=\"logo\"/\u003e\n\u003c/p\u003e\n\nAfter splitting the data into `3` sets then the distribution of labels where visualized.\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"images/train_labels.png\" width=\"80%\" alt=\"logo\"/\u003e\n    \u003cbr/\u003e\n    \u003cimg src=\"images/test_labels.png\" width=\"80%\" alt=\"logo\"/\u003e\n    \u003cbr/\u003e\n    \u003cimg src=\"images/val_labels.png\" width=\"80%\" alt=\"logo\"/\u003e\n\u003c/p\u003e\n\n### Demo\n\nThis is a demo video showing how the application works.\n\nhttps://user-images.githubusercontent.com/59051957/235310636-f2794234-7705-4867-a7a3-3d1d01b0aad8.mp4\n\n### Testing `S2DC` app\n\nYou can test this application locally, you just need to follow the following instructions that will help you play around with our tool in development mode.\n\n1. clone this repository by running:\n\n```shell\nhttps://github.com/CrispenGari/symptoms-to-disease-classifier.git\n```\n\n2. navigate to the server by running the following command:\n\n```shell\ncd  server\n```\n\n3. create a virtual environment on the server folder, activate it and install required packages by running the following command:\n\n```shell\nvirtualenv venv \u0026\u0026 .\\venv\\Scripts\\activate\n```\n\n4. Start the server by running the following command:\n\n```shell\npython server.py\n```\n\n5. When the server is running it will start on a default port of `3001` go ahead and open `ngrok` cli and run the following command:\n\n```shell\nngrok http 3001\n```\n\n6. Copy the forwarding url from the `ngrok` shell that looks as follows:\n\n```shell\nForwarding                    https://4c1a-102-66-137-117.ngrok-free.app -\u003e http://localhost:3001\n```\n\n7. Navigate to the `client/src/constants/index.ts` file and change the constant `serverBaseURL` to the forwarding url for example as follows:\n\n```ts\nexport const serverBaseURL: string =\n  \"https://4c1a-102-66-137-117.ngrok-free.app\";\n```\n\n8. Now you can start the expo app but first navigate to the `client` on another terminal and run the following command:\n\n```shell\ncd client \u0026\u0026 yarn \u0026\u0026 expo install \u0026\u0026 yarn start\n```\n\n9. Scan the `QR` code using your phone and start using the `tool`. Make sure that you have `expo-go` installed in your `android` or `ios` phone before scanning the `QR` code.\n\n### Model Training and Evaluation\n\nIn this section we are going to visualize how the model training history and the best model metrics.\n\n#### Training time and last saved epoch.\n\n|                     | value        |\n| ------------------- | ------------ |\n| TOTAL EPOCHS        | `30`         |\n| LAST SAVED EPOCH    | `30`         |\n| TOTAL TRAINING TIME | `0:00:31.23` |\n\n#### Training time per epoch\n\nThe following graph shows the training time each epoch took to complete on the batched data.\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"images/training-time.png\" width=\"400\" alt=\"logo\"/\u003e\n\u003c/p\u003e\n\n#### Training \u0026 Validation Accuracies.\n\nThe following graph shows the train and validation accuracies that were observed per epoch during model training.\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"images/train-history.png\" width=\"400\" alt=\"logo\"/\u003e\n\u003c/p\u003e\n\n#### Training \u0026 Validation Losses.\n\nThe following graph shows the train and validation losses that were observed per epoch during model training.\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"images/train-loss.png\" width=\"400\" alt=\"logo\"/\u003e\n\u003c/p\u003e\n\n#### Best model accuracy and loss\n\nThe following table shows the best model metric in terms of loss and accuracy based on the test dataset.\n\n| Set    | Loss    | Accuracy  | ETA (time) |\n| ------ | ------- | --------- | ---------- |\n| `Test` | `0.456` | ` 93.23%` | -          |\n\nThe best model was then evaluated using each `set` and the following graphs shows the losses obtained and accuracies for each set respectively.\n\n\u003cp align=\"center\"\u003e\n   \u003cimg src=\"images/best-model-losses.png\" width=\"400\" alt=\"logo\"/\u003e\n   \u003cbr/\u003e\n    \u003cimg src=\"images/best-model-accuracies.png\" width=\"400\" alt=\"logo\"/\u003e\n\u003c/p\u003e\n\n#### Confusion matrix.\n\nThe confusion matrix for the best model can be found [here.](https://github.com/CrispenGari/nlp-pytorch/blob/main/11_SYMPTOMS_2_DISEASE_CLASSIFICATION/01_SYMPTOMS_2_DISEASE_CLASSIFICATION.ipynb)\n\n#### Classification report\n\nHere is the classification report table for the best model, after it have been evaluated on the `test` set.\n\n|                | precision | recall | f1-score | support |\n| -------------- | --------- | ------ | -------- | ------- |\n| `0`            | `0.81`    | `1.00` | `0.90`   | `22`    |\n| `1`            | `1.00`    | `1.00` | `1.00`   | `18`    |\n| `2`            | `0.95`    | `0.91` | `0.93`   | `22`    |\n| `3`            | `0.94`    | `0.76` | `0.84`   | `21`    |\n| `4`            | `1.00`    | `1.00` | `1.00`   | `22`    |\n| `5`            | `0.70`    | `0.50` | `0.58`   | `14`    |\n| `6`            | `1.00`    | `1.00` | `1.00`   | `23`    |\n| `7`            | `0.97`    | `0.97` | `0.97`   | `29`    |\n| `8`            | `0.90`    | `1.00` | `0.95`   | `18`    |\n| `9`            | `0.96`    | `1.00` | `0.98`   | `22`    |\n| `10`           | `1.00`    | `1.00` | `1.00`   | `18`    |\n| `11`           | `1.00`    | `1.00` | `1.00`   | `19`    |\n| `12`           | `1.00`    | `0.92` | `0.96`   | `25`    |\n| `13`           | `1.00`    | `1.00` | `1.00`   | `19`    |\n| `14`           | `1.00`    | `1.00` | `1.00`   | `22`    |\n| `15`           | `0.94`    | `1.00` | `0.97`   | `16`    |\n| `16`           | `1.00`    | `1.00` | `1.00`   | `18`    |\n| `17`           | `1.00`    | `1.00` | `1.00`   | `17`    |\n| `18`           | `0.94`    | `1.00` | `0.97`   | `17`    |\n| `19`           | `1.00`    | `0.74` | `0.85`   | `19`    |\n| `20`           | `0.80`    | `1.00` | `0.89`   | `20`    |\n| `21`           | `0.74`    | `0.85` | `0.79`   | `20`    |\n| `22`           | `0.93`    | `0.68` | `0.79`   | `19`    |\n| `23`           | `0.78`    | `0.90` | `0.84`   | `20`    |\n| `accuracy`     |           |        | `0.93`   | `480`   |\n| `macro avg`    | `0.93`    | `0.93` | `0.92`   | `480`   |\n| `weighted avg` | `0.94`    | `0.93` | `0.93`   | `480`   |\n\n### Notebooks\n\nThe `.ipynb` notebook that was used to train and save the model can be found:\n\n1. [01_SYMPTOMS_2_DISEASE_CLASSIFICATION](https://github.com/CrispenGari/nlp-pytorch/blob/main/11_SYMPTOMS_2_DISEASE_CLASSIFICATION/01_SYMPTOMS_2_DISEASE_CLASSIFICATION.ipynb)\n\n### License\n\nThis project is under the [`MIT` license ](/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrispengari%2Fs2dc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrispengari%2Fs2dc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrispengari%2Fs2dc/lists"}