Background: Skin cancer is the most common cancer worldwide, with melanoma being the deadliest type, though it accounts for less than 5% of cases. Traditional skin cancer detection methods are effective but are often costly and time-consuming. Recent advances in artificial intelligence have improved skin cancer diagnosis by helping dermatologists identify suspicious lesions. Methods: The study used datasets from two ethnic groups, sourced from the ISIC platform and CSMU Hospital, to develop an AI diagnostic model. Eight pre-trained models, including convolutional neural networks and vision transformers, were fine-tuned. The three best-performing models were combined into an ensemble model, which underwent multiple random experiments to ensure stability. To improve diagnostic accuracy and reduce false negatives, a two-stage classification strategy was employed: a three-class model for initial classification, followed by a binary model for secondary prediction of benign cases. Results: In the ISIC dataset, the false negative rate for malignant lesions was significantly reduced, and the number of malignant cases misclassified as benign dropped from 124 to 45. In the CSMUH dataset, false negatives for malignant cases were completely eliminated, reducing the number of misclassified malignant cases to zero, resulting in a notable improvement in diagnostic precision and a reduction in the false negative rate. Conclusions: Through the proposed method, the study demonstrated clear success in both datasets. First, a three-class AI model can assist doctors in distinguishing between melanoma patients who require urgent treatment, non-melanoma skin cancer patients who can be treated later, and benign cases that do not require intervention. Subsequently, a two-stage classification strategy effectively reduces false negatives in malignant lesions. These findings highlight the potential of AI technology in skin cancer diagnosis, particularly in resource-limited medical settings, where it could become a valuable clinical tool to improve diagnostic accuracy, reduce skin cancer mortality, and reduce healthcare costs.