SlideShare une entreprise Scribd logo
1  sur  13
COVID-19 lung CT image segmentation
B y :
S w a p n a Ta l l a
1
Agenda
Segmentation Process
Dataset Description
Methods
Visualization of CT Image
Normalization & Splitting Data
Model Creation
Model Compilation and Evaluation
Conclusion
2
Segmentation
Process
Loading the Dataset
Preprocessing the data
Data Splitting
Model Creation(U-Net)
Model Compilation
Model Evaluation
Model Inference
3
Dataset
It consists of two parts:
Medseg part:
images_medseg.npy - training images – 100 slices 512x512 size
masks_medseg.npy - training masks – 100 masks with 4 channels: (0
- "ground glass", 1 - "consolidations", 2 - "lungs other", 3 -
"background" )
test_images_medseg.npy - test images – 10 slices 512x512 size
Radiopedia part:
images_radiopsedia.npy - training images – 829 slices 512x512 size
masks_radiopedia.npy - training masks – 829 masks with 4
channels: (0 - "ground glass", 1 - "consolidations", 2 - "lungs other", 3
- "background" )
4
Methods
U-Net Architecture:
Images were segmented by a radiologist using 3 labels: ground-glass
(mask value =1), consolidation (=2) and pleural effusion (=3).
Hyperparameter Tuning:
 Size of the Conv2D layers' filters (3x3)
 Filter count in Conv2D layers (32, 64, 128, 256, 512)
 Conv2DTranspose layers' stride size, for instance in (2, 2)
 Activation Function, "relu"
 padding ( "same")
5
Random CT Image
Visualization(medseg)
# Choose a random image and its mask to
visualize
idx = 0 # index of the image you want to v
isualize
image = images_medseg[idx, :, :, 0]
mask = masks_medseg[idx, :, :, 0]
fig, axs = plt.subplots(1, 3, figsize=(20, 10
))
axs[0].imshow(image, cmap='gray')
axs[0].set_title('CT Image')
axs[1].imshow(mask, cmap='gray')
axs[1].set_title('GGO')
axs[2].imshow(masks_medseg[idx, :, :, 1],
cmap='gray')
axs[2].set_title('Consolidations')
plt.show()
6
Random CT Image
Visualization(Radiopedia)
# Visualizing the data
# Plot an example image and its corre
sponding mask
idx = 30 # index of the image you w
ant to visualize
image = images_radiopedia[idx, :, :,
0]
mask = masks_radiopedia[idx, :, :, 1]
fig, axs = plt.subplots(1, 3, figsize=(2
0, 10))
axs[0].imshow(image, cmap='gray')
axs[0].set_title('Image')
axs[1].imshow(masks_radiopedia[idx
, :, :, 0], cmap='gray')
axs[1].set_title('GGO')
axs[2].imshow(mask, cmap='gray')
axs[2].set_title('Consolidations')
plt.show()
7
Normalization & Splitting Data
# Normalize images to [0, 1] range
images_medseg = (images_medseg -
np.min(images_medseg)) / (np.max(images_medseg) -
np.min(images_medseg))
images_radiopedia = (images_radiopedia -
np.min(images_radiopedia)) / (np.max(images_radiopedia) -
np.min(images_radiopedia))
test_images_medseg = (test_images_medseg -
np.min(test_images_medseg)) / (np.max(test_images_medseg) -
np.min(test_images_medseg))
# Split the data into training, validation, and testing sets
x_train = images_radiopedia
y_train = masks_radiopedia
x_val = images_medseg
y_val = masks_medseg
8
Model
Creation(U-Net)
9
Model Compile and
Evaluation
# Model Compile
model.compile(optimizer='adam', loss='binary_cr
ossentropy', metrics=['accuracy'])
10
# Model Evaluation
history = unet_model.fit(x_train, y_trai
n, batch_size=32, epochs=10, validatio
n_data=(x_val, y_val))
11
Conclusion
• In computer vision, image
segmentation is a very beneficial
process that may be used in a range
of use-cases, including medical
imaging and driverless cars, to
collect various segments or classes
in real-time. One can now
experiment with utilizing U-Net to
implement image segmentation on
various challenges or by
investigating other models that are
helpful in image segmentation.
12
Thank you
13

Contenu connexe

Similaire à Covid-19 Segmentation of Lung CT images.pptx

An Efficient System for Cancer Detection using Digital Mammograms
An Efficient System for Cancer Detection using Digital MammogramsAn Efficient System for Cancer Detection using Digital Mammograms
An Efficient System for Cancer Detection using Digital MammogramsIOSRjournaljce
 
maXbox starter65 machinelearning3
maXbox starter65 machinelearning3maXbox starter65 machinelearning3
maXbox starter65 machinelearning3Max Kleiner
 
DN 2017 | Multi-Paradigm Data Science - On the many dimensions of Knowledge D...
DN 2017 | Multi-Paradigm Data Science - On the many dimensions of Knowledge D...DN 2017 | Multi-Paradigm Data Science - On the many dimensions of Knowledge D...
DN 2017 | Multi-Paradigm Data Science - On the many dimensions of Knowledge D...Dataconomy Media
 
29-kashyap-mask-detaction.pptx
29-kashyap-mask-detaction.pptx29-kashyap-mask-detaction.pptx
29-kashyap-mask-detaction.pptxKASHYAPPATHAK7
 
What is the UML Class diagram for accident detection using CNN- i have.pdf
What is the UML Class diagram for accident detection using CNN- i have.pdfWhat is the UML Class diagram for accident detection using CNN- i have.pdf
What is the UML Class diagram for accident detection using CNN- i have.pdfanilagarwal8880432
 
Liver segmentationwith2du net
Liver segmentationwith2du netLiver segmentationwith2du net
Liver segmentationwith2du netAmrCady
 
Machine Learning - Introduction
Machine Learning - IntroductionMachine Learning - Introduction
Machine Learning - IntroductionEmpatika
 
maXbox starter68 machine learning VI
maXbox starter68 machine learning VImaXbox starter68 machine learning VI
maXbox starter68 machine learning VIMax Kleiner
 
Machine Learning Algorithms
Machine Learning AlgorithmsMachine Learning Algorithms
Machine Learning AlgorithmsHichem Felouat
 
Primer vistazo al computer vision | 4Sessions Feb17
Primer vistazo al computer vision | 4Sessions Feb17Primer vistazo al computer vision | 4Sessions Feb17
Primer vistazo al computer vision | 4Sessions Feb17[T]echdencias
 
Denis Sergienko "Pip install driven deep learning"
Denis Sergienko "Pip install driven deep learning"Denis Sergienko "Pip install driven deep learning"
Denis Sergienko "Pip install driven deep learning"Fwdays
 
PyData London 2015 - Localising Organs of the Fetus in MRI Data Using Python
PyData London 2015 - Localising Organs of the Fetus in MRI Data Using PythonPyData London 2015 - Localising Organs of the Fetus in MRI Data Using Python
PyData London 2015 - Localising Organs of the Fetus in MRI Data Using PythonKevin Keraudren
 
AIML4 CNN lab256 1hr (111-1).pdf
AIML4 CNN lab256 1hr (111-1).pdfAIML4 CNN lab256 1hr (111-1).pdf
AIML4 CNN lab256 1hr (111-1).pdfssuserb4d806
 
Brain Tumor Detection and Classification Using MRI Brain Images
Brain Tumor Detection and Classification Using MRI Brain ImagesBrain Tumor Detection and Classification Using MRI Brain Images
Brain Tumor Detection and Classification Using MRI Brain ImagesIRJET Journal
 
An Efficient Approach of Segmentation and Blind Deconvolution in Image Restor...
An Efficient Approach of Segmentation and Blind Deconvolution in Image Restor...An Efficient Approach of Segmentation and Blind Deconvolution in Image Restor...
An Efficient Approach of Segmentation and Blind Deconvolution in Image Restor...iosrjce
 
FUZZY IMAGE SEGMENTATION USING VALIDITY INDEXES CORRELATION
FUZZY IMAGE SEGMENTATION USING VALIDITY INDEXES CORRELATIONFUZZY IMAGE SEGMENTATION USING VALIDITY INDEXES CORRELATION
FUZZY IMAGE SEGMENTATION USING VALIDITY INDEXES CORRELATIONijcsit
 
Week2- Deep Learning Intuition.pptx
Week2- Deep Learning Intuition.pptxWeek2- Deep Learning Intuition.pptx
Week2- Deep Learning Intuition.pptxfahmi324663
 

Similaire à Covid-19 Segmentation of Lung CT images.pptx (20)

An Efficient System for Cancer Detection using Digital Mammograms
An Efficient System for Cancer Detection using Digital MammogramsAn Efficient System for Cancer Detection using Digital Mammograms
An Efficient System for Cancer Detection using Digital Mammograms
 
maXbox starter65 machinelearning3
maXbox starter65 machinelearning3maXbox starter65 machinelearning3
maXbox starter65 machinelearning3
 
DN 2017 | Multi-Paradigm Data Science - On the many dimensions of Knowledge D...
DN 2017 | Multi-Paradigm Data Science - On the many dimensions of Knowledge D...DN 2017 | Multi-Paradigm Data Science - On the many dimensions of Knowledge D...
DN 2017 | Multi-Paradigm Data Science - On the many dimensions of Knowledge D...
 
29-kashyap-mask-detaction.pptx
29-kashyap-mask-detaction.pptx29-kashyap-mask-detaction.pptx
29-kashyap-mask-detaction.pptx
 
Eigenfaces
EigenfacesEigenfaces
Eigenfaces
 
What is the UML Class diagram for accident detection using CNN- i have.pdf
What is the UML Class diagram for accident detection using CNN- i have.pdfWhat is the UML Class diagram for accident detection using CNN- i have.pdf
What is the UML Class diagram for accident detection using CNN- i have.pdf
 
Liver segmentationwith2du net
Liver segmentationwith2du netLiver segmentationwith2du net
Liver segmentationwith2du net
 
Machine Learning - Introduction
Machine Learning - IntroductionMachine Learning - Introduction
Machine Learning - Introduction
 
maXbox starter68 machine learning VI
maXbox starter68 machine learning VImaXbox starter68 machine learning VI
maXbox starter68 machine learning VI
 
Machine Learning Algorithms
Machine Learning AlgorithmsMachine Learning Algorithms
Machine Learning Algorithms
 
Primer vistazo al computer vision | 4Sessions Feb17
Primer vistazo al computer vision | 4Sessions Feb17Primer vistazo al computer vision | 4Sessions Feb17
Primer vistazo al computer vision | 4Sessions Feb17
 
Denis Sergienko "Pip install driven deep learning"
Denis Sergienko "Pip install driven deep learning"Denis Sergienko "Pip install driven deep learning"
Denis Sergienko "Pip install driven deep learning"
 
PyData London 2015 - Localising Organs of the Fetus in MRI Data Using Python
PyData London 2015 - Localising Organs of the Fetus in MRI Data Using PythonPyData London 2015 - Localising Organs of the Fetus in MRI Data Using Python
PyData London 2015 - Localising Organs of the Fetus in MRI Data Using Python
 
AIML4 CNN lab256 1hr (111-1).pdf
AIML4 CNN lab256 1hr (111-1).pdfAIML4 CNN lab256 1hr (111-1).pdf
AIML4 CNN lab256 1hr (111-1).pdf
 
Brain Tumor Detection and Classification Using MRI Brain Images
Brain Tumor Detection and Classification Using MRI Brain ImagesBrain Tumor Detection and Classification Using MRI Brain Images
Brain Tumor Detection and Classification Using MRI Brain Images
 
An Efficient Approach of Segmentation and Blind Deconvolution in Image Restor...
An Efficient Approach of Segmentation and Blind Deconvolution in Image Restor...An Efficient Approach of Segmentation and Blind Deconvolution in Image Restor...
An Efficient Approach of Segmentation and Blind Deconvolution in Image Restor...
 
F017614146
F017614146F017614146
F017614146
 
FUZZY IMAGE SEGMENTATION USING VALIDITY INDEXES CORRELATION
FUZZY IMAGE SEGMENTATION USING VALIDITY INDEXES CORRELATIONFUZZY IMAGE SEGMENTATION USING VALIDITY INDEXES CORRELATION
FUZZY IMAGE SEGMENTATION USING VALIDITY INDEXES CORRELATION
 
Dip 3
Dip 3Dip 3
Dip 3
 
Week2- Deep Learning Intuition.pptx
Week2- Deep Learning Intuition.pptxWeek2- Deep Learning Intuition.pptx
Week2- Deep Learning Intuition.pptx
 

Dernier

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 

Dernier (20)

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 

Covid-19 Segmentation of Lung CT images.pptx

  • 1. COVID-19 lung CT image segmentation B y : S w a p n a Ta l l a 1
  • 2. Agenda Segmentation Process Dataset Description Methods Visualization of CT Image Normalization & Splitting Data Model Creation Model Compilation and Evaluation Conclusion 2
  • 3. Segmentation Process Loading the Dataset Preprocessing the data Data Splitting Model Creation(U-Net) Model Compilation Model Evaluation Model Inference 3
  • 4. Dataset It consists of two parts: Medseg part: images_medseg.npy - training images – 100 slices 512x512 size masks_medseg.npy - training masks – 100 masks with 4 channels: (0 - "ground glass", 1 - "consolidations", 2 - "lungs other", 3 - "background" ) test_images_medseg.npy - test images – 10 slices 512x512 size Radiopedia part: images_radiopsedia.npy - training images – 829 slices 512x512 size masks_radiopedia.npy - training masks – 829 masks with 4 channels: (0 - "ground glass", 1 - "consolidations", 2 - "lungs other", 3 - "background" ) 4
  • 5. Methods U-Net Architecture: Images were segmented by a radiologist using 3 labels: ground-glass (mask value =1), consolidation (=2) and pleural effusion (=3). Hyperparameter Tuning:  Size of the Conv2D layers' filters (3x3)  Filter count in Conv2D layers (32, 64, 128, 256, 512)  Conv2DTranspose layers' stride size, for instance in (2, 2)  Activation Function, "relu"  padding ( "same") 5
  • 6. Random CT Image Visualization(medseg) # Choose a random image and its mask to visualize idx = 0 # index of the image you want to v isualize image = images_medseg[idx, :, :, 0] mask = masks_medseg[idx, :, :, 0] fig, axs = plt.subplots(1, 3, figsize=(20, 10 )) axs[0].imshow(image, cmap='gray') axs[0].set_title('CT Image') axs[1].imshow(mask, cmap='gray') axs[1].set_title('GGO') axs[2].imshow(masks_medseg[idx, :, :, 1], cmap='gray') axs[2].set_title('Consolidations') plt.show() 6
  • 7. Random CT Image Visualization(Radiopedia) # Visualizing the data # Plot an example image and its corre sponding mask idx = 30 # index of the image you w ant to visualize image = images_radiopedia[idx, :, :, 0] mask = masks_radiopedia[idx, :, :, 1] fig, axs = plt.subplots(1, 3, figsize=(2 0, 10)) axs[0].imshow(image, cmap='gray') axs[0].set_title('Image') axs[1].imshow(masks_radiopedia[idx , :, :, 0], cmap='gray') axs[1].set_title('GGO') axs[2].imshow(mask, cmap='gray') axs[2].set_title('Consolidations') plt.show() 7
  • 8. Normalization & Splitting Data # Normalize images to [0, 1] range images_medseg = (images_medseg - np.min(images_medseg)) / (np.max(images_medseg) - np.min(images_medseg)) images_radiopedia = (images_radiopedia - np.min(images_radiopedia)) / (np.max(images_radiopedia) - np.min(images_radiopedia)) test_images_medseg = (test_images_medseg - np.min(test_images_medseg)) / (np.max(test_images_medseg) - np.min(test_images_medseg)) # Split the data into training, validation, and testing sets x_train = images_radiopedia y_train = masks_radiopedia x_val = images_medseg y_val = masks_medseg 8
  • 10. Model Compile and Evaluation # Model Compile model.compile(optimizer='adam', loss='binary_cr ossentropy', metrics=['accuracy']) 10
  • 11. # Model Evaluation history = unet_model.fit(x_train, y_trai n, batch_size=32, epochs=10, validatio n_data=(x_val, y_val)) 11
  • 12. Conclusion • In computer vision, image segmentation is a very beneficial process that may be used in a range of use-cases, including medical imaging and driverless cars, to collect various segments or classes in real-time. One can now experiment with utilizing U-Net to implement image segmentation on various challenges or by investigating other models that are helpful in image segmentation. 12