Magnetic field sensing plays a pivotal role in numerous fields of medical, transportation and aerospace. The optical fiber-based magnetic field sensor possesses outstanding characteristics of compactness, long-distance interrogation, low cost and high sensitivity, which has attracted intensive interest. However, the fiber-based magnetic field sensor is generally affected by the temperature perturbation.