Dianna McAllister’s ROP Adventures in the Tyrrell Lab!

My name is Dianna McAllister and I am approaching the finish of my second year at University of Toronto, pursuing a bioinformatics specialist and computer science major. This year I was given the incredible opportunity to work in Dr. Tyrrell’s lab for the ROP299 course.
I have just handed in my first ever formal research paper for my work in Dr. Tyrrell’s lab. My project observed the effectiveness of using grad-CAM visualizations on different layers in a convolutional neural network. Though the end results of my project were colourful heat maps placed on top of images, the process to get there was not nearly as colourful or as effortless as the results may seem. There was lots of self-teaching, debugging, decision-making and collaboration that went on behind the scenes that made this project difficult, but much more rewarding when complete.
My journey in Dr. Tyrrell’s lab began when I first started researching ROP projects. I can still remember scrolling through the various projects, trying to find something that I thought I would be really passionate about. Once I happen upon Dr. Tyrrell’s ROP299, I could feel my heart skip a beat- it was exactly the research project that I was looking for. It explained the use of machine learning in medicine, specifically medical imaging. Being in bioinformatics, this project was exactly what I was looking for; it integrated biology and medicine with computer science and statistics. Once I saw this unique combination, I knew that I needed to apply.
After I applied, I was overjoyed that I had received an interview. When I attended the interview, I was very excited to show Dr. Tyrrell my interest in his research and explain how my past research would help me with this new project. But once I walked into his office, it was unlike any other interview I had ever had; he was able to point out things about myself that I had barely even realized and asked me many questions that I had no answer to. I remember walking out of that interview feeling disappointed as I thought that there was no way I would get a position in his lab, but a few weeks later heard back that I had gotten the position! I was delighted to have the opportunity to prove to Dr. Tyrrell that he made a good choice in choosing me for the position and that I would work hard in his lab and on my project.
The night before my first lab meeting, I researched tons of information on machine learning, making sure to have- what I thought- an in-depth understand of machine learning. But after less than five minutes into the lab meeting, I quickly realized that I was completely wrong. Terms like regression, weights, backpropagation were being thrown around so naturally, and I had absolutely no idea what they were talking about. I walked out of the meeting determined to really begin understanding what machine learning was all about!
Thus began my journey to begin my project. When I decided on my project, it seemed fun and not too difficult- all I have to do is slap on some heat maps to images, right? Well as much as I felt it wouldn’t be too difficult, I was not going to be deceived just as I had before attending our first meeting; and after completion I can definitely say it was not easy! The first problem that I encountered immediately was where to start. Sure, I understood the basic concepts associated with machine learning, but I had no experience or understanding of how to code anything related to creating and using a convolutional neural network. I was fortunate enough to be able to use Ariana’s CNN model. Her model used x-rays of teeth to classify if dental plates were damaged and therefore adding damage (artifacts) to the x-rays of teeth or if the plates were functional. It took me quite some time to understand what each line of code did within the program- the code was incredible, and I could not imagine having to write it from scratch! I then began the code to map the grad-CAM visualizations (resembling heat maps) onto the images that Ariana’s model took as input. I was again fortunate enough to find code online that was similar to what I needed for my project. I made very minor tweaks until the code was functional and worked how I needed it to. Throughout this process of trying to debug my own code or figure out why it wouldn’t even begin running, Mauro was always there to help, always being enthusiastic even when my problem was as silly as accidentally adding an extra period to a word.
Throughout the process, Dr. Tyrrell was always there as well- he always helped me to remember the big picture of what my project was about and what I was trying to accomplish during my time in his lab. This was extremely valuable, as it kept me from accidentally veering off-course and focusing on something that wasn’t important to my project. Without his guidance, I would have never been able to finish and execute the project in the way that I did and am proud of.
Everything that I learned, not only about machine learning, but about how to write a research paper, how to collaborate with others, how to learn from other’s and your own mistakes and how to keep trying new ideas and approaches when it seems like nothing is working, I will always carry with me throughout the rest of my undergraduate experience and the rest of my professional future. Thank you, Dr. Tyrrell, for this experience and every opportunity I was given in your lab.
Dianna McAllister

Rachael Jaffe’s ROP Journey… From the Pool to the Lab!

https://thevarsity.ca/2019/03/10/what-does-a-scientist-look-like/
My name is Rachael Jaffe and I am completing my third year in Global Health, Economics and Statistics. I had no clue what I was getting myself into this year during my ROP (399) with Dr. Tyrrell. I initially applied because the project description had to do with statistics,
and I was inclined to put my minor to the test! Little did I know that I was about to embark on a machine learning adventure.
My adventure started with the initial interview: after a quite a disheartening tale of Dr. Tyrrell telling me that my grades weren’t high enough and me trying to convince him that I would be a good addition to the lab because “I am funny”, I was almost 100% certain that I
wasn’t going to be a part of the lab for 2018-2019 year. If my background in statistics has taught me anything, nothing truly has a 100% probability. And yet, last April I found myself sitting in the department of medical imaging at my first lab meeting.
Fast forward to September of 2018. I was knee deep (well, more accurately, drowning) in machine learning jargon; from learning about the basics of a CNN to segmentation to what a GPU is. From there, I chose a project. Initially, I was just going to explore the relationship between sample size and model accuracy, but then it expanded to include an investigation in k-fold cross validation.
I started my project with the help of Ariana, a student from a lab in Costa Rica. She built a CNN that classifies dentistry PSP’s for damage. I modified it to include a part that allowed the total sample size to be reduced. The relationship between sample size and model accuracy is very well known in the machine learning world, so Dr. Tyrrell decided that I
should add an investigation of k-fold cross validation because the majority of models use this to validate their estimate of model accuracy. With further help from Ariana’s colleague, Mauro, I was able to gather a ton of data so that I could analyze my results statistically.
It was more of a “academic” project as Dr. Tyrrell noted. However, that came with its own trials and tribulations. I was totally unprepared for the amount of statistical interpretation that was required, and it took a little bit of time to wrap my head around the intersection of statistics and machine learning. I am grateful for my statistics minor during this ROP because without it I would’ve definitely been lost. I came in with a knowledge of python so writing and modifying code wasn’t the hardest part.
I learned a lot about the scientific process during my ROP. First, it is incredibly important to pick a project with a clear purpose and objectives. This will help with designing your project and what analyses are needed.  Also, writing the report is most definitely a process. The first draft is going to be the worst, but hang on because it will get better from there. Lastly, I learned to learn from my experience. The most important thing as a budding scientist is to learn from your mistakes so that your next opportunity will be that much better.
I’d like to thank Dr. Tyrrell for giving me this experience and explaining all the stats to me. Also, Ariana and Mauro were invaluable during this experience and I wish them both the best in their future endeavors!

Rachael Jaffe

Adam Adli’s ROP399 Journey in Machine Learning and Medical Imaging

My name is Adam Adli and I am finishing the third year of my undergraduate studies at the University of Toronto specializing in Computer Science. I’m going to start this blog post by talking a little bit about myself. I am a software engineer, an amateur musician, and beyond all, someone who loves to solve problems and treats every creation as art. I have a rather tangled background; I entered university as a life science student, but I have been a programmer since my pre-teen years. Somewhere along the way, I realized that I would flourish most in my computer science courses and so I switched programs in at the beginning of my third year.
 
While entering this new and uncertain phase in my life and career, I had the opportunity of meeting Dr. Pascal Tyrrell and gaining admission to his research opportunity program (ROP399) course that focused on the application of Machine Learning to Medical Imaging under the Data Science unit of the Department of Medical Imaging.
 
Working in Dr. Tyrrell’s lab was one of the most unique experiences I have had thus far in university, allowing me to bridge both my interest in medicine and computer science in order to gain valuable research experience. When I first began my journey, despite having a strong practical background in software development I had absolutely no previous exposure to machine learning nor high-performance computing.
 
As expected, beginning a research project in a field that you have no experience in is frankly not easy. I spent the first few months of the course trying to learn as much about machine learning algorithms and convolutional neural networks as I could; it was like learning to swim in an ocean. Thankfully, I had the support and guidance of my colleagues in the lab and my professor Dr. Tyrrell throughout the way. With their help, I pushed my boundaries and learned the core concepts of machine learning models and their development with solutions to real-world problems in mind. I finally had a thesis for my research.
 
My research thesis was to experimentally show a relationship that was expected in theory: smaller training sets tend to result in over-fitting of a model and regularization helps prevent over-fitting so regularization should be more beneficial for models trained on smaller training sets in comparison to those trained on larger ones. Through late nights of coding and experimentation, I used many repeated long-running computations on a binary classification model for dental x-ray images in order to show that employing L2 regularization is more beneficial for models training on smaller training samples than models training on larger training samples. This is an important finding as often times in the field of medical imaging, it may be difficult to come across large datasets—either due to the bureaucratic processes or financial costs of developing them.
 
I managed to show that in real-world applications, there is an important trade-off between two resources: computation time and training data. L2 regularization requires hyperparameter tuning which may require repeated model training which may often be very computationally expensive—especially in complex convolutional neural networks trained on large amounts of data. So, due to the diminishing returns of regularization and the increased computational
costs of its employment, I showed that L2 regularization is a feasible procedure to help prevent over-fitting and improve testing accuracy when developing a machine learning model with limited training data.
 
Due to the long-running nature of the experiment, I tackled my research project as not only a machine learning project but also a high-performance computing project as well. I so happened to be taking some systems courses like CSC367: Parallel Programming and CSC369: Operating Systems at the same time as my ROP399, which allowed me to better appreciate the underlying technical considerations in the development of my experimental
machine learning model. I harnessed powerful technologies like Intel AVX2 vectorization instruction set for things like image pre-processing on the CPU and the Nvidia CUDA runtime environment through PyTorch to accelerate tensor operations using multiple GPUs. Overall, the final run of my experiment took about 25 hours to run even with all the high-level optimizations I considered—even on an insane lab machine with an Intel i7-8700 CPU and an Nvidia GeForce GTX Titan X!
 
Overall, my ROP not only opened a door to the world of machine learning and high-performance computing for me but in doing so, it taught me so much more. It strengthened my independent learning, project management, and software development skills. It taught me more about myself. I feel that I never experienced so much growth as an academic, problem-solver, and software engineer in such a condensed period of time.
 
I am proud of all the skills I’ve gained in Dr. Tyrrell’s lab and I am extremely thankful for having received the privilege of working in his lab. He is one of the most supportive professors I have had the pleasure of meeting.
 
Now that I have completed my third year of school, I’m off to begin my year-long software engineering internship at Intel and continue my journey.
 
Signing out,

Adam
Adli

MiWORD of the day is… Mop-top!

Ahhh, the mop-top! I sigh not because I miss the hairdo but because I miss my hair – all of it. In the mid-60s this hair style was made famous by The Beatles. Don’t know who they are (shame on you!) have a listen here for instruction.


Well the mop-top was made popular because the 4 guys who sported the hairdo were crazy successful musicians from England. Their recording company, Electrical Musical Industries (EMI), was also very happy and successful because of the overwhelming record sales (music was sold to listeners on vinyl records back then).


So, what does any of this have to do with medical imaging? Lots actually. The money generated by record sales enabled the EMI basic science researchers (another division of the company) to work in a prosperous cash-rich environment. One of those researchers was Sir Godfrey Hounsfield, an electrical and computer engineer. 


In 1967, he started his work on what would soon become the first CT scanner. By directing x-ray beams through the body at 1 degree angles, with a detector rotating in tandem on the other side, he was able to measure the attenuation of x-rays. These values were then analysed using a mathematical algorithm and a computer to yield a 2-D image of the interior of the body. The production of CT scanners by EMI started in the early 1970s and their monopoly ended by 1975 when companies like DISCO (not even kidding) and GE entered the arena.


Interestingly, in the 1960s Dr Allan Cormack of South Africa had also independently showed similar results to Housfield. In the end, Cormack was cited for his math analysis that led to the CT scan and Housfield for its practical development. They shared the Nobel prize in Physics and Medicine in 1979. Cool.

Now for the fun part (see the rules here), using mop-top in a sentence by the end of the day:

Serious: Who would have thought the success of the mop-top Fab Four would be instrumental in the development of the CT scanner?

Less serious: Hey Bob, I went for my head CT scan today and something weird happened. I went in bald and came out with a mop-top! Is that normal?…

Listen to With a Little Help from My Friends from The Beatles to decompress and…

…I’ll see you in the blogosphere.

Pascal Tyrrell


MiWORD of the day is… Piezoelectric!

Ah, the super villain Livewire. Not sure she was all that much of a challenge for Superman but there you have it: electricity, spandex, and crazy hair. The perfect foe. I wonder if she will make an appearance in the latest Supergirl TV series?


So, today the MiWORD of the day is piezoelectric. Sounds like a fancy name for a downtown pizzaria – but it’s not. Way back before Roentgen discovered x-rays, Pierre and Jacques Curie in 1877 discovered a phenomenon that occurs when crystals are mechanically distorted by external pressure so that an electrical potential develops between the crystal surfaces: the piezoelectric effect. The term was coined by the brothers from the Greek for “pressure-electricity”. So basically, certain crystals (which include quartz, topaz, tourmaline…) can convert electrical to mechanical energy and vice versa.


Why is this important you ask? Well, because this discovery lead to the development of microphones, earphones, and most importantly for us – ultrasound. Based on the physics of sound and not light, ultrasound captures images by manipulating and analyzing sound waves, very high-frequency sound waves as they bounce off surfaces and echo back to the sender. The idea of getting some kind of image from sound waves was first thought of after the sinking of the Titanic in 1912: detecting submerged icebergs with sound reflection.



A little later, in Austria, two brothers Karl and Friedreich Dussik (do you see a trend here?) transmitted sound waves through a patient’s head in 1937. This and then the development of the SONAR (sound navigation and ranging) in WWII was the ground work needed to launch the field of ultrasonography. It would take, however, 20 years after WWII for ultrasonography to become a commercial reality.







Not only is ultrasound one the oldest medical imaging technologies but it is also an important tool for visualizing soft tissue structures in medical diagnosis, follow up of disease processes and pregnancies. Cool.

 


 


 

 





Now for the fun part (see the rules here), using piezoelectric in a sentence by the end of the day:

Serious: Mom went for her ultrasound today. Told me that I am going to have a little baby sister! She had to wait a while to have her scan because the piezoelectric transducer was on the fritz – again.


Less serious: Hey Bob, do you remember a pizza place on Electric Avenue in Calgary? Piezoelectric something or other? All closed down now. What a shame…




Listen to Electric Avenue from Eddy Grant to decompress and…

…I’ll see you in the blogosphere.

Pascal Tyrrell

MiWord of the Day Is… CAT scan!

A what scan? I am actually a cat guy myself. Not to say I don’t love dogs but if I had to make a choice…


I just finished reading a fantastic book by David Dosa entitled “Making Rounds With Oscar”. The premise of the book is a story about an extraordinary cat but the subject matter is very serious –  dementia and end-of-life care in the elderly. Have a gander.


So what the heck is a cat scan and what does it have to do with medical imaging? 


CT scans – also referred to as computerized axial tomography (CAT) – are special X-ray tests that produce cross-sectional images of the body using X-rays and a computer. CT was developed independently by a British engineer named Sir Godfrey Hounsfield and Dr. Alan Cormack and were jointly awarded the Nobel Prize in 1979. Yes, more Nobel prize winners…






In a nutshell, x-ray computed tomography:


– uses data from several X-ray images of structures inside the body and converts them into 3D pictures – especially useful for soft tissues.


– emits a series of narrow beams through the human body, producing more detail than standard single beam X-rays.


– is able to distinguish tissues inside a solid organ. A CT scan is able to illustrate organ tear and organ injury quickly and so is often used for accident victims.


– is analyzed by radiologists.


Unfortunately, unlike MRI scans, a CT scan uses X-rays and therefore are a source of ionizing radiation.





Now for the fun part (see the rules here), using CAT Scan in a sentence by the end of the day:

Serious: Hey Bob, did you know that the recorded image of a CAT Scan is called a tomogram? 

Less serious: My GP suggested that howling at the moon at night is not normal behavior and he wants to send me for a CAT scan. What? No way, I’m allergic to cats…

OK, listen to Cat Stevens to decompress and I’ll see you in the blogosphere…


 
Pascal Tyrrell

MiWord of the Day Is… Cinemaradiology!

Yes, it is Halloween today and my kids could barely contain themselves getting ready for school. I suspect today will not be very productive as they count down the minutes before heading out to terrorize my neighbors.


Anyway, how about this for a scary thought: cinemaradiology! In the late 1800’s John MacIntyre at the Gasgow Royal Infirmary experimented with producing X-ray motion pictures. What!!!? He tried exposing film by passing it between the screen of the fluoroscope and the x-ray tube and by simply filming the fluoroscopic screen. This latter method was very difficult because, as all of you budding radiologists know, the images viewed on the fluoroscope screen were dim and of poor resolution at the time.


For years researchers worked on perfecting cinemaradiology. However, during those early years of discovery they lost interest when they realized that sharper images were possible when BOTH patients and investigators were exposed together AND that excessive radiation was a bad thing – duh! 


It would only be many many years later that fluoroscope screen technology would be improved to allow for brighter and higher resolution images (and without frying the patient and everyone around!). 

Fluoroscopy is a study of moving body structures – similar to an x-ray “movie.”  A continuous x-ray beam is passed through the body part being examined, and is transmitted to a TV-like monitor so that the body part and its motion can be seen in detail. As an imaging tool, Fluoroscopy is used in many types of examinations and procedures.

To my knowledge, no actors from the cinemaradiology era ever became successful stars in Hollywood…


No need to use the MiWord of the day in a sentence today (see rules here) as I realize you are busy getting ready for Halloween and need a break!


Decompress listening to the classic song Thriller by the King of Pop Michael Jackson and I’ll see you in the blogosphere…






Pascal Tyrrell

 

MiWord of the Day Is… Cuckoo!

One of my favorite more serious films is One Flew Over the Cuckoo’s Nest. What does Jack Nicholson’s portrayal of a bad guy hoping for easy served time in a mental institution have to do with medical imaging? Well it all starts with the lobotomy. Not to spoil the story, suffice it to say that the movie broaches the topic of lobotomies and how ridiculous they were. Lobotomy was a form of neurosurgery that involved damaging the prefrontal cortex in order to “calm” certain mentally ill patients. Needless to say the procedure was controversial from the beginning (1935 to the early 1970’s) but the author of the discovery, Egas Moniz, was awarded the Nobel Prize in 1949. Maybe not the most sound of decisions by the committee. However, for the time, it was considered progress in a very challenging area of medicine – mental illness. 


OK, medical imaging? Well as it turns out Moniz (do not confuse with St-Moriz, ahhh skiing…) is also known for developing cerebral angiography – a technique allowing the visualization of blood vessels in and around the brain. 



Moniz was interested in finding a non-toxic substance that would be eliminated from the body, but would not be diluted by the flow of blood before the x-ray could be taken. Another requirement is that the substance could not cause an emboli or clot as this would be a bad thing. Moniz played with salts of iodine and bromine and settled on iodine because of its greater radiographic density. And voila, birth of iodinated radiocontrast agents still in use today. Cool.




Supposedly it took him 9 patients to perfect his angiogram technique. Don’t ask about the first 8…

Moral of the story is: lobotomy bad and cerebral angiography good.



Now for the fun part (see the rules here), using Cuckoo in a sentence by the end of the day:

 
Serious: Hey Bob, when I was visiting my aunt in Australia I spied a little bronze cuckoo in her backyard! This could be my “big year“…


Less serious: Someone won a Nobel Prize for developing the lobotomy? Are you cuckoo?
 
 
Listen to Los Lobos (not short for lobotomy but “the wolves” in Spanish) singing La Bamba to decompress and…
 
… I’ll see you in the blogosphere,
 
 
Pascal Tyrrell

MiWord of the Day Is… Fluoroscope!

It is hard to believe that the fluoroscope (essentially an x-ray machine used to produce real-time moving images viewed on a screen of the internal structures of a patient) was used to “help” better fit shoes to your feet! From the 1920 to about 1970 you were able to irradiate your feet with x-rays in order to see if you had enough “wiggle-room” in your new shoes! Crazy. 
 
So, the whole concept of Fluroscopy dates back to you know who, Wilhelm Röntgen. We chatted about him here in our blog. He is also responsible for discovering the interesting phenomenon of barium salts fluorescing when exposed to x-rays (see here in our blog). 
 
Basic function of a fluoroscope
Soon after Rontgen’s discovery was announced, Thomas Edison (the light bulb guy) decided he could improve on this whole x-ray thing as these rays were produced by a “glass tube apparatus” – something he knew a lot about. After setting his team to work – he had a team as he was a very successful man in those days following his 1879 patent of the light bulb – they soon discovered the risks of working with x-rays. Edison decided to remove himself (literally!) from x-ray research. But before he did he developed one of the first (and arguably the most advanced in it’s time ) fluoroscopes along with a full line of x-ray kits. He also coined the term “Fluoroscope”. Interesting man…
Fluoroscopes have come a long way over the years and are still used today in areas such as orthopedic surgery, gastrointestinal investigations, and angiography but, of course, the dose of x-rays a patient receives is minimized and closely monitored. Have a look at this machine from Siemen’s. “Beam me up Scotty!”. 
So how did all of these machines suddenly flood the shoe retail industry? Good question. As it happens, following the development of the high vacuum, hot cathode, tungsten-target x-ray tube by William Coolidge in 1913 the interest for a portable and reliable machine increased dramatically with the advent of the First World War. The successful deployment of numerous machines during the war to aid army physicians spurred the manufacturing industry to mass produce them. After the war, the impact the fluoroscope had on army medicine flowed into community practice. 
 
Due to the enormous supply of portable x-ray machines at the time following the end of the war, Dr Jacob Lowe introduced the idea of using a modified portable x-ray machine in the shoe retail industry. Voila, fried feet fricassee for the next 50 years!

Now If were to be interested in using a fluoroscope to look at my feet I may be inclined to use a suit like this gentleman below is sporting…

WW I x-ray protection suit

Now for the fun part, using Fluoroscope in a sentence by the end of the day:


Serious: Bob, did you know that the foot-o-scope was a modified fluoroscope used to view ones feet when fitting new shoes which delivered on average 13 Roentgens for every 20 second exposure?


Less serious: I heard grampa grumbling he can never find shoes that fit right anymore since they banned fluoroscopes in shoe stores. What is a fluoroscope mommy?




Listen to High Heels to decompress and I’ll see you in the blogosphere.




Pascal Tyrrell

MiWord of the Day Is… Radio!

Easy one today! I thought I would give everyone a break as you have all been working very hard on the MiWord of the day in the past weeks. 


So, what does radio have to do with medical imaging? What a great question! The origin of the root word “Radio” is radiant energy. The radio you immediately think of is the one that is attached to your ear most of the time and has a DJ who selects music to play for your entertainment – along with ads to pay for the station’s bills! The use of “radio” to describe this form of wireless communication comes from the word radiotelegraphy


How about if we were simply interested in a medical picture produced by radiant energy? Well you would end up with a radiograph AKA an x-ray! We talked about that word here. Do you see the trend? How about a picture produced by radiant energy in the visible light range of the electromagnetic spectrum? A photograph. Cool.


OK now suppose you are an MD working in the emergency department and someone presents with a lung disorder. What do you do? Generally, you order a chest radiograph. As you zap your patient with x-rays you expect that most of them will pass through the chest area – that is mostly filled with air – unchecked and will proceed to expose the film (or trigger the detector) resulting in a dark area. However, if the lungs become filled with abnormal substances more of the x-rays are blocked and result in a lighter (whiter) radiograph. What would you be looking for?





1- Pus – a combination of bacteria and white blood cells as seen with pneumonia.
2- Edema – fluid that leaks into the lungs as seen with heart failure.
3- Hemorrhage – bleeding into the lung cavity as seen with trauma.
4- a solid mass – as seen in lung cancer.



Today, we have to use “Radio” in a sentence (see rules here). Easy! Here are two examples to help you along:


Serious: Bob, you will need to remove your radio from your person before entering the MRI. No metal objects are permissible in the room.


Less serious: I went for a radiograph today and all they did was have me stand in a room by myself and that was it! What a relief. I thought for a moment I was scheduled for a radio-graft…!



Have a listen to my favorite Radiohead to decompress and…


… I’ll see you in the blogosphere,




Pascal Tyrrell