For the prediction of river flow sequence, owing to the non-stationariness and randomness of the sequence, the prediction accuracy of extreme river flow is not enough. In this study, the sparse factor of the loss function in a sparse autoencoder was enhanced using the inverse method of simulated annealing (ESA), and the river flow of the Kenswat Station in the Manas River Basin in northern Xinjiang, China, at 9:00, 15:00, and 20:00 daily during June, July, and August in 1998–2000 was considered as the study sequence. When the initial values of the sparse factor β0 are 5, 10, 15, 20, and 25, the experiment is designed with 60, 70, 80, 90, and 100 neurons, respectively, in the hidden layer to explore the relationship between the output characteristics of the hidden layer, and the original river flow sequence after the network is trained with various sparse factors and different numbers of neurons in the hidden layer. Meanwhile, the orthogonal experimental groups ESA1, ESA2, ESA3, ESA4, and ESA5 were designed to predict the daily average river flow in September 2000 and compared with the prediction results of the support vector machine (SVM) and the feedforward neural network (FFNN). The results indicate that after the ESA training, the output of the hidden layer consists of a large number of features of the original river flow sequence, and the boundaries of these features can reflect the river flow series with large changes. The upper bound of the features can reflect the characteristics of the river flow during the flood. Meanwhile, the prediction results of the orthogonal experiment groups indicate that when the number of neurons in the hidden layer is 90 and β0 = 15, the ESA has the best prediction effect on the sequence. In particular, the fitting effect on the day of ‘swelling up’ of the river flow is more satisfactory than that of SVM and FFNN. The results are significant, as they provide a guide for exploring the evolution of the river flow under drought and flood as well as for optimally dispatching and managing water resources.