SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.07633 · IJCAI · 2023

Complete Instances Mining for Weakly Supervised Instance Segmentation

Jin-Gang Yu, Zecheng Li, Yuqi Liang, Zening Zeng

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; 2 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 6 failures of our instrument; 0 no recorded run), measured 2026-11-22; 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/2402.07633.json · badge: /api/ran/2402.07633.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
ZechengLi19/CIM canonical (classifier label)
classifier basis: census
9 ran · 0 no recorded run
FunctionStatusWhere it lives
binary_mask_to_rle Ran
ran; our contract draft was wrong, not the code
ZechengLi19/CIM/lib/datasets/pycococreatortools.py
pointer only (licence: MIT); the stored copy get_code serves, from yuhuan-wu/RDPNet, is pointer only (licence: NONE) · get_code("d805cf01161ac845")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from yuhuan-wu/RDPNet, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

close_contour Ran
ran, violated the contract we drafted
ZechengLi19/CIM/lib/datasets/pycococreatortools.py
code served (permissive licence) · get_code("24680b34da633bbd")
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 ndarray, ndim 2, dtype family float, shape (5, 2) 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

# Create a valid contour as a numpy array
# A contour should be a 2D array where each row is a point (e.g., x, y coordinates)
# Using shape (4, 2) - 4 points with 2 coordinates each
contour = np.array([
    [0.0, 0.0],
    [1.0, 0.0],
    [1.0, 1.0],
    [0.5, 0.5]
])

ARGS = {
    "contour": contour
}
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 ndarray, ndim 2, dtype family float, shape (5, 2) — shape (5, 2) 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
dis_eval Ran
ran, honoured the contract we drafted
ZechengLi19/CIM/lib/datasets/dis_eval.py
code served (permissive licence) · get_code("dd2212897360cbfa")
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 float64, ndim 0, 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 tempfile
import os
import numpy as np
import xml.etree.ElementTree as ET

# Create temporary directory for test files
tmpdir = tempfile.mkdtemp()

# Create a sample annotation XML file
anno_dir = os.path.join(tmpdir, 'annotations')
os.makedirs(anno_dir, exist_ok=True)

# Create sample annotation XML for image1
xml_content_1 = """<?xml version="1.0"?>
<annotation>
    <object>
        <name>person</name>
        <pose>Unspecified</pose>
        <truncated>0</truncated>
        <difficult>0</difficult>
        <bndbox>
            <xmin>10</xmin>
            <ymin>20</ymin>
            <xmax>100</xmax>
            <ymax>150</ymax>
        </bndbox>
    </object>
</annotation>
"""

# Create sample annotation XML for image2
xml_content_2 = """<?xml version="1.0"?>
<annotation>
    <object>
        <name>person</name>
        <pose>Left</pose>
        <truncated>0</truncated>
        <difficult>0</difficult>
        <bndbox>
            <xmin>50</xmin>
            <ymin>60</ymin>
            <xmax>120</xmax>
            <ymax>180</ymax>
        </bndbox>
    </object>
</annotation>
"""

with open(os.path.join(anno_dir, 'image1.xml'), 'w') as f:
    f.write(xml_content_1)

with open(os.path.join(anno_dir, 'image2.xml'), 'w') as f:
    f.write(xml_content_2)

# Create imageset file
imageset_file = os.path.join(tmpdir, 'imageset.txt')
with open(imageset_file, 'w') as f:
    f.write('image1\n')
    f.write('image2\n')

# Create detections file
det_dir = os.path.join(tmpdir, 'detections')
os.makedirs(det_dir, exist_ok=True)
det_file = os.path.join(det_dir, 'person.txt')
with open(det_file, 'w') as f:
    f.write('image1 0.95 15 25 95 145\n')
    f.write('image2 0.87 55 65 115 175\n')

# Create cache directory
cache_dir = os.path.join(tmpdir, 'cache')
os.makedirs(cache_dir, exist_ok=True)

# Define arguments
ARGS = {
    'detpath': os.path.join(det_dir, '{}.txt'),
    'annopath': os.path.join(anno_dir, '{}.xml'),
    'imagesetfile': imageset_file,
    'classname': 'person',
    'cachedir': cache_dir,
    'ovthresh': 0.5
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, six — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
filter_for_training Ran
ran; our contract draft was wrong, not the code
ZechengLi19/CIM/lib/datasets/roidb.py
code served (permissive licence) · get_code("7951428fcb43dcc0")
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 1, 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 numpy as np
import logging

logging.basicConfig(level=logging.INFO)

# Create a minimal roidb (Region of Interest database)
# Each entry needs to have a 'gt_classes' key with array values
roidb = [
    {
        'gt_classes': np.array([1, 2, 0]),  # Valid entry with non-zero sum
        'image_id': 0,
        'boxes': np.array([[10, 20, 30, 40]])
    },
    {
        'gt_classes': np.array([0, 0, 0]),  # Invalid entry with zero sum
        'image_id': 1,
        'boxes': np.array([[50, 60, 70, 80]])
    },
    {
        'gt_classes': np.array([1, 0, 0]),  # Valid entry with non-zero sum
        'image_id': 2,
        'boxes': np.array([[100, 110, 120, 130]])
    },
    {
        'gt_classes': np.array([2, 1, 3]),  # Valid entry with non-zero sum
        'image_id': 3,
        'boxes': np.array([[200, 210, 220, 230]])
    }
]

ARGS = {
    'roidb': roidb
}
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 list, ndim 1, 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
parse_rec Ran
ran; our contract draft was wrong, not the code
ZechengLi19/CIM/lib/datasets/dis_eval.py
code served (permissive licence) · get_code("0eafc51289a49033")
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 1, 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 xml.etree.ElementTree as ET
import tempfile
import os

# Create a minimal valid PASCAL VOC XML file
xml_content = """<?xml version="1.0" encoding="UTF-8"?>
<annotation>
    <object>
        <name>dog</name>
        <pose>Frontal</pose>
        <truncated>0</truncated>
        <difficult>0</difficult>
        <bndbox>
            <xmin>10</xmin>
            <ymin>20</ymin>
            <xmax>100</xmax>
            <ymax>150</ymax>
        </bndbox>
    </object>
    <object>
        <name>cat</name>
        <pose>Rear</pose>
        <truncated>1</truncated>
        <difficult>1</difficult>
        <bndbox>
            <xmin>50</xmin>
            <ymin>60</ymin>
            <xmax>200</xmax>
            <ymax>250</ymax>
        </bndbox>
    </object>
</annotation>
"""

# Create a temporary file with the XML content
temp_file = tempfile.NamedTemporaryFile(mode='w', suffix='.xml', delete=False)
temp_file.write(xml_content)
temp_file.close()

ARGS = {
    'filename': temp_file.name
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, 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
pr_conv2d Ran
ran; our contract draft was wrong, not the code
ZechengLi19/CIM/lib/bp/exbp.py
code served (permissive licence) · get_code("7bf64121ea2939d9")
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 4, dtype family float, shape (2, 4, 5, 5) 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
import torch.nn.functional as F

torch.manual_seed(0)

# Create a minimal Conv2d module with the required attributes
class SimpleConv2d(nn.Module):
    def __init__(self):
        super().__init__()
        # Small conv2d: in_channels=3, out_channels=4, kernel_size=3
        self.weight = nn.Parameter(torch.randn(4, 3, 3, 3))
        self.bias = nn.Parameter(torch.randn(4))
        self.stride = 1
        self.padding = 1
        self.dilation = 1
        self.groups = 1

# Create the conv2d module instance
conv_module = SimpleConv2d()

# Create input tensor: (batch=2, channels=3, height=5, width=5)
input_tensor = torch.randn(2, 3, 5, 5)

ARGS = {
    'self': conv_module,
    'input': input_tensor
}
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 4, dtype family float, shape (2, 4, 5, 5) — shape (2, 4, 5, 5) 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
pr_linear Ran
ran; our contract draft was wrong, not the code
ZechengLi19/CIM/lib/bp/exbp.py
code served (permissive licence) · get_code("e7f202798fa936b4")
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
import torch.nn as nn
from torch.autograd import Function

torch.manual_seed(0)

# Define the EBLinear function class
class EBLinear(Function):
    @staticmethod
    def forward(ctx, input, weight, bias=None):
        ctx.save_for_backward(input, weight, bias)
        output = input.mm(weight.t())
        if bias is not None:
            output += bias.unsqueeze(0).expand_as(output)
        return output

    @staticmethod
    def backward(ctx, grad_output):
        input, weight, bias = ctx.saved_tensors
        weight = weight.clamp(min=0) if torch.use_pos_weights else weight.clamp(max=0).abs()
        input.data = input.data - input.data.min() if input.data.min() < 0 else input.data
        grad_output /= input.mm(weight.t()).abs() + 1e-10
        grad_input = grad_weight = grad_bias = None
        if ctx.needs_input_grad[0]:
            grad_input = grad_output.mm(weight)
            grad_input *= input
        if ctx.needs_input_grad[1]:
            grad_weight = grad_output.t().mm(input)
        if bias is not None and ctx.needs_input_grad[2]:
            grad_bias = grad_output.sum(0).squeeze(0)
        return (grad_input, grad_weight, grad_bias)

# Create a minimal model with weight and bias attributes
class LinearModule(nn.Module):
    def __init__(self, in_features, out_features):
        super().__init__()
        self.weight = nn.Parameter(torch.randn(out_features, in_features))
        self.bias = nn.Parameter(torch.randn(out_features))
    
    def forward(self, input):
        output = EBLinear.apply(input, self.weight, self.bias)
        return output

# Create instances
linear_module = LinearModule(in_features=3, out_features=4)
input_tensor = torch.randn(2, 3)

# Create the function that wraps pr_linear
def pr_linear(self, input):
    """
    linear under excitation bp setting.
    """
    output = EBLinear.apply(input, self.weight, self.bias)
    return output

# Construct arguments for pr_linear
# pr_linear takes (self, input) where self is a module with weight and bias
ARGS = {
    "self": linear_module,
    "input": input_tensor
}
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
rank_for_training Ran
ran, honoured the contract we drafted
ZechengLi19/CIM/lib/datasets/roidb.py
code served (permissive licence) · get_code("1d0f686f173313ef")
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, 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 numpy as np

# Create a small roidb (region of interest database)
# Each entry needs 'width' and 'height' keys
roidb = [
    {'width': 640, 'height': 480},
    {'width': 800, 'height': 600},
    {'width': 1024, 'height': 768},
    {'width': 400, 'height': 300},
]

ARGS = {
    'roidb': roidb,
}
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, ndim 2, dtype family float — a tuple 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
resize_binary_mask Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ZechengLi19/CIM/lib/datasets/pycococreatortools.py
code served (permissive licence) · get_code("85747a26d672282d")
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 ndarray, ndim 2, dtype family float, shape (5, 6) 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
from PIL import Image

# Create a small binary mask array (4x3)
array = np.array([
    [1, 0, 1],
    [0, 1, 0],
    [1, 1, 0],
    [0, 0, 1]
], dtype=np.uint8)

# Define new size as a tuple
new_size = (6, 5)

ARGS = {
    "array": array,
    "new_size": new_size
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, 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 (5, 6) — shape (5, 6) 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

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, 7 are also present in other papers whose code we hold (7 with at least one paper dated earlier, 2 the same month, 1 later) and 2 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.

FunctionAlso present inEarliest-datedOthers named
parse_rec 14 other papers
13 dated earlier, 1 later
1506.01497 (2015-06)
Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks
1605.06409 (2016-05)
R-FCN: Object Detection via Region-based Fully Convolutional Networks
1609.03605 (2016-09)
Detecting Text in Natural Image with Connectionist Text Proposal Network
and 11 more not named here
binary_mask_to_rle 2 other papers
2 dated earlier
2002.09576 (2020-02)
UnMask: Adversarial Detection and Defense Through Robust Feature Alignment
2008.12416 (2020-08)
Regularized Densely-connected Pyramid Network for Salient Instance Segmentation
close_contour 2 other papers
1 dated earlier, 1 the same month
2002.09576 (2020-02)
UnMask: Adversarial Detection and Defense Through Robust Feature Alignment
2402.03290 (2024-02)
InstanceDiffusion: Instance-level Control for Image Generation
resize_binary_mask 2 other papers
1 dated earlier, 1 the same month
2002.09576 (2020-02)
UnMask: Adversarial Detection and Defense Through Robust Feature Alignment
2402.03311 (2024-02)
HASSOD: Hierarchical Adaptive Self-Supervised Object Detection
dis_eval 1 other paper
1 dated earlier
2004.04725 (2020-04)
Instance-aware, Context-focused, and Memory-efficient Weakly Supervised Object Detection
filter_for_training 1 other paper
1 dated earlier
2004.04725 (2020-04)
Instance-aware, Context-focused, and Memory-efficient Weakly Supervised Object Detection
rank_for_training 1 other paper
1 dated earlier
2004.04725 (2020-04)
Instance-aware, Context-focused, and Memory-efficient Weakly Supervised Object Detection

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

Weakly supervised instance segmentation (WSIS) using only image-level labels is a challenging task due to the difficulty of aligning coarse annotations with the finer task. However, with the advancement of deep neural networks (DNNs), WSIS has garnered significant attention. Following a proposalbased paradigm, we encounter a redundant segmentation problem resulting from a single instance being represented by multiple proposals. For example, we feed a picture of a dog and proposals into the network and expect to output only one proposal containing a dog, but the network outputs multiple proposals. To address this problem, we propose a novel approach for WSIS that focuses on the online refinement of complete instances through the use of MaskIoU heads to predict the integrity scores of proposals and a Complete Instances Mining (CIM) strategy to explicitly model the redundant segmentation problem and generate refined pseudo labels. Our approach allows the network to become aware of multiple instances and complete instances, and we further improve its robustness through the incorporation of an Anti-noise strategy. Empirical evaluations on the PASCAL VOC 2012 and MS COCO datasets demonstrate that our method achieves state-of-the-art performance with a notable margin. Our implementation will be made available at https://github.com/ZechengLi19/CIM.

For agents

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

get_harvested_code_for_paper("2402.07633")
get_code_for_paper("2402.07633")
have("2402.07633")

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

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

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

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

Connect an agent — have() is free.