๐ฒ Pixel
Choose the most informative pixels under a budget โ probe what models actually look at.
๐The task, in plain English
Under a strict pixel budget, choose which pixels of each image to keep (masking the rest) so that a classifier can still do its job. Score depends on how well classification survives your masking.
| Input | Images + a pixel budget |
|---|---|
| Output | A pixel mask per image |
| Really tests | Creative reasoning about where information lives in images and how to probe a model's attention |
๐งThe baseline you're given
Naive masks: random pixels, or a fixed central crop. Limitations: ignores image content entirely.
๐Baseline vs. solution
- Random / central pixels for every image
- Content-blind
- Saliency-guided selection: use gradients (โoutput/โpixel) or occlusion tests to find pixels the classifier relies on; spend the budget there
- Cheap classical proxy: edges/high-contrast regions (opencv) carry most information
- Evaluate empirically: try 3 strategies on a validation slice, keep the winner โ measurement beats theory in contests
๐งExplain it like I'm brand new
The intuition: not all pixels are equal โ a blank sky pixel tells you nothing; the pixel on a cat's ear tells you a lot. "Saliency" is asking the model: if I nudge this pixel, how much does your answer change? Pixels with big answers matter. Tasks like this reward experimenters: nobody knows the best strategy in advance, so the winner is whoever tests the most ideas cheaply.
๐ฌThe Gemma 4 playthrough (2000-token limit)
PyTorch classifier `model`, input image x (1,3,H,W), requires_grad. Give ONLY code computing pixel saliency = abs gradient of the top logit wrt x, summed over channels, then indices of the top-k pixels. Max 15 lines.
x = x.clone().requires_grad_(True) logit = model(x).max() logit.backward() sal = x.grad.abs().sum(dim=1).squeeze(0) # (H,W) flat = sal.flatten() topk = flat.topk(k).indices ys, xs = topk // sal.shape[1], topk % sal.shape[1]
๐ฏTakeaways & what Day 1 might do with this
- Pattern family: open-ended probing task โ appears each year in some form; strategy beats recipe.
- Budgeted-resource thinking again: pixels here, LLM calls in Concepts, questions in John Wilkins.