{"id":531,"date":"2021-11-27T20:57:18","date_gmt":"2021-11-27T20:57:18","guid":{"rendered":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/?p=531"},"modified":"2024-10-10T20:55:15","modified_gmt":"2024-10-10T19:55:15","slug":"machine-learning-medical-image-classification-examples","status":"publish","type":"post","link":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/?p=531","title":{"rendered":"Machine learning medical image classification notebooks"},"content":{"rendered":"\n<p>Image classification is an interesting challenge that requires many images for training. Here we propose to explore 4 different machine learning classification approaches (from random forest to ResNet) on an image set created from the IXI data set using famous python packages: scikit-learn and Keras\/TensorFlow.<\/p>\n\n\n\n<p>This example is split into 4 notebooks. The first notebook is about reading and preparing image sets.<\/p>\n\n\n\n<p>The second notebook introduces 4 machine learning classification approaches and allow user to train them. The goal is also to change some hyper-parameters to reach F1 score greater than 0.95. Classical classification metrics are also introduced in this notebook. The last network training (finetuning ResNet50) is long and thus GPU can be usefull for this part. <\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized wp-duotone-default-filter\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"393\" src=\"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/wp-content\/uploads\/architecture_cnn_en-1024x393.png\" alt=\"\" class=\"wp-image-535\" style=\"width:512px;height:197px\" srcset=\"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/wp-content\/uploads\/architecture_cnn_en-1024x393.png 1024w, https:\/\/www.creatis.insa-lyon.fr\/~grenier\/wp-content\/uploads\/architecture_cnn_en-300x115.png 300w, https:\/\/www.creatis.insa-lyon.fr\/~grenier\/wp-content\/uploads\/architecture_cnn_en-768x295.png 768w, https:\/\/www.creatis.insa-lyon.fr\/~grenier\/wp-content\/uploads\/architecture_cnn_en-1200x461.png 1200w, https:\/\/www.creatis.insa-lyon.fr\/~grenier\/wp-content\/uploads\/architecture_cnn_en.png 1429w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Image classification network with convolution layers and then fully connected (MLP)<\/figcaption><\/figure>\n\n\n\n<p>The third notebook is on interpretability. It allows us to understand better how CNN network works and why the results are so good on the used images. It is based on GradCAM.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized wp-duotone-default-filter\"><img loading=\"lazy\" decoding=\"async\" width=\"446\" height=\"449\" src=\"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/wp-content\/uploads\/GradCam.png\" alt=\"\" class=\"wp-image-539\" style=\"width:335px;height:337px\" srcset=\"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/wp-content\/uploads\/GradCam.png 446w, https:\/\/www.creatis.insa-lyon.fr\/~grenier\/wp-content\/uploads\/GradCam-298x300.png 298w, https:\/\/www.creatis.insa-lyon.fr\/~grenier\/wp-content\/uploads\/GradCam-150x150.png 150w\" sizes=\"auto, (max-width: 446px) 100vw, 446px\" \/><figcaption class=\"wp-element-caption\">GradCAM activation map of the predicted class superposed on tested image.<\/figcaption><\/figure>\n\n\n\n<p>The notebook 4 introduces the knowledge distillation. It is applied to help a light student model to perform as well as a heavy teacher model.<\/p>\n\n\n\n<p>There is a last notebook that illustrates the auto differentiation and the gradient descent optimization algorithm.<\/p>\n\n\n\n<p>The following archive contains all necessary materials: <a href=\"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/wp-content\/uploads\/teaching\/DeepLearning\/TP4_Classification.zip\">TP4_Classification.zip<\/a><\/p>\n\n\n\n<p>This project is GitLab versioned <a href=\"https:\/\/gitlab.in2p3.fr\/thomas.grenier\/tp1ss_classification\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Image classification is an interesting challenge that requires many images for training. Here we propose to explore 4 different machine learning classification approaches (from random forest to ResNet) on an image set created from the IXI data set using famous python packages: scikit-learn and Keras\/TensorFlow. This example is split into 4 notebooks. The first notebook [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":532,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"templates\/template-full-width.php","format":"standard","meta":{"footnotes":""},"categories":[18,6,4],"tags":[],"class_list":["post-531","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-deep-learning-teaching","category-image-processing","category-teaching"],"_links":{"self":[{"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=\/wp\/v2\/posts\/531","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=531"}],"version-history":[{"count":10,"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=\/wp\/v2\/posts\/531\/revisions"}],"predecessor-version":[{"id":1353,"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=\/wp\/v2\/posts\/531\/revisions\/1353"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=\/wp\/v2\/media\/532"}],"wp:attachment":[{"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=531"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=531"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=531"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}