Skip to content

Commit

Permalink
gh pages init
Browse files Browse the repository at this point in the history
  • Loading branch information
angerhang committed Jul 10, 2023
1 parent 0beee3c commit cc9a6ed
Show file tree
Hide file tree
Showing 66 changed files with 2,002 additions and 3,828 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
I" {"source"=>"/Users/hangy/Dphil/code/asleep", "destination"=>"/Users/hangy/Dphil/code/asleep/_site", "collections_dir"=>"", "cache_dir"=>".jekyll-cache", "plugins_dir"=>"_plugins", "layouts_dir"=>"_layouts", "data_dir"=>"_data", "includes_dir"=>"_includes", "collections"=>{"posts"=>{"output"=>true, "permalink"=>"/:categories/:year/:month/:day/:title:output_ext"}}, "safe"=>false, "include"=>[".htaccess"], "exclude"=>[".sass-cache", ".jekyll-cache", "gemfiles", "Gemfile", "Gemfile.lock", "node_modules", "vendor/bundle/", "vendor/cache/", "vendor/gems/", "vendor/ruby/"], "keep_files"=>[".git", ".svn"], "encoding"=>"utf-8", "markdown_ext"=>"markdown,mkdown,mkdn,mkd,md", "strict_front_matter"=>false, "show_drafts"=>nil, "limit_posts"=>0, "future"=>false, "unpublished"=>false, "whitelist"=>[], "plugins"=>[], "markdown"=>"kramdown", "highlighter"=>"rouge", "lsi"=>false, "excerpt_separator"=>"\n\n", "incremental"=>false, "detach"=>false, "port"=>"4000", "host"=>"127.0.0.1", "baseurl"=>"/ssl-wearables", "show_dir_listing"=>false, "permalink"=>"date", "paginate_path"=>"/page:num", "timezone"=>nil, "quiet"=>false, "verbose"=>false, "defaults"=>[], "liquid"=>{"error_mode"=>"warn", "strict_filters"=>false, "strict_variables"=>false}, "kramdown"=>{"auto_ids"=>true, "toc_levels"=>[1, 2, 3, 4, 5, 6], "entity_output"=>"as_char", "smart_quotes"=>"lsquo,rsquo,ldquo,rdquo", "input"=>"GFM", "hard_wrap"=>false, "guess_lang"=>true, "footnote_nr"=>1, "show_warnings"=>false}, "title"=>"OxWearables SSL-wearables", "tagline"=>"Communicate your research and beyond", "paginate"=>1, "locale"=>"en", "author"=>{"name"=>"OxWearables", "url"=>"https://oxwearables.github.io/ssl-wearables/"}, "gems"=>["jekyll-paginate"], "livereload_port"=>35729, "serving"=>true, "watch"=>true, "url"=>"http://localhost:4000"}:ET
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
I" <p>You’ll find this post in your <code class="language-plaintext highlighter-rouge">_posts</code> directory - edit this post and re-build (or run with the <code class="language-plaintext highlighter-rouge">-w</code> switch) to see your changes!
To add new posts, simply add a file in the <code class="language-plaintext highlighter-rouge">_posts</code> directory that follows the convention: YYYY-MM-DD-name-of-post.ext.</p>

<p>Jekyll also offers powerful support for code snippets:</p>

<figure class="highlight"><pre><code class="language-ruby" data-lang="ruby"><span class="k">def</span> <span class="nf">print_hi</span><span class="p">(</span><span class="nb">name</span><span class="p">)</span>
<span class="nb">puts</span> <span class="s2">"Hi, </span><span class="si">#{</span><span class="nb">name</span><span class="si">}</span><span class="s2">"</span>
<span class="k">end</span>
<span class="n">print_hi</span><span class="p">(</span><span class="s1">'Tom'</span><span class="p">)</span>
<span class="c1">#=&gt; prints 'Hi, Tom' to STDOUT.</span></code></pre></figure>

<p>Check out the <a href="http://jekyllrb.com">Jekyll docs</a> for more info on how to get the most out of Jekyll. File all bugs/feature requests at <a href="https://github.com/mojombo/jekyll">Jekyll’s GitHub repo</a>.</p>

:ET
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
I"�<!------------------------------------------ Hyperlinks ---------------------------------------------------->
<!--- If you want to update links for your code/paper/demo, modify that in _includes/page-header.html -->
<!------------------------------------- End of hyperlinks -------------------------------------------------->

<!---------------------------------------------------------------------------------------------------------->
<!----------------------------------------- Abstract ------------------------------------------------------->
<hr />

<p style="text-align: center;">Abstract</p>

<p>
Advances in deep learning for human activity recognition have been relatively limited due to the lack of large labelled datasets.
In this study, we leverage self-supervised learning techniques on the UK-Biobank activity tracker dataset--the largest of
its kind to date--containing more than 700,000 person-days of unlabelled wearable sensor data. Our resulting activity
recognition model consistently outperformed strong baselines across seven benchmark datasets, with an F1 relative improvement
of 2.5%-100% (median 18.4%), the largest improvements occurring in the smaller datasets. In contrast to previous studies,
our results generalise across external datasets, devices, and environments. Our open-source model will help researchers and developers
to build customisable and generalisable activity classifiers with high performance.

</p>
<hr />

<!--------------------------------------- End abstract ----------------------------------------------------->
<!---------------------------------------------------------------------------------------------------------->

<!---------------------------------------------------------------------------------------------------------->
<!------------------------------------------ Main body ------------------------------------------------------>
<h1 id="summary">Summary</h1>
<p><strong>We developed a foundation model for human activity recognition (HAR) using self-supervision. The pre-trained model is available to build high-performance human activity classifiers using accelerometer data.</strong></p>

<p><code class="language-plaintext highlighter-rouge">harnet10</code> takes data that is 10-second long windows with 30hz of frequency. <code class="language-plaintext highlighter-rouge">harnet30</code> for 30-second long windows will be avaliable at
a later date.</p>

<p>We used self-supervision to train a ResNet16 V2 with 1D convolution. We inverted (arrow of the time), permuted, and time-warped the accelerometer data.</p>

<p><img src="assets/ssl_diagram.png" alt="alt text" title="Overview" /></p>

<h2 id="using-the-pre-trained-model">Using the pre-trained model</h2>
<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kn">import</span> <span class="nn">torch</span>
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="n">np</span>

<span class="n">repo</span> <span class="o">=</span> <span class="s">'OxWearables/ssl-wearables'</span>
<span class="n">harnet10</span> <span class="o">=</span> <span class="n">torch</span><span class="p">.</span><span class="n">hub</span><span class="p">.</span><span class="n">load</span><span class="p">(</span><span class="n">repo</span><span class="p">,</span> <span class="s">'harnet10'</span><span class="p">,</span> <span class="n">class_num</span><span class="o">=</span><span class="mi">5</span><span class="p">,</span> <span class="n">pretrained</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>

<span class="n">x</span> <span class="o">=</span> <span class="n">np</span><span class="p">.</span><span class="n">random</span><span class="p">.</span><span class="n">rand</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">300</span><span class="p">)</span>
<span class="n">x</span> <span class="o">=</span> <span class="n">torch</span><span class="p">.</span><span class="n">FloatTensor</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="n">harnet10</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
</code></pre></div></div>

<h1 id="results">Results</h1>

<h3 id="the-pre-trained-model-can-consistenly-improve-activity-classification-performance">The pre-trained model can consistenly improve activity classification performance</h3>
<p><img src="assets/baseline.png" alt="alt text" title="limited_subject" /></p>

<h3 id="self-supervised-pre-training-out-performs-supervised-pre-training">Self-supervised pre-training out-performs supervised pre-training</h3>
<p><img src="assets/transfer.png" alt="alt text" title="limited_subject" /></p>

<h3 id="pre-trained-models-achieves-high-performance-even-with-limited-labelled-datasets">Pre-trained models achieves high performance even with limited labelled datasets</h3>
<p><img src="assets/subject.png" alt="alt text" title="limited_subject" /></p>

<h3 id="the-learnt-features-can-discriminate-activity-intensities-and-frequencies-without-fine-tuning">The learnt features can discriminate activity intensities and frequencies without fine-tuning</h3>
<p><img src="assets/visu.png" alt="alt text" title="cluster" /></p>

<h2 id="bibliography">Bibliography</h2>

<div class="language-tex highlighter-rouge"><div class="highlight"><pre class="highlight"><code>@misc<span class="p">{</span>yuan2022selfsupervised,
title=<span class="p">{</span>Self-supervised Learning for Human Activity Recognition Using 700,000 Person-days of Wearable Data<span class="p">}</span>,
author=<span class="p">{</span>Hang Yuan and Shing Chan and Andrew P. Creagh and Catherine Tong and David A. Clifton and Aiden Doherty<span class="p">}</span>,
year=<span class="p">{</span>2022<span class="p">}</span>,
eprint=<span class="p">{</span>2206.02909<span class="p">}</span>,
archivePrefix=<span class="p">{</span>arXiv<span class="p">}</span>,
primaryClass=<span class="p">{</span>eess.SP<span class="p">}</span>
<span class="p">}</span>
</code></pre></div></div>

<h2 id="acknowledgement">Acknowledgement</h2>

<blockquote>
<p>We would like to thank all the helpful discussions and feedback we recevied from Aidan Acquah, Gert Mertes, Henrique Aguiar, Andres Tamm, and Korsuk Sirinukunwattana.
This research has been conducted using the UK Biobank Resource under Application Number 59070. This work is supported by: Novo Nordisk (HY, AD); the Wellcome Trust [223100/Z/21/Z] (AD); GlaxoSmithKline (AC, DC); the British Heart Foundation Centre of Research Excellence [RE/18/3/34214] (AD); the National Institute for Health Research (NIHR) Oxford Biomedical Research Centre (AD, DC); and Health Data Research UK, an initiative funded by UK Research and Innovation, Department of Health and Social Care (England) and the devolved administrations, and leading medical research charities. It is also supported by the UK’s Engineering and Physical Sciences Research Council (EPSRC) with grants EP/S001530/1 (the MOA project) and EP/R018677/1 (the OPERA project); and the European Research Council (ERC) via the REDIAL project (Grant Agreement ID: 805194), and industrial funding from Samsung AI.
We would also like to thank Alex Rowlands and Mike Catt, who kindly shared their activity dataset with us. Their project was funded by a grant from Unilever Discover to the School of Sports and Health Sciences, University of Exeter.</p>
</blockquote>
:ET
9 changes: 9 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
source 'https://rubygems.org'
gemspec

gem 'jekyll'
gem 'jekyll-paginate'
gem 'kramdown'
gem 'pygments.rb'

gem "webrick", "~> 1.7"
83 changes: 83 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
PATH
remote: .
specs:
jekyll-cayman-theme (0.1.0)

GEM
remote: https://rubygems.org/
specs:
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
colorator (1.1.0)
concurrent-ruby (1.1.10)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
eventmachine (1.2.7)
ffi (1.15.5)
forwardable-extended (2.6.0)
http_parser.rb (0.8.0)
i18n (1.10.0)
concurrent-ruby (~> 1.0)
jekyll (4.2.2)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 1.0)
jekyll-sass-converter (~> 2.0)
jekyll-watch (~> 2.0)
kramdown (~> 2.3)
kramdown-parser-gfm (~> 1.0)
liquid (~> 4.0)
mercenary (~> 0.4.0)
pathutil (~> 0.9)
rouge (~> 3.0)
safe_yaml (~> 1.0)
terminal-table (~> 2.0)
jekyll-paginate (1.1.0)
jekyll-sass-converter (2.2.0)
sassc (> 2.0.1, < 3.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.3)
listen (3.7.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (4.0.7)
pygments.rb (2.3.0)
rake (13.0.6)
rb-fsevent (0.11.1)
rb-inotify (0.10.1)
ffi (~> 1.0)
rexml (3.2.5)
rouge (3.28.0)
safe_yaml (1.0.5)
sassc (2.4.0)
ffi (~> 1.9)
terminal-table (2.0.0)
unicode-display_width (~> 1.1, >= 1.1.1)
unicode-display_width (1.8.0)
webrick (1.7.0)

PLATFORMS
arm64-darwin-21

DEPENDENCIES
bundler (>= 2.2.10)
jekyll
jekyll-cayman-theme!
jekyll-paginate
kramdown
pygments.rb
rake (>= 12.3.3)
webrick (~> 1.7)

BUNDLED WITH
2.3.6
52 changes: 0 additions & 52 deletions LICENSE.md

This file was deleted.

6 changes: 0 additions & 6 deletions MANIFEST.in

This file was deleted.

Loading

0 comments on commit cc9a6ed

Please sign in to comment.