Our proposed RDHNet network model is based on semantic segmentation of nighttime scenes and consists of three modules and a multi-head decoder. The three modules - Histogram, MSRCR(Multi-scale Retinex with color restoration), and N-EX(No exposure) - aim to enhance the robustness of RDHNet for image segmentation under different lighting conditions. The histogram module prevents over optimization of well lit images, while the MSRCR module enhances images with insufficient lighting, improving object recognition and facilitating segmentation. The N-EX module uses a dark channel prior method to remove excess light covering the surface of an object. Extensive experiments have shown that the three modules are suitable for different network models and can be inserted and used at will. They significantly improve the model’s segmentation ability for nighttime images while also having good generalization ability. When added to the multi-head decoder network, MIoU has increased by 6.2% on the nighttime dataset Rebecca and 1.5% on the daytime dataset CamVid.