# meteorsee/mknet architecture

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

- Interactive diagram: https://gitdiagram.com/meteorsee/mknet
- Repository: https://github.com/meteorsee/mknet

## Overview

MKNet is a lightweight YOLO-based object-detection model for resource-constrained and assistive-vision use. Its principal workflow is to train a configured model on image data, then validate or run inference to obtain detections. The repository includes training and validation scripts, model-building blocks, and ablation configurations; the README also documents CLI inference and COCO-style evaluation. Available source excerpts do not establish how the YAML variants assemble the blocks, and the documented inference and COCO-evaluation scripts are absent from the supplied tree, so those links are omitted.

Main entry points: [`scripts/train.py`](https://github.com/meteorsee/mknet/blob/main/scripts/train.py) (Custom training), [`scripts/val_model.py`](https://github.com/meteorsee/mknet/blob/main/scripts/val_model.py) (Validation), [`ablation`](https://github.com/meteorsee/mknet/tree/main/ablation) (Ablation variants), [`results/comparison_results.csv`](https://github.com/meteorsee/mknet/blob/main/results/comparison_results.csv) (Reported metrics)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_model["Model architecture"]
  node_configs["Ablation variants"]
  node_mobilenet["MobileNetV3 blocks<br/>[MobileNetV3.py]"]
  node_spd["SPD-DW downsampling<br/>[MobileNetV3.py]"]
  node_cspcam["CSPCAM context<br/>[MobileNetV3.py]"]
  node_akmix["AKMix partial convolution<br/>[MobileNetV3.py]"]
  node_gsconv["GSConv fusion blocks<br/>[GSConv.py]"]
end

subgraph group_workflow["Training and evaluation"]
  node_train["Custom training<br/>[train.py]"]
  node_validate["Validation<br/>[val_model.py]"]
  node_inference["CLI inference"]
  node_coco_eval["COCO evaluation"]
  node_results["Reported metrics"]
  node_ablations["Ablation metrics"]
end

node_user(("Engineer"))
node_data[("Detection dataset")]
node_yolo["Ultralytics YOLO"]

node_user -->|"starts training"| node_train
node_train -->|"calls train and val"| node_yolo
node_data -.->|"supplies samples"| node_yolo
node_user -->|"starts validation"| node_validate
node_validate -->|"calls validation"| node_yolo
node_user -.->|"requests detections"| node_inference
node_inference -.->|"runs prediction"| node_yolo
node_user -.->|"requests evaluation"| node_coco_eval
node_coco_eval -.->|"runs validation"| node_yolo
node_yolo -.->|"produces metrics"| node_results
node_configs -.->|"compared by"| node_ablations

click node_configs "https://github.com/meteorsee/mknet/tree/main/ablation"
click node_mobilenet "https://github.com/meteorsee/mknet/blob/main/models/MobileNetV3.py"
click node_spd "https://github.com/meteorsee/mknet/blob/main/models/MobileNetV3.py"
click node_cspcam "https://github.com/meteorsee/mknet/blob/main/models/MobileNetV3.py"
click node_akmix "https://github.com/meteorsee/mknet/blob/main/models/MobileNetV3.py"
click node_gsconv "https://github.com/meteorsee/mknet/blob/main/models/GSConv.py"
click node_train "https://github.com/meteorsee/mknet/blob/main/scripts/train.py"
click node_validate "https://github.com/meteorsee/mknet/blob/main/scripts/val_model.py"
click node_results "https://github.com/meteorsee/mknet/blob/main/results/comparison_results.csv"
click node_ablations "https://github.com/meteorsee/mknet/blob/main/results/ablation_results.csv"

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_configs,node_mobilenet,node_spd,node_cspcam,node_akmix,node_gsconv toneBlue
class node_train,node_validate,node_inference,node_coco_eval,node_results,node_ablations,node_data toneAmber
class node_user,node_yolo toneIndigo
```

## Components

### Model architecture

- [Ablation variants](https://github.com/meteorsee/mknet/tree/main/ablation): `ablation`
- [MobileNetV3 blocks](https://github.com/meteorsee/mknet/blob/main/models/MobileNetV3.py): `models/MobileNetV3.py`
- [SPD-DW downsampling](https://github.com/meteorsee/mknet/blob/main/models/MobileNetV3.py): `models/MobileNetV3.py`
- [CSPCAM context](https://github.com/meteorsee/mknet/blob/main/models/MobileNetV3.py): `models/MobileNetV3.py`
- [AKMix partial convolution](https://github.com/meteorsee/mknet/blob/main/models/MobileNetV3.py): `models/MobileNetV3.py`
- [GSConv fusion blocks](https://github.com/meteorsee/mknet/blob/main/models/GSConv.py): `models/GSConv.py`

### Training and evaluation

- [Custom training](https://github.com/meteorsee/mknet/blob/main/scripts/train.py): `scripts/train.py`
- [Validation](https://github.com/meteorsee/mknet/blob/main/scripts/val_model.py): `scripts/val_model.py`
- **CLI inference**
- **COCO evaluation**
- [Reported metrics](https://github.com/meteorsee/mknet/blob/main/results/comparison_results.csv): `results/comparison_results.csv`
- [Ablation metrics](https://github.com/meteorsee/mknet/blob/main/results/ablation_results.csv): `results/ablation_results.csv`

### Other components

- **Engineer**
- **Detection dataset**
- **Ultralytics YOLO**

## Connections

- Engineer → Custom training: starts training
- Custom training → Ultralytics YOLO: calls train and val
- Detection dataset → Ultralytics YOLO: supplies samples
- Engineer → Validation: starts validation
- Validation → Ultralytics YOLO: calls validation
- Engineer → CLI inference: requests detections
- CLI inference → Ultralytics YOLO: runs prediction
- Engineer → COCO evaluation: requests evaluation
- COCO evaluation → Ultralytics YOLO: runs validation
- Ultralytics YOLO → Reported metrics: produces metrics
- Ablation variants → Ablation metrics: compared by
