SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2210.15091 · NeurIPS · 2022

Segmentation of Multiple Sclerosis Lesions across Hospitals: Learn Continually or Train from Scratch?

Sarath Chandar, Enamundram Karthik, Anne Kerbrat, Pierre Labauge, Tobias Granberg, Jason Talbott, Daniel Reich, Massimo Filippi, Rohit Bakshi, Virginie Callot, Julien Cohen-Adad

arXiv · PDF · Open in the Atlas

Code that ran

9 of 9 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 9 have no contract verdict; 0 failures of our instrument; 0 no recorded run), measured 2026-11-22; 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/2210.15091.json · badge: /api/ran/2210.15091.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
naga-karthik/continual-learning-ms canonical (classifier label)
classifier basis not recorded on the link
9 ran · 0 no recorded run
FunctionStatusWhere it lives
ACC Ran
ran on a synthesized input
naga-karthik/continual-learning-ms/utils/metrics.py
code served (permissive licence) · get_code("447a1ae345c95ca9")
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 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 numpy as np

# Create a small result matrix with shape (5, 3)
# Rows represent different training tasks, columns represent test tasks
# The function uses result_matrix[-1, :] to get the last row (final accuracies)
result_matrix = np.array([
    [0.9, 0.7, 0.6],
    [0.85, 0.8, 0.65],
    [0.88, 0.82, 0.7],
    [0.89, 0.83, 0.72],
    [0.91, 0.85, 0.75]
], dtype=np.float32)

ARGS = {
    "result_matrix": result_matrix
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — 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
BWT Ran
ran on a synthesized input
naga-karthik/continual-learning-ms/utils/metrics.py
code served (permissive licence) · get_code("e86b1d16979bdf56")
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 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 numpy as np

# Create a valid result_matrix for BWT function
# TxT matrix where T is number of tasks
# Entry (i, j) represents test accuracy on task j after training on task i
# We'll use T=4 tasks

np.random.seed(0)

# Create a 4x4 result matrix with reasonable accuracy values (0-1 range)
# Diagonal should have highest values (training accuracy on own task)
# Lower triangle should have lower values (backward transfer)
result_matrix = np.array([
    [0.95, 0.45, 0.40, 0.35],  # After task 0
    [0.92, 0.93, 0.42, 0.38],  # After task 1
    [0.88, 0.85, 0.94, 0.41],  # After task 2
    [0.80, 0.75, 0.82, 0.96]   # After task 3 (final accuracies on all tasks)
], dtype=np.float32)

ARGS = {
    "result_matrix": result_matrix
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — 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
FWT Ran
ran on a synthesized input
naga-karthik/continual-learning-ms/utils/metrics.py
code served (permissive licence) · get_code("1ab69a1cba4e1f3f")
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 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 numpy as np

# Create a result matrix (TxT) where entry (i,j) is accuracy on task j after training on task i
# Using T=4 tasks
result_matrix = np.array([
    [0.95, 0.80, 0.75, 0.70],
    [0.85, 0.92, 0.78, 0.72],
    [0.80, 0.85, 0.90, 0.76],
    [0.78, 0.82, 0.88, 0.94]
], dtype=np.float32)

# Single task accuracies on random init (1xT matrix, or just a 1D array of length T)
single_task_res = np.array([0.50, 0.52, 0.51, 0.49], dtype=np.float32)

ARGS = {
    "result_matrix": result_matrix,
    "single_task_res": single_task_res
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — 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
conv_norm_lrelu Ran
ran on a synthesized input
naga-karthik/continual-learning-ms/models.py
code served (permissive licence) · get_code("6676dd4f1c023783")
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 Sequential. 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)

# The function conv_norm_lrelu takes two parameters:
# - feat_in: number of input features (channels)
# - feat_out: number of output features (channels)
# Both are integers representing channel dimensions

ARGS = {
    "feat_in": 3,
    "feat_out": 16,
}
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 Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 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
get_test_datasets Ran
ran on a synthesized input
naga-karthik/continual-learning-ms/main_pl_ft_random.py
code served (permissive licence) · get_code("88ea4a3dc2d52e3c")
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 list, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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 monai.transforms import Compose, Identity
from monai.data import Dataset
import tempfile
import json
import os

torch.manual_seed(0)

# Create a temporary directory for mock data
temp_dir = tempfile.mkdtemp()

# Create mock dataset JSON files
def create_mock_dataset_json(filepath, center_name):
    """Create a minimal valid decathlon-style dataset JSON"""
    dataset_dict = {
        "name": f"Dataset_{center_name}",
        "description": "Mock dataset",
        "modality": {"0": "MRI"},
        "labels": {"0": "background", "1": "foreground"},
        "numTraining": 2,
        "numTest": 2,
        "training": [
            {
                "image": "./imagesTr/img_001_0000.nii.gz",
                "label": "./labelsTr/img_001.nii.gz"
            },
            {
                "image": "./imagesTr/img_002_0000.nii.gz",
                "label": "./labelsTr/img_002.nii.gz"
            }
        ],
        "test": [
            {"image": "./imagesTs/img_003_0000.nii.gz"},
            {"image": "./imagesTs/img_004_0000.nii.gz"}
        ]
    }
    os.makedirs(os.path.dirname(filepath), exist_ok=True)
    with open(filepath, 'w') as f:
        json.dump(dataset_dict, f)

# Create mock dataset files for each center
centers = ["center_a", "center_b"]
for center in centers:
    dataset_json_path = os.path.join(temp_dir, f'dataset_{center}.json')
    create_mock_dataset_json(dataset_json_path, center)

# Define test transforms - a simple composition of transforms
test_transforms = Compose([
    Identity()
])

ARGS = {
    "centers_list": ["center_a", "center_b"],
    "root": temp_dir + "/",
    "test_transforms": test_transforms,
    "seed": 42
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
monai, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 2, dtype family float — a list output has no array shape of its own; none is stated
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_test_datasets Ran
ran on a synthesized input
naga-karthik/continual-learning-ms/main_pl_multi-task.py
code served (permissive licence) · get_code("1f9a3633084a0474")
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 list, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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 numpy as np
from monai.transforms import Compose, Identity
from unittest.mock import MagicMock, patch
import json
import tempfile
import os

torch.manual_seed(0)

# Create a temporary directory for mock data
temp_dir = tempfile.mkdtemp()

# Create mock dataset JSON files
mock_dataset = {
    "training": [],
    "test": [
        {"image": "test_image_1.nii.gz", "label": "test_label_1.nii.gz"},
        {"image": "test_image_2.nii.gz", "label": "test_label_2.nii.gz"}
    ]
}

dataset_path = os.path.join(temp_dir, "dataset_mix.json")
with open(dataset_path, 'w') as f:
    json.dump(mock_dataset, f)

# Create mock test_transforms
test_transforms = Compose([
    Identity()
])

# Define the ARGS dictionary
ARGS = {
    'centers_list': ['mix'],
    'root': temp_dir + '/',
    'test_transforms': test_transforms,
    'seed': 42
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
monai, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 2, dtype family float — a list output has no array shape of its own; none is stated
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_test_datasets Ran
ran on a synthesized input
naga-karthik/continual-learning-ms/main_pl_single-task.py
code served (permissive licence) · get_code("a2046c9ad4f7396f")
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 list, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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 monai.transforms import Compose, Identity
from monai.data import Dataset
import tempfile
import json
import os

torch.manual_seed(0)

# Create a temporary directory for mock data
temp_dir = tempfile.mkdtemp()

# Create a mock dataset JSON file
mock_dataset = {
    "training": [
        {"image": "img_001.nii.gz", "label": "label_001.nii.gz"},
        {"image": "img_002.nii.gz", "label": "label_002.nii.gz"},
    ],
    "test": [
        {"image": "test_001.nii.gz"},
        {"image": "test_002.nii.gz"},
    ]
}

dataset_json_path = os.path.join(temp_dir, "dataset_amu.json")
with open(dataset_json_path, 'w') as f:
    json.dump(mock_dataset, f)

# Create mock test_transforms
test_transforms = Compose([
    Identity()
])

# Define ARGS dictionary with all required parameters
ARGS = {
    'centers_list': ['amu'],
    'root': temp_dir + '/',
    'test_transforms': test_transforms,
    'seed': 42
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
monai, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 2, dtype family float — a list output has no array shape of its own; none is stated
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
lrelu_conv Ran
ran on a synthesized input
naga-karthik/continual-learning-ms/models.py
code served (permissive licence) · get_code("37d727f7206d2797")
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 Sequential. 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 = {
    "feat_in": 3,
    "feat_out": 16,
}
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 Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 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
norm_lrelu_conv Ran
ran on a synthesized input
naga-karthik/continual-learning-ms/models.py
code served (permissive licence) · get_code("e7f1a4969d41930d")
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 Sequential. 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 = {
    "feat_in": 16,
    "feat_out": 32
}
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 Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 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

Also present in other papers' code

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

Repositories linked to this paper

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

Abstract

Segmentation of Multiple Sclerosis (MS) lesions is a challenging problem. Several deep-learning-based methods have been proposed in recent years. However, most methods tend to be static, that is, a single model trained on a large, specialized dataset, which does not generalize well. Instead, the model should learn across datasets arriving sequentially from different hospitals by building upon the characteristics of lesions in a continual manner. In this regard, we explore experience replay, a well-known continual learning method, in the context of MS lesion segmentation across multi-contrast data from 8 different hospitals. Our experiments show that replay is able to achieve positive backward transfer and reduce catastrophic forgetting compared to sequential fine-tuning. Furthermore, replay outperforms the multi-domain training, thereby emerging as a promising solution for the segmentation of MS lesions. The code is available at this link.

For agents

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

get_harvested_code_for_paper("2210.15091")
get_code_for_paper("2210.15091")
have("2210.15091")

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

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

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

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

Connect an agent — have() is free.