Skip to content
Back to skills

Weak Supervision Label Propagation

ASecurity

Propagates image-level multi-labels to individual instances as weak supervision for instance-level training.

  • 61 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 12, 2026
documentationpython

Security analysis

A100/100

Scanned September 12, 2026

npx -y skills add wenmin-wu/ds-skills --skill weak-supervision-label-propagation --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Weak Supervision Label Propagation?

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

Security grade badge for Weak Supervision Label Propagation
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/wenmin-wu-weak-supervision-label-propagation/badge)](https://www.skillsdirectory.com/skills/wenmin-wu-weak-supervision-label-propagation)

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

Download with Pro
SKILL.md
---
name: cv-weak-supervision-label-propagation
description: >
  Propagates image-level multi-labels to individual instances as weak supervision for instance-level training.
---
# Weak Supervision Label Propagation

## Overview

When only image-level labels exist but instance-level predictions are needed, propagate image labels to every detected instance within that image. Each instance inherits all image-level labels, creating weak but usable supervision for training instance classifiers without expensive per-instance annotations.

## Quick Start

```python
import pandas as pd

def propagate_labels(image_labels_df, instances_df):
    """Assign image-level labels to each detected instance."""
    rows = []
    for _, img in image_labels_df.iterrows():
        label_ids = str(img["Label"]).split("|")
        instances = instances_df[instances_df["image_id"] == img["ID"]]
        for _, inst in instances.iterrows():
            for label in label_ids:
                rows.append({
                    "image_id": img["ID"],
                    "instance_id": inst["instance_id"],
                    "label": int(label),
                    "bbox": inst["bbox"],
                    "mask": inst["mask_rle"],
                })
    return pd.DataFrame(rows)
```

## Workflow

1. Run instance segmentation to detect objects/cells per image
2. Load image-level multi-label annotations
3. Duplicate each instance for every label in its parent image
4. Train instance classifier on propagated labels
5. At inference, predict per-instance — model learns to disambiguate despite noisy labels

## Key Decisions

- **Noise tolerance**: Models like neural nets handle label noise well; tree models less so
- **Label cleaning**: Optionally filter with co-occurrence priors or confident learning
- **Instance quality**: Segmentation quality directly impacts downstream accuracy
- **Multi-label vs single-label**: Works best when instances genuinely share image-level labels

## References

- HPA Single Cell Classification competition (Kaggle)
- Source: [mmdetection-for-segmentation-training](https://www.kaggle.com/code/its7171/mmdetection-for-segmentation-training)

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.