Ensuring the confidentiality and integrity of sensitive patient records is a critical challenge in modern healthcare. Among various data security techniques, steganography, which conceals data within digital media, has emerged as a prominent solution. However, conventional methods often fail to achieve a sufficient balance between high data embedding capacity and the preservation of diagnostic image quality, limiting their practical use in clinical settings. To address this, this paper introduces BASMEDSecure, a novel data hiding framework that utilizes a logistic regression model to classify pixels based on their intensity levels. An adaptive embedding algorithm then utilizes this classification to dynamically adjust the number of secret data bits hidden within each pixel’s least significant bit. Experimental results demonstrate promising performance for the proposed BASMEDSecure, with a PSNR (expressing the quality of the stego image) ranging from 52.103 to 75.521 decibels (dB). The obtained SSIM value of 0.9999 highlights a close similarity between the cover and stego medical images, emphasizing the efficiency of BASMEDSecure in maintaining image integrity, which is crucial for accurate medical interpretations.