Paper · 2021-05-18 · cs.CV
Progressively Normalized Self-Attention Network for Video Polyp Segmentation
PNS-Net segments polyps in colonoscopy video with normalized self-attention blocks: channels split into four groups, dilated neighbourhoods over five frames, soft attention, and two progressively stacked blocks. Author-reported: about 140 fps on one RTX 2080 and the best maxDice on all three test sets, with no post-processing.
Self-attentionLayer normalizationSemantic segmentationSegmentation evaluation (scoring foreground, saliency and segmentation masks)segmentationmedical-imagingvideoattention
arXivPDFCodeMarkdown16 min read
AI-compiled by claude-haiku-5-5 on 2026-11-12, not yet reviewed by a human. Every claim cites its source; check it when a detail matters.
In plain words
Doctors look for polyps, small growths on the bowel wall, by watching a camera video during a colonoscopy. A computer program that outlines each polyp in every frame has to cope with blurry edges, polyps that look like the surrounding tissue, and polyps of very different sizes. Older programs mostly looked at one frame at a time, or used convolution filters that only see a small patch.
PNS-Net looks at a short run of consecutive frames at once. Its core piece is a self-attention block: for each pixel, it asks which nearby pixels in the same frames and in the other frames of the clip look most alike, and mixes their information in. The block is built so that each part of the input is looked at through a different pattern of spacing, so that both slow and fast moving polyps are caught. A stack of two such blocks refines the high-level features, and a decoder turns them into a mask for each frame.
The authors report that this runs in real time and is more accurate than the baselines they compared against on three public video datasets.
TL;DR
- PNS-Net is a video polyp segmenter built on one kind of block: a normalized self-attention (NS) block that works over a clip of five frames §3.1.
- Each NS block splits channels into four groups, uses a different dilation per group, and multiplies the aggregated features by a soft-attention map §2.1.
- Two NS blocks are stacked on the high-level features, with a progressive residual §2.2 eq. 8–eq. 9.
- Author-reported: about 140 fps on one RTX 2080 and the best maxDice on CVC-300-TV, CVC-612-V and CVC-612-T tab. 1.
- The official code differs from the paper in several details that matter for reimplementation (see Paper vs code and Pitfalls).
Problem
Early and accurate polyp detection in colonoscopy is important, but manual inspection depends on clinician experience and misses polyps §1. Segmentation must be accurate and real-time, which is hard because polyp boundaries have low contrast with the surroundings and polyp shapes vary widely §1.
Image-based CNN segmenters ignore temporal information. Video methods that combine 2D and 3D convolutions are limited because the spatial correlation between frames is bounded by the kernel size, which hurts fast-moving polyps §1. Standard non-local self-attention captures long-range dependence, but its computation and memory cost limits the speed required for dense prediction on video §2.1, Motivation and Analysis. The paper assumes that polyps of different sizes move at different speeds, so the receptive field must adapt §2.1.
Method
The network has two parts. The NS block §2.1 is a self-attention module over a clip of T frames. The progressive learning strategy §2.2 places two NS blocks on the high-level encoder features and adds a residual connection, then a decoder produces one mask per frame fig. 1.
Normalized self-attention (NS) §2.1
The input is a feature map X of T frames, H × W pixels and C channels. Three 1 × 1 × 1 convolutions produce queries Q, keys K and values V eq. 1.
- Channel split: Q, K and V are each split into N groups along the channel axis. The paper uses N = 4 §2.1 §3.1.
- Query-dependent affinity: group i uses a dilation d_i = 2i − 1 and a window of half-size k = 3 §2.1. For each query pixel, the keys are sampled over all T frames inside that dilated window, giving T(2k+1)² candidates eq. 2. Affinity is a dot product between the query and these keys, scaled by sqrt(C/N) and passed through a softmax eq. 4.
- Normalization: the queries of each group are normalized before the dot product. The paper states that this is layer normalization along the temporal dimension §2.1 eq. 3. Keys and values are not normalized.
- Aggregation: the affinities weight the values in the same windows, giving one aggregated feature per group eq. 5.
- Soft attention: the affinity matrices of all groups are concatenated, and a channel-wise maximum gives one soft-attention value per position eq. 6.
- Output: the aggregated features are concatenated, passed through a learned weight W_T, and multiplied channel-wise by the soft-attention map. The block returns the input plus this update eq. 7.
# Normalized self-attention block [§2.1] [eq. 1]-[eq. 7]
# Input: features (T, H, W, C) for T consecutive frames
# Output: features + update, same shape [eq. 7]
def normalized_self_attention(features):
# Three 1x1x1 embeddings of the input [§2.1] [eq. 1]
queries = theta(features) # (T, H, W, C)
keys = phi(features) # (T, H, W, C)
values = g(features) # (T, H, W, C)
# Split the channels of each embedding into N groups [§2.1]
queries = split_channels(queries, N) # N x (T, H, W, C/N)
keys = split_channels(keys, N) # N x (T, H, W, C/N)
values = split_channels(values, N) # N x (T, H, W, C/N)
affinities = []
aggregated = []
for i in range(1, N + 1):
# Normalize the queries of group i along time [§2.1] [eq. 3]
query_i = layer_norm_over_time(queries[i - 1])
# Dilation 2i-1, window half-size k=3, all T frames [§2.1] [eq. 2]
scores_i = window_dot(query_i, keys[i - 1], k=3, dilation=2 * i - 1)
# Scale by sqrt(C/N) and normalize with softmax [§2.1] [eq. 4]
affinity_i = softmax(scores_i / sqrt(C / N))
# Weighted sum of values over the same windows [§2.1] [eq. 5]
aggregated_i = window_weighted_sum(affinity_i, values[i - 1])
affinities.append(affinity_i)
aggregated.append(aggregated_i)
# Soft attention: channel-wise max over all groups [§2.1] [eq. 6]
soft_map = max_over_channels(concat(affinities)) # (T, H, W, 1)
# Learned projection of the concatenated aggregates [§2.1] [eq. 7]
projected = concat(aggregated) @ W_T # (T, H, W, C)
# Channel-wise product with the soft map, then residual [§2.1] [eq. 7]
update = projected * soft_map
return features + updateThe paper gives the window sums as formulas with sums over m, n and t eq. 2, and does not give boundary behaviour for windows that leave the frame.
Progressive learning strategy §2.2
- Encoder: a Res2Net-50 backbone, the same as PraNet's §2.2. Features are taken from the conv3_4 layer (low level) and the conv4_6 layer (high level) §2.2. A light RFB-like module reduces the channels to 24 for the low-level and 32 for the high-level features §2.2 [fn. 2].
- Progressive refinement: the high-level features of the T frames are reshaped into a temporal tensor and refined by R NS blocks stacked in sequence eq. 8. The paper uses R = 2 §3.1 §3.3. The refined features are added to the input once more, around the whole stack eq. 9.
- Decoder: the low-level features and the refined high-level features go into a two-stage UNet-like decoder §2.2. The paper does not describe the decoder's internal layers.
- Output and loss: the decoder output is passed through a sigmoid, and the training loss is the standard cross-entropy §2.2.
# Progressive refinement of high-level features [§2.2] [eq. 8] [eq. 9]
# Input: high (T, H, W, C_h) for T frames; blocks = [NS, NS] (R = 2)
def progressive_refine(high, blocks):
# Stack the NS blocks; each one returns its input plus an update [eq. 8]
refined = high
for block in blocks:
refined = block(refined)
# Add the input back once more around the whole stack [§2.2] [eq. 9]
return high + refined# Forward pass of PNS-Net for one clip [§2.2] [fig. 1]
# Input: clip (T, 3, 256, 448) with T = 5 frames [§3.1]
# Output: one mask per frame, values in (0, 1)
def pns_net(clip):
# Low-level (conv3_4) and high-level (conv4_6) features [§2.2]
low, high = backbone_features(clip)
# Channel reduction: 24 for low, 32 for high [§2.2] [fn. 2]
low = rfb_low(low)
high = rfb_high(high)
# Refine the high-level clip with the two NS blocks [§2.2] [eq. 8, 9]
high = progressive_refine(high, [ns_block_1, ns_block_2])
# Two-stage UNet-like decoder; its layers are not stated [§2.2]
# How the high map is aligned to the low map is not stated either
mask = decoder(low, high)
# Sigmoid output, trained with cross-entropy [§2.2]
return sigmoid(mask)Hyperparameters
| Name | Value | Where | Notes |
|---|---|---|---|
| Clip length T (test) | 5 frames | §3.1 Testing and Runtime | Training clip length not stated in the paper; code uses 5 config.py |
| Input resolution | 256 × 448 | §3.1 Testing and Runtime | Code also uses 256 × 448 config.py |
| Attention groups N | 4 | §3.1 Training, item ii | Code hard-codes 4 heads PNS_Module.py |
| Window half-size k | 3 | §3.1 Training, item ii | Code uses radius 3, so a 7 × 7 window PNS_Module.py |
| Dilation d_i | 2i − 1, i = 1..N (1, 3, 5, 7) | §2.1 eq. 2 | Code lists 1, 3, 5, 7 PNS_Module.py |
| Stacked NS blocks R | 2 | §3.1 Training, item ii; §3.3 | Code hard-codes two blocks, with no R parameter PNS_Network.py |
| Channels, high level | 32 | §2.2 footnote 2 | PNS_Network.py |
| Channels, low level | 24 | §2.2 footnote 2 | PNS_Network.py |
| Channels per group C/N | 8 (derived from 32 / 4) | §2.1 eq. 4 | PNS_Module.py |
| Affinity scale | sqrt(C/N) = sqrt(8) | eq. 4 | PNS_Module.py |
| Optimizer | Adam | §3.1 Training, item i | MyTrain_Pretrain.py |
| Pretraining learning rate | 1e-4 (initial) | §3.1 Training, item i | Code multiplies by 0.1 every 50 epochs utils.py MyTrain_Pretrain.py. Paper does not state a schedule |
| Pretraining weight decay | 1e-4 | §3.1 Training, item i | MyTrain_Pretrain.py |
| Pretraining length | converges after 100 epochs | §3.1 Training, item i | Code runs 101 epochs (index 0 to 100) MyTrain_Pretrain.py |
| Fine-tuning learning rate | 1e-4 | §3.1 Training, item ii | config.py |
| Fine-tuning weight decay | not stated | §3.1 | Code uses 1e-4 MyTrain_Finetune.py |
| Fine-tuning length | 1 epoch | §3.1 Training, item ii | config.py |
| Batch size | not stated | — | Code: 4 for both stages config.py; the pretraining batch size of 20 in config.py is unused config.py |
| Gradient clipping | not stated | — | Code clamps every gradient element to ±0.5 utils.py config.py |
| Loss | cross-entropy on the sigmoid output | §2.2 Decoder and learning strategy | Code uses binary cross-entropy MyTrain_Finetune.py |
| Input augmentation | not stated | — | Code: random crop and resize (7 for video, 15 for images), horizontal flip with p = 0.5 dataloader.py dataloader.py |
| Normalization statistics | not stated | — | Training reads a statistics file dataloader.py; the test script hard-codes mean and std MyTest_Finetune.py |
| Decoder dropout | not stated | — | Code: Dropout2d with p = 0.1 before the 1 × 1 output conv PNS_Network.py |
| Pretraining datasets | Kvasir, plus training sets of CVC-300, CVC-612 and ASU-Mayo | §3.1 Training, item i | Code pretrains on config's image list, IVPS-TrainSet config.py dataloader.py |
| Fine-tuning datasets | ASU-Mayo, CVC-300 and CVC-612 training sets | §3.1 Training, item ii | Code uses ASU-Mayo_Clinic, CVC-ClinicDB-612 and CVC-ColonDB-300 config.py |
Results
Author-reported. Setup: the three video test sets (CVC-300-TV, CVC-612-V, CVC-612-T) §3.1 §3.2. Baselines (UNet, UNet++, ResUNet, ACSNet, PraNet) were retrained by the authors, on the same data and with their default settings §3.2 Baselines. Speed is measured on one RTX 2080 GPU for PNS-Net without post-processing §3.1. Model size and the hardware used for the baseline speeds are not stated in the uncommented text. Metrics are maxDice, maxSpecificity, maxIoU, S-measure (Sα), E-measure (Eφ) and mean absolute error (M) §3.2.
Table 1 tab. 1 — quantitative results. Bold marks the best value in the paper.
| Dataset | Metric | UNet | UNet++ | ResUNet | ACSNet | PraNet | PNS-Net (ours) |
|---|---|---|---|---|---|---|---|
| all | Speed (fps) | 108 | 45 | 20 | 35 | 97 | 140 |
| CVC-300-TV | maxDice ↑ | 0.639 | 0.649 | 0.535 | 0.738 | 0.739 | 0.840 |
| CVC-300-TV | maxSpe ↑ | 0.963 | 0.944 | 0.852 | 0.987 | 0.993 | 0.996 |
| CVC-300-TV | maxIoU ↑ | 0.525 | 0.539 | 0.412 | 0.632 | 0.645 | 0.745 |
| CVC-300-TV | Sα ↑ | 0.793 | 0.796 | 0.703 | 0.837 | 0.833 | 0.909 |
| CVC-300-TV | Eφ ↑ | 0.826 | 0.831 | 0.718 | 0.871 | 0.852 | 0.921 |
| CVC-300-TV | M ↓ | 0.027 | 0.024 | 0.052 | 0.016 | 0.016 | 0.013 |
| CVC-612-V | maxDice ↑ | 0.725 | 0.684 | 0.752 | 0.804 | 0.869 | 0.873 |
| CVC-612-V | maxSpe ↑ | 0.971 | 0.952 | 0.939 | 0.929 | 0.983 | 0.991 |
| CVC-612-V | maxIoU ↑ | 0.610 | 0.570 | 0.648 | 0.712 | 0.799 | 0.800 |
| CVC-612-V | Sα ↑ | 0.826 | 0.805 | 0.829 | 0.847 | 0.915 | 0.923 |
| CVC-612-V | Eφ ↑ | 0.855 | 0.830 | 0.877 | 0.887 | 0.936 | 0.944 |
| CVC-612-V | M ↓ | 0.023 | 0.025 | 0.023 | 0.054 | 0.013 | 0.012 |
| CVC-612-T | maxDice ↑ | 0.729 | 0.740 | 0.617 | 0.782 | 0.852 | 0.860 |
| CVC-612-T | maxSpe ↑ | 0.971 | 0.975 | 0.950 | 0.975 | 0.986 | 0.992 |
| CVC-612-T | maxIoU ↑ | 0.635 | 0.635 | 0.514 | 0.700 | 0.786 | 0.795 |
| CVC-612-T | Sα ↑ | 0.810 | 0.800 | 0.727 | 0.838 | 0.886 | 0.903 |
| CVC-612-T | Eφ ↑ | 0.836 | 0.817 | 0.758 | 0.864 | 0.904 | 0.903 |
| CVC-612-T | M ↓ | 0.058 | 0.059 | 0.084 | 0.053 | 0.038 | 0.038 |
Text summary §3.2: on CVC-300-TV the paper reports a maxDice gain of about 10 points over the best baseline. On CVC-612-V and CVC-612-T the paper reports consistent gains over the other methods §3.2. The figures in the table do not support "consistent" on every metric; see Pitfalls.
Qualitative results on CVC-612-T are shown in fig. 2, described in §3.2.
Table 2 tab. 2 — ablation on two test sets. The ✓ marks follow the paper's column labels. The paper does not define the "Base" column. Row #8 is the configuration the paper uses.
| No. | Base | N | Soft | Norm | R | 300-TV maxDice | 300-TV maxIoU | 300-TV Sα | 300-TV Eφ | 612-T maxDice | 612-T maxIoU | 612-T Sα | 612-T Eφ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| #1 | ✓ | – | – | – | – | 0.778 | 0.665 | 0.850 | 0.858 | 0.850 | 0.778 | 0.896 | 0.885 |
| #2 | ✓ | 1 | – | – | 1 | 0.755 | 0.650 | 0.865 | 0.844 | 0.850 | 0.779 | 0.896 | 0.891 |
| #3 | ✓ | 2 | – | – | 1 | 0.790 | 0.679 | 0.876 | 0.872 | 0.825 | 0.746 | 0.870 | 0.856 |
| #4 | ✓ | 4 | – | – | 1 | 0.809 | 0.709 | 0.893 | 0.884 | 0.834 | 0.760 | 0.881 | 0.867 |
| #5 | ✓ | 8 | – | – | 1 | 0.763 | 0.663 | 0.867 | 0.842 | 0.787 | 0.702 | 0.841 | 0.829 |
| #6 | ✓ | 4 | ✓ | – | 1 | 0.829 | 0.729 | 0.896 | 0.903 | 0.852 | 0.784 | 0.895 | 0.897 |
| #7 | ✓ | 4 | ✓ | ✓ | 1 | 0.827 | 0.732 | 0.897 | 0.898 | 0.856 | 0.792 | 0.898 | 0.896 |
| #8 | ✓ | 4 | ✓ | ✓ | 2 | 0.840 | 0.745 | 0.909 | 0.921 | 0.860 | 0.795 | 0.903 | 0.903 |
| #9 | ✓ | 4 | ✓ | ✓ | 3 | 0.737 | 0.609 | 0.793 | 0.751 | 0.732 | 0.613 | 0.776 | 0.728 |
Row #8 matches the CVC-300-TV and CVC-612-T columns of Table 1 tab. 1. The paper's conclusions from Table 2: N = 4 is the best group count on CVC-300-TV §3.3, channel split; soft attention improves CVC-612-T §3.3, soft attention; R = 2 is best, and R = 3 is worse on both sets §3.3, number of NS blocks.
Paper vs code
Official code: GewelsJI/PNS-Net at commit
02bff88a9c1ebe4899cc0fc17c01ea7a76922bb9 (Apache-2.0). Paper and code are
compared at this commit. The owner's account is the first author's, and the
README names Ge-Peng Ji as the author. The paper's footnote links
dpfan.net/pranet/; at the time of compilation that page contained unrelated
promotional content and no PNS-Net code, so it is not used. Searches run: the
paper's links and footnote, then the GitHub repository search for "PNS-Net
polyp", which returned this repository.
The discrepancies below were found by reading the code. Paper citations come first, code citations second.
- Normalization axis. The paper normalizes the queries along the temporal
dimension §2.1 eq. 3. The code builds
nn.LayerNorm([8, 16, 28])and applies it to each frame's query group, normalizing over channels and space, not time PNS_Module.py PNS_Module.py. The code's layer norm also has learnable gain and bias of that shape. - Feature strides. Footnote 2 gives H^l = H'/4 and H^h = H'/8 §2.2. The
code takes the low level from
layer2and the high level fromlayer3, which are stride 8 and 16 in a 256 × 448 input PNS_Network.py. The layer names conv3_4 and conv4_6 in the text §2.2 agree with the code; the footnote sizes do not. - Number of NS blocks. The paper says R = 2 is a setting §3.1 and gives R as a tunable parameter §3.3. The code has exactly two named blocks and no R parameter PNS_Network.py PNS_Network.py.
- Decoder. The paper describes a two-stage decoder §2.2. The code applies
one decoder stage (
conbine_feature) PNS_Network.py PNS_Network.py. - Pretraining data. The paper pretrains on Kvasir and the training sets of
CVC-300, CVC-612 and ASU-Mayo §3.1. The pretraining script builds its dataset
from
img_dataset_list, which defaults toIVPS-TrainSetand reads only that set's frames config.py dataloader.py. The video training sets are not used in the pretraining script. - Pretraining schedule. The paper states Adam with learning rate 1e-4 and weight decay 1e-4 §3.1. The code multiplies the learning rate by 0.1 every 50 epochs utils.py MyTrain_Pretrain.py.
- Gradient clipping. The paper does not mention clipping. The code clamps each gradient element to ±0.5 utils.py MyTrain_Finetune.py.
- Learning-rate groups. The fine-tuning script puts parameters named
temporal_highin a base group MyTrain_Finetune.py. No module of PNSNet has that name PNS_Network.py, so the base group is empty. Both groups use 1e-4, so the result is the same either way. - Batch size. The paper does not state it §3.1. Both scripts use
video_batchsize, which is 4 MyTrain_Pretrain.py MyTrain_Finetune.py config.py. The config'spretrain_batchsizeof 20 is never read config.py. - Pretraining epochs. The paper says the static part converges after 100
epochs §3.1. The loop runs
range(pretrain_epoches + 1), which is 101 epochs MyTrain_Pretrain.py. - Residual placement. The paper's NS block includes its own residual eq. 7.
The code's
NS_Blockreturns only the update, and the residual is added inPNSNet.forwardPNS_Module.py PNS_Network.py. The two match, but a block used alone would differ from the paper's Z. - Dead code.
squeeze, a 1024 → 32 projection, is defined but not used in the forward pass PNS_Network.py. - Test-time normalization. Training reads a statistics file dataloader.py, and the test script hard-codes mean and std MyTest_Finetune.py. I did not load the statistics file, so I have not checked that the values agree.
- Test clips. The paper says five frames are sampled §3.1. The code uses consecutive, non-overlapping clips, with the last clip moved to end on the final frame. Some frames are therefore predicted twice, and the later write wins MyTest_Finetune.py. Predictions are saved as sigmoid values × 255 with no threshold MyTest_Finetune.py.
- Training clips. The paper does not state how training clips are chosen. The code takes consecutive five-frame clips, starting at index 1 of each video dataloader.py.
- Speed. The code has no timing script, so the 140 fps figure is not reproduced here §3.1 PNS_Network.py.
- Pretrained encoder. The code loads
res2net50_v1b_26w_4s(pretrained=True)PNS_Network.py. The paper does not name the pretraining data for the encoder. - Evaluation. The code includes MATLAB evaluation scripts under
eval/. I did not check their metric definitions against the paper's text.
Pitfalls
- Normalization axis. Following the paper (temporal layer norm) and the code (per-frame norm over channels and space) gives different models. The code behaviour is the one that produced the reported numbers, but the paper's text is what a reader sees. Pick one and state it.
- Fixed spatial size. The code's
LayerNorm([8, 16, 28])fixes the high-level feature map at 16 × 28, so any other input size fails PNS_Module.py. The paper's 256 × 448 input is the only size that works. - Border handling. Neighbours outside the frame get a score of 0 and enter the softmax denominator, but they contribute no value sa.cu sa.cu. Attention mass leaks to the border, which the paper does not mention.
- Scaling. Affinities are divided by sqrt(8) in the code, and sqrt(C/N) in the paper eq. 4 PNS_Module.py. Both agree for C = 32 and N = 4.
- CUDA dependency. The NS block needs the custom
self_cuda_backendextension PNS_Module.py. The README targets PyTorch 1.1 and CUDA 10.x README.md. Expect to rebuild it on a current toolchain, or write a pure-PyTorch version and check it against the CUDA output. - Memory. Each query stores T(2k+1)² affinities per group. For k = 3 and T = 5 that is 245 per query per group eq. 2 eq. 4. The paper gives no memory figure.
- Undefined ablation column. Table 2's "Base" column has no definition in the paper tab. 2.
- Claims beyond the table. The text says the best result is "consistent" on CVC-612-V and CVC-612-T §3.2, and the conclusion says the best results hold "on all existing publicly available datasets under six metrics" §4. In Table 1 the one exception is CVC-612-T Eφ, where PraNet has 0.904 and PNS-Net 0.903 tab. 1. On CVC-612-T M the two tie at 0.038 tab. 1.
- Split counts. §3.1 gives 12 and 29 clips split 60/20/20. §3.2 gives six test videos for CVC-300-TV and five each for CVC-612-V and CVC-612-T §3.1 §3.2. The counts do not match, and the exact split is not stated. Use the released test folders.
- Speed. The paper gives about 140 fps without stating whether this is per frame or per clip, the batch size, or whether I/O is included §3.1.
- Overfitting claim. The paper says more NS blocks overfit small datasets §3.3. This is an interpretation, not a tested result.
- Missing optimizer details. Batch size, gradient clipping, data augmentation and normalization statistics are not stated in the paper. The code's choices are listed in Hyperparameters.
- Footnote link. The paper's footnote URL does not lead to PNS-Net code (see Paper vs code). Do not use it.
Lineage
- Builds on: the non-local self-attention block of Wang et al. §2.1, the channel-split and query-dependent design of a video salient object detection model by Gu et al. (AAAI 2020) §2.1, and layer normalization (Ba et al., arXiv:1607.06450, as cited in the paper's references) §2.1. The PNS block is a change to these, not an extension of any specific card.
- Compared against: UNet, UNet++, ResUNet, ACSNet and PraNet §3.2. PraNet is also the source of the Res2Net-50 backbone §2.2. The RFB-like module follows Liu et al. §2.2.
- Superseded by: not known from this wiki.
Source and license
Adapted from “Progressively Normalized Self-Attention Network for Video Polyp Segmentation” by Ge-Peng Ji, Yu-Cheng Chou, Deng-Ping Fan, Geng Chen, Huazhu Fu, Debesh Jha, Ling Shao (arXiv:2105.08468), used under CC BY 4.0. Changes: condensed and restructured for implementation, with tables, equations and algorithms taken from the paper and its code, each cited to its source. Not affiliated with or endorsed by the authors. Code citations refer to https://github.com/GewelsJI/PNS-Net at commit 02bff88a9c1e (Apache-2.0). Any quoted code is shown under that license.