Artificial intelligence (AI) related to intelligent control in healthcare denotes using AI techniques to enhance the management and control of healthcare processes and systems. Damage to the inner and middle ear caused by accidents and diseases even causes hearing impairment in the ear that has been harmed or injured. Traditional otoscopy devices were utilized to check the tympanic membrane (TM) to identify OM in medical practice, and a conclusion is drawn depending on the outcomes of the examination. While developing a computer-aided method to support the OM diagnosis, it is possible to focus on methods like feature extraction, image pre-processing, classification, and image segmentation. The existing methodology of detecting the ear infection experiences a reduction of accuracy due to the influence of the noise in the input ear image. This presence of noise affects the feature extraction process, directly influences the accuracy in detection process. To overcome this issue, in this manuscript, a Deep learning (DL) is utilized to find biomedical ear infections by examining images of the eardrum and ear canal. The process includes training a DL method with a large dataset of ear images, where the images were labeled as either not infected or infected. With this motivation, this article emphasizes the design of Bayesian optimization with a deep learning-based automated ear infection detection and classification (BODL-AEIDC) model. The BODL-AEIDC technique exploits the DL model with a metaheuristic optimization algorithm for the ear infection classification process. The BODL-AEIDC technique employs a Wiener filtering (WF) based noise removal process to eliminate the noise data. In addition, the BODL-AEIDC technique exploits W-Net-based segmentation and the EfficientNet model for feature extraction purposes. Moreover, the BODL-AEIDC technique employs a fuzzy Restricted Boltzmann machine (FRBM) model for ear infection detection. Furthermore, the BO algorithm is utilized to adjust the FRBM technique's hyperparameter values effectively. The BODL-AEIDC technique's experimental outcomes occur using the medical dataset. The comprehensive comparative study stated the enhanced performance of the BODL-AEIDC approach over other existing methods.