In strong ground‐motion observations, accelerograms are an important material in both seismic research and earthquake engineering. However, the ubiquitous baseline drift in near‐field acceleration records has a large impact on the integrated velocity and double‐integrated displacement with linear and parabolic drift, respectively. Conventionally, high‐pass filtering and two‐stage baseline fitting methods are commonly applied in baseline corrections to obtain reliable strong‐motion records. However, these filtering methods exclude low‐frequency components from acceleration records and cause unexpected waveform loss. The baseline fitting method, which is based on the experiential selection of intersection moments, is easily affected by external factors and requires a large amount of time for operations. Currently, as the number of accelerometers grows, conventional methods are insufficient in both efficiency and precision to process vast acceleration records. Here, we propose TraceNet, a deep‐learning‐based method, to correct baseline drifts in velocity records integrated from accelerograms. The training data set is developed with the fusion of artificial baselines and nondrift velocities from corrected accelerations and displacements from events. TraceNet extracts the baseline from the input velocity trace. After TraceNet prediction, the drift can be corrected by subtracting the extracted baseline. In addition, the potential coseismic ground displacement can be recovered from the integration in the corrected velocity. In this study, we used acceleration records and continuous Global Positioning System observations from the 2008 Wenchuan earthquake to demonstrate the ground offset recovery. As a deep learning application, TraceNet can extract and correct the baseline drifts automatically without subjective factors. The coseismic displacements estimated from accelerograms can provide additional insight into the ground deformation.