Identifying skin diseases by using digital images of skin that are also automated, efficient, and accurate is critical for biomedical image analysis. Many researchers have developed numerous machine-learning techniques for the prediction and diagnosis of various diseases that help clinicians identify infections early and provide crucial data for virus management. In this work, we use the inherent attributes of Particle Swarm Optimization (PSO), such as exploration and exploitation, to identify images for monkeypox virus prediction and diagnosis. Alongside, monkeypox, chickenpox, smallpox, cowpox, measles, tomato flu, and normal skin images were all considered in this study for monkeypox virus prediction and diagnosis. We collect photos from the International Skin Imaging Collaboration (ISIC) for analysis and experimentation purposes. Finally, we compare the proposed model Particle Swarm Optimization- Monkeypox Virus (PSOMPX) for monkeypox virus identification with four distinct pre-trained deep learning models (e.g., VGG16, ResNet50, InceptionV3, and Ensemble). Then we use four performance evaluation metrics—accuracy, precision, recall, and F1 score—to evaluate the model and analyze the outcomes of experiments. The experimental results obtained through the PSOMPX model significantly outperform other models due to its numerous traits.