 Our proposed approach addresses the challenge of data privacy in healthcare settings by using asynchronous federated learning and convolutional neural networks, CNNs, to improve the accuracy of skin cancer diagnosis. We divide the CNN layers into shallow and deep layers, with the shallow layers being updated more frequently. Additionally, we use a temporarily weighted aggregation approach to optimize the central model, which has been trained locally each participating device. This approach outperformed existing methods in terms of accuracy and communication cost, suggesting that it could be a promising solution for improving skin cancer diagnosis, while also addressing data privacy concerns in healthcare settings.