The vertical blooming of charge-coupled device (CCD) usually occurs in silicon-based cameras, which poses great challenge to determine the M 2 of near-infrared (NIR) lasers. In this paper, a new method based on deep learning technique to suppress the influence of CCD vertical blooming on M 2 determination is proposed for the first time, to the best of our knowledge. Taking a step-index few-mode fiber as an example, large amounts of samples including the blooming near-field beam patterns and their corresponding M 2 values are used to train the convolutional neural network (CNN), aiming at learning a fast and accurate mapping from the beam pattern to the M 2 parameter. The trained CNN can then be utilized to analyse the blooming pattern recorded by CCD to determine the M 2 . The simulated testing results have shown that the averaged prediction error of our scheme is about 0.5% for the investigated fiber beams. As for the time cost, our trained CNN only takes about 10 ms to determine the M 2 value using a common laptop computer, indicating real-time ability with high performance.