Thyroid extraction from single photon emission computed tomography (SPECT) image is an important primary work for medical image analysis and computer aided diagnosis. However, SPECT image of thyroid does not have a clear margin boundary compared with ultrasound or CT images. A thyroid extraction method for SPECT Image based on artificial immune network that is optimized with firefly algorithm is developed. Artificial immune network is employed for discovering the correlation between spatial distance and pixel value by samples selection, and firefly algorithm with adaptive step is used for optimization the samples selection. The experimental results demonstrate that the proposed method is efficient with less extraction error which is superior to other extraction methods. The average error of the proposed method is 21.9% and 14.4% less than that of sampling method and global sampling method, respectively. And the proposed method is also robust for initial regions with varies radius. The experiments reveal that the proposed method is more efficient than other sampling methods with different trimaps.