Skip to content
HS®
All projects

(008) / 012

SparseNetworksforJetClassification

A sparsity-aware residual network for CMS calorimeter data, and a pruning study measuring how much of it can be removed.

Category
Deep learning · Model efficiency
Year
2026
Last pushed
Mar 2026
Primary language
Jupyter Notebook
GLOBAL L1 PRUNING · 80%
Conceptual diagram — a network with most of its connections pruned away. Real plots are shown below.

(01) Overview

An ML4SCI Google Summer of Code evaluation task: build and benchmark sparse neural network architectures for binary classification of CMS calorimeter jet data, and analyse the efficiency–accuracy trade-off under progressive weight pruning.

(02) Problem statement

Calorimeter data is extremely sparse — most detector cells record zero energy. A standard dense CNN spends most of its computation on empty space. Two questions follow:

  • Does a sparsity-aware architecture outperform a standard dense CNN on this data?
  • How does global L1 pruning affect accuracy as weight sparsity rises and effective FLOPs fall?

(03) Technical approach

Build a dense baseline and a sparsity-aware network, train both under the same setup, then prune the better one step by step and measure what is lost.

The key idea in SparseResNet is the sparse residual block: it computes a binary mask from the input and zeroes activations at empty detector cells after each residual computation, so the network does not propagate signal through physically meaningless regions.

(04) System architecture

Experiment pipelineConceptual diagram · select a stage

Stage 01 — Calorimeter data

10,000 labelled samples, 125 × 125 × 8, split 70 / 15 / 15.

(05) Implementation details

Input samples are 125 × 125 grids with 8 detector channels, max-normalised per sample to keep relative energy structure. The 10,000 samples are split 70 / 15 / 15. Both models are trained for 10 epochs with Adam at a learning rate of 1e-3, binary cross-entropy with logits, batch size 32, a reduce-on-plateau scheduler and a fixed seed.

Pruning is global and L1-unstructured at ratios from 0.2 to 0.8, with two epochs of fine-tuning after each step.

(06) Main features

  1. 01DenseCNN baseline with about 5.9k parameters.
  2. 02SparseResNet: residual blocks that mask activations at empty detector cells.
  3. 03Global L1-unstructured pruning at five ratios, each followed by fine-tuning.
  4. 04Effective FLOPs measured alongside accuracy and AUC.

(07) Technology stack

PythonPyTorchtorch.nn.utils.pruneptflopsscikit-learnh5pyMatplotlib

(08) Engineering challenges

  • A fair comparison. SparseResNet has about 13 times the parameters of the dense baseline, so its accuracy gain cannot be attributed to masking alone. The pruning study is what speaks to efficiency: most of those weights can be removed.
  • Measuring cost, not just size. Weight sparsity is reported alongside effective FLOPs, since unstructured sparsity does not automatically mean faster inference.
  • Reproducibility. Seeds, splits and hyperparameters are fixed in a config file, and result tables are committed.

(09) Evaluation and results

SparseResNet improves on the dense baseline by 6.2 percentage points of accuracy on the held-out test set. With 80% of its weights pruned, accuracy drops by about 1.3 points while effective FLOPs fall to a fifth. The plots below are the actual outputs committed to the repository.

Held-out test set results from the repository
DenseCNN0.8127 accAUC 0.8731 · 5,889 parameters
SparseResNet0.8747 accAUC 0.9333 · 75,777 parameters
SparseResNet, 60% pruned0.8693 accAUC 0.9319 · 67.73M FLOPs (from 169.32M)
SparseResNet, 80% pruned0.8613 accAUC 0.9316 · 33.86M FLOPs

Source: results/tables/model_comparison.csv · pruning_results.csv

Plots of accuracy against weight sparsity and effective FLOPs for the pruned SparseResNet
Actual output from the repository — efficiency vs. accuracy under pruning.
ROC curves and confusion matrices for DenseCNN and SparseResNet on the test set
Actual output from the repository — ROC curves and confusion matrices.