In complex road scenarios, issues such as low-detection accuracy of positive and negative obstacles on the road surface and weak generalization ability of detection models are prevalent. We propose a high-precision detection network for positive and negative road obstacles, named multiscale diffusion and mix-attention transformer (MSD-MixFormer), which is based on multiscale fusion and diffusion mix-attention mechanisms. This network is designed based on the transformer architecture with a window adjustment mechanism to capture multi-scale features of obstacles, thereby addressing the issue of confusion between obstacle foreground and background. In the shallow and deep stages of the encoder module, dilation self-attention and diffusion self-attention are introduced respectively to enhance the feature fusion capability of the network. In the decoder module, mix-attention operations are incorporated to improve the segmentation accuracy of detailed features, addressing the problem of detail feature loss. To improve the generalization ability of the model, we collect and extend the VRE-NPO dataset with images from actual complex road scenarios. Experiments show that the MSD-MixFormer model converges faster and more stably during training compared with other higher-level models in the same series. In testing, MSD-MixFormer achieves higher detection accuracy for positive and negative obstacles, as well as for objects of varying sizes, across various complex road scenarios.