The subsurface small-scale geological structures are manifested as diffractions in seismic data. Diffraction imaging provides high-resolution details of discontinuities such as faults, collapse columns, and karst caves. However, this high-resolution information is often obfuscated by strong reflections, necessitating their removal prior to diffraction imaging. Here, we propose a novel diffraction separation method based on shape dynamic time warping (shapeDTW) and median-mean filter. The shapeDTW is an effective time series alignment method that utilizes the distance between temporal points within a neighborhood as the alignment criterion, which can accurately align strong energy events in seismic data. We implement shapeDTW to construct flattened reflection gathers, in which the reflections are aligned and therefore behaves as horizontal events with consistent strong amplitudes, while the diffractions appear as non-horizontal weak events. Leveraging this difference in shape and amplitude, the median-mean filter can effectively extract the reflections from flattened reflection gathers. Diffractions are separated from seismic data by subtracting the extracted reflections. The synthetic data experiment confirms the feasibility of the proposed method in eliminating strong reflected waves while preserving weak diffracted waves related to karst caves in seismic data with low signal-to-noise ratio. The field data application further illustrates its effectiveness in removing strong high-slope reflections, highlighting small-scale fracture-related detailed features.