Ambient temperature fluctuations often induce measurement errors in fiber-optic Fabry-Perot strain sensors. To effectively compensate for the influence of temperature on measurement accuracy, this study proposes an optimized particle swarm optimization-back propagation (PSO-BP) neural network algorithm. The combined predictive model is applied to the monitoring data of a Fabry-Perot strain sensor based on a single-mode fiber-hollow-core fiber-single-mode fiber (SMF-HCF-SMF) structure. By preprocessing the data collected from the sensor, the temperature values and spectral valley shift data obtained from the fiber-optic Fabry-Perot strain sensor are directly used as input features to establish a temperature-compensated neural network model. Based on the traditional PSO-BP neural network algorithm, an optimization strategy incorporating adaptive adjustment of inertia weights and learning factors is employed to enhance global search capability and local convergence accuracy, thereby enabling effective compensation for temperature-induced effects.Experimental results demonstrate that in the entire temperature measurement range of the sensor, the optimized PSO-BP neural network achieves a mean absolute percentage error (MAPE) of about 1.2% and a root mean square error (RMSE) of about 5.9, significantly outperforming other methods. Comparative analysis with different model architectures reveals that compared with the BP, PSO-BP, RF, and GA-BP models, the optimized PSO-BP model improves MAPE by 57.14%, 45.45%, 73.91%, and 53.85%, respectively, while reducing RMSE by 68.11%, 52.42%, 72.94%, and 63.13%. Moreover, the coefficient of determination (R2) consistently exceeds 0.995 under various temperature conditions, indicating that the model effectively compensates for temperature-induced errors in the sensor under different thermal and strain conditions, and has excellent stability and adaptability.Therefore, the temperature compensation method proposed in this study not only offers a novel approach for improving the measurement accuracy of fiber-optic Fabry-Perot strain sensors, but also provides a valuable reference for studying the temperature compensation in related sensor technologies. Future research may further explore the applicability of this method to other types of sensors, thereby promoting the sustaining development of intelligent sensing technologies.