Background: Ovarian cancer (OC) is a highly fatal malignancy of the female reproductive system, characterized by its high mortality rate and the challenges associated with clinical research due to the disease's complexity and late-stage diagnosis. Advances in technology, such as the Internet of Medical Things (IoMT), offer new opportunities for improving OC detection and diagnosis. Objective: This study aimed to develop and evaluate a novel method for OC detection using IoMT data, leveraging Self-Organizing Maps (SOM) and Improved Recurrent Neural Networks (IRNN) enhanced with the Extended Harmony Search Optimization (EHSO) algorithm to improve feature selection and classification accuracy. Methods: The study utilized OC data from the IoMT and applied SOM for feature selection, which helps in managing and classifying large datasets. SOM was employed to improve data representation and address challenges in labeling and classifying data. The IRNN model, optimized using the EHSO algorithm, was developed to enhance classification performance. The model was tested using a dataset from Kaggle comprising 179 benign and 172 malignant OC images with 50 attributes. Results: The IRNN model with EHSO demonstrated superior performance compared to other methods. In the training dataset, it achieved an accuracy of 95.72% and a Root Mean Square Error (RMSE) of 4.8%. For the testing dataset, the model maintained a high accuracy of 90.4% and an RMSE of 6.8%. The IRNN with EHSO outperformed alternative methods in terms of specificity and sensitivity, while the Genetic Algorithm (GA) showed the lowest performance across all metrics. Conclusion: The proposed method using SOM and IRNN with EHSO significantly improves the detection of ovarian cancer by optimizing feature selection and classification accuracy. This approach offers a promising advancement in utilizing IoMT data for early and accurate OC diagnosis, potentially enhancing patient outcomes through more effective detection and treatment strategies.