Lung fields segmentation on CXR images using convolutional neural networks.
Branch: master
Clone or download
Latest commit b06884e Dec 31, 2018

Lung Segmentation (2D)

Repository features UNet inspired architecture used for segmenting lungs on chest X-Ray images.


See the application of the model in Demo folder.


Implemented in Keras(2.0.4) with TensorFlow(1.1.0) as backend.

Use of data augmentation for training required slight changes to keras ImageDataGenerator. Generator in applies same transformation to both the image and the label mask.

To use this implementation one needs to load and preprocess data (see, train new model if needed ( and use the model for generating lung masks (

trained_model.hdf5 contains model trained on both data sets mentioned below.


Scores achieved on Montgomery and JSRT(With these masks. See (Measured using 5-fold cross-validation):

JSRT Montgomery
IoU 0.971 0.956
Dice 0.985 0.972