KI

AI for medical imaging: which learning strategies for models?

  • Sarah Madeleine
  • 31.03.21
  • Aktualisiert am 21.04.22

Deep learning methods, mainly represented by convolutional neural networks, have an iterative function. The estimation and validation phases of the model are repeated several times until good performances are obtained.

Deep learning methods, mainly represented by convolutional neural networks, have an iterative function. The estimation and validation phases of the model are repeated several times until good performances are obtained. This iterative process is made possible by backpropagation and gradient descent.
In this article we will present several possible options, which exist to enable the data scientist to control the deep learning process.

Neural network learning

Gradient backpropagation

Convolutional neural networks have two directions of information propagation: 

  • forward pass 
  • backward pass or backpropagation

The forward pass is the training phase of the model, where the parameter estimate is calculated. The backpropagation is the validation phase of the model, where the parameters are updated according to the value of the gradient of the error between the estimate and the observation. 

The objective of this update is to minimize the gradient of the error for each neuron of the network. Once the gradient is computed, the most important values lead to a strong penalty of the parameters associated with them (i.e. weights).

Deep learning is an iterative process, so the regular update of the model parameters by minimizing the error gradient is called gradient descent.

Gradient descent

Gradient descent is an iterative algorithm for minimizing the gradient of the model's loss function. An epoch of the Stochastic Gradient Descent (SGD) method corresponds to:

Q represents the cost function that minimizes the loss function of the model. n is the number of observations in the dataset, w the parameter that minimizes the cost function and η is the learning rate [1].
The gradient descent associated with the backpropagation algorithm enables the automatic learning process of neural networks.

Hyper-parameters

The hyper-parameters are the parameters of the deep learning models, thus of the neural networks. They are of two types:

  1. Hyper-parameters of the model
  2. Hyper-parameters of the algorithm

Hyper-parameters of the model

The model hyper-parameters are mainly related to the topology and the size of the neural network, often predefined by the architecture of the chosen one (e.g. CNN, RNN, auto-encoder, GAN). Generally, these parameters are hardly or not changed, because the architecture is often used as suggested by its author, or even modified at the margin in the case of a fine-tuning strategy (explained further down).

Algorithm hyper-parameters

Algorithm hyper-parameters are the ones that the Data Scientist will manipulate the most to control the learning speed of the model. With deep learning, the model is encapsulated in a learning algorithm that defines:

     a. the loading of the model's input data 
     b. the course of the training phase
     c. the progress of the validation phase

For data loading:

  • the batch size of the data is provided at the input of the network
  • the data loader method with or without sampling

For the training and validation phases, there are: 

  • the number of epochs, which defines the number of learning loops (i.e. training-validation) that the algorithm will perform to allow the model to improve its estimates
  • the loss function that calculates the value of the error between the estimate and the observation
  • the optimizer is the optimization function used for gradient descent
  • the learning rate is the step in the gradient descent algorithm

The optimizers

Optimizers are the cornerstone of the gradient descent algorithm. The main method is the Stochastic Gradient Descent, from which other methods aimed at improving it are derived. Formally written:

Q represents the cost function that minimizes the loss function of the model. n is the number of observations in the dataset, w the parameter that minimizes the cost function and η the learning rate [1].

In the event of a very large dataset, calculating the sum of the gradients of each cost function (one per observation of the dataset) becomes very expensive. The Stochastic Gradient Descent method uses the sampling technique to calculate the sum of the gradients over a random sample of the cost functions in the dataset at each epoch. The random sample size is 1 observation for the standard method, but a so-called "mini-batch" method is also used where the random sample is composed of several observations of the dataset.
The learning rate (or learning stride) is the parameter defining the "speed" of the gradient descent by the optimization algorithm. The choice of its value is difficult, because if it’s too large the optimization algorithm diverges, and if it’s too small the speed of convergence is too low. 

The different optimization algorithms presented next, tend to all improve the estimation of the learning rate according to the past epoch of the gradient descent.

The most common optimizers are:

  • SGD moment, which uses mathematical moments to keep the information of the learning rate value of the previous epoch in order to define a new value of it for the current epoch.
  • AdaGrad, which applies a multiplicative factor (the sum of the squares of the previous gradients of each network parameter) to the learning rate in order to adapt it to each network parameter. The updates of these parameters are evened out between them, by amplifying the updates that are too weak and attenuating the updates that are too strong. This process avoids defining as global minimum a local minimum, and stops the gradient descent prematurely. Its major disadvantage is the rapid accumulation of the squares of the gradients which drastically decreases the learning rate at each epoch.
  • RMSprop is an improvement of AdaGrad for slowing down the decrease of the learning rate at each new epoch, and computes the multiplicative factor of the learning rate by an average of the squares of the previous gradients of each network parameter.
  • ADAM is an improvement of RMSprop, and computes the multiplicative factor of the learning rate by a combination of the average of the squares and the average of the second order moments (i.e. the variance) of the prior gradients. Like the SGD optimizer, the ADAM optimizer also has many derivatives.

Learning strategies specific to deep learning

Among the automatic learning strategies, some are commonly used by deep learning algorithms:

  1. data augmentation
  2. transfer learning
  3. fine-tuning

Data augmentation

This is a technique to overcome the lack of data that reduces the chances of the model to obtain good generalization performances. There are two types of augmentation: 

  • by data transformation 
  • by creating synthetic data

Data transformation is often done by applying geometrical transformations (e.g. horizontal flip, rotation), contrast modification, random clipping, addition of white noise, random deletion of pixel values from an image area. The creation of synthetic data is notably possible by the use of neural networks of the Generative Adversarial Network type. 

Generally, data augmentation is used during the training phase of the model, i.e. from the training dataset. The validation and test data sets are not subjected to this technique. 

When a lack of data is observed, it is important to identify its characteristics: is my dataset unbalanced? In what proportions? The intra- and inter-class variance of the dataset must also be studied. These preparatory analyses make it possible to define which types of augmentation to apply, in what proportion and on which data of the training dataset.

Transfer learning

The main idea of this technique is to take advantage of the previous learning of a third-party algorithm. This algorithm will have been trained for a similar task (e.g. classification of natural images) to the one of our network (e.g. classification of CT images of different stages of lung cancer), but from a dataset of much larger size (e.g. ImageNet) than the dataset available for our project. This approach reduces the time needed to train the model to obtain good performance, as this pre-training phase on a similar dataset allows us to obtain the parameter values associated with the extraction of conventional image descriptors, such as Scale-Invariant Feature Transform (SIFT) and histogram of oriented gradients (HOG). As a result, rather than initializing our network parameters randomly, they are initialized from the final parameter values of this third-party algorithm. Then, the training is done using the dataset specific to our project.

Fine-tuning

This technique also aims to take advantage of the previous learning of a pre-trained model on a large dataset. Models with a very large number of parameters, such as deep neural networks, must be trained on equally large datasets to reduce the risk of overfitting. 
From a model pre-trained on a dataset of n classes, its final classification layer is modified to match the task at hand, i.e. the classification of m classes (e.g. m < n with the task-specific dataset). Now the pre-trained model has a final classification layer with m outputs. The parameters of the model feature extraction layers are excluded from the backpropagation phase (i.e. frozen), in order to keep the values estimated during the pre-training with a larger dataset (e.g. ImageNet). Only the parameters of the classification layers of the model will be trained on the specific dataset.
Fine-tuning reduces the training time and the risk of overfitting the model inherent to a dataset smaller than the number of model parameters.

Want to go deeper into the subject? Here are three more articles about data quality and performance validation, how convolutional neural networks work and the most common architectures for medical image classification.

Andere Artikel, die Sie interessieren könnten