All models

FederatedLearningPyTorch CNNMnist

A small convolutional network for MNIST digits, the CNN of the FederatedAveraging experiments.

Image classification · 12 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (14 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
21.8K
Operations
12
Framework
PyTorch
Recurrent
No
Published
2016
Cited by
24,963 (as of 18 November 2026)
Authors
H. Brendan McMahan, Eider Moore, Daniel Ramage and others
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m1005
Graph hash
385cbdde1b4ff58257a419b74933c74204ee115fc39f7389a12e8bf18757694f
Skeleton hash
098b1b01eaed83c14229f0511326671fab7a5196f26c027567a8245fa2569583
Architecture hash
7e28286c2ed055c95b4803ae3351747d288201d483f203946cab3ed8c75e811f
Diagram SHA-256
0d472b1a2bcd7891ebe1b735300450c796cd072b9a21a22fca081d7af255a2c2
TorchLens version
2.35.3
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

How this diagram was made

menagerie.classics.federated_nets:build_cnn_mnist: build({})

What it is

This is the convolutional network that the Federated Learning paper trains on the MNIST digit recognition task. The paper's subject is the training method more than the network: it introduces FederatedAveraging (FedAvg), which combines local stochastic gradient descent on each client with a server that performs model averaging. In that setting each client keeps a local training dataset that is never uploaded to the server.

In the paper the CNN has two 5x5 convolution layers, the first with 32 channels and the second with 64, each followed by 2x2 max pooling, then a fully connected layer with 512 units and ReLu activation and a final softmax output layer. The paper reports 1,663,370 total parameters for that configuration.

For the experiments MNIST was divided among 100 clients, either shuffled (IID) or sorted by digit label so that each client received 2 shards of 300 examples. With a target of 99% test-set accuracy on MNIST, the paper reports that more computation per client decreased the number of communication rounds by 35× for the CNN on the IID partition. It also reports a FedAvg CNN reaching 99.44% accuracy after 300 rounds, against 99.22% after 1200 rounds for the FedSGD baseline.

Key idea. The paper introduces FederatedAveraging, which combines local stochastic gradient descent on each client with a server that performs model averaging.

  • FedAvg CNN
  • FederatedAveraging
  • federated averaging
  • federated learning
  • MNIST CNN
  • CNNMnist
  • digit recognition
  • fedavg-cnn-mnist

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{mcmahan2023communicationefficientlearningdeepnetworks,
      title={Communication-Efficient Learning of Deep Networks from Decentralized Data}, 
      author={H. Brendan McMahan and Eider Moore and Daniel Ramage and Seth Hampson and Blaise Agüera y Arcas},
      year={2023},
      eprint={1602.05629},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/1602.05629}, 
}