SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1906.02283 · 2019

Improving RetinaNet for CT Lesion Detection with Dense Masks from Weak RECIST Labels

arXiv · PDF · Open in the Atlas

Code that ran

7 of 13 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 7 have no contract verdict; 0 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/1906.02283.json · badge: /api/ran/1906.02283.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
fizyr/keras-retinanet community (classifier label)
classifier basis not recorded on the link
7 ran · 6 no recorded run
FunctionStatusWhere it lives
bbox_transform_inv Ran
ran on a synthesized input
fizyr/keras-retinanet/keras_retinanet/backend/backend.py
code served (permissive licence) · get_code("5b0e0c7a212d74ca")
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 EagerTensor, ndim 3, dtype family float, shape (2, 3, 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 numpy as np
from tensorflow import keras

# Set seed for reproducibility
np.random.seed(0)

# Create small test data
batch_size = 2
num_boxes = 3

# boxes: shape (B, N, 4) with (x1, y1, x2, y2)
# Using small distinct values for each dimension
boxes = np.array([
    [[10.0, 20.0, 30.0, 40.0],
     [50.0, 60.0, 70.0, 80.0],
     [5.0, 15.0, 25.0, 35.0]],
    [[100.0, 110.0, 120.0, 130.0],
     [200.0, 210.0, 220.0, 230.0],
     [150.0, 160.0, 170.0, 180.0]]
], dtype=np.float32)

# deltas: shape (B, N, 4) with (d_x1, d_y1, d_x2, d_y2)
deltas = np.array([
    [[0.1, 0.2, 0.15, 0.25],
     [0.05, 0.1, 0.08, 0.12],
     [0.2, 0.15, 0.1, 0.2]],
    [[0.12, 0.18, 0.14, 0.22],
     [0.06, 0.09, 0.07, 0.11],
     [0.19, 0.16, 0.09, 0.21]]
], dtype=np.float32)

# Define mean and std
mean = [0, 0, 0, 0]
std = [0.2, 0.2, 0.2, 0.2]

ARGS = {
    'boxes': boxes,
    'deltas': deltas,
    'mean': mean,
    'std': std
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 3, dtype family float, shape (2, 3, 4) — shape (2, 3, 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
filter_detections Ran
ran on a synthesized input
fizyr/keras-retinanet/keras_retinanet/layers/filter_detections.py
code served (permissive licence) · get_code("876bc5be4083b8e9")
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. 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 tensorflow
import numpy as np

# Create small test tensors
num_boxes = 2
num_classes = 3

# boxes: (num_boxes, 4) with coordinates (x1, y1, x2, y2)
boxes = tensorflow.constant([
    [10.0, 20.0, 50.0, 60.0],
    [15.0, 25.0, 55.0, 65.0]
], dtype=tensorflow.float32)

# classification: (num_boxes, num_classes) with class scores
classification = tensorflow.constant([
    [0.1, 0.8, 0.1],
    [0.7, 0.2, 0.1]
], dtype=tensorflow.float32)

# other: list of additional tensors to filter along with boxes and classification
# Create a tensor of shape (num_boxes, 2) as an example
other_tensor_1 = tensorflow.constant([
    [1.0, 2.0],
    [3.0, 4.0]
], dtype=tensorflow.float32)

other = [other_tensor_1]

# Define all arguments
ARGS = {
    "boxes": boxes,
    "classification": classification,
    "other": other,
    "class_specific_filter": True,
    "nms": True,
    "score_threshold": 0.05,
    "max_detections": 300,
    "nms_threshold": 0.5
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list — a list 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
focal Ran
ran on a synthesized input
fizyr/keras-retinanet/keras_retinanet/losses.py
code served (permissive licence) · get_code("94708d13faf10d34")
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 function. 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 tensorflow as tf
from tensorflow import keras

# Create the focal loss function
def focal(alpha=0.25, gamma=2.0, cutoff=0.5):
    """ Create a functor for computing the focal loss.

    Args
        alpha: Scale the focal weight with alpha.
        gamma: Take the power of the focal weight with gamma.
        cutoff: Positive prediction cutoff for soft targets

    Returns
        A functor that computes the focal loss using the alpha and gamma.
    """

    def _focal(y_true, y_pred):
        """ Compute the focal loss given the target tensor and the predicted tensor.

        As defined in https://arxiv.org/abs/1708.02002

        Args
            y_true: Tensor of target data from the generator with shape (B, N, num_classes).
            y_pred: Tensor of predicted data from the network with shape (B, N, num_classes).

        Returns
            The focal loss of y_pred w.r.t. y_true.
        """
        labels = y_true[:, :, :-1]
        anchor_state = y_true[:, :, -1]
        classification = y_pred
        indices = tensorflow.where(keras.backend.not_equal(anchor_state, -1))
        labels = tensorflow.gather_nd(labels, indices)
        classification = tensorflow.gather_nd(classification, indices)
        alpha_factor = keras.backend.ones_like(labels) * alpha
        alpha_factor = tensorflow.where(keras.backend.greater(labels, cutoff), alpha_factor, 1 - alpha_factor)
        focal_weight = tensorflow.where(keras.backend.greater(labels, cutoff), 1 - classification, classification)
        focal_weight = alpha_factor * focal_weight ** gamma
        cls_loss = focal_weight * keras.backend.binary_crossentropy(labels, classification)
        normalizer = tensorflow.where(keras.backend.equal(anchor_state, 1))
        normalizer = keras.backend.cast(keras.backend.shape(normalizer)[0], keras.backend.floatx())
        normalizer = keras.backend.maximum(keras.backend.cast_to_floatx(1.0), normalizer)
        return keras.backend.sum(cls_loss) / normalizer
    return _focal

# Create test tensors
# y_true shape: (B=2, N=3, num_classes+1=5) where last dimension includes anchor_state
y_true = tf.constant([
    [[0.1, 0.2, 0.3, 0.4, 1.0],
     [0.5, 0.6, 0.7, 0.8, 1.0],
     [0.2, 0.3, 0.4, 0.5, -1.0]],
    [[0.1, 0.2, 0.3, 0.4, 1.0],
     [0.6, 0.7, 0.8, 0.9, 1.0],
     [0.3, 0.4, 0.5, 0.6, 1.0]]
], dtype=tf.float32)

# y_pred shape: (B=2, N=3, num_classes=4)
y_pred = tf.constant([
    [[0.2, 0.3, 0.4, 0.5],
     [0.4, 0.5, 0.6, 0.7],
     [0.3, 0.4, 0.5, 0.6]],
    [[0.15, 0.25, 0.35, 0.45],
     [0.5, 0.6, 0.7, 0.8],
     [0.25, 0.35, 0.45, 0.55]]
], dtype=tf.float32)

ARGS = {
    "alpha": 0.25,
    "gamma": 2.0,
    "cutoff": 0.5,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
parse_args Ran
ran on a synthesized input
fizyr/keras-retinanet/keras_retinanet/bin/convert_model.py
code served (permissive licence) · get_code("2cc742d85463061d")
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 Namespace. 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 argparse

ARGS = {
    'args': [
        'model_checkpoint.pt',
        'model_inference.pt',
        '--backbone', 'resnet50',
        '--config', 'config.ini',
        '--nms-threshold', '0.5',
        '--score-threshold', '0.05',
        '--max-detections', '300',
        '--parallel-iterations', '32'
    ]
}
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 Namespace — a Namespace output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Namespace 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
resize_images Ran
ran on a synthesized input
fizyr/keras-retinanet/keras_retinanet/backend/backend.py
code served (permissive licence) · get_code("f72ab75d77478491")
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 SymbolicTensor. 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 tensorflow
import numpy as np

# Create a small batch of images
# TensorFlow image format is typically [batch, height, width, channels]
# Using shape [2, 4, 3, 1] for batch=2, height=4, width=3, channels=1
images = tensorflow.constant(np.random.randn(2, 4, 3, 1).astype(np.float32))

# Target size for resizing
size = [8, 6]

# Method for interpolation
method = 'bilinear'

# Align corners flag
align_corners = False

ARGS = {
    'images': images,
    'size': size,
    'method': method,
    'align_corners': align_corners
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SymbolicTensor — a SymbolicTensor 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
shift Ran
ran on a synthesized input
fizyr/keras-retinanet/keras_retinanet/backend/backend.py
code served (permissive licence) · get_code("95689b7dfe9f464e")
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 EagerTensor, ndim 2, dtype family float, shape (30, 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 tensorflow
from tensorflow import keras
import numpy as np

# Set seed for reproducibility
np.random.seed(0)
tensorflow.random.set_seed(0)

# Create small stand-in arguments for the shift function

# shape: A tuple representing the shape of the feature map (height, width)
# Using small distinct values: 3 for height, 5 for width
shape = (3, 5)

# stride: An integer stride value
stride = 16

# anchors: A tensor of shape [num_anchors, 4] representing anchor boxes
# Each anchor is [x1, y1, x2, y2]
# Using 2 anchors with 4 coordinates each
anchors = keras.backend.constant([
    [0.0, 0.0, 10.0, 10.0],
    [5.0, 5.0, 15.0, 15.0]
], dtype=keras.backend.floatx())

ARGS = {
    "shape": shape,
    "stride": stride,
    "anchors": anchors
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 2, dtype family float, shape (30, 4) — shape (30, 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
smooth_l1 Ran
ran on a synthesized input
fizyr/keras-retinanet/keras_retinanet/losses.py
code served (permissive licence) · get_code("1b6055f42f4750b8")
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 function. 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 tensorflow as tf
from tensorflow import keras
import numpy as np

def smooth_l1(sigma=3.0):
    """ Create a smooth L1 loss functor.

    Args
        sigma: This argument defines the point where the loss changes from L2 to L1.

    Returns
        A functor for computing the smooth L1 loss given target data and predicted data.
    """
    sigma_squared = sigma ** 2

    def _smooth_l1(y_true, y_pred):
        """ Compute the smooth L1 loss of y_pred w.r.t. y_true.

        Args
            y_true: Tensor from the generator of shape (B, N, 5). The last value for each box is the state of the anchor (ignore, negative, positive).
            y_pred: Tensor from the network of shape (B, N, 4).

        Returns
            The smooth L1 loss of y_pred w.r.t. y_true.
        """
        regression = y_pred
        regression_target = y_true[:, :, :-1]
        anchor_state = y_true[:, :, -1]
        indices = tf.where(keras.backend.equal(anchor_state, 1))
        regression = tf.gather_nd(regression, indices)
        regression_target = tf.gather_nd(regression_target, indices)
        regression_diff = regression - regression_target
        regression_diff = keras.backend.abs(regression_diff)
        regression_loss = tf.where(keras.backend.less(regression_diff, 1.0 / sigma_squared), 0.5 * sigma_squared * keras.backend.pow(regression_diff, 2), regression_diff - 0.5 / sigma_squared)
        normalizer = keras.backend.maximum(1, keras.backend.shape(indices)[0])
        normalizer = keras.backend.cast(normalizer, dtype=keras.backend.floatx())
        return keras.backend.sum(regression_loss) / normalizer
    return _smooth_l1

# Create small tensors for testing
batch_size = 2
num_anchors = 3
feature_dims = 4

# y_pred: shape (B, N, 4) - predicted regression values
y_pred = tf.constant(np.random.randn(batch_size, num_anchors, 4).astype(np.float32))

# y_true: shape (B, N, 5) - target values (4 regression targets + 1 anchor state)
# anchor_state: 1 for positive anchors, 0 or -1 for others
y_true_values = np.random.randn(batch_size, num_anchors, 4).astype(np.float32)
anchor_states = np.array([[[1.0], [0.0], [1.0]], [[1.0], [-1.0], [0.0]]], dtype=np.float32)
y_true = tf.constant(np.concatenate([y_true_values, anchor_states], axis=2))

ARGS = {
    "sigma": 3.0
}

# Create loss function and test it
loss_fn = smooth_l1(**ARGS)
loss_value = loss_fn(y_true, y_pred)
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
create_generator Not yet run
unverified (harvested, no recorded run)
fizyr/keras-retinanet/keras_retinanet/bin/debug.py
code served (permissive licence) · get_code("f7a1ea7a29ff5fcb")
How it ran

no invocation recorded.

create_generator Not yet run
unverified (harvested, no recorded run)
fizyr/keras-retinanet/keras_retinanet/bin/evaluate.py
code served (permissive licence) · get_code("28a0b71399edaa38")
How it ran

no invocation recorded.

densenet_retinanet Not yet run
unverified (harvested, no recorded run)
fizyr/keras-retinanet/keras_retinanet/models/densenet.py
code served (permissive licence) · get_code("b24fdf51323ff27f")
How it ran

no invocation recorded.

parse_args Not yet run
unverified (harvested, no recorded run)
fizyr/keras-retinanet/keras_retinanet/bin/debug.py
code served (permissive licence) · get_code("f3b605b2e9899c4d")
How it ran

no invocation recorded.

parse_args Not yet run
unverified (harvested, no recorded run)
fizyr/keras-retinanet/keras_retinanet/bin/evaluate.py
code served (permissive licence) · get_code("fb87a61525f75536")
How it ran

no invocation recorded.

run Not yet run
unverified (harvested, no recorded run)
fizyr/keras-retinanet/keras_retinanet/bin/debug.py
code served (permissive licence) · get_code("4f808cfce01205f8")
How it ran

no invocation recorded.

Also present in other papers' code

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

Accurate, automated lesion detection in Computed Tomography (CT) is an important yet challenging task due to the large variation of lesion types, sizes, locations and appearances. Recent work on CT lesion detection employs two-stage region proposal based methods trained with centroid or bounding-box annotations. We propose a highly accurate and efficient one-stage lesion detector, by re-designing a RetinaNet to meet the particular challenges in medical imaging. Specifically, we optimize the anchor configurations using a differential evolution search algorithm. For training, we leverage the response evaluation criteria in solid tumors (RECIST) annotation which are measured in clinical routine. We incorporate dense masks from weak RECIST labels, obtained automatically using GrabCut, into the training objective, which in combination with other advancements yields new state-of-the-art performance. We evaluate our method on the public DeepLesion benchmark, consisting of 32,735 lesions across the body. Our one-stage detector achieves a sensitivity of 90.77% at 4 false positives per image, significantly outperforming the best reported methods by over 5%.

For agents

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

get_harvested_code_for_paper("1906.02283")
get_code_for_paper("1906.02283")
have("1906.02283")

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

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

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

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

Connect an agent — have() is free.