A method based on the independent component analysis (ICA) is proposed to compensate the in-phase and quadrature-phase the (IQ) imbalance in orthogonal frequency division multiplexing (OFDM) optical fiber communication systems. The mathematical model of IQ imbalance system has been analyzed. Then, ICA algorithm is applied in the system to combat the mirror interference introduced by IQ imbalance. This algorithm can realize the joint compensation of both transmitter and receiver IQ imbalance with the optical channel that contains noise, attenuation and chromatic dispersion. The simulation shows that the performance degradation caused by IQ imbalance can be compensated by ICA algorithm effectively.