SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1903.00179 · 2019

Pyramid Feature Attention Network for Saliency detection

arXiv · PDF · Open in the Atlas

Code that ran

6 of 10 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 4 have no contract verdict; 2 failures of our instrument; 4 no recorded run), measured 2026-11-23; 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/1903.00179.json · badge: /api/ran/1903.00179.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
Wu0409/HSC_WSSS community (classifier label)
classifier basis not recorded on the link
6 ran · 4 no recorded run
FunctionStatusWhere it lives
HWC_to_CHW Ran
ran on a synthesized input
Wu0409/HSC_WSSS/utils/imutils.py
code served (permissive licence) · get_code("caa2fbfb63938959")
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 3, dtype family float, shape (2, 4, 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

# Create a small HWC (Height, Width, Channel) image
# H=4, W=3, C=2 to have distinct dimensions
img = np.random.rand(4, 3, 2).astype(np.float32)

ARGS = {
    "img": img
}
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 3, dtype family float, shape (2, 4, 3) — shape (2, 4, 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
adaptive_min_pooling_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Wu0409/HSC_WSSS/module/loss_helper.py
code served (permissive licence) · get_code("4c323e44c38f5fb2")
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 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 torch.nn.functional as F

torch.manual_seed(0)

# The function takes a single parameter 'x' which is a tensor
# It expects x to have 4 dimensions: (n, c, h, w)
# The function uses:
# - x.size() to get dimensions
# - torch.max(x, dim=1) to get max across channel dimension
# - view(n, -1) to reshape
# - torch.topk() to get top-k smallest values
# - F.relu() to apply ReLU
# - torch.sum() to sum values

# Create a small 4D tensor with shape (batch=2, channels=4, height=3, width=3)
# This gives us h*w = 9, so k = 9 // 4 = 2
x = torch.randn(2, 4, 3, 3)

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 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_eps_loss Ran
ran on a synthesized input
Wu0409/HSC_WSSS/module/loss_helper.py
code served (permissive licence) · get_code("1ddac962729fdc7c")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 torch.nn.functional as F

torch.manual_seed(0)

# Construct arguments for get_eps_loss
batch_size = 2
num_classes = 20
height = 4
width = 3

# cam: (batch_size, 21, height, width) - logits for 20 classes + 1 background
cam = torch.randn(batch_size, 21, height, width)

# saliency: (batch_size, 1, height//2, width//2) - will be interpolated to (height, width)
saliency = torch.rand(batch_size, 1, height // 2, width // 2)

# label: (batch_size, 20) - binary labels for each class
label = torch.randint(0, 2, (batch_size, 20)).float()

# tau: threshold for IoU
tau = 0.5

# alpha: blending parameter
alpha = 0.7

# intermediate: whether to return intermediate outputs
intermediate = True

ARGS = {
    "cam": cam,
    "saliency": saliency,
    "label": label,
    "tau": tau,
    "alpha": alpha,
    "intermediate": intermediate
}
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 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
max_norm Ran
ran on a synthesized input
Wu0409/HSC_WSSS/module/train_helper.py
code served (permissive licence) · get_code("ecf5f2ec37a98524")
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, 3, 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.functional as F

torch.manual_seed(0)

# Test case 1: 3D tensor (C, H, W)
p_3d = torch.randn(4, 3, 5)

# Test case 2: 4D tensor (N, C, H, W)
p_4d = torch.randn(2, 4, 3, 5)

# ARGS will test the 4D case as it's more complex
ARGS = {
    "p": p_4d,
    "e": 1e-05
}
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, 3, 5) — shape (2, 4, 3, 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
max_onehot Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Wu0409/HSC_WSSS/module/train_helper.py
code served (permissive licence) · get_code("a9c8bd4002c21246")
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 4, dtype family float, shape (2, 4, 3, 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

torch.manual_seed(0)

# The function max_onehot takes a 4D tensor x with shape (n, c, h, w)
# It finds the max across channels (dim=1) for channels 1 onwards
# and zeros out all non-max values in those channels
# Channel 0 is left untouched

# Create a small 4D tensor: (batch=2, channels=4, height=3, width=5)
x = torch.randn(2, 4, 3, 5)

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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, 3, 5) — shape (2, 4, 3, 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
random_crop_with_saliency Ran
ran on a synthesized input
Wu0409/HSC_WSSS/utils/imutils.py
code served (permissive licence) · get_code("7fac06b9c89542aa")
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 4, 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 random

random.seed(0)
np.random.seed(0)

# Create a small image array (height=10, width=8, channels=3)
imgarr = np.random.rand(10, 8, 3).astype(np.float32)

# Create a corresponding mask with same shape
mask = np.random.rand(10, 8, 3).astype(np.float32)

# Define crop size
crop_size = 6

ARGS = {
    "imgarr": imgarr,
    "mask": mask,
    "crop_size": crop_size
}
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 4, 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
convert_mxnet_to_torch Not yet run
unverified (harvested, no recorded run)
Wu0409/HSC_WSSS/network/resnet38d.py
code served (permissive licence) · get_code("95dfca01d7656b7c")
How it ran

no invocation recorded.

get_model Not yet run
unverified (harvested, no recorded run)
Wu0409/HSC_WSSS/module/model.py
code served (permissive licence) · get_code("ea15bd7bc92d037b")
How it ran

no invocation recorded.

predict_cam Not yet run
unverified (harvested, no recorded run)
Wu0409/HSC_WSSS/inference.py
code served (permissive licence) · get_code("610ad05e3fb49956")
How it ran

no invocation recorded.

preprocess Not yet run
unverified (harvested, no recorded run)
Wu0409/HSC_WSSS/inference.py
code served (permissive licence) · get_code("f44d3592aaea45c1")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 4 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 4 later) and 6 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
convert_mxnet_to_torch 7 other papers
1 dated earlier, 6 later
1803.10464 (2018-03)
Learning Pixel-level Semantic Affinity with Image-level Supervision for Weakly Supervised Semantic Segmentation
1911.01370 (2019-11)
Self-Supervised Difference Detection for Weakly-Supervised Semantic Segmentation
2008.01183 (2020-08)
Weakly-Supervised Semantic Segmentation via Sub-category Exploration
and 4 more not named here
adaptive_min_pooling_loss 3 other papers
3 later
2004.04581 (2020-04)
Self-supervised Equivariant Attention Mechanism for Weakly Supervised Semantic Segmentation
2104.07216 (2021-04)
Learning structure-aware semantic segmentation with image-level supervision
2108.03852 (2021-08)
Complementary Patch for Weakly Supervised Semantic Segmentation
HWC_to_CHW 2 other papers
2 later
1911.01370 (2019-11)
Self-Supervised Difference Detection for Weakly-Supervised Semantic Segmentation
2005.08104 (2020-05)
Single-Stage Semantic Segmentation from Image Labels
max_onehot 2 other papers
2 later
2004.04581 (2020-04)
Self-supervised Equivariant Attention Mechanism for Weakly Supervised Semantic Segmentation
2104.07216 (2021-04)
Learning structure-aware semantic segmentation with image-level supervision

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

Saliency detection is one of the basic challenges in computer vision. How to extract effective features is a critical point for saliency detection. Recent methods mainly adopt integrating multi-scale convolutional features indiscriminately. However, not all features are useful for saliency detection and some even cause interferences. To solve this problem, we propose Pyramid Feature Attention network to focus on effective high-level context features and low-level spatial structural features. First, we design Context-aware Pyramid Feature Extraction (CPFE) module for multi-scale high-level feature maps to capture rich context features. Second, we adopt channel-wise attention (CA) after CPFE feature maps and spatial attention (SA) after low-level feature maps, then fuse outputs of CA & SA together. Finally, we propose an edge preservation loss to guide network to learn more detailed information in boundary localization. Extensive evaluations on five benchmark datasets demonstrate that the proposed method outperforms the state-of-the-art approaches under different evaluation metrics.

For agents

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

get_harvested_code_for_paper("1903.00179")
get_code_for_paper("1903.00179")
have("1903.00179")

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

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

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

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

Connect an agent — have() is free.