# venu277/neuromorphic-event-camera-perception-for-automotive-applications architecture

> Architecture diagram of the GitHub repository venu277/neuromorphic-event-camera-perception-for-automotive-applications, 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/venu277/neuromorphic-event-camera-perception-for-automotive-applications
- Repository: https://github.com/venu277/neuromorphic-event-camera-perception-for-automotive-applications

## Overview

This repository is a research pipeline for event-camera car-versus-background perception and SNN/CNN tradeoff evaluation. The documented workflow starts with N-MNIST event framing and SNN training, then parses and bins raw N-Cars events, trains spiking and conventional classifiers, and measures accuracy, spike/FLOP proxies, and CPU latency. The N-Cars parser and dataset handling are embedded in several scripts rather than factored into a shared module. The README documents the head-to-head findings; the sampled benchmark scripts measure their respective models separately.

Main entry points: [`step8_train_cnn_baseline.py`](https://github.com/venu277/neuromorphic-event-camera-perception-for-automotive-applications/blob/main/step8_train_cnn_baseline.py) (Train car CNN), [`step9_benchmark_snn.py`](https://github.com/venu277/neuromorphic-event-camera-perception-for-automotive-applications/blob/main/step9_benchmark_snn.py) (Measure SNN), [`step4_train_snn.py`](https://github.com/venu277/neuromorphic-event-camera-perception-for-automotive-applications/blob/main/step4_train_snn.py) (Train digit SNN), [`step7_train_ncars_snn.py`](https://github.com/venu277/neuromorphic-event-camera-perception-for-automotive-applications/blob/main/step7_train_ncars_snn.py) (SNN event loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mnist["N-MNIST Baseline"]
  node_nmnist["N-MNIST dataset"]
  node_inspect_nmnist["Inspect event frames"]
  node_train_nmnist["Train digit SNN<br/>[step4_train_snn.py]"]
  node_nmnist_model["Digit SNN weights"]
end

subgraph group_ncars["N-Cars Data"]
  node_ncars_files["N-Cars event files"]
  node_inspect_ncars["Inspect parsed sample"]
  node_snn_data["SNN event loader"]
  node_cnn_data["CNN event loader"]
  node_bench_data["Benchmark event loader"]
end

subgraph group_models["Classifier Training"]
  node_train_snn["Train car SNN"]
  node_train_cnn["Train car CNN"]
  node_snn_weights["Car SNN weights"]
  node_cnn_weights["Car CNN weights"]
end

subgraph group_evaluation["Model Evaluation"]
  node_benchmark_snn["Measure SNN"]
  node_comparison["Tradeoff findings<br/>[README.md]"]
end

node_nmnist -->|"loads samples"| node_inspect_nmnist
node_nmnist -->|"loads and frames"| node_train_nmnist
node_train_nmnist -->|"saves weights"| node_nmnist_model
node_ncars_files -->|"reads events"| node_inspect_ncars
node_ncars_files -->|"parses and bins"| node_snn_data
node_ncars_files -->|"parses and bins"| node_cnn_data
node_ncars_files -->|"parses and bins"| node_bench_data
node_snn_data -->|"supplies batches"| node_train_snn
node_cnn_data -->|"supplies batches"| node_train_cnn
node_train_snn -->|"saves weights"| node_snn_weights
node_train_cnn -->|"saves weights"| node_cnn_weights
node_snn_weights -->|"loads weights"| node_benchmark_snn
node_bench_data -->|"supplies test samples"| node_benchmark_snn
node_train_cnn -.->|"documents CNN results"| node_comparison
node_benchmark_snn -.->|"documents SNN results"| node_comparison

click node_inspect_nmnist "https://github.com/venu277/neuromorphic-event-camera-perception-for-automotive-applications/blob/main/step3_load_nmnist.py"
click node_train_nmnist "https://github.com/venu277/neuromorphic-event-camera-perception-for-automotive-applications/blob/main/step4_train_snn.py"
click node_nmnist_model "https://github.com/venu277/neuromorphic-event-camera-perception-for-automotive-applications/blob/main/snn_nmnist_model.pth"
click node_inspect_ncars "https://github.com/venu277/neuromorphic-event-camera-perception-for-automotive-applications/blob/main/step6_load_ncars.py"
click node_snn_data "https://github.com/venu277/neuromorphic-event-camera-perception-for-automotive-applications/blob/main/step7_train_ncars_snn.py"
click node_cnn_data "https://github.com/venu277/neuromorphic-event-camera-perception-for-automotive-applications/blob/main/step8_train_cnn_baseline.py"
click node_bench_data "https://github.com/venu277/neuromorphic-event-camera-perception-for-automotive-applications/blob/main/step9_benchmark_snn.py"
click node_train_snn "https://github.com/venu277/neuromorphic-event-camera-perception-for-automotive-applications/blob/main/step7_train_ncars_snn.py"
click node_train_cnn "https://github.com/venu277/neuromorphic-event-camera-perception-for-automotive-applications/blob/main/step8_train_cnn_baseline.py"
click node_snn_weights "https://github.com/venu277/neuromorphic-event-camera-perception-for-automotive-applications/blob/main/snn_ncars_model_v2.pth"
click node_cnn_weights "https://github.com/venu277/neuromorphic-event-camera-perception-for-automotive-applications/blob/main/cnn_ncars_baseline.pth"
click node_benchmark_snn "https://github.com/venu277/neuromorphic-event-camera-perception-for-automotive-applications/blob/main/step9_benchmark_snn.py"
click node_comparison "https://github.com/venu277/neuromorphic-event-camera-perception-for-automotive-applications/blob/main/README.md"

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_nmnist,node_inspect_nmnist,node_train_nmnist,node_nmnist_model toneBlue
class node_ncars_files,node_inspect_ncars,node_snn_data,node_cnn_data,node_bench_data toneAmber
class node_train_snn,node_train_cnn,node_snn_weights,node_cnn_weights toneMint
class node_benchmark_snn,node_comparison toneRose
```

## Components

### N-MNIST Baseline

- **N-MNIST dataset**
- [Inspect event frames](https://github.com/venu277/neuromorphic-event-camera-perception-for-automotive-applications/blob/main/step3_load_nmnist.py): `step3_load_nmnist.py`
- [Train digit SNN](https://github.com/venu277/neuromorphic-event-camera-perception-for-automotive-applications/blob/main/step4_train_snn.py): `step4_train_snn.py`
- [Digit SNN weights](https://github.com/venu277/neuromorphic-event-camera-perception-for-automotive-applications/blob/main/snn_nmnist_model.pth): `snn_nmnist_model.pth`

### N-Cars Data

- **N-Cars event files**
- [Inspect parsed sample](https://github.com/venu277/neuromorphic-event-camera-perception-for-automotive-applications/blob/main/step6_load_ncars.py): `step6_load_ncars.py`
- [SNN event loader](https://github.com/venu277/neuromorphic-event-camera-perception-for-automotive-applications/blob/main/step7_train_ncars_snn.py): `step7_train_ncars_snn.py`
- [CNN event loader](https://github.com/venu277/neuromorphic-event-camera-perception-for-automotive-applications/blob/main/step8_train_cnn_baseline.py): `step8_train_cnn_baseline.py`
- [Benchmark event loader](https://github.com/venu277/neuromorphic-event-camera-perception-for-automotive-applications/blob/main/step9_benchmark_snn.py): `step9_benchmark_snn.py`

### Classifier Training

- [Train car SNN](https://github.com/venu277/neuromorphic-event-camera-perception-for-automotive-applications/blob/main/step7_train_ncars_snn.py): `step7_train_ncars_snn.py`
- [Train car CNN](https://github.com/venu277/neuromorphic-event-camera-perception-for-automotive-applications/blob/main/step8_train_cnn_baseline.py): `step8_train_cnn_baseline.py`
- [Car SNN weights](https://github.com/venu277/neuromorphic-event-camera-perception-for-automotive-applications/blob/main/snn_ncars_model_v2.pth): `snn_ncars_model_v2.pth`
- [Car CNN weights](https://github.com/venu277/neuromorphic-event-camera-perception-for-automotive-applications/blob/main/cnn_ncars_baseline.pth): `cnn_ncars_baseline.pth`

### Model Evaluation

- [Measure SNN](https://github.com/venu277/neuromorphic-event-camera-perception-for-automotive-applications/blob/main/step9_benchmark_snn.py): `step9_benchmark_snn.py`
- [Tradeoff findings](https://github.com/venu277/neuromorphic-event-camera-perception-for-automotive-applications/blob/main/README.md): `README.md`

## Connections

- N-MNIST dataset → Inspect event frames: loads samples
- N-MNIST dataset → Train digit SNN: loads and frames
- Train digit SNN → Digit SNN weights: saves weights
- N-Cars event files → Inspect parsed sample: reads events
- N-Cars event files → SNN event loader: parses and bins
- N-Cars event files → CNN event loader: parses and bins
- N-Cars event files → Benchmark event loader: parses and bins
- SNN event loader → Train car SNN: supplies batches
- CNN event loader → Train car CNN: supplies batches
- Train car SNN → Car SNN weights: saves weights
- Train car CNN → Car CNN weights: saves weights
- Car SNN weights → Measure SNN: loads weights
- Benchmark event loader → Measure SNN: supplies test samples
- Train car CNN → Tradeoff findings: documents CNN results
- Measure SNN → Tradeoff findings: documents SNN results
