Research Article COVID-19 Diagnosis Using Capsule Network and Fuzzy C-Means and Mayfly Optimization Algorithm Ali Farki , 1 Zahra Salekshahrezaee, 2 Arash Mohammadi Tofigh, 3 Reza Ghanavati, 4 Behdad Arandian , 5 and Amirahmad Chapnevis 6 1 Department of Information Technology Engineering, Industrial and Systems Engineering Faculty, Tarbiat Modares University, Tehran, Iran 2 Florida Atlantic University, College of Engineering and Computer Science, Boca Raton, Florida 33431, USA 3 Department of General Surgery, School of Medicine, Shahid Beheshti University of Medical Sciences, Tehran, Iran 4 Department of Chemical and Petroleum Engineering, Sharif University of Technology, Tehran, Iran 5 Department of Electrical Engineering, Dolatabad Branch, Islamic Azad University, Isfahan, Iran 6 Department of Computer Engineering and Information Technology, Amirkabir University of Technology, Tehran, Iran Correspondence should be addressed to Behdad Arandian; b.arandian@iauda.ac.ir Received 23 July 2021; Accepted 22 September 2021; Published 19 October 2021 Academic Editor: Paul Harrison Copyright © 2021 Ali Farki et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. The COVID-19 epidemic is spreading day by day. Early diagnosis of this disease is essential to provide eective preventive and therapeutic measures. This process can be used by a computer-aided methodology to improve accuracy. In this study, a new and optimal method has been utilized for the diagnosis of COVID-19. Here, a method based on fuzzy C-ordered means (FCOM) along with an improved version of the enhanced capsule network (ECN) has been proposed for this purpose. The proposed ECN method is improved based on mayy optimization (MFO) algorithm. The suggested technique is then implemented on the chest X-ray COVID-19 images from publicly available datasets. Simulation results are assessed by considering a comparison with some state-of-the-art methods, including FOMPA, MID, and 4S-DT. The results show that the proposed method with 97.08% accuracy and 97.29% precision provides the highest accuracy and reliability compared with the other studied methods. Moreover, the results show that the proposed method with a 97.1% sensitivity rate has the highest ratio. And nally, the proposed method with a 97.47% F1-score rate gives the uppermost value compared to the others. 1. Introduction In recent decades, several new diseases have emerged in dierent geographical areas with pathogens including the Ebola virus, Zika virus, NIPA virus, and coronaviruses. Recently, a new type of pathological infection has emerged in Wuhan, China. The new strain is severe acute respiratory syndrome 2 (SARS-CoV-2), which causes Coronavirus Disease 2019 (COVID-19). Following the increase in the number of patients, the Chinese public clinical and scientic associations reacted quickly to allow the new virus to be identied promptly, and the viral gene sequence to be identied and distributed to other countries around the world. Following extensive research on January 30, 2020, the World Health Organization (WHO) declared the prevalence of public health emergencies to be an international concern [1]. By increasing the extension of this disease, researchers have worked on dierent methods for early detection of this case at least for minimizing the outbreak. People with sus- pected COVID-19 should determine as soon as possible if they are infected [2]. Therefore, they should quarantine themselves, receive medical treatment, and inform and warn their relatives. One of the most popular and less harmful imaging methods for diagnosis of this area is chest X-ray imaging. Chest X-ray images are images that use small doses of ionizing radiation to take pictures of the inside of the body called radiographs [3]. The X-rays can help physicians Hindawi BioMed Research International Volume 2021, Article ID 2295920, 11 pages https://doi.org/10.1155/2021/2295920