Off-the-shelf 3D Lung Segmentation in CT using Generalized Histogram Thresholding

  • Marcelo A. F. de Toledo USP
  • Marina F. S. Rebelo USP
  • José E. Krieger USP
  • Marco A. Gutierrez USP


Computerized Tomography is very important for lung disease diagnostics, including computer assisted methods. Lung segmentation is usually a first step in further sophisticated methods of diagnosis. If in one hand, deep learning methods have state-of-the-art performance, they aren't as simple to apply compared to classical methods, sometimes requiring extra data and training. We designed a method specific for lung segmentation based on histogram thresholding. We observed that, in our proposed method, by changing from Otsu to the more recently developed GHT we got a significant improvement in segmentation, jumping from 77% to 91% average dice (from 90% to 95% median dice, respectively), approaching deep learning methods (UNet) results (94% average and 97% median dice). Even though our proposed method runs on CPU, it's still 2.6 times faster than UNet on GPU. Moreover, our proposed method is off-the-shelf, requiring no training or parameter calibration, being suitable as pre-processing for more sophisticated methods that aim specific diagnoses.


Akter, O., Moni, M. A., Islam, M. M., Quinn, J. M. W., & Kamal, A. H. M. (2020). Lung cancer detection using enhanced segmentation accuracy. Applied Intelligence, (October).

Automatic Lung Field Segmentation in X-ray Radiographs Using Statistical Shape and Appearance Models. (2016). Journal of Medical Imaging and Health Informatics, 6(2).

Barron, J. T. (2020). A Generalization of Otsu’s Method and Minimum Error Thresholding. Retrieved from

Chen, X., Udupa, J. K., Bagci, U., Zhuge, Y., & Yao, J. (2012). Medical image segmentation by combining graph cuts and oriented active appearance models. IEEE Transactions on Image Processing, 21(4), 2035–2046.

Chilakala, L. R. (2020). Optimal deep belief network with opposition-based hybrid grasshopper and honeybee optimization algorithm for lung cancer classification : A DBNGHHB approach. (April), 1–20.

Doyle, W. (1962). Operations Useful for Similarity-Invariant Pattern Recognition. Journal of the ACM, 9(2), 259–267.

Gordaliza, P. M., Muñoz-Barrutia, A., Abella, M., Desco, M., Sharpe, S., & Vaquero, J. J. (2018). Unsupervised CT Lung Image Segmentation of a Mycobacterium Tuberculosis Infection Model. Scientific Reports, 8(1), 1–10.

Hofmanninger, J., Prayer, F., Pan, J., Röhrich, S., Prosch, H., & Langs, G. (2020). Automatic lung segmentation in routine imaging is primarily a data diversity problem, not a methodology problem. European Radiology Experimental, 4(1), 50.

Huidrom, R., Chanu, Y. J., & Singh, K. M. (2018). Automated lung segmentation on computed tomography image for the diagnosis of lung cancer. Computacion y Sistemas, 22(3), 907–915.

Im, H.-J., Solaiyappan, M., Lee, I., Bradshaw, T., Daw, N. C., Navid, F., … Cho, S. Y. (2018). Multi-level otsu method to define metabolic tumor volume in positron emission tomography. American Journal of Nuclear Medicine and Molecular Imaging, 8(6), 373–386. Retrieved from

Kittler, J., & Illingworth, J. (1986). Minimum error thresholding. Pattern Recognition, 19(1), 41–47.

Kumar, S., Pant, M., & Ray, A. K. (2012). Segmentation of CT Lung Images Based on 2D Otsu Optimized by Differential Evolution. In Deep, K and Nagar, A and Pant, M and Bansal, JC (Ed.), PROCEEDINGS OF THE INTERNATIONAL CONFERENCE ON SOFT COMPUTING FOR PROBLEM SOLVING (SOCPROS 2011), VOL 2 (pp. 891–902). HEIDELBERGER PLATZ 3, D-14197 BERLIN, GERMANY: SPRINGER-VERLAG BERLIN.

Lenth, R. V. (2016). Least-Squares Means: The {R} Package {lsmeans}. Journal of Statistical Software, 69(1), 1–33.

Liu, C., & Pang, M. (2020). Extracting Lungs from CT Images via Deep Convolutional Neural Network Based Segmentation and Two-Pass Contour Refinement. Journal of Digital Imaging, 33(6), 1465–1478.

Liu, C., Zhao, R., Xie, W., & Pang, M. (2020). Pathological lung segmentation based on random forest combined with deep model and multi-scale superpixels. Neural Processing Letters, 52(2), 1631–1649.

McCarthy, D. (2001). Chest CT in “Post” COVID-19: What the Radiologist Must Know. Progress in Transplantation, 11(3), 162–162.

Otsu, N. (1979). A Threshold Selection Method from Gray-Level Histograms. IEEE Transaction on Systems, Man and Cybernetics, smc-9(1), 62–66.

Pinheiro, J., Bates, D., DebRoy, S., Sarkar, D., & R Core Team. (2013). nlme: Linear and Nonlinear Mixed Effects Models.

Pu, J., Leader, J. K., Bandos, A., Ke, S., Wang, J., Shi, J., … Jin, C. (2020). Automated quantification of COVID-19 severity and progression using chest CT images. European Radiology.

Rajagopalan, K., & Babu, S. (2020). The detection of lung cancer using massive artificial neural network based on soft tissue technique. BMC Medical Informatics and Decision Making, 20(1), 1–13.

Ronneberger, O., Fischer, P., & Brox, T. (2015). U-net: Convolutional networks for biomedical image segmentation. Lecture Notes in Computer Science (Including Subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics), 9351, 234–241.

Sara Naybandi Atashi, Zeinab Naderpour, & Saeedi, K. G. M. (2021). An Eight-week Follow-up Study in Patients With COVID-19 Respiratory Failure: Delayed Recovery or Lung Sequel. Case Reports in Clinical Practice, 5(Covid-19), 153–157.

Than, J. C. M., Noor, N. M., Rijal, O. M., Yunus, A., & Kassim, R. M. (2014). Lung segmentation for HRCT thorax images using radon transform and accumulating pixel width. IEEE TENSYMP 2014 - 2014 IEEE Region 10 Symposium, 157–161.

Yakubovskiy, P. (2019). Segmentation Models. GitHub Repository. GitHub.

Yang, J., Sharp, G., Veeraraghavan, H., van Elmpt, W., Dekker, A., Lustberg, T., & Gooding, M. (2017). Data from lung CT segmentation challenge. The Cancer Imaging Archive.

Zhou, H., Goldgof, D. B., Hawkins, S., Wei, L., Liu, Y., Creighton, D., … Nahavandi, S. (2016). A Robust Approach for Automated Lung Segmentation in Thoracic CT. Proceedings - 2015 IEEE International Conference on Systems, Man, and Cybernetics, SMC 2015, 2267–2272.

Zimmerman, D. W., & Zumbo, B. D. (1993). Relative power of the wilcoxon test, the friedman test, and repeated-measures ANOVA on ranks. Journal of Experimental Education, 62(1), 75–86.
TOLEDO, Marcelo A. F. de; REBELO, Marina F. S.; KRIEGER, José E.; GUTIERREZ, Marco A.. Off-the-shelf 3D Lung Segmentation in CT using Generalized Histogram Thresholding. In: SIMPÓSIO BRASILEIRO DE COMPUTAÇÃO APLICADA À SAÚDE (SBCAS), 21. , 2021, Evento Online. Anais [...]. Porto Alegre: Sociedade Brasileira de Computação, 2021 . p. 71-82. ISSN 2763-8952. DOI: