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

Related tags

Deep LearningTRACER
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
PointNet: Deep Learning on Point Sets for 3D Classification and Segmentation

PointNet: Deep Learning on Point Sets for 3D Classification and Segmentation Created by Charles R. Qi, Hao Su, Kaichun Mo, Leonidas J. Guibas from Sta

Charles R. Qi 4k Dec 30, 2022
MNIST, but with Bezier curves instead of pixels

bezier-mnist This is a work-in-progress vector version of the MNIST dataset. Samples Here are some samples from the training set. Note that, while the

Alex Nichol 15 Jan 16, 2022
This repo contains code to reproduce all experiments in Equivariant Neural Rendering

Equivariant Neural Rendering This repo contains code to reproduce all experiments in Equivariant Neural Rendering by E. Dupont, M. A. Bautista, A. Col

Apple 83 Nov 16, 2022
High-performance moving least squares material point method (MLS-MPM) solver.

High-Performance MLS-MPM Solver with Cutting and Coupling (CPIC) (MIT License) A Moving Least Squares Material Point Method with Displacement Disconti

Yuanming Hu 2.2k Dec 31, 2022
LeViT a Vision Transformer in ConvNet's Clothing for Faster Inference

LeViT: a Vision Transformer in ConvNet's Clothing for Faster Inference This repository contains PyTorch evaluation code, training code and pretrained

Facebook Research 504 Jan 02, 2023
Generative Exploration and Exploitation - This is an improved version of GENE.

GENE This is an improved version of GENE. In the original version, the states are generated from the decoder of VAE. We have to check whether the gere

33 Mar 23, 2022
Identifying a Training-Set Attack’s Target Using Renormalized Influence Estimation

Identifying a Training-Set Attack’s Target Using Renormalized Influence Estimation By: Zayd Hammoudeh and Daniel Lowd Paper: Arxiv Preprint Coming soo

Zayd Hammoudeh 2 Oct 08, 2022
This is a Tensorflow implementation of Learning to See in the Dark in CVPR 2018

Learning-to-See-in-the-Dark This is a Tensorflow implementation of Learning to See in the Dark in CVPR 2018, by Chen Chen, Qifeng Chen, Jia Xu, and Vl

5.3k Jan 01, 2023
Reporting and Visualization for Hazardous Events

Reporting and Visualization for Hazardous Events

Jv Kyle Eclarin 2 Oct 03, 2021
Code for "Training Neural Networks with Fixed Sparse Masks" (NeurIPS 2021).

Code for "Training Neural Networks with Fixed Sparse Masks" (NeurIPS 2021).

Varun Nair 37 Dec 30, 2022
The code for our NeurIPS 2021 paper "Kernelized Heterogeneous Risk Minimization".

Kernelized-HRM Jiashuo Liu, Zheyuan Hu The code for our NeurIPS 2021 paper "Kernelized Heterogeneous Risk Minimization"[1]. This repo contains the cod

Liu Jiashuo 8 Nov 20, 2022
WHENet: Real-time Fine-Grained Estimation for Wide Range Head Pose

WHENet: Real-time Fine-Grained Estimation for Wide Range Head Pose Yijun Zhou and James Gregson - BMVC2020 Abstract: We present an end-to-end head-pos

368 Dec 26, 2022
Code for Talk-to-Edit (ICCV2021). Paper: Talk-to-Edit: Fine-Grained Facial Editing via Dialog.

Talk-to-Edit (ICCV2021) This repository contains the implementation of the following paper: Talk-to-Edit: Fine-Grained Facial Editing via Dialog Yumin

Yuming Jiang 221 Jan 07, 2023
FCN (Fully Convolutional Network) is deep fully convolutional neural network architecture for semantic pixel-wise segmentation

FCN_via_Keras FCN FCN (Fully Convolutional Network) is deep fully convolutional neural network architecture for semantic pixel-wise segmentation. This

Kento Watanabe 48 Aug 30, 2022
A Gura parser implementation for Python

Gura Python parser This repository contains the implementation of a Gura (compliant with version 1.0.0) format parser in Python. Installation pip inst

Gura Config Lang 19 Jan 25, 2022
Context-Sensitive Misspelling Correction of Clinical Text via Conditional Independence, CHIL 2022

cim-misspelling Pytorch implementation of Context-Sensitive Spelling Correction of Clinical Text via Conditional Independence, CHIL 2022. This model (

Juyong Kim 11 Dec 19, 2022
HarDNeXt: Official HarDNeXt repository

HarDNeXt-Pytorch HarDNeXt: A Stage Receptive Field and Connectivity Aware Convolution Neural Network HarDNeXt-MSEG for Medical Image Segmentation in 0

5 May 26, 2022
A Kitti Road Segmentation model implemented in tensorflow.

KittiSeg KittiSeg performs segmentation of roads by utilizing an FCN based model. The model achieved first place on the Kitti Road Detection Benchmark

Marvin Teichmann 890 Jan 04, 2023
Fast and Context-Aware Framework for Space-Time Video Super-Resolution (VCIP 2021)

Fast and Context-Aware Framework for Space-Time Video Super-Resolution Preparation Dependencies PyTorch 1.2.0 CUDA 10.0 DCNv2 cd model/DCNv2 bash make

Xueheng Zhang 1 Mar 29, 2022
Convolutional Neural Networks on Graphs with Fast Localized Spectral Filtering

Graph ConvNets in PyTorch October 15, 2017 Xavier Bresson http://www.ntu.edu.sg/home/xbresson https://github.com/xbresson https://twitter.com/xbresson

Xavier Bresson 287 Jan 04, 2023