Trace‐wise noise is a type of noise often seen in seismic data, which is characterized by vertical coherency and horizontal incoherency. Using self‐supervised deep learning to attenuate this type of noise, the conventional blind‐trace deep learning trains a network to blindly reconstruct each trace in the data from its surrounding traces; it attenuates isolated trace‐wise noise but causes signal leakage in clean and noisy traces and reconstruction errors next to each noisy trace. To reduce signal leakage and improve denoising, we propose a new loss function and masking procedure in a semi‐blind‐trace deep learning framework. Our hybrid loss function has weighted active zones that cover masked and non‐masked traces. Therefore, the network is not blinded to clean traces during their reconstruction. During training, we dynamically change the masks' characteristics. The goal is to train the network to learn the characteristics of the signal instead of noise. The proposed algorithm enables the designed U‐net to detect and attenuate trace‐wise noise without having prior information about the noise. A new hyperparameter of our method is the relative weight between the masked and non‐masked traces' contribution to the loss function. Numerical experiments show that selecting a small value for this parameter is enough to significantly decrease signal leakage. The proposed algorithm is tested on synthetic and real off‐shore and land datasets with different noises. The results show the superb ability of the method to attenuate trace‐wise noise while preserving other events. An implementation of the proposed algorithm as a Python code is also made available.This article is protected by copyright. All rights reserved