SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · aaai_28521 · AAAI · 2024

Weakly-Supervised Mirror Detection via Scribble Annotations

Yang Yang, Heng Shen, Tianyu Li, Guoqing Wang, Yunqiang Pei, Mingfeng Zha, Wenbin Qian

Open in the Atlas

Code that ran

4 of 5 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 3 have no contract verdict; 1 failure of our instrument; 1 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/aaai_28521.json · badge: /api/ran/aaai_28521.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
winter-flow/WSMD canonical (classifier label)
classifier basis: census
4 ran · 1 no recorded run
FunctionStatusWhere it lives
cos_distance Ran
ran on a synthesized input
winter-flow/WSMD/loss.py
code served (permissive licence) · get_code("f515fcd7e65de2f1")
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, 3) 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.functional as F

torch.manual_seed(0)

# Create small embedded tensors
# embedded_fg: batch of foreground embeddings (batch_size=2, embedding_dim=4)
embedded_fg = torch.randn(2, 4)

# embedded_bg: batch of background embeddings (batch_size=3, embedding_dim=4)
# Using different batch size to make dimensions distinct
embedded_bg = torch.randn(3, 4)

ARGS = {
    "embedded_fg": embedded_fg,
    "embedded_bg": embedded_bg,
}
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, 3) — shape (2, 3) 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
cos_simi Ran
ran; our contract draft was wrong, not the code
winter-flow/WSMD/loss.py
code served (permissive licence) · get_code("680715467d49f014")
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, 3) 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.functional as F

torch.manual_seed(0)

# Create small tensors for embedded_fg and embedded_bg
# embedded_fg: (batch_size=2, embedding_dim=4)
# embedded_bg: (batch_size=3, embedding_dim=4)
embedded_fg = torch.randn(2, 4)
embedded_bg = torch.randn(3, 4)

ARGS = {
    "embedded_fg": embedded_fg,
    "embedded_bg": embedded_bg,
}
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, 3) — shape (2, 3) 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
get_loader Ran
ran on a synthesized input
winter-flow/WSMD/data.py
code served (permissive licence) · get_code("258911cfac89ec47")
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 DataLoader. 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 os
import tempfile
from PIL import Image
import torch
import torch.utils.data as data
import torchvision.transforms as transforms

# Create temporary directories with minimal test images
temp_dir = tempfile.mkdtemp()
image_root = os.path.join(temp_dir, 'images') + '/'
gt_root = os.path.join(temp_dir, 'gt') + '/'
mask_root = os.path.join(temp_dir, 'mask') + '/'
gray_root = os.path.join(temp_dir, 'gray') + '/'
edge_root = os.path.join(temp_dir, 'edge') + '/'

for directory in [image_root, gt_root, mask_root, gray_root, edge_root]:
    os.makedirs(directory, exist_ok=True)

# Create minimal test images (64x64 to pass size checks)
img_size = (64, 64)

# Create 2 RGB images for image_root
for i in range(2):
    img = Image.new('RGB', img_size, color=(100, 150, 200))
    img.save(os.path.join(image_root, f'image_{i}.jpg'))

# Create 2 grayscale images for gt_root (must match image size)
for i in range(2):
    img = Image.new('L', img_size, color=128)
    img.save(os.path.join(gt_root, f'gt_{i}.png'))

# Create 2 grayscale images for mask_root
for i in range(2):
    img = Image.new('L', img_size, color=100)
    img.save(os.path.join(mask_root, f'mask_{i}.png'))

# Create 2 grayscale images for gray_root
for i in range(2):
    img = Image.new('L', img_size, color=120)
    img.save(os.path.join(gray_root, f'gray_{i}.jpg'))

# Create 2 grayscale images for edge_root
for i in range(2):
    img = Image.new('L', img_size, color=50)
    img.save(os.path.join(edge_root, f'edge_{i}.png'))

ARGS = {
    'image_root': image_root,
    'gt_root': gt_root,
    'mask_root': mask_root,
    'gray_root': gray_root,
    'edge_root': edge_root,
    'batchsize': 2,
    'trainsize': 32,
    'shuffle': True,
    'num_workers': 0,
    'pin_memory': False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataLoader — a DataLoader output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataLoader 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
l2_distance Ran
ran on a synthesized input
winter-flow/WSMD/loss.py
code served (permissive licence) · get_code("ac58891e8f1564df")
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, 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 torch

torch.manual_seed(0)

# The function expects two tensors with shape (N, C)
# where N is the batch size and C is the embedding dimension
# It computes pairwise L2 distances between all pairs

N = 2  # batch size
C = 4  # embedding dimension

embedded_fg = torch.randn(N, C)
embedded_bg = torch.randn(N, C)

ARGS = {
    "embedded_fg": embedded_fg,
    "embedded_bg": embedded_bg,
}
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, 2) — shape (2, 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
get_loader Not yet run
unverified (harvested, no recorded run)
winter-flow/WSMD/dataloader.py
code served (permissive licence) · get_code("bc3b2391b7cb324c")
How it ran

no invocation recorded.

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 0 later) and 4 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
cos_simi 1 other paper
1 dated earlier
2203.13505 (2022-03)
C 2 AM: Contrastive learning of Class-agnostic Activation Map for Weakly Supervised Object Localization and Semantic Segmentation

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

Mirror detection is of great significance for avoiding false recognition of reflected objects in computer vision tasks. Existing mirror detection frameworks usually follow a supervised setting, which relies heavily on high quality labels and suffers from poor generalization. To resolve this, we instead propose the first weakly-supervised mirror detection framework and also provide the first scribble-based mirror dataset. Specifically, we relabel 10,158 images, most of which have a labeled pixel ratio of less than 0.01 and take only about 8 seconds to label. Considering that the mirror regions usually show great scale variation, and also irregular and occluded, thus leading to issues of incomplete or over detection, we propose a local-global feature enhancement (LGFE) module to fully capture the context and details. Moreover, it is difficult to obtain basic mirror structure using scribble annotation, and the distinction between foreground (mirror) and background (non-mirror) features is not emphasized caused by mirror reflections. Therefore, we propose a foreground-aware mask attention (FAMA), integrating mirror edges and semantic features to complete mirror regions and suppressing the influence of backgrounds. Finally, to improve the robustness of the network, we propose a prototype contrast loss (PCL) to learn more general foreground features across images. Extensive experiments show that our network outperforms relevant state-of-the-art weakly supervised methods, and even some fully supervised methods. The dataset and codes are available at https://github.com/winter-flow/WSMD.

For agents

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

get_harvested_code_for_paper("aaai_28521")
get_code_for_paper("aaai_28521")
have("aaai_28521")

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

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

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

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

Connect an agent — have() is free.