SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2312.07381 · 2023

ScribblePrompt: Fast and Flexible Interactive Segmentation for Any Biomedical Image

arXiv · PDF · Open in the Atlas

Code that ran

3 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 0 have no contract verdict; 3 failures of our instrument; 6 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/2312.07381.json · badge: /api/ran/2312.07381.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
halleewong/ScribblePrompt canonical (classifier label)
classifier basis: census
3 ran · 6 no recorded run
FunctionStatusWhere it lives
binary_focal_cross_entropy Ran
ran; our contract draft was wrong, not the code
halleewong/ScribblePrompt/scribbleprompt/loss/focal_dice.py
code served (permissive licence) · get_code("4c201fecc5928f5f")
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 0, dtype family float, shape () 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
import torch.nn as nn

torch.manual_seed(0)

# Create small tensors for binary focal cross entropy
batch_size = 2
feature_dim = 4

# y_pred: predicted probabilities (should be in [0, 1])
y_pred = torch.sigmoid(torch.randn(batch_size, feature_dim))

# y_true: binary labels (should be in [0, 1])
y_true = torch.randint(0, 2, (batch_size, feature_dim)).float()

# weights: optional weights matching shape of y_pred
weights = torch.ones(batch_size, feature_dim)

# gamma: focal loss gamma parameter
gamma = 20.0

# eps: small epsilon for numerical stability
eps = 1e-07

# dim: dimension to reduce over (None means reduce all)
dim = None

ARGS = {
    'y_pred': y_pred,
    'y_true': y_true,
    'weights': weights,
    'gamma': gamma,
    'eps': eps,
    'dim': dim,
}
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 0, dtype family float, shape () — shape () 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
rescale_inputs Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
halleewong/ScribblePrompt/scribbleprompt/models/unet.py
code served (permissive licence) · get_code("ec185b4c4929868b")
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 dict. 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.functional as F

torch.manual_seed(0)

# Construct test inputs dictionary with various optional fields
inputs = {
    'img': torch.randn(2, 3, 256, 256),  # batch=2, channels=3, h=256, w=256
    'scribbles': torch.randn(2, 1, 256, 256),  # batch=2, channels=1, h=256, w=256
    'box': torch.tensor([[10, 20, 100, 150], [30, 40, 120, 180]], dtype=torch.int32).reshape(1, 2, 4),  # 1 batch, 2 boxes, 4 coords
    'point_coords': torch.tensor([[50, 75], [100, 125]], dtype=torch.int32),  # 2 points with x, y coords
}

input_size = (128, 128)

ARGS = {
    'inputs': inputs,
    'input_size': input_size,
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
scribbles_to_clicks Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
halleewong/ScribblePrompt/scribbleprompt/models/sam.py
code served (permissive licence) · get_code("29421035d6d0e780")
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 torch

torch.manual_seed(0)

# Create a scribble tensor with shape (2, H, W)
# 2 channels: first for positive scribbles, second for negative scribbles
H, W = 4, 5
scribble = torch.zeros((2, H, W), dtype=torch.float32)

# Add some positive scribble points (channel 0)
scribble[0, 1, 2] = 1.0
scribble[0, 2, 3] = 1.0

# Add some negative scribble points (channel 1)
scribble[1, 0, 1] = 1.0
scribble[1, 3, 4] = 1.0

ARGS = {
    "scribble": scribble,
}
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 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
RandomScale Not yet run
unverified (harvested, no recorded run)
halleewong/ScribblePrompt/scribbleprompt/augmentation/geometry.py
code served (permissive licence) · get_code("76f4ba705e24fc08")
How it ran

no invocation recorded.

RandomShear Not yet run
unverified (harvested, no recorded run)
halleewong/ScribblePrompt/scribbleprompt/augmentation/geometry.py
code served (permissive licence) · get_code("c1f2516b575d2e1d")
How it ran

no invocation recorded.

RandomTranslate Not yet run
unverified (harvested, no recorded run)
halleewong/ScribblePrompt/scribbleprompt/augmentation/geometry.py
code served (permissive licence) · get_code("8eb62c25a8d9519d")
How it ran

no invocation recorded.

augmentations_from_config Not yet run
unverified (harvested, no recorded run)
halleewong/ScribblePrompt/scribbleprompt/augmentation/containers.py
code served (permissive licence) · get_code("73ca67530aed024c")
How it ran

no invocation recorded.

click_onehot Not yet run
unverified (harvested, no recorded run)
halleewong/ScribblePrompt/scribbleprompt/models/unet.py
code served (permissive licence) · get_code("b3e2d469d9e7fae8")
How it ran

no invocation recorded.

prepare_inputs Not yet run
unverified (harvested, no recorded run)
halleewong/ScribblePrompt/scribbleprompt/models/unet.py
code served (permissive licence) · get_code("a2294a98b783fc03")
How it ran

no invocation recorded.

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 9 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 9 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

Biomedical image segmentation is a crucial part of both scientific research and clinical care. With enough labelled data, deep learning models can be trained to accurately automate specific biomedical image segmentation tasks. However, manually segmenting images to create training data is highly labor intensive and requires domain expertise. We present \emph{ScribblePrompt}, a flexible neural network based interactive segmentation tool for biomedical imaging that enables human annotators to segment previously unseen structures using scribbles, clicks, and bounding boxes. Through rigorous quantitative experiments, we demonstrate that given comparable amounts of interaction, ScribblePrompt produces more accurate segmentations than previous methods on datasets unseen during training. In a user study with domain experts, ScribblePrompt reduced annotation time by 28% while improving Dice by 15% compared to the next best method. ScribblePrompt's success rests on a set of careful design decisions. These include a training strategy that incorporates both a highly diverse set of images and tasks, novel algorithms for simulated user interactions and labels, and a network that enables fast inference. We showcase ScribblePrompt in an interactive demo, provide code, and release a dataset of scribble annotations at https://scribbleprompt.csail.mit.edu

For agents

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

get_harvested_code_for_paper("2312.07381")
get_code_for_paper("2312.07381")
have("2312.07381")

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

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

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

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

Connect an agent — have() is free.