Abstract:Targeting the continuous ripening process of green mature tomatoes after harvest, timely temperature adjustment plays a pivotal role in meeting the appropriate storage and transportation temperature requirements for tomatoes at different stages of ripeness. Meanwhile, automatic recognition and dynamic prediction of fruit ripeness serve as fundamental prerequisites for achieving temperature control at the right time. A tomato ripeness recognition and temporal dynamic prediction model was proposed based on Swin Transformer and improved GRU. Firstly, by fusing the images of both sides of tomatoes, the overall redness proportion as a visual feature was obtained and a dataset of tomato images at different ripeness stages was constructed. Through transfer learning, the initial weight configuration of the Swin Transformer model was optimized to achieve tomato ripeness classification. Secondly, tomato image data at different storage temperatures (4℃, 9℃ and 14℃) was periodically collected, and the initial color features of tomatoes were combined with storage environment information to build a tomato ripeness temporal prediction model based on Swin Transformer and GRU. Furthermore, a time attention module was incorporated to enhance the prediction accuracy of the model. Lastly, the prediction results of different models were compared and analyzed to validate the accuracy and superiority of the proposed model. The results demonstrated a correct recognition rate of 95.783% for tomato ripeness classification, with respective improvements of 2.83%, 3.35%, and 12.34% compared with that of the VGG16, AlexNet, and ResNet50 models. The mean square error (MSE) for tomato ripeness temporal prediction was 0.225, representing a maximum reduction of 29.46% compared with that of the original GRU, LSTM, and BiGRU models. The research result can provide a key theoretical basis for the flexible and timely regulation of storage temperature considering tomato maturity.