A method of analyzing foreign matter in a sample includes:measuring an optical spectrum for each of a plurality of measurement points of a measurement region on the sample by a microscopic spectroscope;calculating a feature value of each measured spectrum by a computer;determining whether each of the measurement points is on the foreign matter or not based on each feature value;retaining the spectrum of the measurement point that is determined to be on the foreign matter, anddeleting the spectrum of the measurement point that is not determined to be on the foreign matter or storing the same to a storage unit; andexecuting multivariate analysis of the spectra of the plurality of the measurement points that are determined to be on the foreign matter or classifying the same with AI search.展开▼