The computed tomography (CT) image-guided needle biopsy was applied in the diagnosis of lung malignant tumors based on artificial intelligence (AI) algorithm under convolutional neural network (CNN) to explore the effect of artificial intelligence algorithms segmentation in needle biopsy surgery and to guide the diagnosis of lung malignant tumors. The subjects of the study were 100 patients with lung malignant tumors admitted to the hospital. The cases were diagnosed as lung cancers by CT, and they were divided into two groups with 50 people in each group. Among them, 50 people in the control group did not use algorithms for guidance and 50 people in the experimental group used algorithms for guidance. The 50 patients who received needle biopsy without guidance of any algorithm were included in the control group. The results showed that the average coincidence rate of automatic segmentation and manual segmentation by the artificial intelligence algorithm was 97.46%, and the average false positive rate (FPR) and false negative rate (FNR) were 0.07% and 0.08%, respectively. The segmentation time of the algorithm group was 12.5 s, which was significantly shorter than the 36.11 s of the control group, and the segmentation speed was significantly faster. The positive rate of pathology in the control group was 78%, and the pathological positive rate of the algorithm group was 80%. The difference in the pathological positive rate between the two groups was 2%, and the detection effect of the pathological positive rate in the algorithm group was close to that in the control group, which was of positive significance in pathological detection. The satisfaction rate of patients in the algorithm group with the detection effect was 88%, and that of the patients in the control group was 94%. The difference in the detection satisfaction rate between the two groups was 6%. The number of patients with pneumothorax in the algorithm group was 22, the number of patients with bleeding was 21, and the number of patients with infection was 2. The number of patients with pneumothorax in the control group was 17, the number of patients with bleeding was 19, and the number of patients with infection was 3. The patients had a higher probability of pneumothorax and bleeding and a lower probability of infection; there was no significant difference in the incidence of complications between the two groups of patients. In summary, the intelligent algorithm was effective and feasible in segmenting lesions, and the accuracy of segmentation could meet the clinical needs, which can be used as a reference for surgery. CT images based on artificial intelligence algorithms were a good way to guide the needle biopsy in the diagnosis of lung malignant tumors, improving the accuracy and sensitivity of the diagnosis of lung malignant tumors.