Accurate estimation of lithium-ion battery (LIB) state of health (SOH) is critical for prolonging battery life and ensuring safe operation. To address the limitations of existing data-driven models in robustness and feature coupling, this paper presents a new Bagging-PiFormer framework for SOH estimation. The framework integrates ensemble learning with an improved Transformer architecture to achieve accurate and stable performance across various degradation conditions. Specifically, multiple PiFormer base models are trained independently under the Bagging strategy to enhance generalization. Each PiFormer consists of a stack of PiFormer layers, which combines a cross-channel attention mechanism to model voltage–current interactions and a local convolutional feed-forward network (LocalConvFFN) to extract local degradation patterns from charging curves. Residual connections and layer normalization stabilize gradient propagation in deep layers, while a purely linear output head enables precise regression of the continuous SOH values. Experimental results on three datasets demonstrate that the proposed method achieves the lowest MAE, RMSE, and MAXE values among all compared models, reducing overall error by 10–33% relative to mainstream deep-learning methods such as Transformer, CNN-LSTM, and GCN-BiLSTM. These results confirm that the Bagging-PiFormer framework significantly improves both the accuracy and robustness of battery SOH estimation.
Pomegranate is a highly valued fruit known for its delicious seeds packed with health benefits and also a popular ornamental tree, as well as traditional medicine, but traditional management of the orchard heavily relies on manual laborious processes, leading to low efficiency and increased cost. Using machine vision to monitor its fruit development in real time can achieve accurate intelligent management and save a lot of lab our costs. Faster and lighter weight detection model is crucial to machine vision. The proposed YOLO-Punica model is built on an improved version of You Only Look Once version 8n (YOLOv8n) algorithm, resulting in a lightweight and faster detection model specifically designed for monitoring pomegranate fruit development in real time. The optimization includes the integration of two innovative modules, the Dual Path Downsampling Module (DPDM) and the Cross-Scale Feature Fusion Module (CCFM). The incorporation of the DPDM into the backbone network significantly enhances detection precision and computational efficiency. Additionally, the integration of both CCFM and DPDM into the neck structure, substantially reduces parameters, memory consumption, and overall model size, while improving operational efficiency and detection accuracy. The implementation of DPDM and CCFM in the YOLOv8n framework results in a lighter model, faster processing speeds, and improved detection accuracy. Comparative test results indicate that YOLO-Punica achieves reductions of 45.8% in parameters, 28% in Giga Floating-point Operations Per Second (GFLOP), and 43.7% in model size relative to YOLOv8n, while realizing a mean Average Precision (mAP) of 92.6%, surpassing YOLOv8n by 0.98%. Furthermore, the model is capable of processing images at a rate of 14.3 frames per second on embedded devices demonstrating its applicability for real-time detection of pomegranate fruit development, even in low computational power environments. This research not only provides technical support for intelligent detection of pomegranate fruit development, but also provide a new perspective for enhancing machine vision models in other agricultural contexts.