oxwearables / ssl-wearables Goto Github PK
View Code? Open in Web Editor NEWSelf-supervised learning for wearables using the UK-Biobank (>700,000 person-days)
Home Page: https://oxwearables.github.io/ssl-wearables/
License: Other
Self-supervised learning for wearables using the UK-Biobank (>700,000 person-days)
Home Page: https://oxwearables.github.io/ssl-wearables/
License: Other
At the moment, we only ran the weighted sampling experiment once to get the training curves, we would like to run them a few times to get the error bars just to be sure.
I used the provided torch hub way to load the harnet5/10/30 model, but I wanted to be able to make inference in Rowland labels, so I download and attempted to load the Rowland pre-trained model. However, it seemed like the Rowland Pre-trained model has a different model architecture than the Torch hub models. Can you please clarify?
Another adjacent question is, does 'Rowland Pre-trained' model mean a model that
The key components needed:
To help people understand why our benchmarks are a much more robust evaluation than what's currently available
Cite the recent ssl paper.
Hello authors,
I saw that using your processed capture 24_30hz_full Y.npy, the unique labels are
{'moderate-vigorous', 'sleep', 'light', 'sedentary'}
However, I was confused when I see the corresponding UMAP feature map in the paper.
Can you please explain the difference?
As a side question, with all due respect why was the subset of labels chosen out of the annotation directory, dubbed Walmsley2020? They seem to be easy to be distinguished by the the magnitude of accelerator along and does not carry any periodic information or fine upper body activity.
Experiments
Both the below experiments can be run using https://github.com/OxWearables/ssl-wearables/blob/main/downstream_task_evaluation.py
Example scripts to run for different modes. Ask Hang for model weights for different pre-trained models.
python downstream_task_evaluation.py data=pamap_10s evaluation=hand_crafted
python downstream_task_evaluation.py gpu=1 data=pamap_10s evaluation=flip_net_random_mlp model=resnet
python downstream_task_evaluation.py gpu=0 data=pamap_10s evaluation=flip_net_ft_freeze model=resnet
python downstream_task_evaluation.py gpu=2 data=pamap_10s evaluation=flip_net_ft model=resnet
python downstream_task_evaluation.py gpu=3 data=pamap_10s evaluation=flip_net_100k_ft model=resnet
The model weights for Table 2 can be downloaded from Github readme links. For Table 3, self-supervised ones, you can get from Github readme links too. Ask Hang for the supervised weights.
Writing
Because of the lack the homogenous baselines, to validate the effectiveness of the SSL models, we shall also assess the model performance using a different window length
Hi! First of all, thanks for this high quality and open research!
I ran the usage example shown in the README.md
:
import torch
import numpy as np
repo = 'OxWearables/ssl-wearables'
harnet5 = torch.hub.load(repo, 'harnet5', class_num=5, pretrained=True)
x = np.random.rand(1, 3, 150)
x = torch.FloatTensor(x)
harnet5(x)
harnet10 = torch.hub.load(repo, 'harnet10', class_num=5, pretrained=True)
x = np.random.rand(1, 3, 300)
x = torch.FloatTensor(x)
harnet10(x)
harnet30 = torch.hub.load(repo, 'harnet30', class_num=5, pretrained=True)
x = np.random.rand(1, 3, 900)
x = torch.FloatTensor(x)
harnet30(x)
I have trouble understanding exactly what the harnet models are. I understand that they are instances of sslearning.models.accNet.Resnet
, and my understanding is the following:
feature_extractor
part was pre-trained using multi-task SSL on UK-Biobank dataset, as explained in your paperclassifier
part is not trained at all, and we have to train it on any labelled classification dataset (what makes me understand this is that we can select any number class_num
).Is my understanding correct?
Also, would it be possible to write this information next to the usage example?
Thanks a lot in advance :)
Overview:
I am encountering an issue when building a Docker dev container to run this repo through vs code, specifically during the installation of dependencies from a req.txt file. The build process fails with several errors related to various dependencies.
Environment:
Docker version: 4.26.0
Operating System: Windows 11
Steps To Reproduce:
# Use Ubuntu as the base image
FROM ubuntu:18.04
# Install Python 3.7
RUN apt-get update && \
apt-get install -y software-properties-common && \
add-apt-repository ppa:deadsnakes/ppa && \
apt-get update && \
apt-get install -y python3.7 python3-pip python3.7-dev
# Create a working directory
WORKDIR /app
# Copy the requirements file into the container
COPY req.txt /app/
# Install Python dependencies
RUN pip install -r req.txt
# Install JupyterLab
RUN pip install jupyterlab
# Expose the port JupyterLab will use
EXPOSE 8888
# Set up the entry point to launch JupyterLab
ENTRYPOINT ["jupyter", "lab", "--ip=0.0.0.0", "--allow-root", "--NotebookApp.token=''", "--NotebookApp.password=''"]
version: '3.8'
services:
dev:
build:
context: .
dockerfile: dockerfile.dev
ports:
- "8888:8888"
volumes:
- .:/app
command: jupyter lab --ip=0.0.0.0 --allow-root --NotebookApp.token='' --NotebookApp.password=''
Expected Behavior:
The Docker container should build without errors, and all dependencies listed in the req.txt file should be installed correctly.
Actual Behavior:
During the build process, the installation of dependencies fails. Dependencies that might be at issue include:
numpy
Werkzeug
pandas
scipy
torch
sci-kitlearn
I would appreciate any guidance on resolving these build errors or suggestions on changes to the Dockerfile or req.txt that might mitigate these issues. Also I would like to raise the question as to why such antiquated packages are being used, many of them are deprecated and no longer supported (e.g. python 3.7 and torch 1.4). The reliance on outdated packages could cause major issues in the future.
Hello,
I am running this code to load the model:
import torch repo = 'OxWearables/ssl-wearables' harnet = torch.hub.load(repo, "harnet30", class_num=5, pretrained=True)
However, it returns while saying: 131 Weights loaded
This seems odd to me as the network has a few million.
Happens on: python3.8 with pytorch 2.1.2 and pytorch 1.11
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.