Dried tofu is a type of bean food that is popular among Chinese people. However, because dried tofu is usually exposed to air during storage or shelf life, this may lead to a rapid increase in colony counts and spoilage, resulting in shortened shelf life. The traditional method for measuring total colony counts is the plate counting method, which is complex and time consuming. Therefore, it is particularly important to explore a method that can quickly, accurately, and non-destructively determine the total colony counts of dried tofu and predict its shelf life. In this study, the samples were measured by low-field nuclear magnetic resonance (LF-NMR) to obtain transverse relaxation data. Then, the total colony counts in dried tofu was determined by plate counting method, and it was used as a reference value. The backpropagation artificial neural network (BP-ANN) was used to analyze the transverse relaxation data. The results show that the BP-ANN model could quickly and accurately predict total colony counts. In addition, the total colony counts predicted by BP-ANN were used to predict the shelf life. Comparing the predicted shelf life with the actual shelf life of dried tofu. The results show that the relative error between them is less than 10%. Thus, the shelf life model established by the BP-ANN predicted value has a certain reliability. This study provides some references for rapid and nondestructive determination of total colony counts and shelf life prediction of dried tofu.