Добавил:
kiopkiopkiop18@yandex.ru t.me/Prokururor I Вовсе не секретарь, но почту проверяю Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Ординатура / Хирургия / Библиотека им академика М.И. Перельмана / Книга_5525_Библиотеки_им_академика_М_И_Перельмана.pdf
Скачиваний:
0
Добавлен:
31.08.2026
Размер:
29 Мб
Скачать
Artificial Intelligence in Adaptive Radiation Therapy
Support vector machines (SVMs), on the other hand, try to identify a hyperplane that not only accurately classies training data points but also maintains a signicant distance, or margin, to the nearest data points of each class, which are called support vectors as presented in gure 1.4(b). Acting as a buffer zone, this margin provides robustness to variations in the data and improves the models generalization ability. By maximizing this margin, an SVM aims to achieve a clear separation between classes, reducing the risk of misclassication and enhancing the models ability to generalize well to unseen data.
Support vectors are embedded within the model after the training in an SVM. In the context of sensitive medical data, this can potentially violate patient privacy due to the inclusion of support vectors in the model. In particular, if the support vectors correspond to specic individuals in the dataset, it may inadvertently disclose sensitive information about those patients, compromising their privacy. This means that these models should not be trained on identiable data.
1.2.5.4 k-nearest neighbors k-nearest neighbors (kNN) is a simple ML algorithm that operates on the principle
of proximity. The intuition behind kNN is that similar data points in a feature space tend to belong to the same class or category. Distance metrics often measure this similarity in vector space. A common distance metric is Euclidean distance, which measures the straight-line distance between points in a vector space. Other popular distances include Manhattan distance, which calculates the sum of absolute differ­ences along each dimension. Other metrics, such as Minkowski distance, allow a tunable parameter to adjust the emphasis on different dimensions [20].
An illustration of the kNN classication of a test sample (the point with no color) with different k values is provided in gure 1.5. The prediction is often made by a majority voting of the labels that fall within the neighborhood. Note how the decision changes with increasing k value. For a binary classication task, choosing an even or odd value for k is important since it impacts the resolution of ties as shown in gure 1.5(b). An odd k value is preferred to avoid ties (gure 1.6(c)), ensuring a clear majority decision when voting among the nearest neighbors. Note that in multi-label classication a tie situation may occur when multiple neighbors have the same number of occurrences for different labels, and the resolution of the tie does not depend on the specic value of k. In general, a smaller k value tends to
Figure 1.5. Different neighborhoods of an arbitrary test sample: (a) 1NN classifying as blue, (b) 2NN, no classication due to tie, and (c) 3NN classifying as red.
1-11
t
Artificial Intelligence in Adaptive Radiation Therapy
Figure 1.6. Different activation functions: (a) sigmoid, (b) ReLu, and (c) hyperbolic tangent [22].
result in a more exible and low-bias model, allowing it to adapt well to intricate patterns in the data, but it might be sensitive to noise [21]. On the other hand, a larger k value leads to a smoother decision boundary, reducing sensitivity to noise but potentially introducing bias.
While simple, kNN can be a powerful and effective algorithm for certain types of datasets, in particular when the underlying relationships are based on local patterns and proximity. kNN can be categorized as a lazy learner [20], where it learns by memorizing the training data and classifying new instances based on their proximity to known examples. This means that the training data must always be available to the model even when the model is deployed. An important consideration when using such models is the privacy of patients.

1.3 Artificial neural networks

Articial neural networks (ANNs), inspired by the human brain, consist of interconnected layers of arti cial neurons. While traditional models such as decision trees and SVMs require handcrafted features, neural networks can automatically learn complex and hierarchical representations through multiple layers of inter­connected neurons.
1.3.1 Feed-forward neural networks
Feed-forward neural networks are the most basic form of neural nets which express a mapping:
=+yfxWb,1.3() ()
d
where f(·) is an activation function,
in
xR
is the input vector,
output. The mapping is characterized by two learnable parameters
d
(weight matrix) and
out
(bias vector). If f(·) = I(·) (identity function), equation
R
(1.3) expresses a linear mapping. In this case, the neural net can only approximate linear functions. On the other hand, if a non-linear activation is used, the network can approximate more sophisticated functions. Examples of non-linear activations such as sigmoid, rectied linear units (ReLU), and hyperbolic tangent (tanh) are provided in gure 1.6.
1-12
∈yR
d
∈×R
ou
is the
dd
in out
Artificial Intelligence in Adaptive Radiation Therapy
A problem with sigmoid and hyperbolic tangent functions is that they can easily saturate, i.e. large input values converge to 1.0, and small values converge to 1or0 for hyperbolic tangent and sigmoid, respectively. Once saturated, it becomes challenging for the learning algorithm to continue to adapt the weights to improve the models performance. The ReLU, on the other hand, is a piecewise linear function and has greatly improved the performance of neural networks. Since rectied linear units are nearly linear, they preserve many properties that make linear models easy to optimize [8].
Another common activation function is softmax, which is often used to obtain probability values from a vector h = [h
1,h2
, ,hd]:
softmax
()
⎡ ⎢
=…h
⎢ ⎢
h
exp
()
1
,,
h
exp
()
∑∑
j
j
exp
exp
j
h
()
d
h
()
j
⎤ ⎥
.1.4
⎥ ⎥
()
The softmax function is often applied to the output layer of a network and yields class probabilities for a multi-class classication problem.
1.3.2 Recurrent neural networks
The primary assumption of feed-forward networks is that the features of a sample do not change over time; thus, their input is often represented by a single feature vector. Many phenomena, however, have temporal dynamics where the behavior changes through time. A patient, for instance, might have new tests, radiation dose, changes in organs, etc, which means that a sequence of feature vectors x describes the patient where x
denotes a time-dependent feature. A predictive system
t
, x2, , xTnow
1
should consider such changes to provide a personalized treatment recommendation.
Recurrent neural networks (RNNs) are a class of networks introduced for processing sequences [23] where the current state h current input x
t
d
in
R
, and previous hidden state h
t1
d
h
t
R
is a function of the
. Note that the term state is borrowed from the terminology used in control theory, where a system is often described by its state, which represents a set of variables that describe the system at a particular point in time [22]. Figure 1.7 shows a recurrent network. Note the feedback loop, which allows a memory of different time steps/positions.
Figure 1.7. A recurrent network unfolded through time. The hidden representation at time stept( function of
and
x
t
. Reproduced with permission from [22].
−ht 1
1-13
h
t
)isa
Artificial Intelligence in Adaptive Radiation Therapy
The network can be unfolded through time/positions, showing that a recurrent net is, in fact, a feed-forward network that is applied over all positions.
Formally, an RNN can be characterized as
==++
hfxh fxWhWb,.
()( )
ttt tt11
−−
The function is characterized by two weight matrices are learning parameters, as well as a bias vector hidden state sequence up to the current input. The
represents a history of observed inputs from the beginning of a
t
corresponding to the nal position (T)is
t
dd
hin
∈×R
d
h
R
,
. In a recurrent net, the
1.5
()
×Rdd
hh
that
assumed to represent the whole sequence and can be followed by a simple classier to determine the label for the desired task. The weight matrix then needs to be updated based on the error of the classiers prediction. In recurrent nets, particularly with long sequences, the vanishing gradient problem can occur, leading to difculties in preserving relevant information across distant time steps/positions, hindering the networks ability to effectively capture long-term dependencies. This issue can result in diminished learning capabilities for tasks requiring the retention of context over extended temporal spans.
1.3.3 Convolutional neural networks
Convolutional neural networks (CNNs) were introduced for pattern recognition tasks to process spatial data, such as images [24] and have been exponentially applied in the medical computer vision domain. A major difference between a neuron in a CNN from a regular ANN is that its neurons are designed to be three­dimensional with width, height, and depth. A CNN comprises layers where each layer transforms a 3D (i.e. RGB channels) input to a 3D output. The basic components of a CNN are the convolutional, pooling, and fully connected layers.
Convolution layers use lters or kernels, which are spatially small 3D matrices, to convolve or slide across through the width and height of the input volume. The resulting output is then passed to an activation function (see section 1.3.1), producing a 2D feature map or activation map for each lter that learns visual patterns.
Pooling layers downsample an input volume to decrease the size of feature representation progressively, hence reducing the number of parameters and the computational time. It is commonly followed by a convolution layer, achieving spatial invariance. Average pooling computes the average value in a sliding window while preserving general information. Max pooling selects the maximum value in a sliding window, effectively capturing the most prominent features and patterns during down-sampling.
The fully connected (FC) layer attens the output of the nal convolutional or pooling layers into a vector h. An output layer is responsible for producing the nal predictions or classications (elaborated in section 1.3.5). In a CNN, the initial layers often detect general patterns (image edges and colors) and deeper layers learn task-specic representations. Figure 1.8 illustrates a simple example of a
1-14
Artificial Intelligence in Adaptive Radiation Therapy
Figure 1.8. A CNN architecture comprising ve stacked layers: input layer of a histopathology whole slide image, convolutional layer, pooling layer, fully connected layer, and output layer to predict a class.
classication task predicting cancer malignancy from an H&E histopathology whole slide image (WSI) using a CNN-based architecture.
While CNN is often applied to classify entire images, a specic architecture of CNNs designed for pixel-wise biomedical image segmentation is U-Net [25]. It has become the basis of many auto-segmentation algorithms applied to medical images [26]. In this design, the encoder network or the contracting path is a feature extractor. It acquires an abstract representation of the input image through a series of encoder blocks comprising convolutions while the spatial dimensions of the input volume are gradually reduced. The decoder network or the expanding path increases the spatial dimensions of the extracted features, localizing these features in the image and producing a segmentation map.
1.3.4 Attention
CNNs effectively capture local spatial information through convolutional lters but face challenges in capturing global context and long-range dependencies within data [27]. Their limited receptive elds (due to lters with small window size) can hinder understanding complex scenes where relationships between distant elements are crucial. Adaptive attention to local and global context is required to address these challenges. This has motivated the development of architecture such as transformers [28] that use the attention mechanism.
1.3.4.1 Self-attention
The attention mechanism resembles a spotlight that an ML model can use to focus on specic parts of input data when making predictions. Instead of treating all parts of the input equally (equal weights), the model can assign different levels of importance or attentionto different elements [29]. While different forms of attention mechanism exist, one of its most well-known and widely used forms is self-attention, dened as

…=
x x XW XW XW; ; softmax ,
[] (())
1

X
T
qkT
A
 
v
1.6
()
1-15
]
]
Artificial Intelligence in Adaptive Radiation Therapy
whereq,k, and
v
are training parameters and
=…Xxx;;
[
is a matrix of
T1
input representations (positions/time steps 1 to T). In this formalism, the product
qkT
XW XW
()
in a square matrix
represents the similarity between inputs at different positions, resulting
TT
∈×R
, where
represents the amount of attention that the
tk,
tth input element pays to the kth element. A softmax activation is then applied to (row-level) to obtain a probability distribution. The self-attention mechanism results
in a matrix of contextualized representations obtained using an adaptive weighted average of

=…
Xxx;;
[
, enabling the model to
xx,,
T1
, where each row is
T1
focus on different input elements.
1.3.4.2 Positional encoding
Although a self-attention mechanism captures relationships between different elements in a sequence, it does not account for positional information. Thus, additional positional encoding is often introduced before applying self-attention to ensure the model can discern the sequences order and the relative positions of elements. This positional encoding matrix P (often a constant matrix) is added to matrix X. A common form of positional encoding is sinusoidal, which is represented as
2
=Ptsin 10000 1.7
tjjd,2
+
tjjd,2 1
/
() ()
=
tcos 10000 ,
()
where t is the position index and d is the number of input dimensions. An illustration of a positional encoding matrix P for 15 positions (t = 0, , 14) and d = 100
/
2
/
/
2
provided in gure 1.9(a). Note that the representations corresponding to adjacent positions (rows) are similar while distance positions have dissimilar representations, allowing the position of each element in a sequence to be captured explicitly.
is
1.3.4.3 Transformer encoder
Transformers are attention-based networks introduced to address the problem of vanishing long-distance information that exists in RNNs and CNNs [28]. Figure 1.9(b) illustrates the transformer architecture, where its input is the matrix X = [x
; ; xT]. In contrast to a recurrent net, where the input is processed one
1
position at a time, in transformers, the inputs at all positions are fed into the network simultaneously. A self-attention layer obtains the new contextual repre­sentations. A residual connection is used for each layer to avoid issues such as exploding gradient. The nal output of the transformer is a matrix of hidden representations h
(t = 1, , T).
t
Modern neural network architectures are versatile, and advancements in different domains within the broader eld of DL are interconnected. CNNs, for instance, were originally introduced for image data, and their success sparked interest in exploring their adaptability to other domains such as natural language processing
2
The number of positions and the value of d are chosen arbitrarily.
1-16
Artificial Intelligence in Adaptive Radiation Therapy
Figure 1.9. Transformer architecture: (a) positional encoding and (b) transformer encoder.
Figure 1.10. A vision transformer.
(NLP) [30]. On the other hand, transformers, initially developed by the NLP community, marked a signicant paradigm shift in sequence modeling. Surprisingly, their capabilities transcended their original NLP domain and were later successfully applied to computer vision tasks. This adaptation is called the vision transformer, where an image is seen as a sequence of patches, as shown in gure 1.10 [31]. Beneting from the attention mechanism, a vision transformer allows adaptive attention to local and global contexts, often leading to superior performances compared to CNNs.
1-17
)
)
c
Artificial Intelligence in Adaptive Radiation Therapy
1.3.5 Training neural networks Making predictions in neural nets involves using learned representations to generate
outputs. The neural layers discussed in the previous sections are mostly encoders that try to learn a representation from an input. The learned representation (usually a vector) is then used as input to a classier/regressor to make predictions. For classication, a simple projection and
is the number of classes.
N
c
The projection results in a vector
=zhW
∈zR
cls
can be used, where
N
c
of logits where each dimension
∈×R
dNcls
hc
corresponds to a class. A softmax activation is then used to convert the logit values to class probabilities
=pzsoftmax(
corresponds to the predicted class. For regression, a projection used to map
to a single scalar value where
and the dimension with highest
=zhW
dreg 1
h
∈×R
.
probability
p
c
reg
is often
Loss functions are mathematical measures that quantify the difference between predicted values and actual values in an ML model, serving as a guide for adjusting model parameters. The goal is to minimize the loss function during the training process to improve the accuracy of the model. For classication tasks, a commonly used loss
function is cross-entropy loss. The cross-entropy loss
two input arguments
∈y0,1
N
{}
, a one-hot vector representing the true class, andpas
yp y p,loglog
() (
=−
c
cc
=
cN1
,has
the probability vector (softmax output). For regression tasks, squared error
=−
yz y z,2()( )
is a commonly used form.
Gradient descent is an iterative approach for training neural nets and the minimization of their prediction error (over training data). The loss L is a function of the networks trainable parameters zation involves nding an optimal
(see gure 1.11). Therefore, the minimi-
that minimizes the error. Most neural networks describe non-convex functions, meaning that several local minima exist. In this case, a minimum is found using a gradient descent approach that relies on
Figure 1.11. An error/loss surface as a function of training parameters (here w1and w2).
1-18
Artificial Intelligence in Adaptive Radiation Therapy
L, the gradient of loss L with respect to the set of trainable parameters The gradient represents the direction and the magnitude of the ascent of the loss function. In each iteration, trainable parameters are updated with a step-size η > 0 (also known as the learning rate):
new old
h=−WW L.
()
1.8
As illustrated in gure 1.11, −∇L directs the training process towards a descending direction of the loss [22].
1.3.6 Applications and use cases of deep learning
Dosimetry utilizing the Monte Carlo (MC) method is widely regarded as the gold standard and the most precise approach for calculating absorbed radiation dose in heterogeneous materials such as human tissue. This method accurately models fundamental physical processes within the context of patient-specic anatomy, source and applicator geometry, and the presence of tissue and material variations [32]. Monte Carlo simulations, however, involve the stochastic sampling of numerous particle tracks, making them time-consuming. DL, with its capacity to learn from large amounts of data, has the potential to approximate the complex physics involved in radiation interactions. By training neural networks on large datasets of simulated radiation scenarios, these models can potentially learn to predict dose distributions with faster speed while signicantly reducing the computa­tional burden associated with Monte Carlo simulations. An example of such DL systems is RapidBrachyDL [33], which is a 3D deep CNN. RapidBrachyDL calculates dose distributions for high dose rate (HDR) brachytherapy, with patient CT images and treatment plans used as inputs, while accelerating the simulation process by 300 times.
In addition to dose prediction, deep models can also be used for predicting possible side effects of a prescribed dose. For instance, early detection of toxicities in radiotherapy is crucial for ensuring the safety and well-being of patients undergoing cancer treatment. An example is the architecture proposed by Elhaminia et al which is a CNN- and attention-based model for prediction of toxicity in pelvic radio­therapy [34], demonstrating an 80% accuracy. Investigation of attention weights in this model provides insight on which anatomical regions are associated with high risk of toxicity, and how dose maps impact the networks prediction.
DL has shown signicant promise in adaptive radiotherapy when applied to various image modalities such as CT, MRI, and PET. One key application is in image segmentation, where deep learning models can accurately delineate organs at risk and target volumes. For example, in head and neck cancer treatment, precise segmentation of critical structures such as the spinal cord or salivary glands is crucial to avoid unnecessary radiation exposure and minimize side effects. Another application is in image registration, where deep learning can align images from different time points to track changes in tumor size and position. This is particularly important for tumors that exhibit signicant intrafractional motion, such as lung
.
1-19
Artificial Intelligence in Adaptive Radiation Therapy
tumors. By accurately registering images, clinicians can adapt the treatment plan to ensure that the tumor receives the intended dose while sparing healthy tissue.
Despite the novel applications of deep learning models, the moderate-sized datasets in the medical domain pose challenges for training robust ML models. Transfer learning is a technique widely used in medical computer vision tasks with limited datasets and computational resources. It involves utilizing a pre-trained model, trained on a large dataset, as a starting point for a new task with a smaller dataset. In this approach, a large number of parameters in the pre-trained model are frozen (not updated by gradient descent) to retain learned representations, and ne­tuning allows updating a small subset of parameters during training to learn task­specic features. This approach promotes faster model convergence and improved performance by leveraging general knowledge gained from the original large dataset [35]. VGGNet [36] is a well-known CNN, pre-trained on an extensive image classication task, ImageNet [37], which comprises 1000 classes. This pre-training facilitates the deployment of VGGNet in segmentation tasks, a common require­ment in many medical imaging applications [38].

1.4 Model training and evaluation

1.4.1 Hyperparameters
Hyperparameters are external conguration settings that are not learned from the data but are set prior to the training process (by an ML expert). These parameters play a crucial role in determining the models performance. In kNNs, for instance, the primary hyperparameter is the k itself, as well as the choice for the distance metric. Other examples of a hyperparameter are the maximum depth of a decision tree, the minimum number of samples required to split an internal node in a decision tree, and for random forests, the number of estimators (decision trees).
For deep learning models, there are several key hyperparameters that play a crucial role in determining their performance and behavior. The architecture-related hyperparameters include the number of layers, the size of each layer (number of neurons or units), the activation function used in each layer (e.g. ReLU, sigmoid, tanh), and the type of layers used (e.g. dense, convolutional, recurrent). These hyperparameters collectively dene the models capacity to learn complex patterns and representations from the data. Additionally, hyperparameters such as the learning rate ( to the training process.
Hyperparameters are tuned during the training process, allowing the adjustment of these external conguration settings to achieve optimal results. This iterative tuning helps to nd a middle ground between model complexity and generalization, enhancing the overall performance of the ML model.
), batch size, the type of optimizer (e.g. Adam, SGD) are related
1.4.2 Data split
When humans learn, the process of acquiring knowledge and skills involves both training and testing. Just as students need to undergo exams to demonstrate their understanding and prociency, ML models require testing to evaluate their
1-20