# Uczenie wieloinstancyjne (MIL)

EN: **Multiple instance learning (MIL)** · id `multiinstance` · aliases: MIL, multiple-instance learning, uczenie z worków

Path: [AI Atlas](https://aiatlasgraph.com/llms.txt) › [Uczenie maszynowe](https://aiatlasgraph.com/t/ml.md) › [Uczenie z ograniczonym lub automatycznym nadzorem](https://aiatlasgraph.com/t/learningparadigms.md) › Uczenie wieloinstancyjne (MIL)

## Description

- PL: Uczenie z etykiet przypisanych do worków instancji; model agreguje reprezentacje instancji, np. mechanizmem uwagi, w predykcję dla całego worka.
- EN: Learning from labels attached to bags of instances; the model aggregates instance representations, e.g. with attention, into a bag-level prediction.

## In one sentence

- PL: Model dostaje jedną etykietę dla całej grupy elementów i sam musi odkryć, które z nich o niej zdecydowały.
- EN: A model gets one label for a whole group of items and has to work out which items decided it.

## Problem it solves

- PL: Często wiadomo tylko, że gdzieś w dużym zbiorze jest problem, ale nikt nie zaznaczył dokładnie gdzie.
- EN: Often we only know that a problem sits somewhere in a large collection, but nobody marked exactly where.

## What it does

- PL: Jak kontroler, który wie, że w skrzynce jest zepsuty owoc, i uczy się rozpoznawać, który to, bez zaglądania do etykiet poszczególnych sztuk.
- EN: Like an inspector who knows a crate holds a rotten fruit and learns to spot which one, with no tag on each piece.

## Everyday example

- PL: Lekarz oznacza tylko, czy cały skan tkanki jest chory, a model wskazuje fragmenty, które o tym zdecydowały.
- EN: A doctor marks only whether a whole tissue scan is diseased, and the model points to the patches that decided it.

## This concerns you if you…

- PL: masz etykiety dla całych dokumentów, nagrań lub skanów
- PL: chcesz wskazać, która część decyduje o wyniku
- EN: have labels for whole documents, recordings or scans
- EN: want to point to the part that drives the result

## Keywords

attention-based MIL · ABMIL · CLAM · TransMIL · bag-level classification · weakly supervised learning · whole-slide images

## How it works

- PL: W klasycznym założeniu worek jest pozytywny, jeśli zawiera choć jedną pozytywną instancję. Sieć koduje każdą instancję, a operator agregacji niezależny od kolejności (maksimum, średnia, pooling uwagowy) tworzy wektor worka. Wagi uwagi pokazują, które instancje najbardziej wpłynęły na decyzję.
- EN: The classic assumption is that a bag is positive if it contains at least one positive instance. A network encodes each instance and an order-independent aggregator (max, mean, attention pooling) forms a bag vector. Attention weights show which instances most influenced the decision.

## Limits

- PL: Wagi uwagi nie są pewnym wyjaśnieniem i mogą wskazywać korelacje zamiast przyczyn. Bardzo duże worki są kosztowne obliczeniowo. Założenia o związku instancji z workiem nie zawsze pasują do danych.
- EN: Attention weights are not a reliable explanation and can highlight correlations rather than causes. Very large bags are computationally costly. Assumptions about how instances relate to the bag do not always fit the data.

## Key terms

- PL: **worek (bag)**: Zbiór instancji z jedną wspólną etykietą.
- PL: **pooling uwagowy**: Średnia ważona instancji z wagami wyuczonymi przez sieć.
- PL: **niezmienniczość permutacyjna**: Wynik nie zależy od kolejności elementów w worku.
- EN: **bag**: A set of instances sharing a single label.
- EN: **attention pooling**: A weighted average of instances with weights learned by the network.
- EN: **permutation invariance**: The output does not depend on the order of items in the bag.

## Related topics

Untyped, symmetric "see also" links.

- [Uczenie z etykiety całego preparatu (wiele instancji) (Multiple instance learning for whole-slide images)](https://aiatlasgraph.com/t/pathologymil.md)

## Sources

- [Attention-based Deep Multiple Instance Learning](<https://arxiv.org/abs/1802.04712>) `ilse-abmil-2018` · by Maximilian Ilse, Jakub M. Tomczak, Max Welling

---

AI Atlas revision 122 (2026-10-30) · HTML: https://aiatlasgraph.com/t/multiinstance · index: https://aiatlasgraph.com/llms.txt · everything: https://aiatlasgraph.com/llms-full.txt · updated 2026-10-30
