SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2506.09724 · ICML · 2025

The Four Color Theorem for Cell Instance Segmentation

Yongbing Zhang, Jun Xiao, Yu Zhou, Yifeng Wang, Ye Zhang, Ziyue Wang, Jianxu Chen

arXiv · PDF · Open in the Atlas

Code that ran

1 of 1 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 0 failures of our instrument; 0 no recorded run), measured 2026-11-24; 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/2506.09724.json · badge: /api/ran/2506.09724.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
zhangye-zoe/fcis canonical (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
FunctionStatusWhere it lives
CellGraph Ran
ran on a synthesized input · constructed an object; no result was computed
zhangye-zoe/fcis/tiseg/models/utils/cellgraph.py
code served (permissive licence) · get_code("d3bf2189372aa392")
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, CellGraph: 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 random

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

# Batch size: 2
# Height/Width: 8 (for spatial dimensions)
# Semantic feature dimension: 4
# Number of instances per batch: 3

batch_size = 2
height = 8
width = 8
num_cells = height * width
sem_feat_dim = 4

# inst_gt: instance segmentation ground truth
# Shape: (batch_size, height, width)
# Contains instance IDs (1, 2, 3, ...) and background (0)
inst_gt = torch.zeros((batch_size, height, width), dtype=torch.long)
inst_gt[0, 0:4, 0:4] = 1
inst_gt[0, 0:4, 4:8] = 2
inst_gt[0, 4:8, 0:4] = 3
inst_gt[1, 1:5, 1:5] = 1
inst_gt[1, 5:8, 5:8] = 2
inst_gt[1, 0:3, 5:8] = 3

# sem_gt: semantic segmentation ground truth
# Shape: (batch_size, height, width)
sem_gt = torch.randint(0, 5, (batch_size, height, width))

# sem_features: semantic features for each pixel
# Shape: (batch_size, sem_feat_dim, height, width)
sem_features = torch.randn((batch_size, sem_feat_dim, height, width))

# sem_logits: semantic logits
# Shape: (batch_size, num_classes, height, width)
sem_logits = torch.randn((batch_size, 5, height, width))

# adj_gt: adjacency ground truth
# For each batch, a dictionary mapping instance IDs to their neighbors
# We'll create a simple adjacency structure
def create_adj_gt(batch_size, max_instances=5):
    adj_list = []
    for b in range(batch_size):
        adj_dict = {}
        for inst_id in range(1, max_instances):
            # Simple adjacency: each instance connects to a few neighbors
            neighbors = [(inst_id + 1) % max_instances, (inst_id + 2) % max_instances]
            neighbors = [n for n in neighbors if n != 0]
            adj_dict[inst_id] = neighbors
        adj_list.append(adj_dict)
    return adj_list

adj_gt = create_adj_gt(batch_size, max_instances=5)

ARGS = {
    "inst_gt": inst_gt,
    "sem_gt": sem_gt,
    "sem_features": sem_features,
    "sem_logits": sem_logits,
    "adj_gt": adj_gt,
    "neg_sample_ratio": 0.01,
    "sample_ratio": 0.1,
    "contrastive_loss": True,
}
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 CellGraph — 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 CellGraph 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

Also present in other papers' code

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

Repositories linked to this paper

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

Abstract

Cell instance segmentation is critical to analyzing biomedical images, yet accurately distinguishing tightly touching cells remains a persistent challenge. Existing instance segmentation frameworks, including detection-based, contour-based, and distance mapping-based approaches, have made significant progress, but balancing model performance with computational efficiency remains an open problem. In this paper, we propose a novel cell instance segmentation method inspired by the four-color theorem. By conceptualizing cells as countries and tissues as oceans, we introduce a four-color encoding scheme that ensures adjacent instances receive distinct labels. This reformulation transforms instance segmentation into a constrained semantic segmentation problem with only four predicted classes, substantially simplifying the instance differentiation process. To solve the training instability caused by the non-uniqueness of four-color encoding, we design an asymptotic training strategy and encoding transformation method. Extensive experiments on various modes demonstrate our approach achieves state-of-the-art performance. The code is available at https://github.com/zhangye-zoe/FCIS.

For agents

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

get_harvested_code_for_paper("2506.09724")
get_code_for_paper("2506.09724")
have("2506.09724")

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

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

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

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

Connect an agent — have() is free.