The authors propose WNAHVF, a combined weighted and normalized AlexNet with handcrafted visual features for extracting features from images and using those vectors for image retrieval and classification. The authors test the WNAHVF method on two general datasets, Corel-1k and Corel-10k, and one medical dataset. The outcomes demonstrate combining Bag of Features and Local Neighbor patterns with AlexNet enhances the accuracy and gives better results in general and medical image datasets in retrieval and classification problems. This algorithm gives results that are superior to existing strategies.