Skin disease is one of the most common health problems and requires fast and accurate diagnosis. The limited availability of dermatology specialists and the high subjectivity of conventional diagnosis have driven the development of artificial intelligence-based automatic classification systems. This study aims to compare the performance of the Adam and Stochastic Gradient Descent (SGD) optimizers on the MobileNetV4 architecture for classifying eight classes of skin diseases using the ISIC 2019 dataset. The dataset consists of 23,257 valid dermoscopic images after preprocessing, which includes duplicate image removal, hair artifact elimination using the blackhat morphology method, and an asymmetric sampling strategy in which majority classes were capped at a maximum of 2,000 images while minority classes were augmented to reach the target count, in order to address extreme class imbalance with a ratio of up to 53:1. The model was trained using a three-phase training strategy with gradual unfreezing of the MobileNetV4 backbone initialized with pretrained ImageNet weights. All training configurations were made identical for both optimizers except for the optimization algorithm and learning rate, ensuring a fair comparison. Evaluation results on the test set show that the Adam optimizer achieved an accuracy of 71.07% with a macro F1-score of 0.72, while SGD achieved an accuracy of 58.06% with a macro F1-score of 0.57. Adam outperformed SGD across all eight skin disease classes. The performance difference of 13.01% indicates that Adam's adaptive learning rate mechanism is more effective for dermoscopic datasets with imbalanced class distributions compared to SGD. Nevertheless, it should be noted that Adam requires greater computational memory than SGD due to the storage of first and second moment estimates per parameter, and therefore the computational efficiency trade-off should be considered when deploying the model on resource-constrained devices. This study provides empirical contribution in selecting the optimal optimizer for skin lesion classification based on lightweight architectures.