# hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge architecture

> Architecture diagram of the GitHub repository hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge
- Repository: https://github.com/hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge

## Overview

This repository contains a hardware-oriented, four-layer neural-network inference model, alongside Python scripts that reproduce and inspect its calculations. The Python workflow loads Layer 1 inputs and parameters, produces intermediate files consumed by Layers 2–4, and emits numeric outputs. RTL directories show corresponding layer components and a top module; their internal wiring is not shown in the supplied excerpts, so inferred RTL stage connections are dashed. No README content was supplied, and the Layer 5 hard-max module’s role in the full inference path is therefore uncertain.

Main entry points: [`rtl/top module/Model_2_top.v`](https://github.com/hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge/blob/main/rtl/top%20module/Model_2_top.v) (Model top module), [`python/code/Layer_1.py`](https://github.com/hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge/blob/main/python/code/Layer_1.py) (Layer 1 reference), [`python/code/Layer_2.py`](https://github.com/hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge/blob/main/python/code/Layer_2.py) (Layer 2 reference), [`rtl/layer 2`](https://github.com/hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge/tree/main/rtl/layer%202) (Convolution and pooling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Model data"]
  node_inputs["Input samples"]
  node_parameters["Weights and biases"]
end

subgraph group_python["Python reference"]
  node_py_l1["Layer 1 reference<br/>[Layer_1.py]"]
  node_py_l2["Layer 2 reference<br/>[Layer_2.py]"]
  node_py_l3["Layer 3 reference<br/>[Layer_3.py]"]
  node_py_l4["Layer 4 reference<br/>[Layer_4.py]"]
end

subgraph group_rtl["RTL inference"]
  node_rtl_top["Model top module<br/>[Model_2_top.v]"]
  node_rtl_l1["Convolution and pooling<br/>[L_1_0_0_Main.v]"]
  node_rtl_l1_l2["Layer interface"]
  node_rtl_l2["Convolution and pooling"]
  node_rtl_l3["Dense layer<br/>[L_3_0_0_Dense1.v]"]
  node_rtl_l4["Dense layer<br/>[L_4_0_0_Dense2.v]"]
  node_rtl_l5["Hard-max output<br/>[L_5_0_0_HardMax.v]"]
end

subgraph group_verification["Python verification"]
  node_verify_l1["Layer 1 verifier<br/>[Layer_1_Verify.py]"]
  node_verify_l2_all["Layer 2 verifier"]
  node_verify_l2_single["Single-process verifier"]
end

node_inputs -->|"loads samples"| node_py_l1
node_parameters -->|"loads parameters"| node_py_l1
node_py_l1 -->|"writes layer outputs"| node_py_l2
node_py_l2 -->|"writes layer outputs"| node_py_l3
node_py_l3 -->|"writes layer outputs"| node_py_l4
node_inputs -->|"loads samples"| node_verify_l1
node_parameters -->|"loads parameters"| node_verify_l1
node_verify_l1 -->|"writes layer outputs"| node_py_l2
node_py_l1 -->|"loads layer outputs"| node_verify_l2_all
node_py_l1 -->|"loads layer outputs"| node_verify_l2_single
node_rtl_top -.->|"dispatches to"| node_rtl_l1
node_rtl_top -.->|"dispatches to"| node_rtl_l2
node_rtl_top -.->|"dispatches to"| node_rtl_l3
node_rtl_top -.->|"dispatches to"| node_rtl_l4
node_rtl_top -.->|"dispatches to"| node_rtl_l5
node_rtl_l1 -.->|"feeds interface"| node_rtl_l1_l2
node_rtl_l1_l2 -.->|"feeds layer"| node_rtl_l2
node_rtl_l2 -.->|"feeds layer"| node_rtl_l3
node_rtl_l3 -.->|"feeds layer"| node_rtl_l4
node_rtl_l4 -.->|"feeds output"| node_rtl_l5

click node_inputs "https://github.com/hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge/tree/main/inputs"
click node_parameters "https://github.com/hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge/tree/main/weights"
click node_py_l1 "https://github.com/hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge/blob/main/python/code/Layer_1.py"
click node_py_l2 "https://github.com/hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge/blob/main/python/code/Layer_2.py"
click node_py_l3 "https://github.com/hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge/blob/main/python/code/Layer_3.py"
click node_py_l4 "https://github.com/hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge/blob/main/python/code/Layer_4.py"
click node_verify_l1 "https://github.com/hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge/blob/main/python/code/Layer_1_Verify.py"
click node_verify_l2_all "https://github.com/hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge/blob/main/python/code/Layer_2_Verify_All_Process.py"
click node_verify_l2_single "https://github.com/hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge/blob/main/python/code/Layer_2_Verify_Single_Process.py"
click node_rtl_top "https://github.com/hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge/blob/main/rtl/top%20module/Model_2_top.v"
click node_rtl_l1 "https://github.com/hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge/blob/main/rtl/layer%201/L_1_0_0_Main.v"
click node_rtl_l1_l2 "https://github.com/hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge/blob/main/rtl/layer%201%20to%20layer%202%20interface/L_1_6_L_2_0_Interface.v"
click node_rtl_l2 "https://github.com/hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge/tree/main/rtl/layer%202"
click node_rtl_l3 "https://github.com/hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge/blob/main/rtl/layer%203/L_3_0_0_Dense1.v"
click node_rtl_l4 "https://github.com/hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge/blob/main/rtl/layer%204/L_4_0_0_Dense2.v"
click node_rtl_l5 "https://github.com/hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge/blob/main/rtl/layer%205/L_5_0_0_HardMax.v"

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_inputs,node_parameters toneBlue
class node_py_l1,node_py_l2,node_py_l3,node_py_l4 toneAmber
class node_rtl_top,node_rtl_l1,node_rtl_l1_l2,node_rtl_l2,node_rtl_l3,node_rtl_l4,node_rtl_l5 toneMint
class node_verify_l1,node_verify_l2_all,node_verify_l2_single toneRose
```

## Components

### Model data

- [Input samples](https://github.com/hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge/tree/main/inputs): `inputs`
- [Weights and biases](https://github.com/hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge/tree/main/weights): `weights`

### Python reference

- [Layer 1 reference](https://github.com/hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge/blob/main/python/code/Layer_1.py): `python/code/Layer_1.py`
- [Layer 2 reference](https://github.com/hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge/blob/main/python/code/Layer_2.py): `python/code/Layer_2.py`
- [Layer 3 reference](https://github.com/hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge/blob/main/python/code/Layer_3.py): `python/code/Layer_3.py`
- [Layer 4 reference](https://github.com/hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge/blob/main/python/code/Layer_4.py): `python/code/Layer_4.py`

### RTL inference

- [Model top module](https://github.com/hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge/blob/main/rtl/top%20module/Model_2_top.v): `rtl/top module/Model_2_top.v`
- [Convolution and pooling](https://github.com/hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge/blob/main/rtl/layer%201/L_1_0_0_Main.v): `rtl/layer 1/L_1_0_0_Main.v`
- [Layer interface](https://github.com/hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge/blob/main/rtl/layer%201%20to%20layer%202%20interface/L_1_6_L_2_0_Interface.v): `rtl/layer 1 to layer 2 interface/L_1_6_L_2_0_Interface.v`
- [Convolution and pooling](https://github.com/hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge/tree/main/rtl/layer%202): `rtl/layer 2`
- [Dense layer](https://github.com/hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge/blob/main/rtl/layer%203/L_3_0_0_Dense1.v): `rtl/layer 3/L_3_0_0_Dense1.v`
- [Dense layer](https://github.com/hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge/blob/main/rtl/layer%204/L_4_0_0_Dense2.v): `rtl/layer 4/L_4_0_0_Dense2.v`
- [Hard-max output](https://github.com/hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge/blob/main/rtl/layer%205/L_5_0_0_HardMax.v): `rtl/layer 5/L_5_0_0_HardMax.v`

### Python verification

- [Layer 1 verifier](https://github.com/hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge/blob/main/python/code/Layer_1_Verify.py): `python/code/Layer_1_Verify.py`
- [Layer 2 verifier](https://github.com/hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge/blob/main/python/code/Layer_2_Verify_All_Process.py): `python/code/Layer_2_Verify_All_Process.py`
- [Single-process verifier](https://github.com/hrishinahta/ml-based-hardware-for-gesture-recognition-at-the-edge/blob/main/python/code/Layer_2_Verify_Single_Process.py): `python/code/Layer_2_Verify_Single_Process.py`

## Connections

- Input samples → Layer 1 reference: loads samples (evidence: `python/code/Layer_1.py`)
- Weights and biases → Layer 1 reference: loads parameters (evidence: `python/code/Layer_1.py`)
- Layer 1 reference → Layer 2 reference: writes layer outputs (evidence: `python/code/Layer_1.py`)
- Layer 2 reference → Layer 3 reference: writes layer outputs (evidence: `python/code/Layer_2.py`)
- Layer 3 reference → Layer 4 reference: writes layer outputs (evidence: `python/code/Layer_3.py`)
- Input samples → Layer 1 verifier: loads samples (evidence: `python/code/Layer_1_Verify.py`)
- Weights and biases → Layer 1 verifier: loads parameters (evidence: `python/code/Layer_1_Verify.py`)
- Layer 1 verifier → Layer 2 reference: writes layer outputs (evidence: `python/code/Layer_1_Verify.py`)
- Layer 1 reference → Layer 2 verifier: loads layer outputs (evidence: `python/code/Layer_2_Verify_All_Process.py`)
- Layer 1 reference → Single-process verifier: loads layer outputs (evidence: `python/code/Layer_2_Verify_Single_Process.py`)
- Model top module → Convolution and pooling: dispatches to
- Model top module → Convolution and pooling: dispatches to
- Model top module → Dense layer: dispatches to
- Model top module → Dense layer: dispatches to
- Model top module → Hard-max output: dispatches to
- Convolution and pooling → Layer interface: feeds interface
- Layer interface → Convolution and pooling: feeds layer
- Convolution and pooling → Dense layer: feeds layer
- Dense layer → Dense layer: feeds layer
- Dense layer → Hard-max output: feeds output
