Giter VIP home page Giter VIP logo

defect-detection-classifier's Introduction

Defect-Detection-Classifier

Defect detection of water-cooled wall. The sample is hard to collect, so we only have a little dataset 
which includes 320 training images(160 normal+ 160 defect) and 80 testing images(40 normal+ 40 defect). 
The image size is 256*256. The dataset is collected by Dong Jin. Thanks the advice from Yu Fang about 
the using of gcForest.

dataset

the above three images are normal examples and the below are defect.

normal1 normal2 normal3 defect1 defect2 defect3

Classifier

We use Support Vector Machine(SVM) with different feature extractors, deep forest and Convolutional Neural 
Network to train the classifier.
  • Gauss filter+LBP+SVM(rbf kernel)

    Use Gaussian filter and laplacian operator to denoise and extracts edges, then LBP(Local Binary Patt-
    ern) extract features of preprocessed images as the input of SVM.
    
  • CNN+SVM(rbf kernel)

    Use VGG16 to extract features as the input of SVM., the weight of VGG16 is trained on ImageNet.
    
  • simple CNN(3 Conv+1 FC)

    Build a simple neural network to train. The network consists of three convolutional layers and a fully
    connected layer.
    
  • transfer Learning(VGG16)

    Use VGG16 to extract features as input of a simple network that consists of a fully-connected layer.
    
  • Neural Network Search

    Use NNS to search a best network.
    
  • gcForest

    Use deep forest(Only cascade forest structure/With multi-grained forests) to train the ensemble classifier. 
    

Result

classifier accuracy
Gauss filter+LBP+SVM(rbf kernel) 97.25%
CNN+SVM(rbf kernel) 73.75%
simple CNN(3 Conv+1 FC) 68.75%
transfer Learning(VGG16) 82.50%
Neural Network Search 82.28%
gcForest (without multi-grained forests) 77.50%
gcForest (with multi-grained forests, i=8) 88.75%

run

Dependencies

  • Keras sudo pip install keras
  • NumPy sudo pip install numpy
  • h5py sudo pip install h5py
  • scikit-learn sudo pip install scikit-learn
  • gcForest
  • AutoKeras
    compile from source code and revise according to this issue

run

# read README.md in models folder and download weight file of pre-trained VGG on the ImageNet dataset.
# dataset
cp -rf normal_add/* ./normal
rm -rf normal_add/
cp -rf defect_add/* ./defect
rm -rf defect_add
# CNN+SVM(rbf kernel)
python cnnSVM.py
# simple CNN(3 Conv+1 FC)
python CNNclassifier.py
# transfer Learning(VGG16)
python transferLearning.py
# gcForest (without multi-grained forests) 
python ./data/train/write_label.py
python ./data/test/write_label.py
cd 
python ./gcForest/demo_Defect-Detection-Classifier.py --model ./gcForest/demo_Defect-Detection-Classifier-ca.json
# gcForest (with multi-grained forests, i=8) 
python ./gcForest/demo_Defect-Detection-Classifier.py --model ./gcForest/demo_Defect-Detection-Classifier-gc8.json
# Neural Network Search
python ./data/train/write_label2.py
python ./data/test/write_label2.py
python autoCNNclassifier.py

reference

scikit-learn tutorial
Building powerful image classification models using very little data

defect-detection-classifier's People

Contributors

liulongma avatar

Watchers

James Cloos avatar chongbingbao avatar

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.