SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2006.11392 · 2020

PraNet: Parallel Reverse Attention Network for Polyp Segmentation

arXiv · PDF · Open in the Atlas

Code that ran

8 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; 0 honoured the contract we drafted, 0 violated it and 8 have no contract verdict; 0 failures of our instrument; 1 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/2006.11392.json · badge: /api/ran/2006.11392.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
Thehunk1206/PRANet-Polyps-Segmentation community (classifier label)
classifier basis not recorded on the link
8 ran · 1 no recorded run
FunctionStatusWhere it lives
MAE Ran
ran on a synthesized input
Thehunk1206/PRANet-Polyps-Segmentation/utils/segmentation_metric.py
code served (permissive licence) · get_code("5f19cb59109dcf70")
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 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 tensorflow as tf
import numpy as np

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

# Create small tensors for the function
batch_size = 2
dim = 4

# y_mask: ground truth tensor
y_mask = tf.constant(np.random.randn(batch_size, dim).astype(np.float32))

# y_pred: predicted tensor
y_pred = tf.constant(np.random.randn(batch_size, dim).astype(np.float32))

ARGS = {
    "y_mask": y_mask,
    "y_pred": 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 EagerTensor, 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
dice_coef Ran
ran on a synthesized input
Thehunk1206/PRANet-Polyps-Segmentation/utils/segmentation_metric.py
code served (permissive licence) · get_code("9552f127ab03fa34")
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 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 tensorflow as tf

# Create small batch tensors with shape (batch_size, height, width, channels)
# Using batch_size=2, height=4, width=3, channels=1 for distinct dimensions
y_mask = tf.constant([
    [[[0.1], [0.9], [0.8]],
      [[0.2], [0.7], [0.6]],
      [[0.3], [0.5], [0.4]],
      [[0.0], [1.0], [0.9]]],
    [[[0.4], [0.8], [0.7]],
      [[0.5], [0.6], [0.5]],
      [[0.6], [0.4], [0.3]],
      [[0.7], [0.2], [0.1]]]
], dtype=tf.float32)

y_pred = tf.constant([
    [[[0.2], [0.8], [0.7]],
      [[0.3], [0.6], [0.5]],
      [[0.4], [0.4], [0.3]],
      [[0.1], [0.9], [0.8]]],
    [[[0.5], [0.7], [0.6]],
      [[0.6], [0.5], [0.4]],
      [[0.7], [0.3], [0.2]],
      [[0.8], [0.1], [0.0]]]
], dtype=tf.float32)

ARGS = {
    "y_mask": y_mask,
    "y_pred": y_pred,
}
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 EagerTensor, 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
get_model Ran
ran on a synthesized input
Thehunk1206/PRANet-Polyps-Segmentation/polyps_seg_image.py
code served (permissive licence) · get_code("bc51eaabbba19a1c")
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 Sequential. 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.keras import models, layers
import tempfile
import os

# Create a minimal valid Keras model and save it to a temporary file
temp_dir = tempfile.mkdtemp()
model_path = os.path.join(temp_dir, "test_model.keras")

# Build and save a simple model
simple_model = models.Sequential([
    layers.Dense(8, activation='relu', input_shape=(4,)),
    layers.Dense(2, activation='softmax')
])
simple_model.compile(optimizer='adam', loss='sparse_categorical_crossentropy')
simple_model.save(model_path)

# Define arguments for get_model
ARGS = {
    "model_path": model_path
}
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 Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential 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
get_weights Ran
ran on a synthesized input
Thehunk1206/PRANet-Polyps-Segmentation/utils/visualize_bce_iou_loss_weigth.py
code served (permissive licence) · get_code("4c598561b0fdb5cf")
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 4, dtype family float, shape (2, 4, 4, 1) 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 as tf

# Create a small mask tensor
# Shape: (batch=2, height=4, width=4, channels=1)
# This is a grayscale mask with values between 0 and 1
mask = tf.constant([
    [[[0.1], [0.2], [0.3], [0.4]],
     [[0.2], [0.5], [0.6], [0.5]],
     [[0.3], [0.6], [0.8], [0.6]],
     [[0.4], [0.5], [0.6], [0.7]]],
    
    [[[0.2], [0.3], [0.4], [0.5]],
     [[0.3], [0.6], [0.7], [0.6]],
     [[0.4], [0.7], [0.9], [0.7]],
     [[0.5], [0.6], [0.7], [0.8]]]
], dtype=tf.float32)

ARGS = {
    'mask': mask,
    'ksize': 31
}
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 EagerTensor, ndim 4, dtype family float, shape (2, 4, 4, 1) — shape (2, 4, 4, 1) 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_metric Ran
ran on a synthesized input
Thehunk1206/PRANet-Polyps-Segmentation/utils/segmentation_metric.py
code served (permissive licence) · get_code("653839c46c4ad30d")
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 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 tensorflow as tf
import numpy as np

# Create small test tensors
# y_mask: ground truth binary mask (batch_size=2, height=4, width=3)
y_mask = tf.constant([
    [[1.0, 0.0, 1.0], [0.0, 1.0, 0.0], [1.0, 1.0, 0.0], [0.0, 0.0, 1.0]],
    [[0.0, 1.0, 0.0], [1.0, 0.0, 1.0], [0.0, 1.0, 1.0], [1.0, 0.0, 0.0]]
], dtype=tf.float32)

# y_pred: predicted raw mask with probabilities (batch_size=2, height=4, width=3)
y_pred = tf.constant([
    [[0.8, 0.2, 0.9], [0.1, 0.7, 0.3], [0.6, 0.85, 0.15], [0.2, 0.05, 0.75]],
    [[0.15, 0.9, 0.25], [0.8, 0.1, 0.88], [0.05, 0.7, 0.92], [0.95, 0.2, 0.1]]
], dtype=tf.float32)

ARGS = {
    "y_mask": y_mask,
    "y_pred": 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 EagerTensor, 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
preprocess_input Ran
ran on a synthesized input
Thehunk1206/PRANet-Polyps-Segmentation/polyps_seg_video.py
code served (permissive licence) · get_code("77cacc9801b27be9")
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 4, dtype family float, shape (1, 352, 352, 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 numpy as np
import tensorflow as tf

# Create a small numpy array representing an image
# Shape: (height, width, channels) - using 64x64 RGB image
x = np.random.randint(0, 256, size=(64, 64, 3), dtype=np.uint8).astype(np.float32)

# Define ARGS dict with all parameters
ARGS = {
    "x": x,
    "input_size": 352
}
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 4, dtype family float, shape (1, 352, 352, 3) — shape (1, 352, 352, 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
process_output Ran
ran on a synthesized input
Thehunk1206/PRANet-Polyps-Segmentation/train_pranet.py
code served (permissive licence) · get_code("ed2b923957eea909")
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 (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 tensorflow as tf

# Create a small input tensor (batch_size=2, features=4)
x = tf.constant([[0.1, 0.5, 0.9, 0.3], [0.2, 0.8, 0.4, 0.6]], dtype=tf.float32)

# Define threshold parameter
threshold = 0.5

ARGS = {
    "x": x,
    "threshold": threshold,
}
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 EagerTensor, 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
read_mask Ran
ran on a synthesized input
Thehunk1206/PRANet-Polyps-Segmentation/utils/visualize_bce_iou_loss_weigth.py
code served (permissive licence) · get_code("c328287dda0da3e4")
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 4, dtype family float, shape (1, 512, 512, 1) 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 as tf
import tempfile
import os

# Create a temporary JPEG file for the mask
temp_dir = tempfile.mkdtemp()
temp_image_path = os.path.join(temp_dir, "test_mask.jpg")

# Create a simple test image and save it as JPEG
import numpy as np
from PIL import Image

# Create a small 64x64 grayscale test image
test_image_array = np.random.randint(0, 256, size=(64, 64), dtype=np.uint8)
test_image = Image.fromarray(test_image_array, mode='L')
test_image.save(temp_image_path, 'JPEG')

ARGS = {
    "path": temp_image_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, 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 4, dtype family float, shape (1, 512, 512, 1) — shape (1, 512, 512, 1) 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
read_image Not yet run
unverified (harvested, no recorded run)
Thehunk1206/PRANet-Polyps-Segmentation/polyps_seg_image.py
code served (permissive licence) · get_code("cc515a5c9eee8242")
How it ran

no invocation recorded.

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, 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 9 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

Colonoscopy is an effective technique for detecting colorectal polyps, which are highly related to colorectal cancer. In clinical practice, segmenting polyps from colonoscopy images is of great importance since it provides valuable information for diagnosis and surgery. However, accurate polyp segmentation is a challenging task, for two major reasons: (i) the same type of polyps has a diversity of size, color and texture; and (ii) the boundary between a polyp and its surrounding mucosa is not sharp. To address these challenges, we propose a parallel reverse attention network (PraNet) for accurate polyp segmentation in colonoscopy images. Specifically, we first aggregate the features in high-level layers using a parallel partial decoder (PPD). Based on the combined feature, we then generate a global map as the initial guidance area for the following components. In addition, we mine the boundary cues using a reverse attention (RA) module, which is able to establish the relationship between areas and boundary cues. Thanks to the recurrent cooperation mechanism between areas and boundaries, our PraNet is capable of calibrating any misaligned predictions, improving the segmentation accuracy. Quantitative and qualitative evaluations on five challenging datasets across six metrics show that our PraNet improves the segmentation accuracy significantly, and presents a number of advantages in terms of generalizability, and real-time segmentation efficiency.

For agents

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

get_harvested_code_for_paper("2006.11392")
get_code_for_paper("2006.11392")
have("2006.11392")

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

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

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

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

Connect an agent — have() is free.