Submitted:
01 January 2025
Posted:
02 January 2025
You are already at the latest version
Abstract
Keywords:
1. Introduction
- A suitable brain MRI dataset containing different tumor types is selected.
- An initialization strategy is developed to predominantly configure particles with convolutional and pooling layers, ensuring that pooling layers are implicitly positioned after each convolutional layer.
- The search space is refined to focus on determining the optimal number of convolutional layers, their kernel sizes, as well as the ideal number of fully connected layers and their respective neuron counts.
- Incremental training is applied, allowing particles to undergo progressively deeper learning over time.
- The optimal CNN architecture is rigorously evaluated using a holdout validation approach, with classification performance assessed through a detailed analysis of the confusion matrix.
2. Related Work
3. Convolutional Neural Networks (CNN)
3.1. Convolutional Layer (C)
3.2. Pooling Layer (P)
3.3. Fully Connected Layer (FC)
3.4. Activation Function
3.5. Softmax Cross-Entropy Loss
3.6. Training CNN
4. Particle Swarm Optimization
5. Application of PSO to the Optimization of CNN Architecture
5.1. Particle-Based Encoding Scheme
5.2. Initiating the Swarm
5.3. Fitness Evaluation
5.4. Calculation of Difference Between Particles
5.5. Particle Velocity Calculation
5.6. Particle Position Adjustment
6. Experimental Results
6.1. Dataset
6.2. Algorithm Parameters
6.3. Results
6.4. Discussion
7. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- LeCun, Y.; Bengio, Y.; Hinton, G. Deep learning. Nature 2015, 521, 436–444. [Google Scholar] [CrossRef]
- Pathak, K.; Pavthawala, M.; Patel, N.; Malek, D.; Shah, V.; Vaidya, B. Classification of Brain Tumor Using Convolutional Neural Network. In Proceedings of the 2019 3rd International conference on Electronics, Communication and Aerospace Technology (ICECA); 2019; pp. 128–132. [Google Scholar] [CrossRef]
- Litjens, G.; Kooi, T.; Bejnordi, B.; Setio, A.; Ciompi, F.; Ghafoorian, M.; van der Laak, J.; van Ginneken, B.; Sánchez, C. A survey on deep learning in medical image analysis. Medical Image Analysis 2017, 42, 60–88. [Google Scholar] [CrossRef] [PubMed]
- Adaji, P.O.; Mazadu, J.I. Image Segmentation and Object Detection for Automobile using OpenCV and CNN. Journal of Network and Information Security 2024, 12, 7–23. [Google Scholar]
- Singh, A.; Bhatt, S.; Nayak, V.; Shah, M. Automation of surveillance systems using deep learning and facial recognition. International Journal of System Assurance Engineering and Management 2023, 14, 236–245. [Google Scholar] [CrossRef]
- Gao, J.; Bambrah, C.; Parihar, N.; Kshirsagar, S.; Mallarapu, S.; Yu, H.; Wu, J.; Yang, Y. Analysis of Various Machine Learning Algorithms for Using Drone Images in Livestock Farms. Agriculture 2024, 14, 522. [Google Scholar] [CrossRef]
- Al-Galal, S.A.Y.; Alshaikhli, I.F.T.; Abdulrazzaq, M.; Hassan, R.; Abdulrazzaq, M.; Moustafa, H. Brain Tumor MRI Medical Images Classification Model Based on CNN (BTMIC-CNN). J. Eng. Sci. Technol 2022, 17, 4410–4432. [Google Scholar]
- Villanueva-Meyer, J.E.; Mabray, M.C.; Cha, S. Current clinical brain tumor imaging. Neurosurgery 2017, 81, 397–415. [Google Scholar] [CrossRef]
- Bauer, S.; Wiest, R.; Nolte, L.P.; Reyes, M. A survey of MRI-based medical image analysis for brain tumor studies. Physics in Medicine & Biology 2013, 58, R97. [Google Scholar]
- Lawrence, T.; Zhang, L.; Lim, C.P.; Phillips, E.J. Particle swarm optimization for automatically evolving convolutional neural networks for image classification. IEEE access 2021, 9, 14369–14386. [Google Scholar] [CrossRef]
- Eiben, A.E.; Smith, J.E. Introduction to evolutionary computing; Springer, 2015.
- Boussaïd, I.; Lepagnot, J.; Siarry, P. A survey on optimization metaheuristics. Information sciences 2013, 237, 82–117. [Google Scholar] [CrossRef]
- Golberg, D.E. Genetic algorithms in search, optimization, and machine learning. Addion wesley 1989, 1989, 36. [Google Scholar]
- Wang, B.; Sun, Y.; Xue, B.; Zhang, M. Evolving deep convolutional neural networks by variable-length particle swarm optimization for image classification. In Proceedings of the 2018 IEEE Congress on Evolutionary Computation (CEC). IEEE; 2018; pp. 1–8. [Google Scholar]
- Nistor, S.C.; Czibula, G. IntelliSwAS: Optimizing deep neural network architectures using a particle swarm-based approach. Expert Systems with Applications 2022, 187, 115945. [Google Scholar] [CrossRef]
- Yuan, G.; Xue, B.; Zhang, M. An evolutionary neural architecture search method based on performance prediction and weight inheritance. Information Sciences 2024, 667, 120466. [Google Scholar] [CrossRef]
- Berrajaa, A.; Merras, M.; Berrajaa, I. Advanced CNN based on genetic algorithm to automated femoral neck fracture classification. Signal, Image and Video Processing 2024, pp. 1–10.
- Junior, F.E.F.; Yen, G.G. Particle swarm optimization of deep neural networks architectures for image classification. Swarm and Evolutionary Computation 2019, 49, 62–74. [Google Scholar] [CrossRef]
- Anaraki, A.K.; Ayati, M.; Kazemi, F. Magnetic resonance imaging-based brain tumor grades classification and grading via convolutional neural networks and genetic algorithms. biocybernetics and biomedical engineering 2019, 39, 63–74. [Google Scholar] [CrossRef]
- Celik, M.; Inik, O. Development of hybrid models based on deep learning and optimized machine learning algorithms for brain tumor Multi-Classification. Expert Systems with Applications 2024, 238, 122159. [Google Scholar] [CrossRef]
- Bansal, S.; Jadon, R.S.; Gupta, S.K. A Robust Hybrid Convolutional Network for Tumor Classification Using Brain MRI Image Datasets. International Journal of Advanced Computer Science and Applications 2024, 15. [Google Scholar] [CrossRef]
- Gómez-Guzmán, M.A.; Jiménez-Beristaín, L.; García-Guerrero, E.E.; López-Bonilla, O.R.; Tamayo-Perez, U.J.; Esqueda-Elizondo, J.J.; Palomino-Vizcaino, K.; Inzunza-González, E. Classifying Brain Tumors on Magnetic Resonance Imaging by Using Convolutional Neural Networks. Electronics 2023, 12. [Google Scholar] [CrossRef]
- Singh, G.; Chhabra, A.; Mittal, A. Evaluating Deep Learning Algorithms for MRI-Based Brain Tumor Classification. In Proceedings of the 2024 International Conference on Emerging Innovations and Advanced Computing (INNOCOMP). IEEE; 2024; pp. 428–434. [Google Scholar]
- LeCun, Y.; Bengio, Y.; et al. Convolutional networks for images, speech, and time series. The handbook of brain theory and neural networks 1995, 3361, 1995. [Google Scholar]
- Wu, J. Introduction to convolutional neural networks. National Key Lab for Novel Software Technology. Nanjing University. China 2017, 5, 495. [Google Scholar]
- O’Shea, K. An introduction to convolutional neural networks. arXiv preprint, arXiv:1511.08458 2015.
- Zafar, A.; Aamir, M.; Mohd Nawi, N.; Arshad, A.; Riaz, S.; Alruban, A.; Dutta, A.K.; Almotairi, S. A comparison of pooling methods for convolutional neural networks. Applied Sciences 2022, 12, 8643. [Google Scholar] [CrossRef]
- Hao, W.; Yizhou, W.; Yaqin, L.; Zhili, S. The role of activation function in CNN. In Proceedings of the 2020 2nd International Conference on Information Technology and Computer Application (ITCA). IEEE; 2020; pp. 429–432. [Google Scholar]
- Wang, Q.; Ma, Y.; Zhao, K.; Tian, Y. A comprehensive survey of loss functions in machine learning. Annals of Data Science 2020, pp. 1–26.
- Moradi, R.; Berangi, R.; Minaei, B. A survey of regularization strategies for deep models. Artificial Intelligence Review 2020, 53, 3947–3986. [Google Scholar] [CrossRef]
- Goodfellow, I. Deep learning; MIT press, 2016.
- Eberhart, R.; Kennedy, J. Particle swarm optimization. In Proceedings of the Proceedings of the IEEE international conference on neural networks. Citeseer, 1995, Vol. 4, pp. 1942–1948.
- Kennedy, J.; Eberhart, R. Particle swarm optimization. In Proceedings of the Proceedings of ICNN’95-international conference on neural networks. ieee, 1995, Vol. 4, pp. 1942–1948.
- Wang, D.; Tan, D.; Liu, L. Particle swarm optimization algorithm: an overview. Soft computing 2018, 22, 387–408. [Google Scholar] [CrossRef]
- PyTorch. PyTorch Documentation: Default Weights Initialization. https://pytorch.org/docs/stable/nn.init.html.
- Nickparvar, M. Brain Tumor MRI Dataset, Kaggle, 2021. [CrossRef]
- Cheng, J. brain tumor dataset, 2017. [CrossRef]
- Bhuvaji, S.; Kadam, A.; Bhumkar, P.; Dedge, S.; Kanchan, S. Brain Tumor Classification (MRI), Kaggle, 2020. [CrossRef]
- Hamada, A. Br35H :: Brain Tumor Detection, Kaggle, 2020.















| Description | Value |
|---|---|
| Number of iterations | 10 |
| Swarm size | 15 |
| 0.5 |
| Description | Value |
|---|---|
| Max number of filters | 40 |
| Max filter size | |
| Max neurons in FC layer | 140 |
| Max number of layers | 9 |
| Description | Value |
|---|---|
| Starting epochs for particle evaluation | 1 |
| Epochs for final best particle training | 40 |
| Layer (Type) | Output Shape | Param # |
|---|---|---|
| ZeroPad2d-1 | [32, 3, 228, 228] | 0 |
| Conv2d-2 | [32, 16, 224, 224] | 1,216 |
| ReLU-3 | [32, 16, 224, 224] | 0 |
| MaxPool2d-4 | [32, 16, 112, 112] | 0 |
| ZeroPad2d-5 | [32, 16, 114, 114] | 0 |
| Conv2d-6 | [32, 32, 112, 112] | 4,640 |
| ReLU-7 | [32, 32, 112, 112] | 0 |
| MaxPool2d-8 | [32, 32, 56, 56] | 0 |
| Linear-9 | [32, 128] | 12,845,184 |
| ReLU-10 | [32, 128] | 0 |
| Dropout-11 | [32, 128] | 0 |
| Linear-12 | [32, 4] | 516 |
| Class | TP | FP | FN | TN | Precision | Recall | F1 Score | Accuracy |
|---|---|---|---|---|---|---|---|---|
| Glioma | 78 | 1 | 3 | 269 | 0.9873 | 0.9629 | 0.9750 | 0.9886 |
| Meningioma | 81 | 6 | 1 | 263 | 0.9310 | 0.9878 | 0.9585 | 0.9800 |
| No Tumor | 97 | 1 | 3 | 250 | 0.9897 | 0.9700 | 0.9798 | 0.9886 |
| Pituitary | 87 | 0 | 1 | 263 | 1.0000 | 0.9886 | 0.9943 | 0.9971 |
| Approach | Class | Accuracy |
|---|---|---|
| GA + CNN [19] | Glioma | 0.965 |
| Meningioma | 0.945 | |
| Pituitary | 0.974 | |
| Proposed Method | Glioma | 0.9886 |
| Meningioma | 0.980 | |
| Pituitary | 0.9971 |
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. |
© 2025 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 (http://creativecommons.org/licenses/by/4.0/).