An adaptive inertia weight particle swarm algorithm is proposed in this study to solve the local optimal problem with the method of traditional particle swarm optimization in the process of estimating magnetic resonance (MR) image bias field. An indicator measuring the degree of premature convergence was designed for the defect of traditional particle swarm optimization algorithm. The inertia weight was adjusted adaptively based on this indicator to ensure particle swarm to be optimized globally and to avoid it from falling into local optimum. The Legendre polynomial was used to fit bias field, the polynomial parameters were optimized globally, and finally the bias field was estimated and corrected. Compared to those with the improved entropy minimum algorithm, the entropy of corrected image was smaller and the estimated bias field was more accurate in this study. Then the corrected image was segmented and the segmentation accuracy obtained in this research was 10% higher than that with improved entropy minimum algorithm. This algorithm can be applied to the correction of MR image bias field.