1. An image processing apparatus comprising: a dividing unit that divides an object image into regions; a first extracting unit that extracts image features of the regions generated by the dividing unit; a first storage device that stores information relating to clustering of each set of image features; a quantizing unit that quantizes the image features extracted by the first extracting unit; a generating unit that generates an expected value of an occurrence probability of each topic variable corresponding to a topic defined in an LDA (Latent Dirichlet Allocation) model and indicating similar images from the quantized image features corresponding to words defined in the LDA model, using a correlation between the image features quantized by the quantizing unit and the topic variables; and an image output unit that outputs an image of a defective portion in the object image, using the expected values of the occurrence probabilities of the topic variables generated by the generating unit, wherein the quantizing unit quantizes the extracted image features, using the information relating to clustering stored in the storage device, and wherein the information relating to clustering of each set of image features is calculated by clustering each set of image features of the regions in a predetermined pathological change image database.