SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2404.01743 · CVPR · 2024

Atom-Level Optical Chemical Structure Recognition with Limited Supervision

Edward De Brouwer, Martijn Oldenhof, Adam Arany, Yves Moreau

arXiv · PDF · Open in the Atlas

Code that ran

7 of 7 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, 0 violated it and 0 have no contract verdict; 5 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/2404.01743.json · badge: /api/ran/2404.01743.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
molden/atomlenz community
Papers with Code archive
7 ran · 0 no recorded run
FunctionStatusWhere it lives
bb_box_intersects Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
molden/atomlenz/AtomLenz/utils_graph.py
code served (permissive licence) · get_code("d8387858dc58928b")
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) and returned int, ndim 0, dtype family int, 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 numpy as np

torch.manual_seed(0)

# The function bb_box_intersects takes two bounding boxes
# Each box is expected to be indexable with [0], [1], [2], [3]
# representing [xmin, ymin, xmax, ymax] coordinates

# Create two bounding boxes that intersect
boxA = [10, 20, 50, 60]  # xmin=10, ymin=20, xmax=50, ymax=60
boxB = [30, 40, 70, 80]  # xmin=30, ymin=40, xmax=70, ymax=80

ARGS = {
    "boxA": boxA,
    "boxB": boxB
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, 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
bb_intersection_over_union Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
molden/atomlenz/AtomLenz/utils_graph.py
code served (permissive licence) · get_code("c7dedbb8e3b99ff4")
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) and returned float, 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 numpy as np

torch.manual_seed(0)

# The function bb_intersection_over_union takes two bounding boxes
# Each box is a sequence with 4 elements: [x1, y1, x2, y2]
# representing the top-left and bottom-right corners

# Create two sample bounding boxes
boxA = [10, 20, 50, 80]  # x1=10, y1=20, x2=50, y2=80
boxB = [30, 40, 70, 100]  # x1=30, y1=40, x2=70, y2=100

ARGS = {
    "boxA": boxA,
    "boxB": boxB,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, 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
create_molecules Ran
ran; our contract draft was wrong, not the code
molden/atomlenz/AtomLenz/utils_graph.py
code served (permissive licence) · get_code("ac195b4d2f446147")
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) 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 torch
import numpy as np

torch.manual_seed(0)

# Create sample atom predictions
atom_preds = [
    {
        'boxes': [torch.tensor([[10.0, 10.0, 20.0, 20.0], 
                                [30.0, 30.0, 40.0, 40.0],
                                [50.0, 50.0, 60.0, 60.0]])],
        'preds': [torch.tensor([6, 7, 8])],  # atom labels (C, N, O)
        'scores': [torch.tensor([0.9, 0.85, 0.8])]
    },
    {
        'boxes': [torch.tensor([[15.0, 15.0, 25.0, 25.0],
                                [35.0, 35.0, 45.0, 45.0]])],
        'preds': [torch.tensor([6, 7])],
        'scores': [torch.tensor([0.88, 0.82])]
    }
]

# Create sample bond predictions
bond_preds = [
    {
        'boxes': [torch.tensor([[15.0, 15.0, 25.0, 25.0],
                                [40.0, 40.0, 50.0, 50.0]])],
        'preds': [torch.tensor([2, 3])]  # bond types (single, double)
    },
    {
        'boxes': [torch.tensor([[20.0, 20.0, 30.0, 30.0]])],
        'preds': [torch.tensor([2])]
    }
]

# Create sample charge predictions
charges_preds = [
    {
        'boxes': [torch.tensor([[12.0, 12.0, 18.0, 18.0],
                                [32.0, 32.0, 38.0, 38.0],
                                [52.0, 52.0, 58.0, 58.0]])],
        'preds': [torch.tensor([1, 2, 3])]  # charge labels (0, +1, -1)
    },
    {
        'boxes': [torch.tensor([[17.0, 17.0, 23.0, 23.0],
                                [37.0, 37.0, 43.0, 43.0]])],
        'preds': [torch.tensor([1, 2])]
    }
]

# Create sample stereo predictions (not used in function but included for completeness)
stereo_preds = [
    {
        'boxes': [torch.tensor([[10.0, 10.0, 20.0, 20.0]])],
        'preds': [torch.tensor([1])]
    },
    {
        'boxes': [torch.tensor([[15.0, 15.0, 25.0, 25.0]])],
        'preds': [torch.tensor([1])]
    }
]

ARGS = {
    'atom_preds': atom_preds,
    'bond_preds': bond_preds,
    'charges_preds': charges_preds,
    'stereo_preds': stereo_preds
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
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 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
dist_filter_bboxes Ran
ran, honoured the contract we drafted
molden/atomlenz/AtomLenz/utils_graph.py
code served (permissive licence) · get_code("a33eee2b3e40d1c2")
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) and returned tuple, ndim 1, dtype family int; 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 math

def distance(p1, p2):
    return math.sqrt((p1[0] - p2[0]) ** 2 + (p1[1] - p2[1]) ** 2)

def dist_filter_bboxes(list_bboxes):
    distance_val = 0
    for index, bbox in enumerate(list_bboxes):
        for i in range(len(list_bboxes) - index - 1):
            center1x = (bbox[0] + bbox[2]) / 2
            center1y = (bbox[1] + bbox[3]) / 2
            center2x = (list_bboxes[index + i + 1][0] + list_bboxes[index + i + 1][2]) / 2
            center2y = (list_bboxes[index + i + 1][1] + list_bboxes[index + i + 1][3]) / 2
            new_distance = distance([center1x, center1y], [center2x, center2y])
            if new_distance > distance_val:
                distance_val = new_distance
                cand1 = index
                cand2 = i + 1
    return (cand1, cand2)

# Setup: Create a list of bounding boxes
# Each bbox is [x1, y1, x2, y2] format (top-left and bottom-right corners)
list_bboxes = [
    [10, 20, 50, 60],      # bbox 0
    [100, 150, 140, 190],  # bbox 1
    [200, 250, 240, 290],  # bbox 2
]

ARGS = {
    "list_bboxes": list_bboxes
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 tuple, ndim 1, dtype family int — 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
distance Ran
ran; our contract draft was wrong, not the code
molden/atomlenz/AtomLenz/utils_graph.py
code served (permissive licence) · get_code("8a805833e6e55c05")
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 float, 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 math

# The function takes two parameters: p1 and p2
# Both are expected to be indexable objects with at least 2 elements (indices 0 and 1)
# The function accesses p1[0], p1[1], p2[0], p2[1]
# So we need to provide two points, each with at least 2 coordinates

p1 = (3.0, 4.0)
p2 = (0.0, 0.0)

ARGS = {
    "p1": p1,
    "p2": p2,
}
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 float, 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
iou_filter_bboxes Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
molden/atomlenz/AtomLenz/utils_graph.py
code served (permissive licence) · get_code("27e0b4641974894d")
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
import numpy as np

torch.manual_seed(0)

# Create small bounding boxes as tensors
# Format: [x1, y1, x2, y2] for each box
list_bboxes = torch.tensor([
    [10.0, 10.0, 50.0, 50.0],
    [15.0, 15.0, 55.0, 55.0],
], dtype=torch.float32)

# Create labels for each bounding box
list_labels = torch.tensor([0, 1], dtype=torch.long)

# Create scores for each bounding box
list_scores = torch.tensor([0.9, 0.7], dtype=torch.float32)

# IoU threshold
iou_threshold = 0.5

ARGS = {
    'list_bboxes': list_bboxes,
    'list_labels': list_labels,
    'list_scores': list_scores,
    'iou': iou_threshold,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, 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
tensordelete Ran
ran, honoured the contract we drafted
molden/atomlenz/AtomLenz/utils_graph.py
code served (permissive licence) · get_code("7490fad962081afc")
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) 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 numpy as np

torch.manual_seed(0)

# Create a 2D tensor with shape (4, 3)
tensor_2d = torch.randn(4, 3)

# Create a 1D tensor with shape (5,)
tensor_1d = torch.randn(5)

# Define indices to delete
indices = [0, 2]

# Test with 2D tensor
ARGS = {
    "tensor": tensor_2d,
    "indices": indices
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, 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

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 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

Identifying the chemical structure from a graphical representation, or image, of a molecule is a challenging pattern recognition task that would greatly benefit drug development. Yet, existing methods for chemical structure recognition do not typically generalize well, and show diminished effectiveness when confronted with domains where data is sparse, or costly to generate, such as hand-drawn molecule images. To address this limitation, we propose a new chemical structure recognition tool that delivers state-of-the-art performance and can adapt to new domains with a limited number of data samples and supervision. Unlike previous approaches, our method provides atom-level localization, and can therefore segment the image into the different atoms and bonds. Our model is the first model to perform OCSR with atom-level entity detection with only SMILES supervision. Through rigorous and extensive benchmarking, we demonstrate the preeminence of our chemical structure recognition approach in terms of data efficiency, accuracy, and atom-level entity prediction.

For agents

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

get_harvested_code_for_paper("2404.01743")
get_code_for_paper("2404.01743")
have("2404.01743")

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

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

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

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

Connect an agent — have() is free.