# jotis86/alzheimer-project architecture

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

- Interactive diagram: https://gitdiagram.com/jotis86/alzheimer-project
- Repository: https://github.com/jotis86/alzheimer-project

## Overview

##### Main Components
- Data Layer:
- Data acquisition and cleaning (directories like Data, Data_exploration, and Statistics).
- Storage of raw and cleaned data (e.g., CSVs, Parquet files, and MRI image datasets).
- Analytics and Model Building:
- Machine Learning components (located in Machine_learning, with training notebooks and pickled models).
- Deep Learning components (found in Deep_learning, including model files like alzheimer_model.h5 and relevant notebooks).
- Application and User Interface:
- Interactive application with Streamlit (code in App folder and Deep_learning/app.py).
- Visualization components (Data_visualization folder and Power_BI dashboards).
- External Integrations:
- Chat Bot integration with Cohere (as described in the README).
- Alexa Skill (detailed in the README, though the implementation details might reside outside the visible file structure).
- Supporting Documentation and Reports:
- PDFs and reports inside the App folder and documentation in Project_Management and README files.

##### Relationships and Data Flow
- Data flows from the raw data sources into preprocessing pipelines (Data and Data_exploration).
- Preprocessed data feeds into the ML and DL model training pipelines.
- Trained models (serialized using Joblib/pickle or in .h5 format) are then consumed by the interactive application layer.
- Outbound integrations send results to Power BI for advanced dashboards and also interact with chat bot and Alexa skill modules for voice and text-driven assistance.
- There is also cross-referencing among the analysis (machine learning & deep learning) and visualization components for improved feedback and iterative development.

##### Architectural Patterns and Design Principles
- Separation of Concerns: Distinct folders for data processing, ML/DL development, and frontend application.
- Modularity: By keeping deep learning models separate from machine learning models, as well as using individual components for EDA, visualizations, and interactive web apps, the architecture supports modular development and testing.
- Integration: The use of various interfaces (Streamlit for web, Power BI for dashboards, Alexa for voice interactions) shows that the system is built to integrate multiple user interaction channels.
- Data Pipeline: The clear flow from raw data and exploratory analysis into model training and then into front-end applications reflects a typical end-to-end data pipeline architecture.

##### Relevant Technologies/Frameworks
- Python as the main programming language.
- Pandas, NumPy for analytics.
- Scikit-learn (ML model training) and TensorFlow (DL image processing).
- Streamlit for building the interactive application.
- Power BI for external dashboards.
- Chat Bot integration using Cohere.
- Various libraries like OpenCV, Pillow for image processing.
- Joblib (or pickle) for model serialization.

##### Instructing the Principal Software Engineer
- Block for “Data Acquisition & Preprocessing” (covering Data, Data_exploration, Statistics).
- Separate blocks for “Machine Learning Pipeline” (Machine_learning, related notebooks & model files) and “Deep Learning Pipeline” (Deep_learning, MRI Dataset, and DL model files).
- A block for “Interactive Application” covering the Streamlit app in App and Deep_learning/app.py.
- Blocks for “Visualizations & Dashboards” (Data_visualization folder and Power_BI dashboards).
- Blocks representing “Chat Bot Integration” and “Alexa Skill” (to show external integration layers even if the implementation is external).
- The flow from data sources to preprocessing modules, then into both ML and DL pipelines.
- Links from the interactive application to external visualization services (Power BI) and communication interfaces (Chat Bot, Alexa).
- Data storage/processing (e.g., rounded rectangles),
- Computational/modeling components (e.g., squares),
- User interfaces and integrations (e.g., parallelograms).
- Annotations or legends to clarify which parts of the file tree correspond to each block.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Data Acquisition & Preprocessing
    subgraph "Data Acquisition & Preprocessing"
        data1["Data"]:::data
        data2["Data Exploration"]:::data
        data3["Statistics"]:::data
        pd["Preprocessed Data"]:::data
    end
    data1 --> pd
    data2 --> pd
    data3 --> pd

    %% Model Building Pipelines
    pd --> ML["Machine Learning Pipeline"]:::ml
    pd --> DL["Deep Learning Pipeline"]:::dl

    ML --> ml_model["ML Model"]:::ml
    DL --> dl_model["DL Model"]:::dl
    DL --> mri["MRI Data (Imaging)"]:::dl
    DL --> dl_app["DL App Integration"]:::dl

    %% Interactive Application and downstream integrations
    ml_model --> app["Interactive Application (Streamlit App)"]:::app
    dl_model --> app
    dl_app --> app

    app --> viz["Data Visualization"]:::viz
    viz --> power_bi["Power BI Dashboards"]:::viz
    app --> ext["External Integrations (Chat Bot & Alexa)"]:::ext
    app --> docs["Documentation & Reports"]:::docs
    docs --> project_mgmt["Project Management"]:::docs
    project_mgmt --> readme["README.md"]:::docs

    %% Click Events for Data Layer
    click data1 "https://github.com/jotis86/alzheimer-project/blob/main/Data/alzheimers_disease_data.csv"
    click data2 "https://github.com/jotis86/alzheimer-project/tree/main/Data_exploration/"
    click data3 "https://github.com/jotis86/alzheimer-project/tree/main/Statistics/"

    %% Click Events for Model Pipelines
    click ML "https://github.com/jotis86/alzheimer-project/tree/main/Machine_learning/"
    click DL "https://github.com/jotis86/alzheimer-project/tree/main/Deep_learning/"
    click mri "https://github.com/jotis86/alzheimer-project/tree/main/Deep_learning/MRI Dataset/"
    click dl_app "https://github.com/jotis86/alzheimer-project/blob/main/Deep_learning/app.py"

    %% Click Events for Application and Visualization
    click app "https://github.com/jotis86/alzheimer-project/tree/main/App/"
    click viz "https://github.com/jotis86/alzheimer-project/tree/main/Data_visualization/"
    click power_bi "https://github.com/jotis86/alzheimer-project/tree/main/Power_BI/"

    %% Click Events for Documentation
    click project_mgmt "https://github.com/jotis86/alzheimer-project/tree/main/Project_Management/"
    click readme "https://github.com/jotis86/alzheimer-project/blob/main/README.md"

    %% Styles
    classDef data fill:#f9e79f,stroke:#e67e22,stroke-width:2px;
    classDef ml fill:#aed6f1,stroke:#3498db,stroke-width:2px;
    classDef dl fill:#a9dfbf,stroke:#27ae60,stroke-width:2px;
    classDef app fill:#f5b7b1,stroke:#e74c3c,stroke-width:2px;
    classDef viz fill:#d7bde2,stroke:#8e44ad,stroke-width:2px;
    classDef ext fill:#fad7a0,stroke:#f39c12,stroke-width:2px;
    classDef docs fill:#d5f5e3,stroke:#1abc9c,stroke-width:2px;
```
