The vibration features are affected by damage in structure and environmental conditions while the bridges are in the operation. Environment effects should not be ignored in making correct diagnoses of structures. Negative selection algorithm inspired by immune system has the capability for self-nonself discrimination. Temperature effect on natural frequency is analyzed in the paper, and the algorithm based on Euclidean distance is applied to natural frequencies of structures under temperature variations. The results indicate that negative selection algorithm using natural frequency passes the false-positive tests, and effectively detect the anomalous condition of structure under varying temperature.