# Automatic Approach for Brain Aneurysm Detection Using Convolutional Neural Networks
## 4 Proposed Method
### Proposed 3 DCNN-ConvLSTM Architecture
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Layer Type** & **Output Shape** & **Param \#** & **Kernel Size** & **Pooling Size** & **Activation** \\ \hline Conv 3D & 62, 62, 62, 64 & 8704 & 3 & ReLU \\ \hline MaxPooling3D & 31, 31, 64 & 0 & & 2, 2, 2 & \\ \hline Batch Norm & 31, 31, 31, 64 & 256 & & \\ \hline Conv 3D & 32, 47, 46, 64 & 101,757 & 3 & & ReLU \\ \hline MaxPooling3D & 16, 23, 23, 64 & 0 & & 2, 2, 2 & \\ \hline Batch Norm & 16, 23, 23, 64 & 256 & & & \\ \hline Conv 3D & 12, 19, 19, 128 & 457,482 & 3 & & ReLU \\ \hline MaxPooling3D & 6, 9, 9, 128 & 0 & & 2, 2, 2 & \\ \hline Batch Norm & 6, 9, 9, 128 & 512 & & & \\ \hline Conv 3D & 1, 9, 9, 256 & 197,855 & 3 & & ReLU \\ \hline Conv 3D & 1, 9, 9, 512 & 132,758 & 3 & & ReLU \\ \hline MaxPooling3D & 1, 9, 9, 512 & 0 & & 2, 2, 2 & \\ \hline Batch Norm & 1, 9, 9, 512 & 2048 & & & \\ \hline ConvLSTM & 8, 8, 64 & 1,328,375 & 3 & & \\ \hline Batch Norm & 8, 8, 64 & 256 & & & \\ \hline Conv 2D & 6, 6, 16 & 9235 & 3 & ReLU \\ \hline Flatten & 20,736 & & & \\ \hline DropOut & rate = 0.3 & & & \\ \hline Dense & 2 & & & SoftMax \\ \hline \hline \end{tabular}
\end{table} 
Table 3: The description of 3 DCNN-ConvLSTM neural network model. 2D convolutional layer, accompanied by batch normalization, a flattening layer, and a dense layer. This pseudo-code provides a high-level overview of the proposed 3 DCNN-ConvLSTM architecture (Algorithm 2):  
```
1:\(tensorflow\_keras\_models\)
2:\(tensorflow\_keras\_layers\)
3:\(X\_train,X\_test,Y\_train,Y\_test=train\_test\_split(X,Y)\)
4:\(X\_val,X\_test,Y\_val,Y\_test=train\_test\_split(X\_test,Y\_test)\)
5:\(model.add(Conv3D(filters=64,kernel\_size=(3,3,3)))\)
6:\(model.add(BatchNormalization())\)
7:\(model.add(MaxPooling3D(pool\_size=(2,2,2)))\)
8:\(model.add(Conv3D(filters=128,kernel\_size=(3,3,3)))\)
9:\(model.add(BatchNormalization())\)
10:\(model.add(MaxPooling3D(pool\_size=(2,2,2)))\)
11:\(model.add(Conv3D(filters=256,kernel\_size=(3,3,3)))\)
12:\(model.add(BatchNormalization())\)
13:\(model.add(MaxPooling3D(pool\_size=(2,2,2)))\)
14:\(model.add(MaxPooling3D(pool\_size=(2,2,2)))\)
15:\(model.add(Conv1 STM(filters=64,kernel\_size=(3,3,3)))\)
16:\(model.add(BatchNormalization())\)
17:\(model.add(Conv2D(filters=16,kernel\_size=(3,3,3)))\)
18:\(model.add(Flatten())\)
19:\(model.add(Dropout(0.3))\)
20:\(model.add(Dense(2))\)
```  
**Algorithm 2** Pseudo-code of the proposed 3 DCNN-ConvLSTM architecture  
The values in Table 4 describe the overall number of parameters as well as the number of trainable and untrainable parameters. The proposed 3 DCNN-ConvLSTM architecture in this study comprises six 3D convolutional layers and four MaxPooling3D layers. The number of filters and their sizes vary across these layers. The input images have dimensions of 32 \(\times\) 32 \(\times\) 3 (width, height, number of channels). The initial 3D convolution layer utilizes 64 filters with a kernel size of 3 \(\times\) 3 \(\times\) 3. Following this layer, the MaxPooling3D layer of size 2 \(\times\) 2 \(\times\) 2 with a stride of 2 is applied to reduce the data dimension. The second 3D convolution layer maintains 64 filters with the same 3 \(\times\) 3 \(\times\) 3 filter size as the first layer. Another MaxPooling3D layer, identical in size to the previous one, follows this layer. The third and fourth 3D convolution layers feature 128 filters, each with a size of 3 \(\times\) 3 \(\times\) 3. After the fourth 3D convolution layer, a MaxPooling3D layer, identical in size to the previous ones, is applied. The final two 3D convolution layers are equipped with 256 filters of size 6 \(\times\) 1 \(\times\) 1 and 512 filters of size 1 \(\times\) 1 \(\times\) 1, respectively. Following these layers, a final MaxPooling3D layer of size 2 \(\times\) 2 \(\times\) 2 is applied. Each MaxPooling3D layer is accompanied by batch normalization. At the network's conclusion, both a dense layer and a flattened layer are present. The dense layer is singular and directly yields an output of 2. Filter sizes were carefully chosen to