# Segmentation of Brain Tumors from MRI Images Using Convolutional Autoencoder
## 2 Materials and Methods
### Network Architecture  
Brain tumor segmentation was performed using a new network architecture with Convolutional layers, developed in Google Colaboratory, with TensorFlow version 2.4.0. and trained on a Graphical Processing Unit (GPU) Tesla P100. The network architecture is modeled based on autoencoders and the U-network [4] and consists of an input, three main blocks, a classification block, and an output, Figure 2. The first main block, Block A, represents the encoder part of the network. It consists of two Convolutional layers that keep the same size at the output as the input one. The reduction in Block A is made using a MaxPool layer that halves the input size. The second block, Block B, consists of two Convolutional layers that retain the input size and serve for additional processing of characteristics, as in the U-network. Block C, the third main block representing the decoder part of the network, is similar to Block A, except that instead of the MaxPool layer, it contains a Transposed-Convolutional layer that doubles the size at the input, followed by two Convolutional layers as in Block A. The classification block has a Convolutional layer and a SoftMax layer that gives the probability to classify each pixel of the image. All Convolutional layers, except for the one in the classification block, are followed by activation function Rectified Linear Unit and Batch Normalization. These layers were more precisely defined with GlorotNormal [29] kernel initializer and l2 parameter of 0.0001 for kernel regularizer. The Transposed-Convolutional layer was followed by Batch Normalization and was more precisely defined with the same kernel initializer as the Convolutional layers. The exit from the network represents the binary image that ideally should have the same value for every pixel as the mask. We refer to the network output as a predicted mask. In the end, the segmentation network's architecture consists of an input layer, three Blocks A, Block B, three Blocks C, Classification Block, and Output, and it contains a total of 39 layers and output mask and 488,770 trainable parameters, Table 1.  
In the first stage of development, we focused on the U-network with a slight change in the output. The output size was changed to be the same as the input. This network architecture achieved subpar results. The initial modification was to remove the skip connection between the layers from the encoder and decoder parts. The final model architecture, including the number of layers and their parameters, was determined empirically. The proposed network architecture is different from the standard U-network in several aspects. Firstly, there are no skip connections, there is a smaller number of convolution layers, i.e., blocks, the depth of convolution layers is smaller in the proposed network, and the output of the convolution layer in the proposed network is the same size as the input, unlike the U-net where the output of each convolution layer is \(2^{2}\) times smaller than the input. With all the aforementioned differences, the proposed network architecture is smaller than the U-net.