Git Product home page Git Product logo

transalnet's Introduction

TranSalNet: Towards perceptually relevant visual saliency prediction

This repository provides the Pytorch implementation of TranSalNet: Towards perceptually relevant visual saliency prediction published in the Neurocomputing paper.

Overview:

arch

Requirements

  • Python 3.8
  • Pytorch 1.7.1
  • Torchvision 0.8.2
  • OpenCV-Python 4.5.1
  • SciPy 1.6.0
  • tqdm 4.56.0

Pretrained Models

TranSalNet has been implemented in two variants: TranSalNet_Res with the CNN backbone of ResNet-50 and TranSalNet_Dense with the CNN backbone of DenseNet-161.
Pre-trained models on SALICON training set for the above two variants can be download at:

It is also necessary to download ResNet-50 (for TranSalNet_Res) and DenseNet-161 (TranSalNet_Dense) pre-trained models on ImageNet. These models can be download at:

Quick Start

The pre-trained models should be downloaded and put in the folder named pretrained_models in the code folder first, then the following example codes can be used smoothly.
We have prepared two Jupyter Notebook files (.ipynb) for usage of TranSalNet.

  • Testing: testing.ipynb. It can be used to compute and obtain the visual saliency maps of input images.
    By default, the test image and the corresponding output are in the folder named testing, and the models are loaded with parameters pre-trained on the SALCON training set.
  • Fine-tuning or Training from scratch: training&fine-tuning.ipynb
    Data prepare for fine-tuning and training:
    │ dataset/
    ├── train_ids.csv
    ├── val_ids.csv
    ├── train/
    │   ├── train_stimuli/
    │   │   ├── ......
    │   ├── train_saliency/
    │   │   ├── ......
    │   ├── train_fixation/
    │   │   ├── ......
    ├── val/
    │   ├── val_stimuli/
    │   │   ├── ......
    │   ├── val_saliency/
    │   │   ├── ......
    │   ├── val_fixation/
    │   │   ├── ......
    

In the above two .ipynb files, it is possible to choose whether TranSalNet_Res or TranSalNet_Dense is used, depending on the needs and preferences.

Please note: The spatial size of inputs should be 384×288 (width×height).

Citation

If this work is helpful, please consider citing:

@article{TranSalNet,
title = {TranSalNet: Towards perceptually relevant visual saliency prediction},
journal = {Neurocomputing},
year = {2022},
issn = {0925-2312},
doi = {https://doi.org/10.1016/j.neucom.2022.04.080},
author = {Jianxun Lou and Hanhe Lin and David Marshall and Dietmar Saupe and Hantao Liu},
}

transalnet's People

Contributors

ljovo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

transalnet's Issues

Loss value

Hello,
I have some questions. What was your model's best value for the loss after training on trainset?
In other words, except the loss value that is illustrated during training, is there another metric in your scripts that we can check to see if our model's performance is convincing and is not disappointing?
Moreover, for evaluation on Salicon should we send the test results to their website?

The train loss is nan

I retrain fine-tune&train.ipynb with the same dataset and setup, but the train loss is very easy to be nan. Have you encountered this situation? Can you provide a more detailed experimental environment such as random seed and progress of dataset?

input size

Hello, can the input size be other width and height?

Loading Fixation Maps of Salicon dataset

Hello,
In your train script you used MyDataset function and one of the arguments of this function is fixation_dir=r'datasets\val\val_fixation/ . My question is that from which source you downloaded fixation maps (bmp files that also are mentioned in the csv files)? This is because the format of the fixation maps that are provided in this link are mat files. Should we do preprocessing with one of your scripts?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.