profile

Machine Learning for Medical Imaging

Improve Performance for Segmentation Model API

Published 5 months agoΒ β€’Β 2 min read

Hi Reader,,

Welcome to the PYCAD newsletter, where every week you receive doses of machine learning and computer vision techniques and tools to help you learn how to build AI solutions to empower the most vulnerable members of our society, patients.

​

ML Deep Dive:
Improve Performance for Image Segmentation Model APIs

I've used lots of deep learning models for image segmentation in my career. A lot of these segmentation models have been for medical imaging applications.
​
Here's one issue that we constantly faced when using them through an API.
​
Image segmentation models such as YOLOv8 or Mask RCNN are very useful in a variety of computer vision applications.
​
If you're building a cloud based image segmentation solution, you most likely will need to deploy your model through an API.
​
This means that your model will live in a separate entity like a docker container.
​
In most scenarios you'll have a REST API that controls how your backend or frontend interacts with the model.
​
These models produce masks as the main output.
​
These masks are basically binary images that have the same size as your input images.
​
If you return these masks from your REST API as they are, it will require a lot of time to transmit that information from your API to your backend or frontend server.
​
This will quickly become a bottleneck for your application performance.
​
Solution?
​
Don't return full masks. Return polygons instead.
​
Polygons represent the border of the masked regions.
​
This means that they require a lot less time to transfer.
​
Big win for performance!
​
But you need masks in the backend and frontend and not polygons right?
​
Well, just reconstruct the masks from the polygons.
​
You can use a function like cv2.fillpoly to achieve this.
​
Sometimes small modifications can lead to great improvements in terms of performance!

Medical Imaging Datasets Made Public

In the past 3 weeks, 2 medical imaging datasets have been made available by the open source community. Here they are and here’s how to download them.

Dataset 1:

It contains 27 thorax CT scans which contains annotations for airways as well as lungs.

Dataset size: 5Gb

Link to download the dataset: https://zenodo.org/records/10069289​

Dataset 2:

It contains 15 CT scans of:

  • lymph nodes,
  • azygos,
  • esophagus,
  • and subclavian carotid arteries.

But if you’re mostly interested in lymph nodes, then you can access a bigger dataset with 90 CT scans that has only lymph nodes annotations.

It contains:

  • Annotations of a total of 388 mediastinal lymph nodes of 90 patients,
  • Annotations of a total of 595 abdominal lymph nodes of 86 patients.

Link to download the 15 CT scans dataset: https://huggingface.co/datasets/andreped/LyNoS​

Link to download the 90 CT scans dataset: https://wiki.cancerimagingarchive.net/pages/viewpage.action?pageId=19726546​

​

X Post of the Week

​

twitter profile avatar
Darrin Johnson
Twitter Logo
@darrinpjohnson
9:44 PM β€’ Dec 2, 2023
1
Retweets
2
Likes
​

We Can Help You with Your Next Medical Imaging Project

If your company or organization is looking to build a machine learning solution for a medical imaging problem, then feel free to reach out to us at:

​contact@pycad.co​

We can help you build a full ML solution from training to deployment with affordable rates!

You can check out some of the projects that we worked on here:

​https://pycad.co/portfolio and some of our clients case studies here.

​

That's it for this week's edition, I hope you enjoyed it!

​

Machine Learning for Medical Imaging

by Nour Islam Mokhtari from pycad.co

πŸ‘‰ Learn how to build AI systems for medical imaging domain by leveraging tools and techniques that I share with you! | πŸ’‘ The newsletter is read by people from: Nvidia, Baker Hughes, Harvard, NYU, Columbia University, University of Toronto and more!

Read more from Machine Learning for Medical Imaging

Hi Reader,, Welcome to the PYCAD newsletter, where every week you receive doses of machine learning and computer vision techniques and tools to help you learn how to build AI solutions to empower the most vulnerable members of our society, patients. TotalSegmentator : Whole Body Segmentation at your Fingertips This free tool available online can do full body segmentation, it's called TotalSegmentator. I have already mentioned this tool in a previous edition of the newsletter, but in this...

9 days agoΒ β€’Β 3 min read

Hello Reader, Welcome to another edition of PYCAD newsletter where we cover interesting topics in Machine Learning and Computer Vision applied to Medical Imaging. The goal of this newsletter is to help you stay up-to-date and learn important concepts in this amazing field! I've got some cool insights for you below ↓ A Medical Imaging Expert Told Me This Recently I saw a post on LinkedIn where a medical imaging expert showcased his work of segmenting the lungs and its bronchial trees. You can...

16 days agoΒ β€’Β 2 min read

Hello Reader, Welcome to another edition of PYCAD newsletter where we cover interesting topics in Machine Learning and Computer Vision applied to Medical Imaging. The goal of this newsletter is to help you stay up-to-date and learn important concepts in this amazing field! I've got some cool insights for you below ↓ How we helped accelerate inference time for a client's AI product Below is a screenshot of a benchmark we did for a client of ours. The goal was to accelerate inference time. This...

22 days agoΒ β€’Β 3 min read
Share this post