The taste of fresh mushrooms is always appealing. Phlebopus portentosus is the only porcini that can be cultivated artificially in the world, with a daily output of up to 2 tons and a large sales market. Fresh mushrooms are very susceptible to microbial attacks when stored at 0−2 °C for more than 5 days. Therefore, the freshness of P. portentosus must be evaluated during its refrigeration to ensure food safety. According to their freshness, the samples were divided into three categories, namely, category I (1−2 days, 0−48 h, recommended for consumption), category II (3−4 days, 48−96 h, recommended for consumption), and category III (5−6 days, 96−144 h, not recommended). In our study, a fast and reliable shelf life identification method was established through Fourier transform near-infrared (FT-NIR) spectroscopy combined with a machine learning method. Deep learning (DL) is a new focus in the field of food research, so we established a deep learning classification model, traditional supportvector machine (SVM), partial least-squares discriminant analysis (PLS-DA), and an extreme learning machine (ELM) model to identify the shelf life of P. portentosus. The results showed that FT-NIR two-dimensional correlation spectroscopy (2DCOS) combined with the deep learning model was more suitable for the identification of fresh mushroom shelf life and the model had the best robustness. In conclusion, FT-NIR combined with machine learning had the advantages of being nondestructive, fast, and highly accurate in identifying the shelf life of P. portentosus. This method may become a promising rapid analysis tool, which can quickly identify the shelf life of fresh edible mushrooms.