As IoT devices become increasingly integrated into healthcare systems, thesecurity and privacy of medical image data transmitted and stored in cloudenvironments are paramount. This paper introduces a novel approach that harnessesvanilla Generative Adversarial Networks (GANs) and chaotic RestrictedBoltzmann Machines (RBMs) to tackle security challenges in medical imagetransmission and storage. GANs generate privacy-preserving representationsof medical images, while RBMs facilitate secure compression, encryption, andanomaly detection. The suggested GAN-RBM (GAN-RBM) integrates GANsand RBMs into IoT systems to provide the safe and effective transfer of medicalimages over networks that may not be secure. Additionally, it offers strong protectionfor image data saved in the cloud. Therefore, these massive amounts ofmedical data are securely stored, processed, and handled using cloud computingtechnology, which is protected from numerous assaults. Real-time (IntraCranialHaemorrhage -ICH) datasets are collected from hospitals for MRI, and CT imagesare utilized for experimentation. Performance metrics such as encryption/decryptionspeed, compression ratio, and anomaly detection accuracy are evaluated todemonstrate the effectiveness of the proposed approach in safeguarding patient privacy, ensuring data integrity, and detecting unauthorized access or tamperingattempts. Encrypting a 140MB image takes 950 seconds and decrypting 990seconds. For 200 epochs, the proposed model has a compression ratio of 97.34%and GANs-RBM outperformed all other machine-learning models with a 94.17%anomaly detection score.