Submitted:
15 June 2024
Posted:
17 June 2024
You are already at the latest version
Abstract
Keywords:
1. Introduction
1.1. Background

1.2. Importance of Detection Using ML
2. Objectives
2.1. Integrating CNN with SECNN
3. Dataset Description
3.1. Dataset Overview
- Glioma: Cancerous tumors in glial cells.
- Meningioma: Non-cancerous tumors originating from the meninges.
- No Tumor: Normal brain scans without detectable tumors.
- Pituitary: Tumors affecting the pituitary gland, which can be either cancerous or non-cancerous.
3.2. Data Preprocessing

4. Methodology
4.1. Neural Networks: A Detailed Overview
4.1.1. Neural Networks
- Input Layer: This layer receives the input data and passes it to subsequent layers.
- Hidden Layers: These intermediate layers process the inputs received from the input layer through various transformations and activations. They play a crucial role in feature extraction and pattern learning.
- Output Layer: The final layer produces the network’s output based on the processed information from the hidden layers.
4.1.2. Mathematical Foundation of Neural Networks
- Sigmoid:
- ReLU (Rectified Linear Unit):
- Tanh:
4.1.3. Forward and Backward Propagation
- Forward Propagation: The input data is passed through the network layer by layer to obtain the final output. Each neuron calculates its output using the weighted sum of its inputs and the activation function.
- Backward Propagation: The error between the predicted output and the actual output is calculated. This error is then propagated backward through the network, adjusting the weights using the gradient descent optimization algorithm. The weight update rule for gradient descent is:where is the learning rate, L is the loss function, and is the gradient of the loss function with respect to the weight .
4.2. Integrating CNN with SECNN
4.2.1. Implementation of SECNN in Practice
4.2.2. Loss Function
- Mean Squared Error (MSE): Used primarily for regression tasks, it calculates the average squared difference between the actual and predicted values.where represents the actual values, represents the predicted values, and n is the number of samples.
- Cross-Entropy Loss: Commonly used for classification tasks, it measures the performance of a classification model whose output is a probability value between 0 and 1.where represents the actual class labels and represents the predicted probabilities.
4.2.3. Optimization Algorithms
- Stochastic Gradient Descent (SGD): An iterative method that updates the weights using a single or a small batch of training examples at each iteration, defined by the rule:where is the learning rate and is the gradient of the loss function with respect to the weights.
- Adam: Combines the advantages of two other extensions of stochastic gradient descent, namely Adaptive Gradient Algorithm (AdaGrad) and Root Mean Square Propagation (RMSProp). It computes adaptive learning rates for each parameter by maintaining a running average of both the gradients and their second moments.where is the first moment estimate, is the second moment estimate, and is a small constant for numerical stability.
4.3. Convolutional Neural Networks (CNNs)
4.3.1. Convolutional Layer


4.3.2. Pooling Layer

4.3.3. Fully Connected Layer
4.4. Data Augmentation


4.5. Model Optimization
4.6. Performance Metrics
- Precision: Measures the ability of the model to correctly identify positive instances for each class among all instances predicted as positive.where denotes the true positives and denotes the false positives for class c.
- Recall (Sensitivity or True Positive Rate): Calculates the ability of the model to correctly identify positive instances for each class among all actual positive instances.where denotes the true positives and denotes the false negatives for class c.
- F1-Score: The harmonic mean of precision and recall. It provides a balanced measure that combines both metrics for each class.
- Accuracy: Measures the overall correctness of the model’s predictions across all classes.where N is the number of classes, is the true positives, is the false positives, and is the false negatives for class i.
4.7. Self-Expanding Convolutional Neural Networks (SECNNs)

4.7.1. Natural Expansion Score

4.7.2. Model Expansion Strategy
4.8. Model Architecture
- 1.
-
Input Layer
- Input shape: (None, 150, 150, 3)
- 2.
-
Convolutional Layer 1
- Layer name: conv2d_8 (Conv2D)
- Input shape: (None, 150, 150, 3)
- Output shape: (None, 147, 147, 32)
- Additional information: 32 filters, kernel size: (3, 3), activation: ReLU
- 3.
-
Max Pooling Layer 1
- Layer name: max_pooling2d_6 (MaxPooling2D)
- Input shape: (None, 147, 147, 32)
- Output shape: (None, 49, 49, 32)
- Additional information: Pool size: (3, 3)
- 4.
-
Convolutional Layer 2
- Layer name: conv2d_9 (Conv2D)
- Input shape: (None, 49, 49, 32)
- Output shape: (None, 46, 46, 64)
- Additional information: 64 filters, kernel size: (3, 3), activation: ReLU
- 5.
-
Max Pooling Layer 2
- Layer name: max_pooling2d_7 (MaxPooling2D)
- Input shape: (None, 46, 46, 64)
- Output shape: (None, 15, 15, 64)
- Additional information: Pool size: (3, 3)
- 6.
-
Convolutional Layer 3
- Layer name: conv2d_10 (Conv2D)
- Input shape: (None, 15, 15, 64)
- Output shape: (None, 12, 12, 128)
- Additional information: 128 filters, kernel size: (3, 3), activation: ReLU
- 7.
-
Max Pooling Layer 3
- Layer name: max_pooling2d_8 (MaxPooling2D)
- Input shape: (None, 12, 12, 128)
- Output shape: (None, 4, 4, 128)
- Additional information: Pool size: (3, 3)
- 8.
-
Convolutional Layer 4
- Layer name: conv2d_11 (Conv2D)
- Input shape: (None, 4, 4, 128)
- Output shape: (None, 1, 1, 128)
- Additional information: 128 filters, kernel size: (3, 3), activation: ReLU
- 9.
-
Flatten Layer
- Layer name: flatten_2 (Flatten)
- Input shape: (None, 1, 1, 128)
- Output shape: (None, 128)
- 10.
-
Dense Layer 1
- Layer name: dense_4 (Dense)
- Input shape: (None, 128)
- Output shape: (None, 128)
- Additional information: 128 neurons, activation: ReLU
- 11.
-
Dense Layer 2
- Layer name: dense_5 (Dense)
- Input shape: (None, 128)
- Output shape: (None, 512)
- Additional information: 512 neurons, activation: ReLU
- 12.
-
Dropout Layer
- Layer name: dropout_2 (Dropout)
- Input shape: (None, 512)
- Output shape: (None, 512)
- Additional information: Dropout rate: 0.5
- 13.
-
Output Layer
- Layer name: dense_6 (Dense)
- Input shape: (None, 512)
- Output shape: (None, 4)
- Additional information: 4 neurons (one for each class), activation: Softmax



5. Results
5.1. Training and Validation


5.2. Performance Metrics
- Test Accuracy: 93.98%
- Confusion Matrix:
| Class | Precision | Recall | F1-Score |
| Glioma | 0.955 | 0.923 | 0.939 |
| Meningioma | 0.917 | 0.833 | 0.873 |
| No Tumor | 0.924 | 0.998 | 0.960 |
| Pituitary | 0.974 | 0.993 | 0.983 |
| Overall Accuracy | 0.941 |

5.3. Detailed Epoch Results

Epoch 1/40
178/178 -- 134s 716ms/step - accuracy: 0.4533
Epoch 2/40
178/178 -- 1s 924us/step - accuracy: 0.8438
Epoch 3/40
178/178 -- 112s 618ms/step - accuracy: 0.7886
...
Epoch 34/40
178/178 -- 3s 16ms/step - accuracy: 0.9688
Epoch 34: early stopping
Test Loss: 0.17118
Test Accuracy: 0.93984


6. Discussion
7. Conclusions
References
- Chollet, F. (2017). Deep Learning with Python. Manning Publications.
- Goodfellow, I., Bengio, Y., & Courville, A. (2016). Deep Learning. MIT Press.
- Kingma, D. P., & Ba, J. (2014). Adam: A Method for Stochastic Optimization. arXiv preprint arXiv:1412.6980.
- WHO. (2021). World Health Organization: Brain Tumors.
- Deaconu, A., Appolinary, B., Yang, S., & Li, Q. (2024). Self-Expanding Convolutional Neural Networks. arXiv preprint arXiv:2401.05686.
- Krizhevsky, A., Sutskever, I., & Hinton, G. E. (2012). ImageNet Classification with Deep Convolutional Neural Networks. Advances in Neural Information Processing Systems.
- Redmon, J., Divvala, S., Girshick, R., & Far hadi, A. (2015). You Only Look Once: Unified, Real-Time Object Detection. arXiv preprint arXiv:1506.02640.
- Ren, S., He, K., Girshick, R., & Sun, J. (2015). Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks. arXiv preprint arXiv:1506.01497.
- Ronneberger, O., Fischer, P., & Brox, T. (2015). U-Net: Convolutional Networks for Biomedical Image Segmentation. arXiv preprint arXiv:1505.04597.
- Oktay, O., Schlemper, J., Folgoc, L. L., et al. (2018). Attention U-Net: Learning Where to Look for the Pancreas. arXiv preprint arXiv:1804.03999.
- Goodfellow, I., Pouget-Abadie, J., Mirza, M., et al. (2014). Generative Adversarial Networks. Advances in Neural Information Processing Systems.
- Howard, A. G., et al. (2017). MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications. arXiv preprint arXiv:1704.04861.
- Tan, M., & Le, Q. (2019). EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks. arXiv preprint arXiv:1905.11946.
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).