Flexible temperature sensors are of considerable importance in many industrial and domestic fields such as medical care, agriculture, and food.We report a novel flexible temperature sensor based on polyvinyl alcohol acrylamide hydrogels with moisture content compensation.Firstly, the flexible temperature sensor was prepared by using graphene as a thermal conductive filler and polyvinyl alcohol and acrylamide as a matrix.Secondly, because the measurement accuracy of the flexible temperature sensor is considerably affected by the moisture content, a design scheme for the flexible temperature sensor with a moisture content compensation model was proposed.Finally, on the basis of the measured data of the flexible temperature sensor under multiple moisture contents, an improved sparrow search algorithm was used to optimize the backpropagation neural network model to compensate for the error caused by changes in moisture content, so as to improve the measurement accuracy of the sensor.The compensation results show that the proposed scheme can significantly reduce the measurement error of the flexible temperature sensor, enabling accurate, reliable, and sustainable monitoring.