To realize tomato growth period monitoring and yield prediction of tomato cultivation, our study proposes a visual object tracking network called YOLO-deepsort to identify and count tomatoes in different growth periods. Based on the YOLOv5s model, our model uses shufflenetv2, combined with the CBAM attention mechanism, to compress the model size from the algorithm level. In the neck part of the network, the BiFPN multi-scale fusion structure is used to improve the prediction accuracy of the network. When the target detection network completes the bounding box prediction of the target, the Kalman filter algorithm is used to predict the target’s location in the next frame, which is called the tracker in this paper. Finally, calculate the bounding box error between the predicted bounding box and the bounding box output by the object detection network to update the parameters of the Kalman filter and repeat the above steps to achieve the target tracking of tomato fruits and flowers. After getting the tracking results, we use OpenCV to create a virtual count line to count the targets. Our algorithm achieved a competitive result based on the above methods: The mean average precision of flower, green tomato, and red tomato was 93.1%, 96.4%, and 97.9%. Moreover, we demonstrate the tracking ability of the model and the counting process by counting tomato flowers. Overall, the YOLO-deepsort model could fulfill the actual requirements of tomato yield forecast in the greenhouse scene, which provide theoretical support for crop growth status detection and yield forecast.
Vending machines have evolved into a critical element of the intelligent healthcare service system. To enhance the precision of pill box detection counting and cater to the lightweight requirements of its internal embedded controller for deep learning frameworks, an enhanced lightweight YOLOv8n model is introduced. A dataset comprising 4080 images is initially compiled for model training and assessment purposes. The refined YOLOv8n-ShuffleNetV2 model is crafted, featuring the integration of ShuffleNetv2 as the new backbone network, the incorporation of the VoVGSCSP module to bolster feature extraction capabilities, and the utilization of the Wise-IoU v3 loss function for bounding box regression enhancement. Moreover, a model pruning strategy based on structured pruning (SFP) and layer-wise adaptive magnitude pruning (LAMP) is implemented. Comparative experimental findings demonstrate that the enhanced and pruned model has elevated the mean Average Precision (mAP) rate from 94.5% to 95.1%. Furthermore, the model size has been reduced from 11.1 MB to 6.0 MB, and the inference time has been notably decreased from 1.97 s to 0.34 s. The model’s accuracy and efficacy are validated through experiments conducted on the Raspberry Pi 4B platform. The outcomes of the experiments underscore how the refined model significantly amplifies the deployment efficiency of the deep learning model on resource-limited devices, thus greatly supporting the advancement of intelligent medicine management and medical vending machine applications.