In traffic monitoring for video analysis systems, vehicle shadows have a negative effect on their performance. Shadow detection and removal are essential steps in accurate vehicle detection. In this paper, a new method is proposed for shadow detection using a novel convolution neural network architecture. In the proposed method, the edges of the image are first extracted. Edge extraction reduces calculation, and accelerates the execution of the method. The background of the frame is then removed and the main features are extracted using the ResUNet-a architecture. This architecture consists of two parts: the encoder and the decoder, which detect the shadow at the decoder output and then remove it. Deep learning is used to detect shadows, which increases the accuracy of the analysis. The ResUNet-a architecture can learn complex, hierarchical, and appropriate features from the image for accurate feature detection and discarding the irrelevant shadow, thereby outperforming conventional filters.The results show that the proposed method provides better performance on NJDOT traffic video, highway-1, and highway-3 datasets than popular shadow removal methods. Also, the method improves the evaluation criteria such as F-measure and runtime. The F-measure is 94 and 93% for highway-1 and highway-3, respectively.