1. A defect detecting apparatus comprising: an imaging unit that captures, with a first magnification, an image of a microstructure formed on each of a plurality of dies on a semiconductor wafer, with respect to every first division region obtained by dividing each die in plurality; a storage unit that stores therein the image of each first division region together with first identification information for identifying a position of each first division region within each die as a first inspection target image; a model image creating unit that creates an average image as a first model image for the every first identification information, the average image being obtained by averaging, among the first inspection target images, the first inspection target images of respective first division regions having the corresponding first identification information over the dies; a detecting unit that detects presence or absence of a defect of the microstructure on each first division region within one of the dies by comparing the first model image with each first inspection target image corresponding to the first identification information of the first model image; a control unit that controls the imaging unit such that the imaging unit captures, with a second magnification higher than the first magnification, an image of the microstructure on the first division region from which the defect is detected and microstructures on respective first division regions, within other dies, corresponding to the first identification information of the first division region from which the defect is detected, with respect to every second division region obtained by dividing each first division region in plurality; controls the storage unit to store therein the image of each second division region together with second identification information for identifying a position of each second division region within each die as a second inspection target image; and controls the model image creating unit to create an average image as a second model image for every second identification information, the second average image being obtained by averaging, among the second inspection target images, the second inspection target images of respective second division regions having the corresponding second identification information over the dies; and a defect classifying unit that determines the kind of the detected defect by comparing the second model image with each second inspection target image corresponding to the second identification information of the second model image.