# apodwikat/dental_anomaly_detection_graduationproject architecture

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

- Interactive diagram: https://gitdiagram.com/apodwikat/dental_anomaly_detection_graduationproject
- Repository: https://github.com/apodwikat/dental_anomaly_detection_graduationproject

## Overview

##### Project type and purpose
- This is a deep-learning-powered anomaly-detection system for dental X-ray images. It comprises:
- A research/training pipeline (Jupyter notebooks + training scripts)
- A web-based inference application (static front-end + Python REST API)
- The README confirms it’s a proof-of-concept for detecting dental anomalies with ~95.5% accuracy, using ~1,000 panoramic X-rays.

##### File structure
- Top-level directories:
- JupyterCodes/ – exploratory data analysis and model-dev notebooks
- Web Page/ – web application (index1.html, style1.css, main.py, restapi.py, preprocessing_utils.py, requirements.txt)
- runs/ – training logs, metrics, and model weights (detect/train24/…)
- output_folder/ – (likely) storing inference outputs or artifacts
- Key files:
- dentist_data.yaml – data schema or paths for notebooks
- main.py + restapi.py – entrypoint(s) for the inference service (Flask/FastAPI style)
- preprocessing_utils.py – image-prep utilities used by both training and inference
- requirements.txt – lists frameworks (e.g., PyTorch/YOLO, Flask/FastAPI)

##### README for additional insights
- Confirms deep-learning stack, potential future clinical integration, and open-collaboration ethos.

##### Detail without overthinking
– Capture every file’s role: e.g., show preprocessing_utils.py as a shared module between training and inference if applicable.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Overview
    readme["README.md"]:::doc

    %% Data Layer
    subgraph "Data Layer"
        rawData["Panoramic X-rays"]:::data
        dentist_data["dentist_data.yaml"]:::doc
    end

    %% Training Pipeline
    subgraph "Training Pipeline"
        Notebook1["2Dentx.ipynb"]:::compute
        Notebook2["Clache+Resizer.ipynb"]:::compute
        TrainScript["YOLO Training Script"]:::compute
    end

    %% Model Artifacts & Logs
    subgraph "Model Artifacts & Logs"
        bestPT["best.pt"]:::data
        lastPT["last.pt"]:::data
        events["events.out.tfevents.1738968505.DESKTOP-UNDHH4E.8508.2"]:::data
        resultsCSV["results.csv"]:::data
        argsYAML["args.yaml"]:::doc
    end

    %% Inference Application
    subgraph "Inference Application"
        subgraph "Frontend"
            frontendHTML["index1.html"]:::ui
            frontendCSS["style1.css"]:::ui
        end
        subgraph "Backend"
            mainPy["main.py"]:::compute
            restapi["restapi.py"]:::compute
            preproc["preprocessing_utils.py"]:::compute
            requirements["requirements.txt"]:::doc
        end
    end

    %% Output Storage
    subgraph "Output Storage"
        output["output_folder"]:::data
    end

    %% Training Flow
    rawData --> Notebook1
    rawData --> Notebook2
    dentist_data --> Notebook1
    dentist_data --> Notebook2
    Notebook1 -.-> TrainScript
    Notebook2 -.-> TrainScript
    TrainScript --> bestPT
    TrainScript --> lastPT
    TrainScript --> events
    TrainScript --> resultsCSV
    TrainScript --> argsYAML

    %% Inference Flow
    bestPT --> mainPy
    lastPT --> mainPy
    mainPy --> restapi
    preproc --> restapi
    restapi --> output
    frontendHTML --> restapi
    frontendCSS --> restapi

    %% Artifact Hand-off
    bestPT --> restapi
    lastPT --> restapi

    %% Click Events
    click dentist_data "https://github.com/apodwikat/dental_anomaly_detection_graduationproject/blob/main/JupyterCodes/dentist_data.yaml"
    click Notebook1 "https://github.com/apodwikat/dental_anomaly_detection_graduationproject/blob/main/JupyterCodes/2Dentx.ipynb"
    click Notebook2 "https://github.com/apodwikat/dental_anomaly_detection_graduationproject/blob/main/JupyterCodes/Clache+Resizer.ipynb"
    click bestPT "https://github.com/apodwikat/dental_anomaly_detection_graduationproject/blob/main/runs/detect/train24/weights/best.pt"
    click lastPT "https://github.com/apodwikat/dental_anomaly_detection_graduationproject/blob/main/runs/detect/train24/weights/last.pt"
    click events "https://github.com/apodwikat/dental_anomaly_detection_graduationproject/blob/main/runs/detect/train24/events.out.tfevents.1738968505.DESKTOP-UNDHH4E.8508.2"
    click resultsCSV "https://github.com/apodwikat/dental_anomaly_detection_graduationproject/blob/main/runs/detect/train24/results.csv"
    click argsYAML "https://github.com/apodwikat/dental_anomaly_detection_graduationproject/blob/main/runs/detect/train24/args.yaml"
    click frontendHTML "https://github.com/apodwikat/dental_anomaly_detection_graduationproject/blob/main/Web Page/index1.html"
    click frontendCSS "https://github.com/apodwikat/dental_anomaly_detection_graduationproject/blob/main/Web Page/style1.css"
    click mainPy "https://github.com/apodwikat/dental_anomaly_detection_graduationproject/blob/main/Web Page/main.py"
    click restapi "https://github.com/apodwikat/dental_anomaly_detection_graduationproject/blob/main/Web Page/restapi.py"
    click preproc "https://github.com/apodwikat/dental_anomaly_detection_graduationproject/blob/main/Web Page/preprocessing_utils.py"
    click requirements "https://github.com/apodwikat/dental_anomaly_detection_graduationproject/blob/main/Web Page/requirements.txt"
    click output "https://github.com/apodwikat/dental_anomaly_detection_graduationproject/tree/main/output_folder"
    click readme "https://github.com/apodwikat/dental_anomaly_detection_graduationproject/blob/main/README.md"

    %% Styles
    classDef data fill:#D0E8FF,stroke:#0080FF,color:#000
    classDef compute fill:#DFFFD0,stroke:#00A000,color:#000
    classDef ui fill:#FFE5B4,stroke:#FF8C00,color:#000
    classDef doc fill:#F0F0F0,stroke:#888888,color:#000
```
