Nowadays, medical images play a vital role in the clinical diagnosis system, because these images contain a vast amount of medical information. The huge amount of medical images is generated everyday using the digital imaging techniques in medical examination centers and hospitals. The generated data are stored in large database and retrieving the same images is a significant task for better diagnosis. However, manual retrieval of clinical data is a tough and time consuming process due to the large database. The memory requirement and computation complexity of the existing condensed nearest neighbor (CNN) is more, it is solved by proposed independent condensed nearest neighbor (ICNN). The ICNN classification technique is developed to automatically retrieve the medical images from large database. The important features are extracted by using histogram of gradient (HOG) technique. The sub-quadratic time complexity presented in ICNN requires only few iterations to retrieve the query images, which improves the retrieval accuracy of the proposed technique. The experiments are used to test the performance of ICNN method in terms of classification and retrieval presentation. The proposed ICNN method outperforms existing CNN method by achieving specificity of 99.55% in the classification performance.