Giter Club home page Giter Club logo

defectdetection's Introduction

Defect Detection

Ning Yu, Xiaohui Shen, Zhe Lin, Radomír Měch, Connelly Barnes
WACV 2018

Abstract

In this paper, we introduce the problem of simultaneously detecting multiple photographic defects. We aim at detecting the existence, severity, and potential locations of common photographic defects related to color, noise, blur and composition. The automatic detection of such defects could be used to provide users with suggestions for how to improve photos without the need to laboriously try various correction methods. Defect detection could also help users select photos of higher quality while filtering out those with severe defects in photo curation and summarization.

To investigate this problem, we collected a large-scale dataset of user annotations on seven common photographic defects, which allows us to evaluate algorithms by measuring their consistency with human judgments. Our new dataset enables us to formulate the problem as a multi-task learning problem and train a multi-column deep convolutional neural network (CNN) to simultaneously predict the severity of all the defects. Unlike some existing single-defect estimation methods that rely on low-level statistics and may fail in many cases on natural photographs, our model is able to understand image contents and quality at a higher level. As a result, in our experiments, we show that our model has predictions with much higher consistency with human judgments than low-level methods as well as several baseline CNN models. Our model also performs better than an average human from our user study.

Prerequisites

  • Linux
  • NVIDIA GPU + CUDA + CuDNN
  • Caffe

Datasets

  • Training image addresses and seven defect severity ground truth are in the file data/train/defect_training_gt.csv.
  • Testing image addresses and seven defect severity ground truth are in the file data/test/defect_testing_gt.csv.

Network Architectures (visualize from ethereon)

  • Multi-column holistic-input GoogLeNet is in the file prototxt/GoogLeNet/holistic/deploy_holistic.prototxt.
  • Multi-column patch-input GoogLeNet is in the file prototxt/GoogLeNet/patch/deploy_patch.prototxt.

Pre-trained Models

Infogain Weights

  • If users launch their own training or testing with the infogain loss as Eq. 1 in our paper, they can use our pre-computed weights at data/infogain_mat/, which follows the formulation as Eq. 4 in our supplemental material.

Testing

  • First download testing images from the addresses in the first column in the file data/test/defect_testing_gt.csv into data/test/original_resolution/. Or put customized images into that directory.
  • Then run
python test.py -iPath data/test/original_resolution -oPath output/GoogLeNet -holisticDeployPath prototxt/GoogLeNet/holistic/deploy_holistic.prototxt -holisticWeightsPath model/GoogLeNet/weights_holistic.caffemodel -patchDeployPath prototxt/GoogLeNet/patch/deploy_patch.prototxt -patchWeightsPath model/GoogLeNet/weights_patch.caffemodel -gpu 0
  • The final seven defect severity prediction results are saved in the file output/GoogLeNet/defect_scores_combined.csv.
  • Testing images are sorted in the descent order according to each defect severity prediction and visualized correspondingly to the file output/GoogLeNet/defect_scores_combined_*.html.

Evaluation

  • We use the cross-class ranking correlation (proposed in Section 3.2 in our paper) to evaluate the testing results.
  • Assuming the rows and columns of data/test/defect_testing_gt.csv and output/GoogLeNet/defect_scores_combined.csv align to each other, run
python evaluate.py -gtPath data/test/defect_testing_gt.csv -predPath output/GoogLeNet/defect_scores_combined.csv -oPath output/GoogLeNet
  • The evaluation measures are saved in the file output/GoogLeNet/evaluation.csv.

Citation

@inproceedings{yu2018learning,
    author = {Yu, Ning and Shen, Xiaohui and Lin, Zhe and M{\v e}ch, Radom{\' i}r and Barnes, Connelly},
    title = {Learning to Detect Multiple Photographic Defects},
    booktitle = {IEEE Winter Conference on Applications of Computer Vision (WACV)},
    year = {2018}
}

Acknowledgement

  • This research is supported by Adobe Research Funding.
  • We thank to the photographers for licensing photos under Creative Commons or public domain.
  • We express gratitudes to the caffe-googlenet-bn repository as we benefit a lot from their code.

Note

  • It is for non-commercial research purpose only. Adobe has filed a patent for this work: see here.

defectdetection's People

Contributors

ningyu1991 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

Watchers

 avatar  avatar

defectdetection's Issues

training code

I am a complete novice, could you please provide me with the code of training for reference?

Data Augmentation

Hi, I am confused about the data augmentation.
How to do it with each defects?
Thanks.

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.