Medical image similarity perception for content-based image retrieval