AI Medical Imaging Analysis

A library for AI automated segmentation on x-ray images

Project Details

  • Type: Project
  • What We Did: Customized AI Library
  • Tools Used: Pytorch, C++, openCV
  • Started on: May 2020
  • Status: On Going

Customer Problem

The customer asked for a C++ library to be integrated in its x-ray scanners. This library has to detect the x-ray collimator(identify the four ‘blades’ and provide their position) and the background(identify the area that does not belong to the part of the body that is exposed but is part of the background) of every different anatomical scans in less than 200ms without using GPU dedicated hardware.

Our Solution

Segmentation of the collimator device and background in radiographic images: the algorithm receives an X-ray image as input and produces a binary mask whose contours match the edges of the collimator device or the binary mask of the background. The model used for this task is Residual Unet, state of the art regarding 3D semantic segmentation tasks, adapted to two-dimensional images. The weights of each convolution layer of the model are initialized according to the Kaiming rule.

The model is composed of a series of convolution layers followed by a series of upsampling layers, the architecture also provides for connections called skip connections. The number of kernels of the first convolution layer determines the number of parameters of the model, in the experiments carried out the number of initial kernels is 8 (for a total of 737961 parameters) or 16 (for a total of 2947025 parameters). The model is optimized using a gradient descent algorithm, Adam, the parameters of this algorithm are: learning rate: 0.001, beta (0.9, 0.999), epsilon 1e- 8, weight decay 1e-8. The cost function used to optimize the model consists of the reciprocal of the DICE score.

The model input consists of 16-bit B / W (single channel) images, whose values ​​are converted into floating point, the images are resized to a size of 512x512 pixels. Subsequently, for each image, a normalization is applied to the value of each pixel by dividing by the maximum value of the image. In this way each image has a range of values ​​that goes from 0 to 1.The number of images per iteration used in the optimization phase is stabilized at 4.

All the algorithms have been integrated into a C++ multi-platform library which can be easily integrated into existing systems (e.g. as .dll) and used through its dedicated API.

image

image

image