In soil, plant residues have low contrast making them difficult to detect using X‐ray computed tomography (CT). In this work, we tested a convolutional neural network (U‐Net) for its ability to improve the identification of crop residues in soil samples assembled from aggregates of different size fractions (small, large, water‐stable aggregates, and average aggregate composition). Soil CT images were obtained using a 244 μm resolution. About 2500 soil images were annotated to train the neural network, of which only 631 images were selected for the training data set. Intersection over Union (IoU) was used as a measure of success of segmentation by neural network, which takes values from 0 to 1. In the validation data set, IoU of background was 0.93, IoU of solid phase was 0.95, IoU of pore space was 0.77, and IoU of plant residues was 0.40. However, IoU of plant residues in the total data set increased to 0.7. Soil structure influences the quality of multiphase segmentation of soil CT images. The poorest segmentation of plant residues was in the soil samples composed of average aggregate size composition. The quality of pore space segmentation increased with increasing porosity of the soil sample . The model tends to generalize the large areas occupied by plant residues and overlooks the smaller ones. The low values of the IoU metric for plant residues in the training data set can also be related to insufficient quality of annotation of the original images.This article is protected by copyright. All rights reserved