SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2509.20152 · ICCV · 2025

C 2 MIL: Synchronizing Semantic and Topological Causalities in Multiple Instance Learning for Robust and Interpretable Survival Analysis

Hong Zhang, Lequan Yu, Liansheng Wang, Min Zeng, Yuzhe Zhang, Zhenfeng Zhuang, Min Cen, Baptiste Magnier

arXiv · PDF · Open in the Atlas

Code that ran

6 of 11 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (5 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 1 failure of our instrument; 5 no recorded run), measured 2026-11-23; 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/2509.20152.json · badge: /api/ran/2509.20152.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
mimic0127/C2MIL community
Papers with Code archive
6 ran · 5 no recorded run
FunctionStatusWhere it lives
BiasRemoval Ran
ran on a synthesized input · constructed an object; no result was computed
mimic0127/C2MIL/model_causal_double.py
code served (permissive licence) · get_code("44800632da0d7ea1")
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, through the batch API) and returned an instance of its own class, BiasRemoval: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 torch
import torch.nn as nn

torch.manual_seed(0)

# Create small tensors for thumb_all and patch_all
# thumb_all: (batch_size, feature_dim) - used as input to MLPImageEncoder
# patch_all: (batch_size, num_patches, feature_dim) - used for computing patch features
batch_size = 2
thumb_feature_dim = 4
patch_num_patches = 3
patch_feature_dim = 5

thumb_all = torch.randn(batch_size, thumb_feature_dim)
patch_all = torch.randn(batch_size, patch_num_patches, patch_feature_dim)

ARGS = {
    'thumb_all': thumb_all,
    'patch_all': patch_all,
    'K': 3
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type BiasRemoval — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a BiasRemoval output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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
DeepVGAE Ran
ran on a synthesized input · constructed an object; no result was computed
mimic0127/C2MIL/model_causal_double.py
code served (permissive licence) · get_code("81849431d3a1e3f1")
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, through the batch API) and returned an instance of its own class, DeepVGAE: the run constructed the object and did not call it, so no result was computed. 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 torch
import torch.nn as nn
from torch_geometric.nn.models import InnerProductDecoder, VGAE
from torch_geometric.nn.conv import GCNConv
import torch.nn.functional as F

torch.manual_seed(0)

class GCNEncoder(nn.Module):
    def __init__(self, in_channels, hidden_channels, out_channels):
        super(GCNEncoder, self).__init__()
        self.gcn_shared = GCNConv(in_channels, hidden_channels)
        self.gcn_mu = GCNConv(hidden_channels, out_channels)
        self.gcn_logvar = GCNConv(hidden_channels, out_channels)

    def forward(self, x, edge_index):
        x = F.relu(self.gcn_shared(x, edge_index))
        mu = self.gcn_mu(x, edge_index)
        logvar = self.gcn_logvar(x, edge_index)
        return (mu, logvar)

class DeepVGAE(VGAE):
    def __init__(self, enc_in_channels, enc_hidden_channels, enc_out_channels):
        super(DeepVGAE, self).__init__(encoder=GCNEncoder(enc_in_channels, enc_hidden_channels, enc_out_channels))

    def forward(self, x, edge_index):
        z = self.encode(x, edge_index)
        return z

ARGS = {
    "enc_in_channels": 4,
    "enc_hidden_channels": 3,
    "enc_out_channels": 2,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torch_geometric — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DeepVGAE — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a DeepVGAE output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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
GCNEncoder Ran
ran on a synthesized input · constructed an object; no result was computed
mimic0127/C2MIL/model_causal_double.py
code served (permissive licence) · get_code("5163f70f6c805dc6")
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, through the batch API) and returned an instance of its own class, GCNEncoder: the run constructed the object and did not call it, so no result was computed. 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 torch
import torch.nn as nn
from torch_geometric.data import Data

torch.manual_seed(0)

ARGS = {
    'in_channels': 4,
    'hidden_channels': 8,
    'out_channels': 3,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torch_geometric — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type GCNEncoder — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a GCNEncoder output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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
MLPImageEncoder Ran
ran on a synthesized input · constructed an object; no result was computed
mimic0127/C2MIL/model_causal_double.py
code served (permissive licence) · get_code("c24020fdc846e7cc")
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, through the batch API) and returned an instance of its own class, MLPImageEncoder: the run constructed the object and did not call it, so no result was computed. 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 torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'input_dim': 1024,
    'hidden_dim': 512,
    'output_dim': 1024,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MLPImageEncoder — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MLPImageEncoder output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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
SoftCluster_adaptiveK Ran
ran on a synthesized input · constructed an object; no result was computed
mimic0127/C2MIL/model_causal_double.py
code served (permissive licence) · get_code("261af70042ddedcd")
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, through the batch API) and returned an instance of its own class, SoftCluster_adaptiveK: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 torch
import torch.nn as nn
import numpy as np

torch.manual_seed(0)
np.random.seed(0)

# Create a tiny input tensor: batch_size=2, feature_dim=4
x = torch.randn(2, 4)

# Arguments for SoftCluster_adaptiveK
ARGS = {
    'max_clusters': 6,
    'beta': 1.0,
    'tau': 1.0,
    'seed': 988
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SoftCluster_adaptiveK — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a SoftCluster_adaptiveK output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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
bernoulli_sample_with_ste Ran
ran; our contract draft was wrong, not the code
mimic0127/C2MIL/model_causal_double.py
code served (permissive licence) · get_code("4887e73ccc81ea4b")
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, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 4) 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)

# The function takes logits as input
# It applies sigmoid, bernoulli sampling, and straight-through estimator
# logits should be a tensor of any shape

logits = torch.randn(2, 4)

ARGS = {
    "logits": logits
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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, 4) — shape (2, 4) 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
DeepGraphTransformer_mse Not yet run
unverified (harvested, no recorded run)
mimic0127/C2MIL/model_causal_double.py
code served (permissive licence) · get_code("7766bca834017704")
How it ran

no invocation recorded.

GraphCausal2_Surv Not yet run
unverified (harvested, no recorded run)
mimic0127/C2MIL/model_causal_double.py
code served (permissive licence) · get_code("f4f967c9039bb839")
How it ran

no invocation recorded.

GraphTransformer Not yet run
unverified (harvested, no recorded run)
mimic0127/C2MIL/model_causal_double.py
code served (permissive licence) · get_code("8b70b6f63ded0433")
How it ran

no invocation recorded.

GraphTransformerEncoder Not yet run
unverified (harvested, no recorded run)
mimic0127/C2MIL/model_causal_double.py
code served (permissive licence) · get_code("ca5023f99af88302")
How it ran

no invocation recorded.

PatchGCN_Surv_causal Not yet run
unverified (harvested, no recorded run)
mimic0127/C2MIL/model_causal_double.py
code served (permissive licence) · get_code("d0de949d2765dd7f")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 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 11 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-23.

Repositories linked to this paper

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

Abstract

Graph-based Multiple Instance Learning (MIL) is widely used in survival analysis with Hematoxylin and Eosin (H&E)-stained whole slide images (WSIs) due to its ability to capture topological information. However, variations in staining and scanning can introduce semantic bias, while topological subgraphs that are not relevant to the causal relationships can create noise, resulting in biased slide-level representations. These issues can hinder both the interpretability and generalization of the analysis. To tackle this, we introduce a dual structural causal model as the theoretical foundation and propose a novel and interpretable dual causal graph-based MIL model, C 2 MIL. C 2 MIL incorporates a novel cross-scale adaptive feature disentangling module for semantic causal intervention and a new Bernoulli differentiable causal subgraph sampling method for topological causal discovery. A joint optimization strategy combining disentangling supervision and contrastive learning enables simultaneous refinement of both semantic and topological causalities. Experiments demonstrate that C 2 MIL consistently improves generalization and interpretability over existing methods and can serve as a causal enhancement for diverse MIL baselines. The code is available at https://github.com/mimic0127/C2MIL.

For agents

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

get_harvested_code_for_paper("2509.20152")
get_code_for_paper("2509.20152")
have("2509.20152")

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

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

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

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

Connect an agent — have() is free.