Optical fiber sensors, known for their small size, lightweight, and resistance to electronic interference, are widely used in various applications, including medical vital signs monitoring and the Internet of Medical Things (IoMT). They are particularly useful in recording electrocardiogram (ECG) signals and measuring heart rate variability (HRV), which provides insights into the autonomic nervous system activity. HRV, affected by sleep quality, can be used to assess sleep stages. Monitoring ECG and HRV during sleep can identify sleep disruptions and guide interventions to improve sleep quality. However, existing optical fiber sensors for vital signs monitoring have some drawbacks, including signal loss, sensitivity to light source intensity changes, signal distortion during long-distance transmission, and high manufacturing and maintenance costs. They also may produce missing or anomalous data due to sensor failures, transmission and storage issues, or other unforeseen factors. Conventional monitoring methods can be uncomfortable for long-term daily ECG and HRV monitoring. To address these problems, we propose a novel optical fiber sensor based on a fiber interferometer and a robust semi-supervised framework, termed ensemble bidirectional long short-term memory with attention framework (EBLA), which is composed of complete ensemble empirical mode decomposition with adaptive noise network (CEDANN) and graph-based semi-supervised classification model (GSCM) modules, can reconstruct and analyze raw ECG signals, extract temporal and spatial features, and match the relationship between HRV and sleep stages. The framework also applies external knowledge of acquired signals for graph modeling for the first time, revealing data relationships and better understanding the global sample structure from the raw ECG signal. The average root-mean-square error (RMSE) and mean absolute error (MAE) of experiments reach 1.711 and 1.196, respectively, demonstrating its feasibility and effectiveness, exhibiting a better effect and its superior to the state-of-the-art approaches. This work has the potential to promote smart healthcare monitoring and the application of optical fiber sensing.