The Impact of Batch Size on Skin Cancer Classification Using ResNet18
Keywords:
Deep Learning, Skin Cancer, CNN, Batch Size, Artificial Intelligence.Abstract
Skin cancer is one of the most common types of cancer, often caused by prolonged exposure to ultraviolet (UV) radiation. While visual inspection can provide a preliminary diagnosis, accurate identification typically requires a biopsy, an invasive, costly, and time-consuming procedure. Convolutional neural networks (CNNs) offer a promising alternative by achieving high diagnostic accuracy with reduced time and cost. Despite numerous studies in this area, the influence of training hyperparameters, particularly batch size, has not been extensively examined in the context of skin cancer detection. This study explores the effect of batch size on the performance of the ResNet18 network, known for its balance between accuracy and computational efficiency in medical imaging tasks. Batch size, defined as the number of training samples processed before weight updates, plays a critical role in model performance. Seven batch sizes (4, 8, 16, 32, 64, 128, and 256) were evaluated. Results revealed that smaller batch sizes led to lower performance, while a batch size of 32 achieved the highest multi-class accuracy. Batch sizes of 64 and 128 improved precision and recall. However, increasing the batch size beyond 128 did not yield additional benefits. Therefore, batch sizes between 32 and 128 are recommended for optimal results.
Downloads
Published
Versions
- 2025-06-14 (2)
- 2025-06-14 (1)