Deep learning for medical imaging in Python

How we built a Python-based custom healthcare software solution for assisting radiologists in interpreting MRI scans and detecting various pathological conditions using AI and ML technologies.
Deep learning hero image

Magnetic resonance imaging (MRI) is one of the most advanced non-invasive medical diagnostic methods which produces images of cross-sections of organs in the three main body planes, as well as images of their combinations, enabling for more accurate assessment and diagnosis of various diseases.

Deep learning for medical imaging, part 1

Detailed description of machine learning methods and techniques used in our newest medical imaging project.

Similar to other industries, there has been a rise in the use of AI in medicine, as many realize its full potential. There are various applications of artificial intelligence in healthcare, aiming to easily and quickly identify certain medical conditions, which also leads to quicker intervention and treatment. For the development of complex solutions integrating AI and ML technologies, Python programming language is an obvious choice.

Using Python libraries is a great way to develop machine learning software for medical imaging applications. For our project, we utilized several popular libraries to develop a deep learning model that can accurately identify various pathological conditions in knee MRI scans.


MR is often a method of first choice for diagnostic diseases of central nervous system organs, as well as various diseases and states of the locomotor system.

While the hazards of other imaging methods that use ionizing radiation (X-rays, CTs) are now well-understood and controlled, MRI may still be a better choice in many different scenarios. On the other hand, it is a relatively expensive and time-consuming technique. It generates and captures huge amounts of data containing extremely valuable information, at a pace far surpassing what traditional manual methods of analysis can process. The analysis of MR scans requires highly specialized experts that manually review and mark regions affected by some sort of pathology.

Algorithms and processes that automate this work, at least partially, could be very valuable in clinical practice.


The goal of this project is to produce a Software-as-a-Service (SaaS) system for automating segmentation and classification of orthopedics MRI, focusing on knee scans, using Machine Learning (ML) techniques. Algorithmic methods for MRI analysis fall into two general categories: classification and segmentation.

Deep learning for medical imaging, part 2

The role of data preprocessing and segmentation for improved knee pathology classification in magnetic resonance imaging.

In the classification category, labels are assigned to MRI series based on characteristics such as normal/abnormal status, severity level, or diagnosis. Segmentation is the process of delineating the boundaries, or “contours”, of various tissues and processes. Our system aims to contain functionality of both methods, and serves as a prototype for a „virtual assistant“ in interpreting MR scans to help radiologists in their everyday work.


The finalized system includes a functionality for acquiring imaging results via the DICOM standard, data pre-processing, processing of images using appropriate ML models, and displaying results in a user-friendly and intuitive fashion. We have applied Class Activation Map (CAM) overlays on top of original scans to show which areas contributed the most to the classification outcome, signalizing which anatomic structures should be further evaluated for problems.

Deep learning for medical imaging, part 3

The role of data preprocessing and segmentation for improved knee pathology classification in magnetic resonance imaging.

Along with what we have achieved so far, we plan to continue the development of this system by extending its scope in ways to include support for processing scans of other body regions, as well as providing support for an unlimited number of users using cloud-computing technologies. By doing so, we aim to continue improving the usefulness and versatility of the system and thus extending its possible use. The ultimate goal of our solution is to apply the many benefits of machine learning as an emerging technology, as well as the advantages of deep learning methods to optimize and streamline important healthcare processes.

Our tech stack

Book a free consultation

Let us know what would you like to do. We will probably have some ideas on how to do it.