How it works
For each spatial axis:
H_{out} = \left\lfloor \frac{H_{in} + 2p - d\,(k - 1) - 1}{s} \right\rfloor + 1
with kernel k, stride s, padding p and dilation d. same padding (TensorFlow/Keras) gives ceil(H_in / s); valid means p = 0.
| Layer | Parameters | MACs |
|---|---|---|
| Conv2D | k² × C_in × F (+ F bias) | H_out × W_out × F × k² × C_in |
| DepthwiseConv2D | k² × C × m (+ C × m bias) | H_out × W_out × C × m × k² |
| Dense | N × U (+ U bias) | N × U |
| Pooling, Flatten | 0 | 0 (counted as negligible) |
One MAC (multiply-accumulate) is two FLOPs. A depthwise + 1×1 pointwise pair (MobileNet) costs roughly k² + C_out times fewer MACs than one standard convolution: that is why it dominates MCU vision models.
Defaults
The starting stack is a small MobileNet-style classifier on a 96×96×3 input, the size used by common person-detection demos on STM32 and ESP32. The stack is saved in the URL, so you can share a design.