SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2011.08939 · 2020

Dual-stream Multiple Instance Learning Network for Whole Slide Image Classification with Self-supervised Contrastive Learning

arXiv · PDF · Open in the Atlas

Code that ran

4 of 6 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 4 failures of our instrument; 2 no recorded run), measured 2026-11-21; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2011.08939.json · badge: /api/ran/2011.08939.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
binli123/dsmil-wsi canonical (classifier label)
classifier basis: classifier_2025
4 ran · 2 no recorded run
FunctionStatusWhere it lives
dropout_patches Ran
ran; our contract draft was wrong, not the code
binli123/dsmil-wsi/train_tcga.py
code served (permissive licence) · get_code("0661fba29ff6b228")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Tensor, ndim 2, dtype family float, shape (2, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create a small feature tensor
# The function calls feats.size(0) to get num_rows, then indexes with random_indices
# So feats needs to be a 2D tensor with at least 1 dimension
feats = torch.randn(4, 3)  # 4 rows, 3 features

# p is a dropout probability (float between 0 and 1)
p = 0.5

ARGS = {
    "feats": feats,
    "p": p,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 3) — shape (2, 3) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_bag Ran
ran; our contract draft was wrong, not the code
binli123/dsmil-wsi/train_mil.py
code served (permissive licence) · get_code("bea88ad293be0da1")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned ndarray, ndim 2, dtype family float, shape (3, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# The function get_bag expects:
# - data: a list/array-like structure where each element has at least 2 columns (indexed by [:, 1])
# - idb: a bag id value to filter by

# Create sample data with structure: each row has [feature, bag_id, ...]
# We'll create a list of lists where column 1 contains bag IDs
data = [
    [1.0, 0, "extra"],
    [2.0, 1, "extra"],
    [3.0, 0, "extra"],
    [4.0, 1, "extra"],
    [5.0, 0, "extra"],
]

# The bag id to filter for
idb = 0

ARGS = {
    "data": data,
    "idb": idb,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (3, 3) — shape (3, 3) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_bag_feats Ran
ran; our contract draft was wrong, not the code
binli123/dsmil-wsi/train_tcga.py
code served (permissive licence) · get_code("5c435c4bfad3459d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import pandas as pd
import numpy as np
import tempfile
import os

# Create a temporary CSV file with mock feature data
temp_dir = tempfile.mkdtemp()
mock_feats_csv = os.path.join(temp_dir, 'mock_feats.csv')
mock_df = pd.DataFrame({
    'feat_0': np.random.randn(10),
    'feat_1': np.random.randn(10),
    'feat_2': np.random.randn(10),
})
mock_df.to_csv(mock_feats_csv, index=False)

# Create mock args object
class Args:
    def __init__(self):
        self.dataset = 'custom'
        self.num_classes = 3

args = Args()

# Create mock csv_file_df (a pandas Series or DataFrame row)
csv_file_df = pd.Series([mock_feats_csv, 1])

ARGS = {
    'csv_file_df': csv_file_df,
    'args': args
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, pandas, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_data Ran
ran; our contract draft was wrong, not the code
binli123/dsmil-wsi/train_mil.py
code served (permissive licence) · get_code("5bcc734ab9dc940e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned list. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import pandas as pd
import numpy as np
import tempfile
import os

# Create a temporary CSV file with data in the expected format
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "test_data.csv")

# Write test data in the format expected by get_data
# Format: "id1:id2:id3 feature1:value1 feature2:value2 ..."
test_data = """1:2:3 0:0.5 1:0.7 2:0.3
4:5:6 0:0.2 1:0.9 2:0.1
7:8:9 0:0.4 1:0.6 2:0.8"""

with open(temp_file, 'w') as f:
    f.write(test_data)

ARGS = {
    "file_path": temp_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list — a list output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
epoch_train Not yet run
unverified (harvested, no recorded run)
binli123/dsmil-wsi/train_mil.py
code served (permissive licence) · get_code("92b02ded267a7177")
How it ran

no invocation recorded.

train Not yet run
unverified (harvested, no recorded run)
binli123/dsmil-wsi/train_tcga.py
code served (permissive licence) · get_code("f3e5d5f346f71eab")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 6 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-21.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

We address the challenging problem of whole slide image (WSI) classification. WSIs have very high resolutions and usually lack localized annotations. WSI classification can be cast as a multiple instance learning (MIL) problem when only slide-level labels are available. We propose a MIL-based method for WSI classification and tumor detection that does not require localized annotations. Our method has three major components. First, we introduce a novel MIL aggregator that models the relations of the instances in a dual-stream architecture with trainable distance measurement. Second, since WSIs can produce large or unbalanced bags that hinder the training of MIL models, we propose to use self-supervised contrastive learning to extract good representations for MIL and alleviate the issue of prohibitive memory cost for large bags. Third, we adopt a pyramidal fusion mechanism for multiscale WSI features, and further improve the accuracy of classification and localization. Our model is evaluated on two representative WSI datasets. The classification accuracy of our model compares favorably to fully-supervised methods, with less than 2% accuracy gap across datasets. Our results also outperform all previous MIL-based methods. Additional benchmark results on standard MIL datasets further demonstrate the superior performance of our MIL aggregator on general MIL problems. GitHub repository: https://github.com/binli123/dsmil-wsi

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2011.08939")
get_code_for_paper("2011.08939")
have("2011.08939")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2011.08939.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2011.08939.svg)](https://syntology.ai/paper/2011.08939)

Connect an agent — have() is free.