# iamvibhav/autisense architecture

> Architecture diagram of the GitHub repository iamvibhav/autisense, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/iamvibhav/autisense
- Repository: https://github.com/iamvibhav/autisense

## Overview

##### Main Components Based on Project Type
- Since AutiSense is an ML-driven healthcare tool with a focus on privacy, its components include:
- Data Source: The dataset (i.e., the CSV in the “dataset” directory) that holds the Autism Screening data.
- Model Artifacts: The “models” directory contains the trained AdaBoost model, scalers, and label encoders.
- Core Processing Logic: The “neura.py” (and its notebook “neura.ipynb”) serve as the core machine learning module that handles data preprocessing, model inference, and possibly training routines.
- Web Interface: Although not present in the provided file tree, the README indicates an “app.py” that implements a Gradio-based UI for doctors, patients, and researchers.
- Security & Privacy Layer: As described in the README, the system leverages access control (RBAC), encryption, and perturbation techniques to protect patient data.

##### Analyzing the File Structure
- Top-Level Files/Folders:
- README.md – Contains full project description, architecture overview, and instructions.
- dataset/ – Holds the raw dataset (CSV) used for predictions.
- models/ – Includes the saved model artifacts (model pickle, scaler, label encoders).
- neura.py & neura.ipynb – Provide the ML logic and data handling routines.
- requirements.txt – Lists dependencies required by the project.
- These elements indicate a separation of concerns: data management (dataset), model management (models), and processing/interaction (neura scripts and the Gradio UI as mentioned in the README).

- Web UI Component (Gradio Interface): Handles input from doctors/patients and displays predictions.
- Backend Processing Module (ML Engine): Represented by the “neura.py” component that loads the model artifacts.
- Data Storage/Management: Represents the dataset files.
- Model Artifacts Repository: Contains trained model files and encoders.
- Security and Privacy Module: Although not in its own file, it’s an essential cross-cutting concern enforcing RBAC, encryption, perturbation, and secure access based on the README.

##### Architectural Patterns and Design Principles
- Modular Design: Highlight that changes or updates can be made independently in the ML engine or the UI.
- Security by Design: Include a dedicated side-panel or an overlay that shows how RBAC, encryption, and data perturbation mechanisms integrate across modules.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Roles
    subgraph "User Roles"
        doctor["Doctor"]:::user
        patient["Patient"]:::user
        researcher["Researcher"]:::user
    end

    %% Main Components
    webUI["Gradio Web UI"]:::frontend
    security["Security & Privacy Module"]:::security

    subgraph "Backend Processing Module"
        mlPy["ML Engine (neura.py)"]:::backend
        mlIpy["ML Engine (neura.ipynb)"]:::backend
    end

    dataSource["Autism CSV Dataset"]:::database
    modelRepo["Model Artifacts Repository"]:::database

    %% Connections from User Roles to Web UI
    doctor --> webUI
    patient --> webUI
    researcher --> webUI

    %% Connection from Web UI to Backend Processing Module
    webUI -->|"sendsInput"| mlPy

    %% Internal flow within the ML Engine
    mlPy -->|"executes"| mlIpy

    %% Backend accessing stored artifacts and dataset (for training/validation)
    mlIpy -->|"loads"| modelRepo
    mlIpy -->|"queries"| dataSource

    %% Security & Privacy connections (cross-cutting concern)
    security ---|"enforces"| webUI
    security ---|"secures"| mlPy

    %% Click Events
    click dataSource "https://github.com/iamvibhav/autisense/blob/new-branch/dataset/Toddler Autism dataset July 2018.csv"
    click modelRepo "https://github.com/iamvibhav/autisense/tree/new-branch/models/"
    click mlPy "https://github.com/iamvibhav/autisense/blob/new-branch/neura.py"
    click mlIpy "https://github.com/iamvibhav/autisense/blob/new-branch/neura.ipynb"
    click webUI "https://github.com/iamvibhav/autisense/blob/new-branch/README.md"
    click security "https://github.com/iamvibhav/autisense/blob/new-branch/README.md"

    %% Styles
    classDef frontend fill:#AED6F1,stroke:#1B4F72,stroke-width:2px;
    classDef backend fill:#A9DFBF,stroke:#196F3D,stroke-width:2px;
    classDef database fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef security fill:#F5B7B1,stroke:#943126,stroke-width:2px;
    classDef user fill:#D7BDE2,stroke:#6C3483,stroke-width:2px;
```
