# Browser CNN model provenance

This portfolio uses the pretrained convolutional-network weights from Adam W.
Harley's open-source `nn_vis` project:

- Repository: <https://github.com/aharley/nn_vis>
- Pinned commit: `d625f8fa449ea91bc51ff6dab89397200c7d5b36`
- Upstream weights: `js/nn/convnet_weights.js`
- Upstream weights SHA-256: `710a6852c27eb83884ec6f5713e283824ca7be6f5744128fbd3b78bd03b25945`
- License: MIT, copyright Adam Harley

The production asset is a deterministic little-endian Float32 packing of the
62,902 upstream parameters. No weights are retrained or synthesized.

- Asset: [`../aharley-mnist-cnn-v1.f32`](../aharley-mnist-cnn-v1.f32)
- Packed asset SHA-256: `d8ac7a59a14a7c573cbd7276d512e8d6f93296ca1ce0e9bc0aac7e5553299b1c`
- Machine-readable manifest: [`../aharley-mnist-cnn-v1.manifest.json`](../aharley-mnist-cnn-v1.manifest.json)
- Full upstream license: [`../aharley-nn-vis.MIT.txt`](../aharley-nn-vis.MIT.txt)

Run `node scripts/vendor-cnn-model.mjs` to reproduce the asset. The script pins
and verifies both upstream source and license checksums before writing output.

## Runtime adaptation

The portfolio reimplements the original equations in typed, dependency-free
TypeScript and executes them inside a Web Worker. It exposes the real input,
convolution, pooling, 120-neuron dense, 100-neuron dense, and class-score
activations. A numerically stable softmax converts the final class scores into
normalized values for visualization; these values are not presented as
calibrated probabilities.

The validation fixture scores from the unmodified pinned implementation agree
with the production Float32 port to better than `1e-7` for representative
hand-drawn zero, one, and seven inputs.
