{"id":1324,"date":"2020-01-12T15:51:35","date_gmt":"2020-01-12T22:51:35","guid":{"rendered":"http:\/\/www.jimmysastra.com\/blog\/?p=1324"},"modified":"2025-08-30T09:20:37","modified_gmt":"2025-08-30T16:20:37","slug":"what-time-is-it","status":"publish","type":"post","link":"https:\/\/www.jimmysastra.com\/blog\/what-time-is-it\/","title":{"rendered":"A machine learning based clock"},"content":{"rendered":"<p>I wanted to gain more understanding of machine learning. I learn best by doing and also find that I can fool myself (and others) into thinking I know something by reading a book and watching a couple videos. But until I implement something myself, I don&#8217;t <em>really<\/em> know it. As Richard Feynman said: &#8220;what I cannot create, I do not understand.&#8221; So I built a clock that uses a neural net to tell time by looking at the sky.<\/p>\n<div style=\"width: 640px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-1324-1\" width=\"640\" height=\"360\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"http:\/\/www.jimmysastra.com\/blog\/wp-content\/uploads\/2020\/01\/output.mp4?_=1\" \/><a href=\"http:\/\/www.jimmysastra.com\/blog\/wp-content\/uploads\/2020\/01\/output.mp4\">http:\/\/www.jimmysastra.com\/blog\/wp-content\/uploads\/2020\/01\/output.mp4<\/a><\/video><\/div>\n<p>I made a web app <a href=\"https:\/\/neural-net-clock.onrender.com\/\" target=\"_blank\" rel=\"noopener\">here<\/a> so you can try it yourself.<\/p>\n<p>My full dataset can be found <a href=\"https:\/\/drive.google.com\/drive\/folders\/1bTWRWTUkOdVzCbBTUlRCvt-LBui4g6PI?usp=sharing\" target=\"_blank\" rel=\"noopener\">here<\/a>. These are 30 second time-lapses from midnight to midnight at 30fps. So each movie has 900 frames taken over 24 hours. I have 28 days worth of data and counting. Below is the full confusion matrix on my training data. The classifier doesn&#8217;t work so well when it&#8217;s fully cloudy or foggy otherwise I was surprised to learn it can be +\/- 1 hour on a clear day and totally able to distinguish between morning and evening. So it must look at features other than just brightness.<\/p>\n<p><a href=\"http:\/\/www.jimmysastra.com\/blog\/wp-content\/uploads\/2020\/01\/confusion-matrix.png\"><img decoding=\"async\" class=\"alignnone wp-image-1345\" src=\"http:\/\/www.jimmysastra.com\/blog\/wp-content\/uploads\/2020\/01\/confusion-matrix.png\" alt=\"confusion-matrix\" width=\"600\" srcset=\"https:\/\/www.jimmysastra.com\/blog\/wp-content\/uploads\/2020\/01\/confusion-matrix.png 1308w, https:\/\/www.jimmysastra.com\/blog\/wp-content\/uploads\/2020\/01\/confusion-matrix-296x300.png 296w, https:\/\/www.jimmysastra.com\/blog\/wp-content\/uploads\/2020\/01\/confusion-matrix-768x777.png 768w, https:\/\/www.jimmysastra.com\/blog\/wp-content\/uploads\/2020\/01\/confusion-matrix-1012x1024.png 1012w\" sizes=\"(max-width: 1308px) 100vw, 1308px\" \/><\/a><\/p>\n<p>Many thanks to Jeremy Howard&#8217;s excellent <a href=\"http:\/\/fast.ai\" target=\"_blank\" rel=\"noopener\">fast.ai<\/a> class.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I wanted to gain more understanding of machine learning. I learn best by doing and also find that I can fool myself (and others) into thinking I know something by reading a book and watching a couple videos. But until I implement something myself, I don&#8217;t really know it. As Richard Feynman said: &#8220;what I [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-1324","post","type-post","status-publish","format-standard","hentry","category-robotics"],"_links":{"self":[{"href":"https:\/\/www.jimmysastra.com\/blog\/wp-json\/wp\/v2\/posts\/1324","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jimmysastra.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jimmysastra.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jimmysastra.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jimmysastra.com\/blog\/wp-json\/wp\/v2\/comments?post=1324"}],"version-history":[{"count":32,"href":"https:\/\/www.jimmysastra.com\/blog\/wp-json\/wp\/v2\/posts\/1324\/revisions"}],"predecessor-version":[{"id":1442,"href":"https:\/\/www.jimmysastra.com\/blog\/wp-json\/wp\/v2\/posts\/1324\/revisions\/1442"}],"wp:attachment":[{"href":"https:\/\/www.jimmysastra.com\/blog\/wp-json\/wp\/v2\/media?parent=1324"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jimmysastra.com\/blog\/wp-json\/wp\/v2\/categories?post=1324"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jimmysastra.com\/blog\/wp-json\/wp\/v2\/tags?post=1324"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}