Real Time Lung Cancer Classification with YOLOv5




Adenocarcinoma, Artificial Intelligence, Automated diagnosis, Classification, Deep Learning, Image Analysis, Large Cell Carcinoma, Lung Cancer Classification, Machine Learning, Medical Imaging


Cancer must be appropriately categorized for effective diagnosis and treatment. Deep learning algorithms have shown tremendous promise in recent years for automating cancer classification. We used the deep learning system YOLOv5 to classify the four types of lung cancer in this study: big cell carcinoma, adenocarcinoma, normal lung tissue, and squamous cell carcinoma. We trained the YOLOv5 model using a publicly available database of lung cancer pictures. The dataset was divided into four categories: big cell carcinoma, adenocarcinoma, normal lung tissue, and squamous cell cancer. In addition, we compared YOLOv5's performance to older models such as SVM, RF, ANN, and CNN. The comparison found that YOLOv5 outperformed all these models, indicating its potential for the development of more accurate and efficient autonomous cancer classification systems. Conclusions from the research have important implications for cancer identification and therapy. Automatic cancer classification systems have the potential to increase the accuracy and efficacy of cancer detection, perhaps leading to better patient outcomes. The accuracy and speed of these systems can be enhanced by using deep learning techniques like YOLOv5, making them more effective for clinical applications. Our study's findings demonstrated high accuracy for every class, with a total accuracy of 97.77%. With the aid of accuracy, train loss, and test loss graphs, we assessed the model's performance. The graphs demonstrated how the model was able to gain knowledge from the data and increase its accuracy as it was being trained. The study's findings were also compiled in a table that gave a thorough assessment of each class's accuracy.


Download data is not yet available.


Y. Kumar, K. Sood, S. Kaul, and R. Vasuja, “Big Data Analytics and Its Benefits in Healthcare,” Studies in Big Data, vol. 66, pp. 3–21, 2020, doi: 10.1007/978-3-030-31672-3_1/COVER. DOI:

R. L. Siegel Mph et al., “Cancer statistics, 2023,” CA Cancer J Clin, vol. 73, no. 1, pp. 17–48, Jan. 2023, doi: 10.3322/CAAC.21763. DOI:

P. Jin et al., “Artificial intelligence in gastric cancer: a systematic review,” J Cancer Res Clin Oncol, vol. 146, no. 9, pp. 2339–2350, Sep. 2020, doi: 10.1007/S00432-020-03304-9/METRICS. DOI:

W. G. E. Gonçalves, M. H. D. P. Dos Santos, F. M. F. Lobato, Â. Ribeiro-Dos-Santos, and G. S. De Araújo, “Deep learning in gastric tissue diseases: a systematic review,” BMJ Open Gastroenterol, vol. 7, no. 1, p. e000371, Mar. 2020, doi: 10.1136/BMJGAST-2019-000371. DOI:

R. Apsari, Y. N. Aditya, E. Purwanti, and H. Arof, “Development of lung cancer classification system for computed tomography images using artificial neural network,” AIP Conf Proc, vol. 2329, no. 1, Feb. 2021, doi: 10.1063/5.0042195/962453. DOI:

A. Rehman, M. Kashif, I. Abunadi, and N. Ayesha, “Lung Cancer Detection and Classification from Chest CT Scans Using Machine Learning Techniques,” 2021 1st International Conference on Artificial Intelligence and Data Analytics, CAIDA 2021, pp. 101–104, Apr. 2021, doi: 10.1109/CAIDA51941.2021.9425269. DOI:

F. Shaukat, G. Raja, R. Ashraf, S. Khalid, M. Ahmad, and A. Ali, “Artificial neural network based classification of lung nodules in CT images using intensity, shape and texture features,” J Ambient Intell Humaniz Comput, vol. 10, no. 10, pp. 4135–4149, Oct. 2019, doi: 10.1007/S12652-019-01173-W/TABLES/4. DOI:

S. Nageswaran et al., “Lung Cancer Classification and Prediction Using Machine Learning and Image Processing,” Biomed Res Int, vol. 2022, 2022, doi: 10.1155/2022/1755460. DOI:

H. F. Al-Yasriy, M. S. Al-Husieny, F. Y. Mohsen, E. A. Khalil, and Z. S. Hassan, “Diagnosis of Lung Cancer Based on CT Scans Using CNN,” IOP Conf Ser Mater Sci Eng, vol. 928, no. 2, p. 022035, Nov. 2020, doi: 10.1088/1757-899X/928/2/022035. DOI:

J. Kuruvilla and K. Gunavathi, “Lung cancer classification using neural networks for CT images,” Comput Methods Programs Biomed, vol. 113, no. 1, pp. 202–209, Jan. 2014, doi: 10.1016/J.CMPB.2013.10.011. DOI:

L. Kaur, M. Sharma, R. Dharwal, and A. Bakshi, “Lung Cancer Detection Using CT Scan with Artificial Neural Netwok,” 2018 International Conference on Recent Innovations in Electrical, Electronics and Communication Engineering, ICRIEECE 2018, pp. 1624–1629, Jul. 2018, doi: 10.1109/ICRIEECE44171.2018.9009244. DOI:

D. Kumar, A. Wong, and D. A. Clausi, “Lung Nodule Classification Using Deep Features in CT Images,” Proceedings -2015 12th Conference on Computer and Robot Vision, CRV 2015, pp. 133–138, Jul. 2015, doi: 10.1109/CRV.2015.25. DOI:

M. A. Khan et al., “Lungs cancer classification from CT images: An integrated design of contrast based classical features fusion and selection,” Pattern Recognit Lett, vol. 129, pp. 77–85, Jan. 2020, doi: 10.1016/J.PATREC.2019.11.014. DOI:

F. Taher, N. Werghi, and H. Al-Ahmad, “Computer Aided Diagnosis System for Early Lung Cancer Detection,” Algorithms 2015, Vol. 8, Pages 1088-1110, vol. 8, no. 4, pp. 1088–1110, Nov. 2015, doi: 10.3390/A8041088. DOI:

Y. Gordienko et al., “Deep learning with lung segmentation and bone shadow exclusion techniques for chest X-ray analysis of lung cancer,” Advances in Intelligent Systems and Computing, vol. 754, pp. 638–647, 2019, doi: 10.1007/978-3-319-91008-6_63/COVER. DOI:

N. Nasrullah, J. Sang, M. S. Alam, M. Mateen, B. Cai, and H. Hu, “Automated Lung Nodule Detection and Classification Using Deep Learning Combined with Multiple Strategies,” Sensors 2019, Vol. 19, Page 3722, vol. 19, no. 17, p. 3722, Aug. 2019, doi: 10.3390/S19173722. DOI:

P. Wu, X. Sun, Z. Zhao, H. Wang, S. Pan, and B. Schuller, “Classification of Lung Nodules Based on Deep Residual Networks and Migration Learning,” Comput Intell Neurosci, vol. 2020, 2020, doi: 10.1155/2020/8975078. DOI:

J. Park et al., “Automatic Lung Cancer Segmentation in [18F]FDG PET/CT Using a Two-Stage Deep Learning Approach,” Nucl Med Mol Imaging, vol. 57, no. 2, pp. 86–93, Apr. 2022, doi: 10.1007/S13139-022-00745-7/METRICS. DOI:

Y. Zhu, Y. Tan, Y. Hua, M. Wang, G. Zhang, and J. Zhang, “Feature Selection and Performance Evaluation of Support Vector Machine (SVM)-Based Classifier for Differentiating Benign and Malignant Pulmonary Nodules by Computed Tomography,” Journal of Digital Imaging: the official journal of the Society for Computer Applications in Radiology, vol. 23, no. 1, p. 51, Feb. 2010, doi: 10.1007/S10278-009-9185-9. DOI:

T. S. Roy, N. Sirohi, and A. Patle, “Classification of lung image and nodule detection using fuzzy inference system,” International Conference on Computing, Communication and Automation, ICCCA 2015, pp. 1204–1207, Jul. 2015, doi: 10.1109/CCAA.2015.7148560. DOI:




How to Cite

Makhdoomi SM, Khosla C, Pande SD. Real Time Lung Cancer Classification with YOLOv5 . EAI Endorsed Trans Perv Health Tech [Internet]. 2023 Sep. 20 [cited 2024 May 25];9. Available from: