# saicharan0417/dyslexia-detection-using-cnn-and-svm architecture

> Architecture diagram of the GitHub repository saicharan0417/dyslexia-detection-using-cnn-and-svm, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/saicharan0417/dyslexia-detection-using-cnn-and-svm
- Repository: https://github.com/saicharan0417/dyslexia-detection-using-cnn-and-svm

## Overview

This repository is a handwriting-image dyslexia-classification project with a FastAPI demo. Its main runtime workflow accepts an image, preprocesses it, applies CNN feature extraction and SVM classification, then records and returns a prediction. It also includes dataset preparation and CNN/SVM development notebooks. The README provides little architectural detail, and the API excerpt omits the central inference lines, so model-call links reflect the documented project structure and loaded assets; uncertain notebook-to-artifact wiring is not shown.

Main entry points: [`FastAPI and Database/main.py`](https://github.com/saicharan0417/dyslexia-detection-using-cnn-and-svm/blob/main/FastAPI%20and%20Database/main.py) (FastAPI endpoints), [`preprocessing/preprocessing.py`](https://github.com/saicharan0417/dyslexia-detection-using-cnn-and-svm/blob/main/preprocessing/preprocessing.py) (Dataset preparation), [`FastAPI and Database/preprocessing.py`](https://github.com/saicharan0417/dyslexia-detection-using-cnn-and-svm/blob/main/FastAPI%20and%20Database/preprocessing.py) (Image preprocessing), [`FastAPI and Database/model/cnn_feature_extractor.keras`](https://github.com/saicharan0417/dyslexia-detection-using-cnn-and-svm/blob/main/FastAPI%20and%20Database/model/cnn_feature_extractor.keras) (CNN feature extractor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and history"]
  node_api["FastAPI endpoints<br/>[main.py]"]
  node_auth["Account operations<br/>[main.py]"]
  node_history[("Prediction history<br/>[main.py]")]
end

subgraph group_inference["Image inference"]
  node_upload["Uploaded image"]
  node_preprocess["Image preprocessing<br/>[preprocessing.py]"]
  node_extractor["CNN feature extractor"]
  node_classifier["SVM classifier<br/>[svm_model1.pkl]"]
  node_cnnmodel["CNN model asset<br/>[cnn_model.keras]"]
  node_result["Class and confidence"]
end

subgraph group_preparation["Dataset preparation"]
  node_dataset["Handwriting dataset"]
  node_datasetprep["Dataset preparation<br/>[preprocessing.py]"]
  node_prepareddata["Prepared splits<br/>[test.npz]"]
end

subgraph group_development["Model development"]
  node_cnnnotebook["CNN feature development"]
  node_cnnartifact["CNN artifacts"]
  node_cnntrained["CNN model artifact<br/>[cnn_model.keras]"]
  node_svmnotebook["SVM evaluation<br/>[svm_model.ipynb]"]
  node_svmartifact["SVM model artifact<br/>[svm_model1.pkl]"]
end

node_user(("Client"))
node_supabase[("Supabase")]

node_user -->|"sends requests"| node_api
node_api -->|"dispatches auth"| node_auth
node_api -->|"receives image"| node_upload
node_api -->|"preprocesses image"| node_preprocess
node_api -->|"extracts features"| node_extractor
node_api -->|"classifies features"| node_classifier
node_api -->|"returns prediction"| node_result
node_api -->|"records and reads"| node_history
node_auth -.->|"uses when configured"| node_supabase
node_history -.->|"uses when configured"| node_supabase
node_dataset -->|"provides images"| node_datasetprep
node_datasetprep -->|"writes splits"| node_prepareddata

click node_api "https://github.com/saicharan0417/dyslexia-detection-using-cnn-and-svm/blob/main/FastAPI%20and%20Database/main.py"
click node_auth "https://github.com/saicharan0417/dyslexia-detection-using-cnn-and-svm/blob/main/FastAPI%20and%20Database/main.py"
click node_history "https://github.com/saicharan0417/dyslexia-detection-using-cnn-and-svm/blob/main/FastAPI%20and%20Database/main.py"
click node_preprocess "https://github.com/saicharan0417/dyslexia-detection-using-cnn-and-svm/blob/main/FastAPI%20and%20Database/preprocessing.py"
click node_extractor "https://github.com/saicharan0417/dyslexia-detection-using-cnn-and-svm/blob/main/FastAPI%20and%20Database/model/cnn_feature_extractor.keras"
click node_classifier "https://github.com/saicharan0417/dyslexia-detection-using-cnn-and-svm/blob/main/FastAPI%20and%20Database/model/svm_model1.pkl"
click node_cnnmodel "https://github.com/saicharan0417/dyslexia-detection-using-cnn-and-svm/blob/main/FastAPI%20and%20Database/model/cnn_model.keras"
click node_datasetprep "https://github.com/saicharan0417/dyslexia-detection-using-cnn-and-svm/blob/main/preprocessing/preprocessing.py"
click node_prepareddata "https://github.com/saicharan0417/dyslexia-detection-using-cnn-and-svm/blob/main/preprocessing/test.npz"
click node_cnnnotebook "https://github.com/saicharan0417/dyslexia-detection-using-cnn-and-svm/blob/main/CNN%20and%20Feature_Extraction/NeuroWrite_Member2_CNN.ipynb"
click node_cnnartifact "https://github.com/saicharan0417/dyslexia-detection-using-cnn-and-svm/blob/main/CNN%20and%20Feature_Extraction/cnn_feature_extractor.keras"
click node_cnntrained "https://github.com/saicharan0417/dyslexia-detection-using-cnn-and-svm/blob/main/CNN%20and%20Feature_Extraction/cnn_model.keras"
click node_svmnotebook "https://github.com/saicharan0417/dyslexia-detection-using-cnn-and-svm/blob/main/SVM%20and%20Evaluation/svm_model.ipynb"
click node_svmartifact "https://github.com/saicharan0417/dyslexia-detection-using-cnn-and-svm/blob/main/SVM%20and%20Evaluation/svm_model1.pkl"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_api,node_auth,node_history,node_user toneBlue
class node_upload,node_preprocess,node_extractor,node_classifier,node_cnnmodel,node_result,node_supabase toneAmber
class node_dataset,node_datasetprep,node_prepareddata toneMint
class node_cnnnotebook,node_cnnartifact,node_cnntrained,node_svmnotebook,node_svmartifact toneRose
```

## Components

### API and history

- [FastAPI endpoints](https://github.com/saicharan0417/dyslexia-detection-using-cnn-and-svm/blob/main/FastAPI%20and%20Database/main.py): `FastAPI and Database/main.py`
- [Account operations](https://github.com/saicharan0417/dyslexia-detection-using-cnn-and-svm/blob/main/FastAPI%20and%20Database/main.py): `FastAPI and Database/main.py`
- [Prediction history](https://github.com/saicharan0417/dyslexia-detection-using-cnn-and-svm/blob/main/FastAPI%20and%20Database/main.py): `FastAPI and Database/main.py`

### Image inference

- **Uploaded image**
- [Image preprocessing](https://github.com/saicharan0417/dyslexia-detection-using-cnn-and-svm/blob/main/FastAPI%20and%20Database/preprocessing.py): `FastAPI and Database/preprocessing.py`
- [CNN feature extractor](https://github.com/saicharan0417/dyslexia-detection-using-cnn-and-svm/blob/main/FastAPI%20and%20Database/model/cnn_feature_extractor.keras): `FastAPI and Database/model/cnn_feature_extractor.keras`
- [SVM classifier](https://github.com/saicharan0417/dyslexia-detection-using-cnn-and-svm/blob/main/FastAPI%20and%20Database/model/svm_model1.pkl): `FastAPI and Database/model/svm_model1.pkl`
- [CNN model asset](https://github.com/saicharan0417/dyslexia-detection-using-cnn-and-svm/blob/main/FastAPI%20and%20Database/model/cnn_model.keras): `FastAPI and Database/model/cnn_model.keras`
- **Class and confidence**

### Dataset preparation

- **Handwriting dataset**
- [Dataset preparation](https://github.com/saicharan0417/dyslexia-detection-using-cnn-and-svm/blob/main/preprocessing/preprocessing.py): `preprocessing/preprocessing.py`
- [Prepared splits](https://github.com/saicharan0417/dyslexia-detection-using-cnn-and-svm/blob/main/preprocessing/test.npz): `preprocessing/test.npz`

### Model development

- [CNN feature development](https://github.com/saicharan0417/dyslexia-detection-using-cnn-and-svm/blob/main/CNN%20and%20Feature_Extraction/NeuroWrite_Member2_CNN.ipynb): `CNN and Feature_Extraction/NeuroWrite_Member2_CNN.ipynb`
- [CNN artifacts](https://github.com/saicharan0417/dyslexia-detection-using-cnn-and-svm/blob/main/CNN%20and%20Feature_Extraction/cnn_feature_extractor.keras): `CNN and Feature_Extraction/cnn_feature_extractor.keras`
- [CNN model artifact](https://github.com/saicharan0417/dyslexia-detection-using-cnn-and-svm/blob/main/CNN%20and%20Feature_Extraction/cnn_model.keras): `CNN and Feature_Extraction/cnn_model.keras`
- [SVM evaluation](https://github.com/saicharan0417/dyslexia-detection-using-cnn-and-svm/blob/main/SVM%20and%20Evaluation/svm_model.ipynb): `SVM and Evaluation/svm_model.ipynb`
- [SVM model artifact](https://github.com/saicharan0417/dyslexia-detection-using-cnn-and-svm/blob/main/SVM%20and%20Evaluation/svm_model1.pkl): `SVM and Evaluation/svm_model1.pkl`

### Other components

- **Client**
- **Supabase**

## Connections

- Client → FastAPI endpoints: sends requests
- FastAPI endpoints → Account operations: dispatches auth
- FastAPI endpoints → Uploaded image: receives image
- FastAPI endpoints → Image preprocessing: preprocesses image
- FastAPI endpoints → CNN feature extractor: extracts features
- FastAPI endpoints → SVM classifier: classifies features
- FastAPI endpoints → Class and confidence: returns prediction
- FastAPI endpoints → Prediction history: records and reads
- Account operations → Supabase: uses when configured
- Prediction history → Supabase: uses when configured
- Handwriting dataset → Dataset preparation: provides images
- Dataset preparation → Prepared splits: writes splits
