The lung is the organ most commonly affected by tuberculosis infection, with estimates of lung involvement in subjects with active tuberculosis ranging from 79% to 87%. This type of disease is an airborne infectious disease caused by Mycobacterium tuberculosis and is a significant cause of morbidity and mortality, particularly in developing countries. Although recent medical advances have saved many patients, doctors are still subject to human errors when detecting and segmenting these lung lesions. Deep learning models have been developed to aid in lowering errors in the medical industry. In order to successfully detect and segment tuberculosis lesions in a data set of chest X-ray images, we propose a new deep learning technique called Red-Unet based on the conventional U-net architecture. Both the Red-Unet and the U-net were trained using a ten-fold stratified cross-validation schema three times under the same experimental conditions. The results showed that Red-Unet performs as well as the baseline model in less time and with fewer computational requirements, which is significant. The mean and standard deviation of the DICE coefficient and IoU scores for the Red-Unet were 0.92 (0.10) and 0.86 (0.14), while the U-net obtained 0.91 (0.18) and 0.85 (0.19), respectively. Furthermore, the Red-Unet model chosen in the top list with 100 training epochs was validated in a randomly selected test set, scoring as highly as the training values. The quality and generalization ability of the model was confirmed by this performance evaluation on the test data set, which demonstrated that it successfully identified and segmented lung anomalies brought on by tuberculosis regardless of size.