Code Monkey home page Code Monkey logo

xvision's Introduction

Xvision

Chest Xray image analysis using Deep Learning and exploiting Deep Transfer Learning technique for it with Tensorflow.

The maxpool-5 layer of a pretrained VGGNet-16(Deep Convolutional Neural Network) model has been used as the feature extractor here and then further trained on a 2-layer Deep neural network with SGD optimizer and Batch Normalization for classification of Normal vs Nodular Chest Xray Images.

Nodular vs Normal Chest Xray

Some specifications

Property Values
Pretrained Model VggNet-16
Optimizer used stochastic gradient descent(SGD)
Learning rate 0.01
Mini Batch Size 20
Epochs 20
2 Layers 512x512
GPU trained on Nvidia GEFORCE 920M

Evaluation

Confusion Matrix and Training Error Graph

Normal Nodule
Precision 0.7755102 0.55555556
Recall 0.76 0.57692308

Accuracy : 69.3333 %

DataSet

openi.nlm.nih.gov has a large base of Xray,MRI, CT scan images publically available.Specifically Chest Xray Images have been scraped, Normal and Nodule labbeled images are futher extrated for this task.

How to use ?

The above code can be used for Deep Transfer Learning on any Image dataset to train using VggNet as the PreTrained network.

Steps to follow

  1. Download Data- the script download images and saves corresponding disease label in json format.

python scraper.py <path/to/folder/to/save/images>

  1. Follow the scraper/process.ipynb notebook for Data processing and generate
  • Training images folder - All images for training
  • Testing images Folder - All images for testing
  • Training image labels file - Pickled file with training labels
  • Testing image labels file - Pickled file with testing labels
  1. Extract features(CNN Codes) from the maxpool:5 layer of PreTrained CovNet(VggNet) and save them beforehand for faster training of Neural network.

    python train.py <Training images folder> <Testing image folder> <Train images codes folder > <Test images codes folder>

  2. The extracted features are now used for training our 2-Layer Neural Network from scratch.The computed models are saved as tensorflow checkpoint after every Epoch.

    python train_model.py <Training images folder> <Train images codes folder> <Training image labels file> <Folder to save models>

  3. Finally the saved models are used for making predictions.Confusion Matrix is used as the Performance Metrics for this classifcation task.

    models>```

Some Predictions

Alt text

References

  1. Learning to Read Chest X-Rays: Recurrent Neural Cascade Model for Automated Image Annotation
  1. Deep Convolutional Neural Networks for Computer-Aided Detection: CNN Architectures, Dataset Characteristics and Transfer Learning

Contribute

If you want to contribute and add new feature feel free to send Pull request here :D

To report any bugs or request new features, head over to the Issues page

xvision's People

Contributors

ayush1997 avatar

Watchers

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