Recently, the demand for an image retrieval is increasing. In this paper, we propose image retrieval method based on the keyword which consists of natural language. The retrieval system consists of retrieving engine with dictionary. Dictionary has retrieval algorithm corresponding to the keyword. Retrieval algorithm consists of grouping switch, vector quantizer and N out of M(N/M) detector. The parameters of vector quantizer and N/M detector are optimized by Genetic Algorithm and Vector Quantization Algorithm. In this paper, we show the outline of the proposed retrieval system and the method of automatic generation of image retrieval algorithm. Further, we show the proposed method has the capability to generate image retrieval algorithm.