Abstract Recent developments in deep learning techniques have offered an alternative and complementary approach to traditional matched filtering methods for the identification of gravitational wave (GW) signals. The rapid and accurate identification of GW signals is crucial for the progress of GW physics and multi-messenger astronomy, particularly in light of the upcoming fourth and fifth observing runs of LIGO-Virgo-KAGRA. In this work, we use the 2D U-Net algorithm to identify the time-frequency domain GW signals from stellar-mass binary black hole (BBH) mergers. We simulate BBH mergers with component masses from 7 to 50 $M_{\odot}$ and account for the LIGO detector noise. We find that the GW events in the first and second observation runs could all be clearly and rapidly identified. For the third observing run, about 80\% GW events could be identified. Compared to the traditional convolutional neural network, the U-Net algorithm can output time-frequency domain signal images corresponding to probabilities, providing a more intuitive analysis. In conclusion, the U-Net algorithm can rapidly identify the time-frequency domain GW signals from BBH mergers.