# aseeil9/ai-tire-defect-detection architecture

> Architecture diagram of the GitHub repository aseeil9/ai-tire-defect-detection, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aseeil9/ai-tire-defect-detection
- Repository: https://github.com/aseeil9/ai-tire-defect-detection

## Overview

This MATLAB project trains a ResNet-50 transfer-learning model to classify tires as Good or Defective, then supports custom-image inference, final evaluation, and live webcam testing. The README documents the stages and directs users to start live testing with Step7. No source excerpts were provided, so the graph reflects documented capabilities and stage ordering; it does not assert unseen function calls or data transfers.

Main entry points: [`Step4_TrainModel.m`](https://github.com/aseeil9/ai-tire-defect-detection/blob/main/Step4_TrainModel.m) (Train model), [`Step2_DataPrep.m`](https://github.com/aseeil9/ai-tire-defect-detection/blob/main/Step2_DataPrep.m) (Prepare images), [`Step3_BuildModel.m`](https://github.com/aseeil9/ai-tire-defect-detection/blob/main/Step3_BuildModel.m) (Build ResNet-50), [`Step7_LiveWebcam.m`](https://github.com/aseeil9/ai-tire-defect-detection/blob/main/Step7_LiveWebcam.m) (Live webcam test)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Image preparation"]
  node_load["Load tire data"]
  node_prep["Prepare images<br/>[Step2_DataPrep.m]"]
end

subgraph group_training["Model training"]
  node_build["Build ResNet-50<br/>[Step3_BuildModel.m]"]
  node_train["Train model<br/>[Step4_TrainModel.m]"]
end

subgraph group_use["Inference and evaluation"]
  node_custom["Custom image test<br/>[Step5_TestMyTire.m]"]
  node_evaluate["Final evaluation"]
  node_webcam["Live webcam test<br/>[Step7_LiveWebcam.m]"]
end

node_user(("User"))

node_load -->|"prepares for"| node_prep
node_prep -->|"feeds"| node_build
node_build -->|"trains"| node_train
node_train -.->|"enables inference"| node_custom
node_train -.->|"enables evaluation"| node_evaluate
node_train -.->|"enables live testing"| node_webcam
node_user -->|"runs"| node_webcam

click node_load "https://github.com/aseeil9/ai-tire-defect-detection/blob/main/Step1_LoadTireData.m"
click node_prep "https://github.com/aseeil9/ai-tire-defect-detection/blob/main/Step2_DataPrep.m"
click node_build "https://github.com/aseeil9/ai-tire-defect-detection/blob/main/Step3_BuildModel.m"
click node_train "https://github.com/aseeil9/ai-tire-defect-detection/blob/main/Step4_TrainModel.m"
click node_custom "https://github.com/aseeil9/ai-tire-defect-detection/blob/main/Step5_TestMyTire.m"
click node_evaluate "https://github.com/aseeil9/ai-tire-defect-detection/blob/main/Step6_FinalEvaluation.m"
click node_webcam "https://github.com/aseeil9/ai-tire-defect-detection/blob/main/Step7_LiveWebcam.m"

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_load,node_prep,node_user toneBlue
class node_build,node_train toneAmber
class node_custom,node_evaluate,node_webcam toneMint
```

## Components

### Image preparation

- [Load tire data](https://github.com/aseeil9/ai-tire-defect-detection/blob/main/Step1_LoadTireData.m): `Step1_LoadTireData.m`
- [Prepare images](https://github.com/aseeil9/ai-tire-defect-detection/blob/main/Step2_DataPrep.m): `Step2_DataPrep.m`

### Model training

- [Build ResNet-50](https://github.com/aseeil9/ai-tire-defect-detection/blob/main/Step3_BuildModel.m): `Step3_BuildModel.m`
- [Train model](https://github.com/aseeil9/ai-tire-defect-detection/blob/main/Step4_TrainModel.m): `Step4_TrainModel.m`

### Inference and evaluation

- [Custom image test](https://github.com/aseeil9/ai-tire-defect-detection/blob/main/Step5_TestMyTire.m): `Step5_TestMyTire.m`
- [Final evaluation](https://github.com/aseeil9/ai-tire-defect-detection/blob/main/Step6_FinalEvaluation.m): `Step6_FinalEvaluation.m`
- [Live webcam test](https://github.com/aseeil9/ai-tire-defect-detection/blob/main/Step7_LiveWebcam.m): `Step7_LiveWebcam.m`

### Other components

- **User**

## Connections

- Load tire data → Prepare images: prepares for (evidence: `README.md`)
- Prepare images → Build ResNet-50: feeds (evidence: `README.md`)
- Build ResNet-50 → Train model: trains (evidence: `README.md`)
- Train model → Custom image test: enables inference
- Train model → Final evaluation: enables evaluation
- Train model → Live webcam test: enables live testing
- User → Live webcam test: runs (evidence: `README.md`)
