File size: 12,196 Bytes
844b533
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
---
license: apache-2.0
library_name: numpy
tags:
  - tabular-classification
  - tiny-model
  - edge-ai
  - no-gpu
  - numpy
  - real-time
  - ecg
  - eeg
  - seizure-detection
  - activity-recognition
  - medical-ai
  - biosignal
  - analytic-gradients
datasets:
  - shayanfazeli/heartbeat
  - birdy654/eeg-brainwave-dataset-feeling-emotions
  - robikscube/eye-state-classification-eeg-dataset
  - harunshimanto/epileptic-seizure-recognition
  - uciml/human-activity-recognition-with-smartphones
metrics:
  - accuracy
  - f1
  - roc_auc
model-index:
  - name: KestrelNet / GoshawkNet Benchmark Suite
    results:
      - task:
          type: tabular-classification
          name: ECG Arrhythmia Detection
        dataset:
          type: shayanfazeli/heartbeat
          name: MIT-BIH Arrhythmia
        metrics:
          - name: Accuracy
            type: accuracy
            value: 0.972
          - name: Macro F1
            type: f1
            value: 0.853
      - task:
          type: tabular-classification
          name: EEG Emotion Recognition
        dataset:
          type: birdy654/eeg-brainwave-dataset-feeling-emotions
          name: EEG Brainwave Emotions
        metrics:
          - name: Accuracy
            type: accuracy
            value: 0.991
          - name: Macro F1
            type: f1
            value: 0.991
      - task:
          type: tabular-classification
          name: EEG Eye State Detection
        dataset:
          type: robikscube/eye-state-classification-eeg-dataset
          name: EEG Eye State (UCI)
        metrics:
          - name: Accuracy
            type: accuracy
            value: 0.942
          - name: AUC-ROC
            type: roc_auc
            value: 0.986
      - task:
          type: tabular-classification
          name: Epileptic Seizure Detection
        dataset:
          type: harunshimanto/epileptic-seizure-recognition
          name: Bonn University EEG
        metrics:
          - name: Accuracy
            type: accuracy
            value: 0.971
          - name: AUC-ROC
            type: roc_auc
            value: 0.988
      - task:
          type: tabular-classification
          name: Human Activity Recognition
        dataset:
          type: uciml/human-activity-recognition-with-smartphones
          name: UCI HAR Smartphones
        metrics:
          - name: Accuracy
            type: accuracy
            value: 0.949
          - name: Macro F1
            type: f1
            value: 0.949
pipeline_tag: tabular-classification
---

# KestrelNet / GoshawkNet β€” Benchmark Suite

**Here's what a tiny model can do.**

Five public datasets. Five domains. All under 164K parameters. All CPU-only. All pure NumPy β€” no PyTorch, no TensorFlow, no GPU. Every result verified on Kaggle with live scoring.

## Results

| Dataset | Domain | Task | Accuracy | F1 / AUC | Params | Size | Latency |
|---|---|---|---|---|---|---|---|
| [MIT-BIH Arrhythmia](https://kaggle.com/datasets/shayanfazeli/heartbeat) | Cardiology | 5-class ECG | **97.2%** | F1 0.853 | 12,756 | 50 KB | 56 ΞΌs |
| [EEG Brainwave Emotions](https://kaggle.com/datasets/birdy654/eeg-brainwave-dataset-feeling-emotions) | Neuroscience | 3-class EEG | **99.1%** | F1 0.991 | 163,788 | 640 KB | 1.3 ms |
| [EEG Eye State](https://kaggle.com/datasets/robikscube/eye-state-classification-eeg-dataset) | Neuroscience | Binary EEG | **94.2%** | AUC 0.986 | 1,576 | 6 KB | 17 ΞΌs |
| [Epileptic Seizure](https://kaggle.com/datasets/harunshimanto/epileptic-seizure-recognition) | Neurology | Binary EEG | **97.1%** | AUC 0.988 | 12,072 | 47 KB | β€” |
| [HAR Smartphones](https://kaggle.com/datasets/uciml/human-activity-recognition-with-smartphones) | Wearables | 6-class IMU | **94.9%** | F1 0.949 | 15,416 | 60 KB | 70 ΞΌs |

Total model storage for all five: **803 KB**.

For context, a single layer of BERT is 7 million parameters. Our five models combined have 205,608.

## How Small Is Small?

| Dataset | Typical CNN/LSTM | Ours | How much smaller |
|---|---|---|---|
| ECG Heartbeat | 500K – 2M params | 12,756 | **40–160x** |
| EEG Emotions | 1M+ params | 163,788 | **6x** |
| EEG Eye State | 100K+ params | 1,576 | **63x** |
| Seizure Detection | 200K+ params | 12,072 | **17x** |
| HAR Smartphones | 200K – 1M params | 15,416 | **13–65x** |

## Two Model Families

We ship two architectures, named after raptors β€” bird size matches model size, hunting style matches classification style.

### KestrelNet (Standard FC)

The kestrel is the smallest falcon. It hovers perfectly still, then strikes with precision. KestrelNet is a standard fully-connected network with ReLU activations. Minimal parameters, maximum accuracy.

```
Input β†’ Dense(hidden₁, ReLU) β†’ Dense(hiddenβ‚‚, ReLU) β†’ Dense(classes, Softmax)
```

### GoshawkNet (Multivector Products)

The goshawk is a larger raptor that hunts in complex terrain, reading patterns others miss. GoshawkNet replaces standard dot products with multivector products, giving each neuron native access to rotations, reflections, and scaling in a single operation. More parameters, but captures geometric structure in the data that FC nets need many more layers to approximate.

**Best model per dataset:**

| Dataset | Best Model | Architecture |
|---|---|---|
| ECG Heartbeat | GoshawkNet Cl(0,2) | Quaternion, [16, 8] hidden |
| EEG Emotions | GoshawkNet Cl(0,2) | Quaternion, [16, 8] hidden |
| EEG Eye State | GoshawkNet Cl(0,2) | Quaternion, [16, 8] hidden |
| Seizure Detection | GoshawkNet Cl(0,2) | Quaternion, [16, 8] hidden |
| HAR Smartphones | GoshawkNet Cl(0,2) | Quaternion, [16, 8] hidden |

Quaternion algebra (Cl(0,2), dimension 4) consistently wins across all five domains.

## Per-Dataset Details

### ECG Heartbeat β€” MIT-BIH Arrhythmia Database

- **Samples**: 87,554 train / 21,892 test
- **Features**: 187 time-series values per heartbeat
- **Classes**: Normal (N), Supraventricular (S), Ventricular (V), Fusion (F), Unknown (Q)
- **Best model**: GoshawkNet Cl(0,2) [16,8] β€” 97.2% accuracy, 12,756 params
- **Kaggle notebook**: [samareddy94/gnaninet-ecg-benchmark](https://www.kaggle.com/code/samareddy94/gnaninet-ecg-benchmark)

| Class | Accuracy |
|---|---|
| Normal (N) | 99.2% |
| Supraventricular (S) | 64.6% |
| Ventricular (V) | 90.9% |
| Fusion (F) | 63.0% |
| Unknown (Q) | 95.9% |

### EEG Brainwave Emotions

- **Samples**: 2,132 (1,707 train / 425 test)
- **Features**: 2,548 EEG features (channel means + FFT)
- **Classes**: Negative, Neutral, Positive
- **Best model**: GoshawkNet Cl(0,2) [16,8] β€” 99.1% accuracy, 163,788 params
- **Kaggle notebook**: [samareddy94/99-eeg-emotion-detection-164k-params-no-gpu](https://www.kaggle.com/code/samareddy94/99-eeg-emotion-detection-164k-params-no-gpu)

| Class | Accuracy |
|---|---|
| Negative | 99.3% |
| Neutral | 100.0% |
| Positive | 97.9% |

### EEG Eye State β€” UCI / Roesler

- **Samples**: 14,980 (11,985 train / 2,995 test)
- **Features**: 14 EEG channels (AF3, F7, F3, FC5, T7, P7, O1, O2, P8, T8, FC6, F4, F8, AF4)
- **Classes**: Eyes Open, Eyes Closed
- **Best model**: GoshawkNet Cl(0,2) [16,8] β€” 94.2% accuracy, 1,576 params
- **Kaggle notebook**: [samareddy94/gnaninet-eeg-eyestate-benchmark](https://www.kaggle.com/code/samareddy94/gnaninet-eeg-eyestate-benchmark)

The smallest model in the suite: **1,576 parameters, 6 KB**. Runs at 60,000 inferences/sec on CPU.

### Epileptic Seizure Recognition β€” Bonn University

- **Samples**: 11,500 (9,200 train / 2,300 test)
- **Features**: 178 EEG time-series values
- **Classes**: Seizure vs Non-seizure (binary)
- **Best model**: GoshawkNet Cl(0,2) [16,8] β€” 97.1% accuracy, AUC 0.988, 12,072 params

AUC of 0.988 means the model correctly ranks seizure vs non-seizure 98.8% of the time β€” critical for clinical screening.

### HAR Smartphones β€” UCI Activity Recognition

- **Samples**: 7,352 train / 2,947 test (official split)
- **Features**: 228 triaxial accelerometer + gyroscope features
- **Classes**: Walking, Walking Upstairs, Walking Downstairs, Sitting, Standing, Laying
- **Best model**: GoshawkNet Cl(0,2) [16,8] β€” 95.7% local / 94.9% Kaggle live, 15,416 params
- **Kaggle notebook**: [samareddy94/gnaninet-har-benchmark](https://www.kaggle.com/code/samareddy94/gnaninet-har-benchmark)

| Class | Accuracy |
|---|---|
| Walking | 99.0% |
| Walking Upstairs | 90.7% |
| Walking Downstairs | 96.4% |
| Sitting | 91.9% |
| Standing | 95.7% |
| Laying | 99.8% |

## Training Details

All models trained with the same configuration:

- **Optimizer**: Adam (lr=0.001, β₁=0.9, Ξ²β‚‚=0.999)
- **LR Schedule**: Warmup-cosine (10-epoch warmup)
- **Early stopping**: Patience 30–40 on validation loss
- **Batch size**: 64–128
- **L2 regularization**: Ξ» = 1e-4 to 1e-5
- **Gradient clipping**: 5.0
- **Normalization**: Z-score, fit on training set only
- **Backpropagation**: Analytic (hand-derived gradients, no autograd)

Training is fast β€” all five models train in under 10 minutes total on a laptop CPU.

## Repository Structure

```
β”œβ”€β”€ ecg-heartbeat/
β”‚   β”œβ”€β”€ weights.txt        # GoshawkNet Cl(0,2) [16,8] β€” 97.2% accuracy
β”‚   └── results.json       # Full benchmark comparison (4 models)
β”œβ”€β”€ eeg-emotions/
β”‚   β”œβ”€β”€ weights.txt        # GoshawkNet Cl(0,2) [16,8] β€” 99.1% accuracy
β”‚   └── results.json
β”œβ”€β”€ eye-state/
β”‚   β”œβ”€β”€ weights.txt        # GoshawkNet Cl(0,2) [16,8] β€” 94.2% accuracy
β”‚   └── results.json
β”œβ”€β”€ seizure-prediction/
β”‚   β”œβ”€β”€ weights.txt        # GoshawkNet Cl(0,2) [16,8] β€” 97.1% accuracy
β”‚   └── results.json
β”œβ”€β”€ har-smartphones/
β”‚   β”œβ”€β”€ weights.txt        # GoshawkNet Cl(0,2) [16,8] β€” 94.9% accuracy
β”‚   └── results.json
└── inference.py           # Self-contained inference loader (no dependencies beyond NumPy)
```

## Quick Start

```python
import numpy as np
from inference import load_model

# Load any model
model = load_model("ecg-heartbeat")
proba = model.predict_proba(np.random.randn(187))
print(proba)  # [0.92, 0.01, 0.05, 0.01, 0.01] β€” 5-class probabilities
```

## Intended Use

- **Clinical screening**: Pre-filter for ECG/EEG analysis before specialist review
- **Edge deployment**: Wearables, IoT sensors, embedded devices β€” no GPU, no cloud
- **Ensemble first stage**: Fast, tiny model screens easy cases; complex model handles the rest
- **Research baseline**: Reproducible benchmarks on public datasets with minimal compute
- **Education**: Complete from-scratch neural network with analytic gradients

## Limitations

- Models are trained on tabular/flattened features, not raw waveforms
- Per-class accuracy varies β€” rare classes (ECG Fusion, ECG Supraventricular) have lower recall
- No sequence modeling β€” each sample is classified independently
- Medical models are NOT validated for clinical use β€” research benchmarks only

## Kaggle Verification

All results except seizure prediction have been verified with live Kaggle notebook scoring:

| Dataset | Kaggle Notebook |
|---|---|
| ECG Heartbeat | [samareddy94/gnaninet-ecg-benchmark](https://www.kaggle.com/code/samareddy94/gnaninet-ecg-benchmark) |
| EEG Emotions | [samareddy94/99-eeg-emotion-detection-164k-params-no-gpu](https://www.kaggle.com/code/samareddy94/99-eeg-emotion-detection-164k-params-no-gpu) |
| EEG Eye State | [samareddy94/gnaninet-eeg-eyestate-benchmark](https://www.kaggle.com/code/samareddy94/gnaninet-eeg-eyestate-benchmark) |
| HAR Smartphones | [samareddy94/gnaninet-har-benchmark](https://www.kaggle.com/code/samareddy94/gnaninet-har-benchmark) |

## Citation

```bibtex
@misc{kestrelnet-benchmarks-2026,
  title={KestrelNet/GoshawkNet: Tiny Neural Classifiers for Biosignal and Sensor Data},
  author={Sama Reddy},
  year={2026},
  url={https://huggingface.co/reddysama/kestrelnet-benchmarks}
}
```

---

<p align="center">
<em>No PyTorch. No TensorFlow. No GPU. Just NumPy and math.</em><br>
<a href="https://huggingface.co/reddysama/gnaninet-fraud-classifier">Fraud Classifier</a> Β· 
<a href="https://huggingface.co/spaces/reddysama/gnaninet-fraud-classifier">Live Demo</a> Β· 
<a href="https://naninet.ai">Website</a>
</p>