TRACER: Extreme Attention Guided Salient Object Tracing Network implementation in PyTorch

Related tags

Deep Learning TRACER
Overview

TRACER: Extreme Attention Guided Salient Object Tracing Network

This paper was accepted at AAAI 2022 SA poster session.

PWC
PWC
PWC
PWC
PWC

Datasets

All datasets are available in public.

  • Download the DUTS-TR and DUTS-TE from Here
  • Download the DUT-OMRON from Here
  • Download the HKU-IS from Here
  • Download the ECSSD from Here
  • Download the PASCAL-S from Here
  • Download the edge GT from Here.

Data structure


TRACER
├── data
│   ├── DUTS
│   │   ├── Train
│   │   │   ├── images
│   │   │   ├── masks
│   │   │   ├── edges
│   │   ├── Test
│   │   │   ├── images
│   │   │   ├── masks
│   ├── DUT-O
│   │   ├── Test
│   │   │   ├── images
│   │   │   ├── masks
│   ├── HKU-IS
│   │   ├── Test
│   │   │   ├── images
│   │   │   ├── masks
      .
      .
      .

Requirements

  • Python 3.7.x
  • Pytorch >= 1.8.0
  • albumentations >= 0.5.1
  • matplotlib >= 3.3.3
  • tqdm >=4.54.0
  • scikit-learn > 0.23.2

Run

  • Run main.py scripts.

# For training TRACER-TE0 (e.g.)
python main.py train --arch 0 --img_size 320

# For testing TRACER with pre-trained model (e.g.)  
python main.py test --exp_num 0 --arch 0 --img_size 320

Configurations

--img_size: Input image resolution.
--arch: EfficientNet backbone scale: TE0 to TE7.
--frequency_radius: High-pass filter radius in the MEAM.
--gamma: channel confidence ratio \gamma in the UAM.
--denoise: Denoising ratio d in the OAM.
--RFB_aggregated_channel: # of channels in receptive field blocks.
--multi_gpu: Multi-GPU learning options.

Comments
  • Adaptive Pixel Intensity Loss generated NaN values while training

    Adaptive Pixel Intensity Loss generated NaN values while training

    Was training on custom human dataset. Batch Size = 8 No of training images = 3800

    No of steps trained before showing error = 75

    After 75th step It generated an error:

    RuntimeError: Function 'UpsampleBilinear2DBackward1' returned nan values in its 0th output.
    
    

    The model trained successfully when using BCE loss.

    We even checked for NaN values using torch.autograd.set_detect_anamoly(True) But it returned False stating that no NaN values were found

    opened by ThiruRJST 10
  • API_loss for multi_classes semantic segmentation

    API_loss for multi_classes semantic segmentation

    Hello,

    I would like to apply your API_loss to my 3_classes semantic segmentation task, but i am not sure it will be work or not after some modification? Do you have any advice? Look forward to your reply~

    Thanks, best wish!

    opened by DAgalaxy 6
  • Test on my data

    Test on my data

    Thanks for your great work! How can I use the trained model to test when I got the best model after training on my data? Because it seems that the pre training model is still used in the inference stage?

    opened by LitterWindwind 5
  • Reproduce you result on TE1. The MAE is much worse than yours on DUTS-TE

    Reproduce you result on TE1. The MAE is much worse than yours on DUTS-TE

    Hi, I tried your code to reproduce your result. I used python main.py train --arch 1 --img_size 320 to train the model. I did not change any setting in your code. I used four GPU to train this model. But the MAE I got on DUTS-TE is around 0.088 (it is 0.033 in paper). In picture, it shows the loss and the MAE of train and val set when training. It early stopped at 82th epoch. It kind of converged.

    I would like to know did you do any data augmentation off-line (I train on DUTS-TR and the edge gt you provided. I simply change the folder directory to meet your folder structure mentioned in readme)? Should I change any hyper parameter to achieve the same result? image

    opened by YiChuanChang 5
  • Reproducing paper results of TE7

    Reproducing paper results of TE7

    Tried training using the same hyper params of the paper in order to reproduce results on the DUTS-TE split for example.
    Apart from batch size which had to be reduced to 8, all other params were the same.
    However, I reach inferior results:

    Dataset:DUTS
    Test Loss:1.457 | MAX_F:0.903 | AVG_F:0.873 | MAE:0.030 | S_Measure:0.891, time: 68938.211s
    

    This is the training command I used:

    python main.py train --exp_num 1 --arch 7 --img_size 640 --model_path /data/outputs/TRACER --data_path /data/datasets/TRACER/ --multi_gpu true --num_workers 12 --batch_size 8
    

    The best model was achieved at epoch 14 as stated in the logs:

    Best Val Epoch:14 | Val Loss:38.960 | Val MAE:0.019
    

    And the training concluded after epoch 24 due to early stopping mechanism.

    opened by aviadmx 4
  • Reproducible results

    Reproducible results

    I tested the model for some time and witnessed something strange. The same mask doesn't show up if i entered the same input image. It seems there is a random seed generator in the code that affects the output results.

    Do you have any idea where something like this can happen ?

    opened by MohamedAliRashad 4
  • does TRACER pretrained model used for training?

    does TRACER pretrained model used for training?

    Hi, I downloaded pre-trained models of TRACER as you mentioned in README, but I'm confused about the step below Change the model name as 'best_model.pth' and put the weights to the path 'results/DUTS/TEx_0/best_model.pth'

    question is, this path is model save path, not pretrained model load path, and I could not find you load "best_model.pth" at start of training anywhere in your code, did I miss something?

    opened by Alan-Han 3
  • Runtime Speeds

    Runtime Speeds

    Hi, thanks for putting out an interesting paper and the code. I was testing it with the various pretrained weights on DUT-TE, and I'm getting an end-to-end speed of ~11 FPS on an RTX 2070 Super. Is that an expected speed?

    opened by vjsrinivas 3
  • How did you generate gt edge?

    How did you generate gt edge?

    Hi This is really an amazing work. I would like to reproduce your result. But I found you did not mentioned how you generate gt edge data in the paper. And I don't have the permission to access the gt edge data link in README.

    Of course, it would be wonderful if you can provide the full pre-trained model.

    opened by YiChuanChang 3
  • Accessing The Actual Predicited Masks

    Accessing The Actual Predicited Masks

    Hi, I tried to replicate your code and managed to replicate the test on the DUTS test set using TE0_0 pretrained model. However I would like to know how to get the actual masks predicted of the images after running the test. Thanks, Malcolm

    opened by malcolmagius19 2
  • Mask Generation?

    Mask Generation?

    Hello! And thank you for this work. I was curious if you would be releasing or amending (or if I missed it in your paper) the mask generation part of your testing code? To try against more complicated imagery in visual form?

    opened by LBNord 2
  • Bump certifi from 2021.5.30 to 2022.12.7

    Bump certifi from 2021.5.30 to 2022.12.7

    Bumps certifi from 2021.5.30 to 2022.12.7.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Losses decrease quite slowly with custom dataset

    Losses decrease quite slowly with custom dataset

    I created a custom dataset and tried training with arch 5 with image size 512 but the loss decreased quite slowly. Is this normal, or is my data problem?

    my loss Epoch:[001/200] Train Loss:99.721 | MAE:0.189 Valid Loss:82.747 | MAE:0.125 =============================Epoch:[002/200] Train Loss:91.156 | MAE:0.156 Valid Loss:91.560 | MAE:0.166 =============================Epoch:[003/200] Train Loss:91.532 | MAE:0.155 Valid Loss:78.634 | MAE:0.106 =============================Epoch:[004/200] Train Loss:86.963 | MAE:0.135 Valid Loss:76.247 | MAE:0.095 =============================Epoch:[005/200] Train Loss:85.692 | MAE:0.130 Valid Loss:74.397 | MAE:0.086 =============================Epoch:[006/200] Train Loss:85.188 | MAE:0.127 Valid Loss:74.988 | MAE:0.086 =============================Epoch:[007/200] Train Loss:84.972 | MAE:0.125 Valid Loss:73.414 | MAE:0.082 =============================Epoch:[008/200] Train Loss:83.838 | MAE:0.121 Valid Loss:75.131 | MAE:0.087 =============================Epoch:[009/200] Train Loss:83.403 | MAE:0.119

    opened by bbsvip 0
  • Custom Data

    Custom Data

    Hi, I'm getting this error. @Karel911

    <---- Training Params ----> Namespace(RFB_aggregated_channel=[32, 64, 128], action='train', arch='7', aug_ver=1, batch_size=8, channels=[24, 40, 112, 320], clipping=2, criterion='API', data_path='/home/nagas/TRACER/data', dataset='DUTS', denoise=0.93, epochs=100, exp_num=0, frequency_radius=16, gamma=0.1, img_size=640, lr=5e-05, lr_factor=0.1, model_path='/home/nagas/TRACER/results', multi_gpu=True, num_workers=4, optimizer='Adam', patience=5, save_map=None, scheduler='Reduce', seed=42, weight_decay=0.0001) train length : 42 val length : 3 Loaded pretrained weights for efficientnet-b7 0%| | 0/5 [00:00<?, ?it/s]ERROR: Unexpected segmentation fault encountered in worker. ERROR: Unexpected segmentation fault encountered in worker. ERROR: Unexpected segmentation fault encountered in worker. ERROR: Unexpected segmentation fault encountered in worker. 0%| | 0/5 [00:00<?, ?it/s] Traceback (most recent call last): File "/home/nagas/miniconda3/envs/tracer/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 990, in _try_get_data data = self._data_queue.get(timeout=timeout) File "/home/nagas/miniconda3/envs/tracer/lib/python3.7/multiprocessing/queues.py", line 104, in get if not self._poll(timeout): File "/home/nagas/miniconda3/envs/tracer/lib/python3.7/multiprocessing/connection.py", line 257, in poll return self._poll(timeout) File "/home/nagas/miniconda3/envs/tracer/lib/python3.7/multiprocessing/connection.py", line 414, in _poll r = wait([self], timeout) File "/home/nagas/miniconda3/envs/tracer/lib/python3.7/multiprocessing/connection.py", line 921, in wait ready = selector.select(timeout) File "/home/nagas/miniconda3/envs/tracer/lib/python3.7/selectors.py", line 415, in select fd_event_list = self._selector.poll(timeout) File "/home/nagas/miniconda3/envs/tracer/lib/python3.7/site-packages/torch/utils/data/_utils/signal_handling.py", line 66, in handler _error_if_any_worker_fails() RuntimeError: DataLoader worker (pid 20604) is killed by signal: Segmentation fault.

    The above exception was the direct cause of the following exception:

    Traceback (most recent call last): File "main.py", line 56, in main(args) File "main.py", line 35, in main Trainer(args, save_path) File "/home/nagas/TRACER/trainer.py", line 56, in init train_loss, train_mae = self.training(args) File "/home/nagas/TRACER/trainer.py", line 101, in training for images, masks, edges in tqdm(self.train_loader): File "/home/nagas/miniconda3/envs/tracer/lib/python3.7/site-packages/tqdm/std.py", line 1185, in iter for obj in iterable: File "/home/nagas/miniconda3/envs/tracer/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 521, in next data = self._next_data() File "/home/nagas/miniconda3/envs/tracer/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 1186, in _next_data idx, data = self._get_data() File "/home/nagas/miniconda3/envs/tracer/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 1152, in _get_data success, data = self._try_get_data() File "/home/nagas/miniconda3/envs/tracer/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 1003, in _try_get_data raise RuntimeError('DataLoader worker (pid(s) {}) exited unexpectedly'.format(pids_str)) from e RuntimeError: DataLoader worker (pid(s) 20604) exited unexpectedly

    opened by arjunsankar 1
  • multi class question

    multi class question

    Hello. Thank you for your wonderful research.

    I want to extend your methodology to multi-class classification. Is this possible? If possible, could you give me some implementation tips?

    opened by DeepHM 4
  • Adaptive pixel intensity loss

    Adaptive pixel intensity loss

    hi,thank you for your excellent work,I don't understand the following formula. Can you explain it for me? image image 1、Why does equation 8 need to be multiplied by yij? This will cause all background weights to be 0。 2、What is the meaning of adding 1.5 to the denominator in formula 9? Thank you very much and hope to get your reply!!

    opened by liuzhihui2046 1
Owner
Karel
Karel
Official implementation of "Can You Spot the Chameleon? Adversarially Camouflaging Images from Co-Salient Object Detection" in CVPR 2022.

Jadena Official implementation of "Can You Spot the Chameleon? Adversarially Camouflaging Images from Co-Salient Object Detection" in CVPR 2022. arXiv

Qing Guo 13 Nov 29, 2022
Computational modelling of ray propagation through optical elements using the principles of geometric optics (Ray Tracer)

Computational modelling of ray propagation through optical elements using the principles of geometric optics (Ray Tracer) Introduction By applying the

Son Gyo Jung 1 Jul 9, 2022
U2-Net: Going Deeper with Nested U-Structure for Salient Object Detection

The code for our newly accepted paper in Pattern Recognition 2020: "U^2-Net: Going Deeper with Nested U-Structure for Salient Object Detection."

Xuebin Qin 6.5k Jan 9, 2023
The official repo of the CVPR 2021 paper Group Collaborative Learning for Co-Salient Object Detection .

GCoNet The official repo of the CVPR 2021 paper Group Collaborative Learning for Co-Salient Object Detection . Trained model Download final_gconet.pth

Qi Fan 46 Nov 17, 2022
Code for ACM MM2021 paper "Complementary Trilateral Decoder for Fast and Accurate Salient Object Detection"

CTDNet The PyTorch code for ACM MM2021 paper "Complementary Trilateral Decoder for Fast and Accurate Salient Object Detection" Requirements Python 3.6

CVTEAM 28 Oct 20, 2022
Code for the TIP 2021 Paper "Salient Object Detection with Purificatory Mechanism and Structural Similarity Loss"

PurNet Project for the TIP 2021 Paper "Salient Object Detection with Purificatory Mechanism and Structural Similarity Loss" Abstract Image-based salie

Jinming Su 4 Aug 25, 2022
Code for the ICME 2021 paper "Exploring Driving-Aware Salient Object Detection via Knowledge Transfer"

TSOD Code for the ICME 2021 paper "Exploring Driving-Aware Salient Object Detection via Knowledge Transfer" Usage For training, open train_test, run p

Jinming Su 2 Dec 23, 2021
(CVPR 2021) Back-tracing Representative Points for Voting-based 3D Object Detection in Point Clouds

BRNet Introduction This is a release of the code of our paper Back-tracing Representative Points for Voting-based 3D Object Detection in Point Clouds,

null 86 Oct 5, 2022
(IEEE TIP 2021) Regularized Densely-connected Pyramid Network for Salient Instance Segmentation

RDPNet IEEE TIP 2021: Regularized Densely-connected Pyramid Network for Salient Instance Segmentation PyTorch training and testing code are available.

Yu-Huan Wu 41 Oct 21, 2022
CCAFNet: Crossflow and Cross-scale Adaptive Fusion Network for Detecting Salient Objects in RGB-D Images

Code and result about CCAFNet(IEEE TMM) 'CCAFNet: Crossflow and Cross-scale Adaptive Fusion Network for Detecting Salient Objects in RGB-D Images' IEE

zyrant丶 14 Dec 29, 2021
Github project for Attention-guided Temporal Coherent Video Object Matting.

Attention-guided Temporal Coherent Video Object Matting This is the Github project for our paper Attention-guided Temporal Coherent Video Object Matti

null 71 Dec 19, 2022
Code for 'Self-Guided and Cross-Guided Learning for Few-shot segmentation. (CVPR' 2021)'

SCL Introduction Code for 'Self-Guided and Cross-Guided Learning for Few-shot segmentation. (CVPR' 2021)' We evaluated our approach using two baseline

null 34 Oct 8, 2022
PocketNet: Extreme Lightweight Face Recognition Network using Neural Architecture Search and Multi-Step Knowledge Distillation

PocketNet This is the official repository of the paper: PocketNet: Extreme Lightweight Face Recognition Network using Neural Architecture Search and M

Fadi Boutros 40 Dec 22, 2022
PyTorch code for our paper "Attention in Attention Network for Image Super-Resolution"

Under construction... Attention in Attention Network for Image Super-Resolution (A2N) This repository is an PyTorch implementation of the paper "Atten

Haoyu Chen 71 Dec 30, 2022
GDR-Net: Geometry-Guided Direct Regression Network for Monocular 6D Object Pose Estimation. (CVPR 2021)

GDR-Net This repo provides the PyTorch implementation of the work: Gu Wang, Fabian Manhardt, Federico Tombari, Xiangyang Ji. GDR-Net: Geometry-Guided

null 169 Jan 7, 2023
A fast python implementation of Ray Tracing in One Weekend using python and Taichi

ray-tracing-one-weekend-taichi A fast python implementation of Ray Tracing in One Weekend using python and Taichi. Taichi is a simple "Domain specific

null 157 Dec 26, 2022
Implementation of light baking system for ray tracing based on Activision's UberBake

Vulkan Light Bakary MSU Graphics Group Student's Diploma Project Treefonov Andrey [GitHub] [LinkedIn] Project Goal The goal of the project is to imple

Andrey Treefonov 7 Dec 27, 2022
Official PyTorch implementation of "RMGN: A Regional Mask Guided Network for Parser-free Virtual Try-on" (IJCAI-ECAI 2022)

RMGN-VITON RMGN: A Regional Mask Guided Network for Parser-free Virtual Try-on In IJCAI-ECAI 2022(short oral). [Paper] [Supplementary Material] Abstra

null 27 Dec 1, 2022
Code for CVPR2021 paper "Learning Salient Boundary Feature for Anchor-free Temporal Action Localization"

AFSD: Learning Salient Boundary Feature for Anchor-free Temporal Action Localization This is an official implementation in PyTorch of AFSD. Our paper

Tencent YouTu Research 146 Dec 24, 2022