GithubHelp home page GithubHelp logo

tianchi-fft2's Introduction

An official implementation code of Rank 3.

Table of Contents

Background

Demo. The upper part shows the inputs (forged images) and the bottom part is the corresponding outputs (detection results).

In this competition, the competitors are required to proposed an algorithm for detect and locate the forged regions from an input image. The classic forensics algorithms are to locate the forged area by studying the anomalous clues in the image, e.g., JPEG compression artifacts and/or noise pattern. However, these cues are not robust enough, as almost all the input images undergo multiple complex post-processing, making the classic forensics unable to accurately detect and locate the forged regions. With the rapid development of deep learning (DL) in recent years, many DL-based models have been proposed for image forensics as their strong learning representation and generalization abilities.

Thereby, we proposed to use the U-Net [1] that utilizes Se-Resnext50 [2] as encoder and incorporates SCSE [3] attention module. It is worth mentioning that the SCSE attention module is effective as the "attention" operation performed by it can well allow the model to re-weight the characteristics of the tampered area. After proper data enhancement and validation set partitioning, we trained four models for model ensemble.

[1] Ronneberger. et. al., "U-net: Convolutional networks for biomedical image segmentation." Link.

[2] Hu et. al., "Squeeze-and-excitation networks." Link.

[3] Roy et. al., "Recalibrating fully convolutional networks with spatial and channel "squeeze and excitation" blocks." Link.

Dataset

The official dataset can be downloaded from Link after registration, or from Link directly.

Dependency

Please refer to the "requirements.txt" file.

Demo

To train the model:

sh code/train.sh

Note: the training/testing data can be download from the official website.

To test the model:

sh code/run.sh

Then the model will detect the images in the ../s2_data/data/test/ and save the results in the ../prediction_result/images/ directory. The pre-trained weights can be downloaded from Google Drive.

More explanation for "code/run.sh":

For "python main.py test --func=0": the "func=0" means the division of input images. The divided sub-images are save in "../s2_data/data/test_decompose_\*" (\* is the resolution of divided sub-images).
	
For "python main.py test --func=1 --size_idx=0 --fold=1 --tta=1":

    "func=1" means the detection of sub-images and output the probability that the sub-image is fake in pixel-level.
  
    "size_idx" represents the resolution of images (the value is the index of [384, 512, 768, 1024]).
  
    "fold" indicates the model trained by different split.
  
    "tta" is the Test Time Augmentation(1-8 means the fliping and/or rotation).
  
For "python main.py test --func=2": the "func=2" means the ensemble operation.

Licence

The program is made available for academic or non-commercial purposes only. For commercial use, please contact:

tianchi-fft2's People

Contributors

highwaywu 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tianchi-fft2's Issues

Could you please share the data?

Hi,

Thank you very much for sharing your solution. I am wondering if it is possible to share the training and testing dataset? Thanks.

model eval error

The error occurs when running main.py
File "/opt/data/private/code/tianchi_rank3/Tianchi_fft2/code/main_test.py", line 708, in
model.val()
File "/opt/data/private/code/tianchi_rank3/Tianchi_fft2/code/main_test.py", line 463, in val
a, b = metric(pre / 255, gt / 255)
File "/opt/data/private/code/tianchi_rank3/Tianchi_fft2/code/main_test.py", line 625, in metric
true_pos = float(np.logical_and(premask, groundtruth).sum()) # float for division
ValueError: operands could not be broadcast together with shapes (512,512,3) (1319,1319,3)

About the dataset

Hi bro,
This competition finished, so I can't access the dataset. Can you public the dataset with me?
Thank you so much,

求助,关于数据

本人对该比赛非常感兴趣,但是错过了比赛timing,已经无法报名从官方下载原始训练数据,希望能得到您的帮助,感谢

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.