Skip to content
Back to skills

Imagenet C Corruption Metrics

ASecurity

Compute ImageNet-C CE, mCE, relative CE, and relative mCE from clean and corrupted top-1 error tables.

  • 247 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 9, 2026
testingpythonbash

Security analysis

A100/100

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill imagenet_c_corruption_metrics --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Imagenet C Corruption Metrics?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Imagenet C Corruption Metrics
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-imagenet-c-corruption-metrics/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-imagenet-c-corruption-metrics)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
---
name: imagenet_c_corruption_metrics
description: Compute ImageNet-C CE, mCE, relative CE, and relative mCE from clean and corrupted top-1 error tables.
---

# ImageNet-C Corruption Metrics

Use this skill when evaluating corruption robustness from top-1 error rates indexed by corruption type and severity. Use it for ImageNet-C or reduced experiments that preserve the same normalization equations. Do not use it for ImageNet-P perturbation stability metrics.

## Inputs

- Model errors: `{corruption: {severity: top1_error}}`.
- Baseline errors with the same corruption/severity keys.
- Model clean top-1 error.
- Baseline clean top-1 error.
- Optional scale factor, normally `100.0`.

## Outputs

- `ce_by_corruption`.
- `mce`.
- `relative_ce_by_corruption`.
- `relative_mce`.
- Validation diagnostics.

## Workflow

1. Validate matching corruption names and five severity levels.
2. Sum model and baseline errors across severities for each corruption.
3. Compute CE as `scale * model_sum / baseline_sum`.
4. Average CE values to get mCE.
5. Compute relative CE after subtracting clean error from each severity error.
6. Average relative CE values to get relative mCE.

## Validation

Run:

```bash
python tests/test_corruption_metrics.py
```

## Limitations

The script assumes error rates are already computed from predictions and labels. It does not run an image classifier.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.