Skip to main content

A CNN to segment X-Ray images

Project description


XNet is a Convolutional Neural Network designed for the segmentation of X-Ray images into bone, soft tissue and open beam regions. Specifically, it performs well on small datasets with the aim to minimise the number of false positives in the soft tissue class.


  • Built on a typical encoder-decoder architecture as inspired by SegNet.

  • Additional feature extraction stage, with weight sharing across some layers.

  • Fine and coarse grained feature preservation through concatenation of layers.

  • L2 regularisation at each of the convolutional layers, to decrease overfitting.

The architecture is described in the file.


XNet outputs a mask of equal size to the input images.


XNet is trained on a small dataset which has undergone augmention. Examples of this augmentation step can be found in the augmentations.ipynb notebook in the Augmentations folder. Similarly the Training folder contains python scripts that perform the necessary augementations.

Running from the Training folder calls various other scripts to perform one of two possible ways of augmenting the images:

  • 'On the fly augmentation' where a new set of augmentations is generated at each epoch.

  • Pre-augmented images.


XNet was benchmarked against two of the leading segmentation networks:

  • Simplified SegNet (found in the file)

  • UNet (found in the file)


We trained on a dataset of:

  • 150 X-Ray images.

  • No scatter correction.

  • 1500x1500 .tif image downsampled to 200x200

  • 20 human body part classes.

  • Highly imbalanced.

As this work grew out of work with a corporation we are sadly unable to share the propriatory data we used.

More information

For more information and context see the conference poster Poster.pdf.

Please note that some of the path variables may need to be corrected in order to utilise the current filing system. These are planned to be updated in the future.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

durham-XNet-0.0.4.tar.gz (18.9 kB view hashes)

Uploaded source

Built Distribution

durham_XNet-0.0.4-py3-none-any.whl (36.4 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page