The invention discloses a natural image matting method based on deep learning, and the method comprises the following steps: obtaining a matting data set, and carrying out the data enhancement; establishing a natural image matting model with an encoder-decoder structure; in order to reserve detail information, designing an encoder to enable the downsampling multiple to be 4, in order to compensatefor reduction of a receptive field caused by downsampling multiple reduction, introducing a cavity convolution to expand the receptive field, and storing the maximum pixel position in the maximum pooling operation so as to provide position information for an upsampling stage; in order to solve the multi-scale problem, a cavity space pyramid module is connected to the top of the encoder; designinga global context module in a decoder, wherein the global context module is used for fusing high-level features corresponding to the encoder and the decoder; finally training and testing. According tothe method, more detail information is reserved in the feature extraction process, and meanwhile, multi-scale features are associated, so that the model can capture global information, model processing details and large-area transparent objects are facilitated, and the matting quality is improved.