{"id":257,"date":"2021-04-24T23:43:24","date_gmt":"2021-04-24T23:43:24","guid":{"rendered":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/ziyang-yang\/?p=257"},"modified":"2021-04-30T12:04:28","modified_gmt":"2021-04-30T12:04:28","slug":"how-could-particle-filter-track-thanos-explaining-particle-filter-without-mathematics","status":"publish","type":"post","link":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/ziyang-yang\/2021\/04\/24\/how-could-particle-filter-track-thanos-explaining-particle-filter-without-mathematics\/","title":{"rendered":"How could particle filter track Thanos? &#8211; explaining particle filter without mathematics"},"content":{"rendered":"\n<p>This blog will give an general idea about the principle of particle filter without mathematical proofing.<\/p>\n\n\n\n<p>Recently, we are given talks about particle filter (or sequential Monte Carlo). Particle filter has a wide application in signal processing, tracking objects, time series, finance, etc. In the beginning, I am also scared by the maths of particle filter, like partial differential equations and Bayesian stuff. However, the idea behind the particle filter is very straightforward and intuitive.<\/p>\n\n\n\n<p><strong>Now, lets set a situation to explain it under the tracking problem without mathematics!  <\/strong><\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Scenario Setting<\/h1>\n\n\n\n<p>Assume we are agents of <a href=\"https:\/\/en.wikipedia.org\/wiki\/The_Avengers_(2012_film)\">the avengers<\/a> located in &#8216;chessboard&#8217; country (that is because the map of this country is like a chessboard \ud83d\ude42 ). One day Thanos came to this country and said he steal our magic stone and then he just left away and hid somewhere in our city.<\/p>\n\n\n\n<p><strong>Our aim: we are told to trace him before the avengers came.<\/strong> <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img decoding=\"async\" src=\"https:\/\/sm.mashable.com\/t\/mashable_sea\/feature\/t\/the-thanos\/the-thanos-snap-for-real-lets-remove-humans-from-half-of-ear_bq2q.h720.jpg\" alt=\"The Thanos snap for real: Let's remove humans from half of Earth - Science\" width=\"-1986\" height=\"-1116\" \/><figcaption>He is Thanos. You only need to know he is a bad guy if you don&#8217;t know him. If we can&#8217;t find where he hides and take our magic stone back, he will destroy the whole world!!!! And the avengers will help us if we could successfully find his location!  <\/figcaption><\/figure><\/div>\n\n\n\n<h1 class=\"wp-block-heading\">How to find him?<\/h1>\n\n\n\n<p>Luckily, we have three clever dogs named &#8216;particle A&#8217;, &#8216;particle B&#8217;, and &#8216;particle C&#8217;. They have already remembered the smell of Thanos! And we are also clever enough to communicate with them. <\/p>\n\n\n\n<p>Every 10 minutes, they could go head 1 grid in the map based on their own ideas. And then our dogs have to report their location and how likely Thanos come across these areas. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Time=0 minutes<\/h3>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"572\" height=\"371\" src=\"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/ziyang-yang\/wp-content\/uploads\/sites\/18\/2021\/04\/image-14.png\" alt=\"\" class=\"wp-image-268\" srcset=\"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/ziyang-yang\/wp-content\/uploads\/sites\/18\/2021\/04\/image-14.png 572w, https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/ziyang-yang\/wp-content\/uploads\/sites\/18\/2021\/04\/image-14-300x195.png 300w\" sizes=\"auto, (max-width: 572px) 100vw, 572px\" \/><\/figure><\/div>\n\n\n\n<p>At the beginning, particle B said it is 90% sure there is Thanos&#8217;scent. So we think at the beginning Thanos are more likely to go across the middle way. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Time=10 minutes<\/h2>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"532\" height=\"330\" src=\"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/ziyang-yang\/wp-content\/uploads\/sites\/18\/2021\/04\/image-8.png\" alt=\"\" class=\"wp-image-261\" srcset=\"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/ziyang-yang\/wp-content\/uploads\/sites\/18\/2021\/04\/image-8.png 532w, https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/ziyang-yang\/wp-content\/uploads\/sites\/18\/2021\/04\/image-8-300x186.png 300w\" sizes=\"auto, (max-width: 532px) 100vw, 532px\" \/><\/figure><\/div>\n\n\n\n<p>After 10 minutes, our dog moved to new locations and reported their location and their findings. Thanos seems go up from the middle way. as Particle A was 60% sure. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Time=70 minutes<\/h2>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"522\" height=\"326\" src=\"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/ziyang-yang\/wp-content\/uploads\/sites\/18\/2021\/04\/image-9.png\" alt=\"\" class=\"wp-image-262\" srcset=\"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/ziyang-yang\/wp-content\/uploads\/sites\/18\/2021\/04\/image-9.png 522w, https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/ziyang-yang\/wp-content\/uploads\/sites\/18\/2021\/04\/image-9-300x187.png 300w\" sizes=\"auto, (max-width: 522px) 100vw, 522px\" \/><figcaption>The purple line is the real trace of Thanos<\/figcaption><\/figure><\/div>\n\n\n\n<p>At T=70, we report the most likely route to the avengers (blue line in the figure) based on our three dogs findings. We traced Thanos very well at the beginning. But after T=40, we are far away from his real trace! Finally, our task failed, the avengers could not find him, and he destroyed our world at the end! <\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:33.33%\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"315\" height=\"212\" src=\"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/ziyang-yang\/wp-content\/uploads\/sites\/18\/2021\/04\/sfsfsfsfsfsf.gif\" alt=\"\" class=\"wp-image-263\" \/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:66.66%\">\n<p>Why are we failed? Our dogs are clever, and we are clever. Wait! We track his route very well initially, but after time = 40, particle B and particle C always explore the bottom area. Particle B and particle C said they are not sure Thanos came here, but particle A always said he smelled Thanos&#8217; scent. So we could only rely on Particle A. That&#8217;s why we sure Thanos go as particle A&#8217;s route.<\/p>\n<\/div>\n<\/div>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Particle filter without resampling<\/p><cite>The example above illustrates the principle of particle filter without resampling. Each time step, several particles will move follows the transition distribution (like our dogs follow their mind to go head). And based on the evidence (scent of Thanos in our case), we could get the possible location at each time step. Along the time, we could get a trace. However, particle filter without resampling always fails in the long run due to weight degeneracy that the trace is concluded from few particles (In our example, this means we only rely on Particle A after T=40).  <\/cite><\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">Time goes back<\/h2>\n\n\n\n<p>Okay, so now the avengers make the time back and we could search again. Particle B and Particle C always explore the locations in the right-bottom corner where Thanos obviously not been there. So let them find those locations is a waste. <\/p>\n\n\n\n<p><strong>New rule: If one of the dogs found Thanos most likely came across their area, we introduce a new dog in this area to pinpoint search. Additionally, if a dog has the least amount of certainty, we remove this dog.<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Time = 0 minutes<\/h2>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"545\" height=\"361\" src=\"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/ziyang-yang\/wp-content\/uploads\/sites\/18\/2021\/04\/image-13.png\" alt=\"\" class=\"wp-image-267\" srcset=\"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/ziyang-yang\/wp-content\/uploads\/sites\/18\/2021\/04\/image-13.png 545w, https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/ziyang-yang\/wp-content\/uploads\/sites\/18\/2021\/04\/image-13-300x199.png 300w\" sizes=\"auto, (max-width: 545px) 100vw, 545px\" \/><\/figure><\/div>\n\n\n\n<p>Particle B is 90% sure while Particle C is only 2% sure. So we move particle C and give one more dog on the area where Particle B is. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Time = 10 minutes<\/h2>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"536\" height=\"346\" src=\"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/ziyang-yang\/wp-content\/uploads\/sites\/18\/2021\/04\/image-11.png\" alt=\"\" class=\"wp-image-265\" srcset=\"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/ziyang-yang\/wp-content\/uploads\/sites\/18\/2021\/04\/image-11.png 536w, https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/ziyang-yang\/wp-content\/uploads\/sites\/18\/2021\/04\/image-11-300x194.png 300w\" sizes=\"auto, (max-width: 536px) 100vw, 536px\" \/><\/figure><\/div>\n\n\n\n<p>Next, our particles remove follow their mind. Since Particle A is 60% sure it smelled Thanos, we introduce a new dog in its area. Since Particle C in the bottom grid only 5% sure it smelled Thanos, we discard it and let it go back home.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Time = 70 minutes<\/h2>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"538\" height=\"327\" src=\"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/ziyang-yang\/wp-content\/uploads\/sites\/18\/2021\/04\/image-10.png\" alt=\"\" class=\"wp-image-264\" srcset=\"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/ziyang-yang\/wp-content\/uploads\/sites\/18\/2021\/04\/image-10.png 538w, https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/ziyang-yang\/wp-content\/uploads\/sites\/18\/2021\/04\/image-10-300x182.png 300w\" sizes=\"auto, (max-width: 538px) 100vw, 538px\" \/><\/figure><\/div>\n\n\n\n<p>As we see, at time 70 we successfully trace Thanos, and we save the world!<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Particle filter with resampling<\/p><cite>Due to the limitation of particle filter without sampling, we introduce the resampling scheme in the process. It is easy to understand as we duplicate particles when they have a high probability of getting the right path (like introducing a new dog in that area). In addition, we discard those particles with less probability to find the true path.<\/cite><\/blockquote>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/images2.minutemediacdn.com\/image\/upload\/c_fill,g_auto,h_1248,w_2220\/v1555921064\/shape\/mentalfloss\/spongebob_0_0.jpg?itok=FF47w3bl\" alt=\"14 Things You May Not Have Known About 'SpongeBob SquarePants' | Mental  Floss\" width=\"633\" height=\"355\" \/><\/figure><\/div>\n\n\n\n<p>This is the intuitive idea behind particle filter! Now you could understand the whole process of particle filter! <\/p>\n\n\n\n<p>For more reading:<\/p>\n\n\n\n<p><a href=\"https:\/\/www.stats.ox.ac.uk\/~doucet\/doucet_johansen_tutorialPF2011.pdf\">https:\/\/www.stats.ox.ac.uk\/~doucet\/doucet_johansen_tutorialPF2011.pdf<\/a> This is a really good review paper!<\/p>\n\n\n\n<p><a href=\"http:\/\/wwwf.imperial.ac.uk\/~nkantas\/notes4ltcc.pdf\">http:\/\/wwwf.imperial.ac.uk\/~nkantas\/notes4ltcc.pdf<\/a> This is a really good tutorial! And the references are very famous papers!<\/p>\n\n\n\n<p>This is a really good cartoon to show the whole process:<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-4-3 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Particle Filter Explained without Equations\" width=\"688\" height=\"516\" src=\"https:\/\/www.youtube.com\/embed\/aUkBa1zMKv4?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>This blog will give an general idea about the principle of particle filter without mathematical proofing. Recently, we are given&hellip;<\/p>\n","protected":false},"author":25,"featured_media":262,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-257","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogs"],"_links":{"self":[{"href":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/ziyang-yang\/wp-json\/wp\/v2\/posts\/257","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/ziyang-yang\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/ziyang-yang\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/ziyang-yang\/wp-json\/wp\/v2\/users\/25"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/ziyang-yang\/wp-json\/wp\/v2\/comments?post=257"}],"version-history":[{"count":7,"href":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/ziyang-yang\/wp-json\/wp\/v2\/posts\/257\/revisions"}],"predecessor-version":[{"id":372,"href":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/ziyang-yang\/wp-json\/wp\/v2\/posts\/257\/revisions\/372"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/ziyang-yang\/wp-json\/wp\/v2\/media\/262"}],"wp:attachment":[{"href":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/ziyang-yang\/wp-json\/wp\/v2\/media?parent=257"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/ziyang-yang\/wp-json\/wp\/v2\/categories?post=257"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/ziyang-yang\/wp-json\/wp\/v2\/tags?post=257"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}