To explore the performance of the improved DenseNet network in diagnosing pulmonary nodules (PNs) and differentiating benign and malignant PNs, improved DenseNet network was applied to segment MRI images of 60 PN patients, which were defined as the test group, while those segmented by the traditional one were undertaken as the control group. The MRI results were compared with the pathological diagnostic results, and the segmentation effects were evaluated factoring in precision, recall, Dice similarity coefficient, and intersection-over-union (IoU). The results showed that the improved DenseNet network algorithm showed higher accuracy, recall rate, Dice coefficient, and IoU versus the traditional one, and the difference was notable (
P
<
0.05
). The improved DenseNet network algorithm had higher diagnostic accuracy in terms of the PN volume, lobes, burrs, edges, and adhesion to surrounding tissue, with notable differences noted (
P
<
0.05
). The accuracy in differentiating benign and malignant PNs in the test group was higher (92.38 ± 8.74% vs. 75.56 ± 7.56%) versus the control group, and the difference was notable (
P
<
0.05
). In short, the MRI image segmentation algorithm based on the improved DenseNet network shows high accuracy in diagnosing PNs and differentiating benign and malignant PNs, and it is worthy of further promotion in the clinic.