8
B. Solano-Rojas et al.
4.2 Data Preprocessing
MRI image data are groups of images. Every image is a slice, and the group
of slices shapes the MRI. Every image or slice is a matrix of pixels. Each slice
has an associated spatial thickness because they represent reality. Also, every
pixel in every slice has a spacing, that is the space they represent. Thus, the
data is volumetric or, in other words, rectangular cuboids. Taking that into
consideration, we do the following transformations to the data. First, we convert
all volumetric pixels (voxels) to a spacing of 1 × 1 × 1 mm. This conversion may
add or delete slices, or slice pixels. After that, we convert every slice to 256 × 256
pixels as follows. Some slices are not square. If they are not, we fill in with black
pixels. After they are square, if they are not 256 × 256, we convert them to that
size using interpolation. Concerning the size, we also make the cuboids have 256
slices using interpolation. The result is 256 × 256 × 256 cubes. From these cubes,
to keep “see” only the brain as would a human do, we make a cut from slice 40 to
slice 214, from row 50 to row 199, and from column 40 to column 239. With that
cut, we discard borders full of black pixels and conserve the inner cuboids that
have useful information (the brain). Since we made all the MRI the same size, we
assume that the cut keeps the brain and we do not have to apply techniques like
image segmentation (cutting the brain using pattern recognition). From those
cut cuboids, we use only half of the slices and half of the rows and columns of
every slice by eliminating one in between for all. The latter reduces the size of the
images and the dimensionality of the problem considerably. Last, we normalize
the images pixel values to an interval of −1.0 to 1.0.
Data preprocessing can be done both online or beforehand. We implemented
both. However, to maintain a low-cost objective, we use a script to apply the
preprocessing previously to the task of neural network training, and we load the
MRI data already transformed. The previous transformation may be done on a
desktop or laptop computer. Although it will take hours, it is not a task that
will take more than a day on current commodity hardware.
After data preprocessing the images occupy only 13.5 GB, we have reduced
the size of the images slightly more than ten times. This reduction is beneficial
to minimize neural network training time and storage needs of our development
explained in the next section.
4.3 Our Development
We chose to use a convolutional DNN of densenet-BC architecture because of
our objective to use the least resources possible. This kind of architecture has
an excellent performance with fewer parameters to train [10]. We based our
development on the implementation of Hara et al. [8]. We used their densenet
implementation for the densenet-121 architecture. This implementation, in turn,
is based on the two-dimensional implementation available in the Pytorch code.
The implementation of Hara et al., however, is not generic. It was made for video
and incorporates the variables sample size and sample duration that have to do
with the size and duration of video samples. We eliminated that and made the
Précédent

- 21/446

Suivant