# cloviachebett/ml-bones-classification architecture

> Architecture diagram of the GitHub repository cloviachebett/ml-bones-classification, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cloviachebett/ml-bones-classification
- Repository: https://github.com/cloviachebett/ml-bones-classification

## Overview

This is a coursework prototype for classifying pediatric hand X-rays into three bone-maturity phases. The user uploads an image in the Streamlit portal, which preprocesses it, runs the saved model, and displays a phase and confidence. The README also describes a notebook workflow for preparing labeled data, training and evaluating a CNN, and saving the model. The notebook’s source was not sampled, so those training details are based on the README; dataset paths are not present in the tree.

Main entry points: [`app.py`](https://github.com/cloviachebett/ml-bones-classification/blob/main/app.py) (Streamlit portal), [`computervision.ipynb`](https://github.com/cloviachebett/ml-bones-classification/blob/main/computervision.ipynb) (Image preparation), [`bone_age_model.h5`](https://github.com/cloviachebett/ml-bones-classification/blob/main/bone_age_model.h5) (Trained model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_training["Data and Training"]
  node_dataset[("Labeled X-rays")]
  node_preparation["Image preparation"]
  node_split["Data splitting"]
  node_cnn["CNN training"]
  node_evaluation["Model evaluation"]
  node_artifact["Trained model<br/>[bone_age_model.h5]"]
end

subgraph group_portal["Prediction Portal"]
  node_portal_app["Streamlit portal<br/>[app.py]"]
  node_model_loader["Model loader<br/>[app.py]"]
  node_upload_preprocess["Upload preprocessing<br/>[app.py]"]
  node_inference["Model inference<br/>[app.py]"]
  node_assessment["Phase and confidence<br/>[app.py]"]
end

node_user(("X-ray uploader"))

node_dataset -->|"provides images"| node_preparation
node_preparation -->|"provides prepared data"| node_split
node_split -->|"provides training data"| node_cnn
node_cnn -->|"produces model"| node_evaluation
node_evaluation -->|"saves model"| node_artifact
node_user -->|"uploads X-ray"| node_portal_app
node_portal_app -->|"loads model"| node_model_loader
node_model_loader -->|"reads model"| node_artifact
node_portal_app -->|"preprocesses upload"| node_upload_preprocess
node_portal_app -->|"requests prediction"| node_inference
node_inference -->|"returns scores"| node_assessment
node_portal_app -->|"displays assessment"| node_assessment

click node_preparation "https://github.com/cloviachebett/ml-bones-classification/blob/main/computervision.ipynb"
click node_split "https://github.com/cloviachebett/ml-bones-classification/blob/main/computervision.ipynb"
click node_cnn "https://github.com/cloviachebett/ml-bones-classification/blob/main/computervision.ipynb"
click node_evaluation "https://github.com/cloviachebett/ml-bones-classification/blob/main/computervision.ipynb"
click node_artifact "https://github.com/cloviachebett/ml-bones-classification/blob/main/bone_age_model.h5"
click node_portal_app "https://github.com/cloviachebett/ml-bones-classification/blob/main/app.py"
click node_model_loader "https://github.com/cloviachebett/ml-bones-classification/blob/main/app.py"
click node_upload_preprocess "https://github.com/cloviachebett/ml-bones-classification/blob/main/app.py"
click node_inference "https://github.com/cloviachebett/ml-bones-classification/blob/main/app.py"
click node_assessment "https://github.com/cloviachebett/ml-bones-classification/blob/main/app.py"

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_dataset,node_preparation,node_split,node_cnn,node_evaluation,node_artifact toneBlue
class node_portal_app,node_model_loader,node_upload_preprocess,node_inference,node_assessment toneAmber
class node_user toneIndigo
```

## Components

### Data and Training

- **Labeled X-rays**
- [Image preparation](https://github.com/cloviachebett/ml-bones-classification/blob/main/computervision.ipynb): `computervision.ipynb`
- [Data splitting](https://github.com/cloviachebett/ml-bones-classification/blob/main/computervision.ipynb): `computervision.ipynb`
- [CNN training](https://github.com/cloviachebett/ml-bones-classification/blob/main/computervision.ipynb): `computervision.ipynb`
- [Model evaluation](https://github.com/cloviachebett/ml-bones-classification/blob/main/computervision.ipynb): `computervision.ipynb`
- [Trained model](https://github.com/cloviachebett/ml-bones-classification/blob/main/bone_age_model.h5): `bone_age_model.h5`

### Prediction Portal

- [Streamlit portal](https://github.com/cloviachebett/ml-bones-classification/blob/main/app.py): `app.py`
- [Model loader](https://github.com/cloviachebett/ml-bones-classification/blob/main/app.py): `app.py`
- [Upload preprocessing](https://github.com/cloviachebett/ml-bones-classification/blob/main/app.py): `app.py`
- [Model inference](https://github.com/cloviachebett/ml-bones-classification/blob/main/app.py): `app.py`
- [Phase and confidence](https://github.com/cloviachebett/ml-bones-classification/blob/main/app.py): `app.py`

### Other components

- **X-ray uploader**

## Connections

- Labeled X-rays → Image preparation: provides images
- Image preparation → Data splitting: provides prepared data
- Data splitting → CNN training: provides training data
- CNN training → Model evaluation: produces model
- Model evaluation → Trained model: saves model
- X-ray uploader → Streamlit portal: uploads X-ray
- Streamlit portal → Model loader: loads model
- Model loader → Trained model: reads model
- Streamlit portal → Upload preprocessing: preprocesses upload
- Streamlit portal → Model inference: requests prediction
- Model inference → Phase and confidence: returns scores
- Streamlit portal → Phase and confidence: displays assessment
