Osteoporosis occurs due to the fragility fracture of the bone, which mostly affects the women as per the report over 50 years. Various methods are introduced to achieve osteoporosis classification in the X-ray images, but focusing on the cortical bones is a major challenge in the research community. Thus, an Adaptive Gradient Harmony Search (GHS) based Deep Convolutional Neural Network (Deep CNN) is proposed to achieve the osteoporosis classification. Initially, the input images are pre-processed to extract the interesting region and are segmented using the mean shift clustering technique to extract the femur boundaries. The extracted femur boundaries are further processed by the femur bone geometric estimation phase, which uses the template search method to mark the femur points automatically. The features, like medical-level features, image-level features, and pixel-level features are extracted through the feature extraction process. Finally, the osteoporosis classification is achieved using the Deep Convolutional Neural Network, which is trained by the proposed Adaptive Gradient Harmony Search optimization. The implementation of the proposed Adaptive Gradient Harmony Search-based Deep Convolutional Neural Network is carried out and the performance is analyzed using the metrics, namely accuracy, specificity, and sensitivity, which acquire the values of 0.97, 0.99, and 0.99 respectively.