# abhishekudeniyan/steel-defect-detection-on-optimize-yolo architecture

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

- Interactive diagram: https://gitdiagram.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo
- Repository: https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo

## Overview

This repository is a steel-defect detection research project built around custom YOLO/PyTorch layers and repeatable experiments. The main user workflow is to prepare or select a dataset and model configuration, run seeded training and validation, then collect detection and performance metrics. Separate scripts support dataset inspection and model-architecture checks. The README provides only the project title, and several data-preparation scripts were read without excerpts; their exact runtime connections are therefore not asserted.

Main entry points: [`scripts/run_exp.py`](https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/blob/main/scripts/run_exp.py) (Experiment runner), [`src/register_modules.py`](https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/blob/main/src/register_modules.py) (Module registration), [`src/__init__.py`](https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/blob/main/src/__init__.py) (Package API), [`src/custom_modules.py`](https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/blob/main/src/custom_modules.py) (Custom blocks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Dataset workflow"]
  node_prep_dataset["Dataset preparation<br/>[prepare_dataset.py]"]
  node_prep_gc10["GC10 preparation"]
  node_prep_v2["V2 preparation"]
  node_dataset_check["Dataset verification<br/>[verify_dataset.py]"]
  node_dataset_analysis["Dataset analysis<br/>[dataset_info.py]"]
  node_sample_visualizer["Sample visualization"]
  node_dataset["GC10 dataset<br/>[data.yaml]"]
end

subgraph group_model["YOLO extensions"]
  node_yolo["Ultralytics YOLO"]
  node_spd_layers["SPD layers<br/>[spd_conv.py]"]
  node_custom_blocks["Custom blocks<br/>[custom_modules.py]"]
  node_registration["Module registration"]
  node_package_api["Package API<br/>[__init__.py]"]
  node_architecture_check["Architecture verification"]
  node_model_check["Model inspection<br/>[verify_model.py]"]
end

subgraph group_experiments["Experiments and metrics"]
  node_experiment_config["Experiment config<br/>[base.yaml]"]
  node_data_config["Data config<br/>[data.yaml]"]
  node_experiment_runner["Experiment runner<br/>[run_exp.py]"]
  node_metric_logger["Metric logger<br/>[logger.py]"]
  node_metric_files[("Metric CSVs")]
end

node_researcher(("Researcher"))

node_researcher -.->|"runs"| node_experiment_runner
node_experiment_runner -->|"reads"| node_experiment_config
node_experiment_runner -->|"registers"| node_registration
node_experiment_runner -->|"trains and validates"| node_yolo
node_experiment_runner -->|"logs metrics"| node_metric_logger
node_metric_logger -->|"writes CSV"| node_metric_files
node_registration -->|"registers"| node_spd_layers
node_registration -->|"registers"| node_custom_blocks
node_package_api -->|"imports"| node_spd_layers
node_package_api -->|"imports"| node_custom_blocks
node_package_api -->|"imports"| node_metric_logger
node_package_api -->|"registers"| node_registration
node_custom_blocks -->|"uses SPD2"| node_spd_layers
node_researcher -.->|"prepares data"| node_prep_dataset
node_researcher -.->|"prepares data"| node_prep_gc10
node_researcher -.->|"prepares data"| node_prep_v2
node_researcher -.->|"inspects data"| node_dataset_analysis
node_researcher -.->|"checks data"| node_dataset_check
node_researcher -.->|"views samples"| node_sample_visualizer
node_researcher -->|"checks architecture"| node_architecture_check
node_architecture_check -->|"registers modules"| node_registration
node_researcher -.->|"inspects model"| node_model_check
node_model_check -->|"imports layers"| node_spd_layers
node_model_check -->|"imports blocks"| node_custom_blocks

click node_prep_dataset "https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/blob/main/scripts/prepare_dataset.py"
click node_prep_gc10 "https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/blob/main/scripts/prepare_gc10_dataset.py"
click node_prep_v2 "https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/blob/main/scripts/V2_prepare_dataset_v2.py"
click node_dataset_check "https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/blob/main/scripts/verify_dataset.py"
click node_dataset_analysis "https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/blob/main/scripts/dataset_info.py"
click node_sample_visualizer "https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/blob/main/scripts/visualize_samples.py"
click node_dataset "https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/blob/main/data/GC10_DET_YOLO/data.yaml"
click node_experiment_config "https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/blob/main/configs/base.yaml"
click node_data_config "https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/blob/main/configs/data.yaml"
click node_experiment_runner "https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/blob/main/scripts/run_exp.py"
click node_spd_layers "https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/blob/main/src/spd_conv.py"
click node_custom_blocks "https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/blob/main/src/custom_modules.py"
click node_registration "https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/blob/main/src/register_modules.py"
click node_package_api "https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/blob/main/src/__init__.py"
click node_architecture_check "https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/blob/main/scripts/verify_architecture.py"
click node_model_check "https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/blob/main/scripts/verify_model.py"
click node_metric_logger "https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/blob/main/src/logger.py"
click node_metric_files "https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/tree/main/results/metrics"

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_prep_dataset,node_prep_gc10,node_prep_v2,node_dataset_check,node_dataset_analysis,node_sample_visualizer,node_dataset toneBlue
class node_yolo,node_spd_layers,node_custom_blocks,node_registration,node_package_api,node_architecture_check,node_model_check toneAmber
class node_experiment_config,node_data_config,node_experiment_runner,node_metric_logger,node_metric_files toneMint
class node_researcher toneIndigo
```

## Components

### Dataset workflow

- [Dataset preparation](https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/blob/main/scripts/prepare_dataset.py): `scripts/prepare_dataset.py`
- [GC10 preparation](https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/blob/main/scripts/prepare_gc10_dataset.py): `scripts/prepare_gc10_dataset.py`
- [V2 preparation](https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/blob/main/scripts/V2_prepare_dataset_v2.py): `scripts/V2_prepare_dataset_v2.py`
- [Dataset verification](https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/blob/main/scripts/verify_dataset.py): `scripts/verify_dataset.py`
- [Dataset analysis](https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/blob/main/scripts/dataset_info.py): `scripts/dataset_info.py`
- [Sample visualization](https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/blob/main/scripts/visualize_samples.py): `scripts/visualize_samples.py`
- [GC10 dataset](https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/blob/main/data/GC10_DET_YOLO/data.yaml): `data/GC10_DET_YOLO/data.yaml`

### YOLO extensions

- **Ultralytics YOLO**
- [SPD layers](https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/blob/main/src/spd_conv.py): `src/spd_conv.py`
- [Custom blocks](https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/blob/main/src/custom_modules.py): `src/custom_modules.py`
- [Module registration](https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/blob/main/src/register_modules.py): `src/register_modules.py`
- [Package API](https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/blob/main/src/__init__.py): `src/__init__.py`
- [Architecture verification](https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/blob/main/scripts/verify_architecture.py): `scripts/verify_architecture.py`
- [Model inspection](https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/blob/main/scripts/verify_model.py): `scripts/verify_model.py`

### Experiments and metrics

- [Experiment config](https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/blob/main/configs/base.yaml): `configs/base.yaml`
- [Data config](https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/blob/main/configs/data.yaml): `configs/data.yaml`
- [Experiment runner](https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/blob/main/scripts/run_exp.py): `scripts/run_exp.py`
- [Metric logger](https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/blob/main/src/logger.py): `src/logger.py`
- [Metric CSVs](https://github.com/abhishekudeniyan/steel-defect-detection-on-optimize-yolo/tree/main/results/metrics): `results/metrics`

### Other components

- **Researcher**

## Connections

- Researcher → Experiment runner: runs
- Experiment runner → Experiment config: reads (evidence: `scripts/run_exp.py`)
- Experiment runner → Module registration: registers (evidence: `scripts/run_exp.py`)
- Experiment runner → Ultralytics YOLO: trains and validates (evidence: `scripts/run_exp.py`)
- Experiment runner → Metric logger: logs metrics (evidence: `scripts/run_exp.py`)
- Metric logger → Metric CSVs: writes CSV (evidence: `src/logger.py`)
- Module registration → SPD layers: registers (evidence: `src/register_modules.py`)
- Module registration → Custom blocks: registers (evidence: `src/register_modules.py`)
- Package API → SPD layers: imports (evidence: `src/__init__.py`)
- Package API → Custom blocks: imports (evidence: `src/__init__.py`)
- Package API → Metric logger: imports (evidence: `src/__init__.py`)
- Package API → Module registration: registers (evidence: `src/__init__.py`)
- Custom blocks → SPD layers: uses SPD2 (evidence: `src/custom_modules.py`)
- Researcher → Dataset preparation: prepares data
- Researcher → GC10 preparation: prepares data
- Researcher → V2 preparation: prepares data
- Researcher → Dataset analysis: inspects data
- Researcher → Dataset verification: checks data
- Researcher → Sample visualization: views samples
- Researcher → Architecture verification: checks architecture (evidence: `scripts/verify_architecture.py`)
- Architecture verification → Module registration: registers modules (evidence: `scripts/verify_architecture.py`)
- Researcher → Model inspection: inspects model
- Model inspection → SPD layers: imports layers (evidence: `scripts/verify_model.py`)
- Model inspection → Custom blocks: imports blocks (evidence: `scripts/verify_model.py`)
