It is difficult to obtain real-time crop water shortage during spinach seedling production, so this study proposes a real-time spinach seedling water stress classification method based on hierarchical transformer encoder (HTE) MobileNet (HT-MobileNet). An efficient sandglass residual module is designed for the grading algorithm to significantly improve the model grading accuracy. Meanwhile, a lightweight attention mechanism is proposed. It can effectively suppress the influence of irrelevant features on the classification results. Furthermore, an HTE is introduced, classifying the degree of stress accurately under extremely complex spinach seedling conditions. By introducing grouped convolution, the number of model parameters are reduced greatly, which lays the foundation for practical application. The grading accuracy is 94.61%. The number of parameters is 1.78M and the model size is 4.57MB, which are 40.67% lower than the original network. Comparison experiments are conducted between HT-MobileNet and 10 mainstream convolutional neural networks, such as ConvNext. The experimental results demonstrate the outstanding advantages of this research in terms of accuracy and weight. In addition, an intelligent spinach seedling water stress grading system is designed and tested. This study can provide technical support for real-time monitoring of spinach seedling growth status.