In dim light conditions, if the boundary of the object is not clear enough, it will hinder the precise identification function of the autopilot system. Although there are numerous studies on target recognition, there are few studies on the application of target recognition in night automatic driving environment. At present, data sets for night environment are scarce, and models trained in daylight conditions are often difficult to achieve the desired results in night target detection tasks. Inspired by the human eye's sensitivity to color and light, Edwin Herbert Land originally proposed the Retinex hypothesis in 1963. This theory holds that the contrast of color and brightness in the environment also plays a significant role in visual judgment. Based on this theory, we have successfully embedded a preprocessing unit in the input layer of the YOLO model. The main task of this preprocessor is to identify the image with insufficient artificial illumination within the established brightness boundary, and to optimize the image illumination with the help of the traditional algorithm derived from Retinex theory. In order to evaluate the improved architecture, we selected a part of the BDD100K [3] data set, focusing on the picture in the night environment. Experimental data analysis points out that the optimized YOLO architecture has achieved a leap in object recognition performance in night driving environment, which greatly enhances its application potential for night driverless driving. Supported by Retinex theory, Auto-MSRCR algorithm is the best among many traditional algorithms.