Lung tumor detection using computer-aided modeling improves the accuracy of detection and clinical recommendation precision. An optimal tumor detection requires noise reduced computed tomography (CT) images for pixel classification. In this paper, the butterfly optimization algorithm-based [Formula: see text]-means clustering (BOAKMC) method is introduced for reducing CT image segmentation uncertainty. The introduced method detects the overlapping features for optimal edge classification. The best-fit features are first trained and verified for their similarity. The clustering process recurrently groups the feature matched pixels into clusters and updates the centroid based on further classifications. In this classification process, the uncertain pixels are identified and mitigated in the tumor detection analysis. The best-fit features are used to train local search instances in the BOA process, which influences the similar pixel grouping in the uncertainty detection process. The proposed BOAKMC improves accuracy and precision by 10.2% and 13.39% and reduces classification failure and time by 11.29% and 11.52%, respectively.