U-Time: A Fully Convolutional Network for Time Series Segmentation

Overview

U-Time & U-Sleep

Official implementation of

  • The U-Time [1] model for general-purpose time-series segmentation.
  • The U-Sleep [2] model for resilient high-frequency sleep staging.

This repository may be used to train both the original U-Time and newer U-Sleep models. However, the repository has been significantly extended since [1] and may gradually diverge from the version described in [2]. Earlier versions may be found at:

Contents

Overview

This document describes the official software package developed for and used to create the free and public sleep staging system U-Sleep [2]. U-Sleep is a fully convolutional deep neural network for automated sleep staging. A single instance of the model may be trained to perform accurate and resilient sleep staging across a wide range of clinical populations and polysomnography (PSG) acquisition protocols.

This software allows simultaneous training of U-Sleep across any number of PSG datasets using on-the-fly random selection of input channel configurations. It features a command-line interface for initializing, training and evaluating models without needing to modify the underlying codebase.

Pre-trained U-Sleep

In the following we will introduce the software behind U-Sleep in greater detail. Please note that:

  • If you are interested to re-implement, extend, or train U-Sleep yourself e.g. on other datasets, you are at the right place!
  • If you are looking to use our pre-trained U-Sleep model for automated sleep staging, please refer to https://sleep.ai.ku.dk and follow the displayed guide.

U-Time and U-Sleep - What's the Difference?

This repository stores code for training and evaluating the U-Sleep sleep staging model. It builds upon and significantly extends our U-Time repository, published at NeurIPS 2019 [1]. In the following, we will use the term U-Sleep to denote the resilient high frequency sleep staging model currently in press [2], and U-Time to denote this repository of code used to train and evaluate the U-Sleep model.

System Requirements

Minimal Hardware Requirements

Using an already trained U-Sleep model for sleep staging may typically be done on any modern laptop (subject to the software requirements listed below).

For training U-Sleep models from scratch, however, we highly recommend using a Linux based computer with at least the following hardware specifications:

It is possible to train the model on smaller machines, and without GPUs, but doing so may take considerable time. Likewise, more resources will speed up training. If the considered dataset exceeds the system memory (e.g. the 8 GiB of RAM suggested above), data must be preprocessed and streamed from disk as demonstrated in the Demo section below. On larger machines, one may benefit from maintaining a larger pool of data loaded in memory. For instance, we trained U-Sleep [2] using 8 CPU cores, 1 GPU and 40 GiB of RAM, please refer to the Full Reproduction of U-Sleep section below.

*The required hard-disk space depends on the number and sizes of datasets considered. For a Full Reproduction of U-Sleep approximately 4 TiB of available storage is needed.

Software Requirements:

  • A computer with a Linux operating system installed. We have developed and tested the software for Red Hat Enterprise (v7.8) and Ubuntu (v18.04) servers, but any modern distribution should work. The software has also been tested on MacOS Catalina (10.15.6) for CPU-based training and prediction only.
  • Anaconda or Miniconda, v4.5 or higher, 64-bit.

If you are going to train a U-Sleep model yourself from scratch, we highly recommend doing so on a GPU. In order to use the U-Time package with a GPU, the tensorflow-gpu (v2.1) library is required. For this, the following additional software is required on your system:

Please refer to https://www.tensorflow.org/install/gpu for additional details. You do not need to install TensorFlow yourself (see Installation Guide below), but the above software must be installed before proceeding.

Installation Guide

On a Linux machine with at least 1 CUDA enabled GPU available and anaconda or miniconda installed, run the following commands to download the software, create a conda environment named u-sleep and setup the U-Time software package and its dependencies:

git clone https://github.com/perslev/U-Time.git
conda env create --file U-Time/environment.yaml
conda activate u-sleep
pip install mpunet==0.2.12 --no-deps
pip install U-Time/

This installation process may take up to 10 minutes to complete.

Demo

In this following we will demonstrate how to launch a short training session of U-Sleep on a significantly limited subset of the datasets used in [2].

Requirements

  • Completion of the steps outlined in the Installation Guide.
  • This demo takes approximately 30 minutes to complete on a typical computer and network connection. The majority of this time is spend downloading the required data from public databases. This step may take significantly longer depending on current database traffic.
  • Approximately 11 GiB of available disk-space on your computer.

Preparing a project directory

First, we create a project directory that will store all of our data for this demo. The ut init command will create a folder and populate it with a set of default hyperparameter values:

ut init --name demo --model usleep_demo

Entering the newly created project directory we will find a folder storing hyperparameters:

cd demo
ls
> hyperparameters

Download public PSG data

We will download 6 PSG studies from the public sleep databases Sleep-EDF and DCSM using the ut fetch command. You will need approximately 10 GiB of free hard-disk space to store the downloaded files. Depending on your internet speed and the current load on each of the two servers, downloading may take anywhere from 5 minutes to multiple hours:

ut fetch --dataset sedf_sc --out_dir data/sedf_sc --N_first 6
ut fetch --dataset dcsm --out_dir data/dcsm --N_first 6

The raw data that we will consider in this demo has now been downloaded. Our demo project folder now has roughly the following structure:

└─ demo
   ├─ hyperparameters
   └─ data
      ├─ dcsm
      │  ├─ tp005f7e68_a084_46bb_9f0a_b6a084155a1c
      │  │  ├─ hypnogram.ids
      │  │  └─ psg.h5
      │  ├─ ...
      └─ sedf_sc
         ├─ SC4001E0
         │  ├─ SC4001E0-PSG.edf
         │  └─ SC4001EC-Hypnogram.edf
         ├─ ...

Dataset splitting

Before proceeding to train the U-Sleep model we split each dataset into fixed train/validation/test splits using the ut cv_split command. The command must be invoked twice each with a unique set of parameters specifying the naming conventions of dataset:

# Split dataset SEDF-SC
ut cv_split --data_dir data/sedf_sc/ \
            --subject_dir_pattern 'SC*' \
            --CV 1 \
            --validation_fraction 0.10 \
            --test_fraction 0.25 \
            --subject_matching_regex 'SC4(\d{2}).*' \
            --seed 123
            
# Split dataset DCSM
ut cv_split --data_dir data/dcsm/ \
            --subject_dir_pattern 'tp*' \
            --CV 1 \
            --validation_fraction 0.10 \
            --test_fraction 0.25 \
            --seed 123

Note that the splitting of SEDF-SC is performed on a per-subject basis. All PSG records from the same subject will be placed into the same dataset split. This is not needed for DCSM as all recordings are of unique subjects.

Please be aware that if you modify any of the above commands to e.g. use different output directory names, you will need to modify paths in dataset hyperparameter files stored under hyperparameters/dataset_configurations as appropriate before proceding with the next steps.

Data pre-processing

Run the following command to prepare the data for training:

ut preprocess --out_path data/processed_data.h5 --dataset_splits train_data val_data

The ut preprocess script loads and processes all datasets as described by the parameters set in hyperparameters/hparams.yaml and all dataset-specific files in the folder hyperparameters/dataset_configurations. Specifically, it loads the needed channels (ignoring the rest), re-samples, scales and clips the data, maps hypnogram stages to interger representations used internally during training and finally saves the processed data to an HDF5 archive. When training, data may be streamed directly from this archive to significantly reduce the required system memory.

It is also possible to skip this step all together and either 1) load all data needed for training up front, or 2) stream and apply preprocessing on-the-fly during training as shown in the Full Reproduction of U-Sleep section below.

Training the model

We may now start training by invoking the ut train command. A default set of optimization hyperparameters have been pre-specified and are located in the hyperparameters/hparams.yaml file of your project directory. In this demo, we are going to run only a very short training session, but feel free to modify any parameters in the hparams.yaml file as you see fit. Run the following command:

ut train --num_GPUs=1 --preprocessed --seed 123

You may replace the --num_GPUs=1 parameter in the above command with --num_GPUs=0 if you do not have a GPU available, and wish to train on the CPU. Training on CPU may take up to 30 minutes.

Following training, a set of candidate models will be available in the folder model. Using the best one observed (highest validation mean F1 score), we may predict on the testing sets of both SEDF-SC and DCSM using all channel combinations as well as compute majority votes by invoking the following ut predict command:

Predicting and evaluating on the test sets

ut predict --num_GPUs=1 \
           --data_split test_data \
           --strip_func strip_to_match \
           --one_shot \
           --save_true \
           --majority \
           --out_dir predictions

The predicted hypnograms are now available under directory predictions/test_data. Finally, let us print a global confusion matrix (computed across all subjects) for dataset sedf_sc (replace sedf_sc -> dcsm for DCSM evaluation):

ut cm --true 'predictions/test_data/sedf_sc/*TRUE.npy' \
      --pred 'predictions/test_data/sedf_sc/majority/*PRED.npy' \
      --ignore 5 \
      --round 2 \
      --wake_trim_min 30

>>>  Looking for files...
>>>  Loading 2 pairs...
>>>  OBS: Wake trimming of 30 minutes (period length 30 sec)
>>>  OBS: Ignoring class(es): [5]
>>>  
>>>  Raw Confusion Matrix:
>>>  
>>>          Pred 0  Pred 1  Pred 2  Pred 3  Pred 4
>>>  True 0       0       0      17     234       0
>>>  True 1       0       0     132     146       0
>>>  True 2       0       0     790     157       0
>>>  True 3       0       0      25     189       0
>>>  True 4       0       0     243      99       0
>>>  
>>>  Raw Metrics:
>>>  
>>>             F1  Precision  Recall/Sens.
>>>  Class 0  0.00       0.00          0.00
>>>  Class 1  0.00       0.00          0.00
>>>  Class 2  0.73       0.65          0.83
>>>  Class 3  0.36       0.23          0.88
>>>  Class 4  0.00       0.00          0.00
>>>  mean     0.22       0.18          0.34 

If you received an output similar to the above, congratulations! You have successfully installed, configured, trained and evaluated a U-Sleep model on two different datasets.

Please note that:

  • If you ran the above code on a GPU, you may not obtain the exact same numbers listed here, even if you specified the --seed arguments. This is because some computations used during the training of U-Sleep are fundamentally non-deterministic when evaluated on a GPU. However, predicting using a trained U-Sleep model will give deterministic outputs.

  • The performance of the obtained demo model is very low and not suitable for actual sleep staging. The reason is that we trained U-Sleep on a very limited set of data and for a very limited number of epochs. Please refer to the Full Reproduction of U-Sleep section for details on how to prepare and train a complete version of U-Sleep.

Full Reproduction of U-Sleep

The Demo above in principle describes all steps needed to reproduce U-Sleep as reported in [2]. The main - and significant - difference is that in order to reproduce the full model, you will need to 1) be able to access 2) download and 3) preprocess all the required datasets. You may also need a computer with more resources as described in System Requirements.

Prepare the datasets

We did our best to make this process as easy as possible. You should take the following steps:

  1. Carefully read (at least) the Methods and supplementary Datasets sections of our paper [2] to familiarize yourself with the datasets, preprocessing, training pipeline and more.
  2. Download all datasets from the National Sleep Research Resource, PhysioNet or other sleep repositories as described and referenced in the Supplementary Material's Dataset section. For some datasets you must apply to gain access, while others are publicly available. Some datasets may be easily downloaded using the ut fetch command. Please invoke ut fetch --help to see an up-to-date list of which datasets may be downloaded this way.
  3. Place all downloaded data into a single folder [LOCAL_PATH] with 1 sub-folder for each dataset.
  4. Run ut extract, ut extract_hypno, and ut cv_split on all datasets as specified for each dataset separately in files under the folder resources/usleep_dataset_pred of this repository (also found here). These commands will extract and place data into a folder-structure and format that U-Time accepts, as well as split the data into subsets.
  5. (optional) The ut extract command will select the relevant channels, re-sample them to 128 Hz and store the data in HDF5 archives. The original data will not be deleted by default. If you have limited hard-drive space, consider removing the old files before processing the next dataset.
  6. Initialize a U-Sleep project: ut init --name u-sleep --model usleep.
  7. For each dataset configuration file in u-sleep/hyperparameters/dataset_configurations/ replace the string [LOCAL_PATH] with the [LOCAL_PATH] of your data.

Train the model

If you have 40+ GiB system memory available, train U-Sleep using the following command:

ut train --num_GPUs 1 --max_loaded_per_dataset 40 --num_access_before_reload 32 --train_queue_type limitation --val_queue_type lazy --max_train_samples_per_epoch 1000000

On systems with less memory, you may either 1) reduce the --max_loaded_per_dataset parameter from the current 40 to a lower value (this will keep fewer PSG records in the active memory pool, which will reduce randomness when selecting records), or 2) preprocess the data and stream data during training (as demonstrated in the Demo above) by invoking the following two commands (replacing [LOCAL_PATH] as applicable):

ut preprocess --out_path '[LOCAL_PATH]/processed_data.h5' --dataset_splits train_data val_data
ut train --num_GPUs 1 --preprocessed --max_train_samples_per_epoch 1000000

This will apply all preprocessing, create a data archive suitable for streaming, and train U-Sleep using samples loaded on-the-fly from disk.

Due to the vast size of the dataset considered, training U-Sleep with the default parameters may take very long. We suggest increasing the learning rate (from the current 1e-7 to e.g. 1e-6) unless you are looking to re-create U-Sleep under the exact conditions considered in [2].

U-Time Example

You can still use this repository to train the older U-Time model. In the following we show an end-to-end example. The commands listed below prepares a project folder, downloads the sleep-edf-153 dataset, fits and evaluates a U-Time model in a fixed train/val/test dataset split setup. Please note that the below code does not reproduce the sleep-edf-153 experiment of [1] as 10-fold CV was used. To run a CV experiment, please refer to the ut cv_split --help and ut cv_experiment --help commands.

# Obtain a public sleep staging dataset
ut fetch --dataset sedf_sc --out_dir datasets/sedf_sc

# Prepare a fixed-split experiment
ut cv_split --data_dir 'datasets/sedf_sc' \
            --subject_dir_pattern 'SC*' \
            --CV 1 \
            --validation_fraction 0.20 \
            --test_fraction 0.20 \
            --subject_matching_regex 'SC4(\d{2}).*' \
            --file_list

# Initialize a U-Time project
ut init --name my_utime_project \
        --model utime \
        --data_dir datasets/sedf_sc/views/fixed_split

# Start training
cd my_utime_project
ut train --num_GPUs=1 --channels 'EEG Fpz-Cz'

# Predict and evaluate
ut evaluate --out_dir eval --one_shot

# Print a confusion matrix
ut cm --true 'eval/test_data/dataset_1/files/*/true.npz' \
      --pred 'eval/test_data/dataset_1/files/*/pred.npz'
      
# Print per-subject summary statistics
ut summary --csv_pattern 'eval/test_data/*/evaluation_dice.csv' \
           --print_all

# Output sleep stages for every 3 seconds of 128 Hz signal 
# Here, the 'folder_regex' matches 2 files in the dataset 
ut predict --folder_regex '../datasets/sedf_sc/SC400[1-2]E0' \
           --out_dir high_res_pred \
           --data_per_prediction 384 \
           --one_shot

References

[1] U-Time

@incollection{NIPS2019_8692,
	title = {U-Time: A Fully Convolutional Network for Time Series Segmentation Applied to Sleep Staging},
	author = {Perslev, Mathias and Jensen, Michael and Darkner, Sune and Jennum, Poul J\o rgen and Igel, Christian},
	booktitle = {Advances in Neural Information Processing Systems 32},
	editor = {H. Wallach and H. Larochelle and A. Beygelzimer and F. d\textquotesingle Alch\'{e}-Buc and E. Fox and R. Garnett},
	pages = {4415--4426},
	year = {2019},
	publisher = {Curran Associates, Inc.},
	url = {http://papers.nips.cc/paper/8692-u-time-a-fully-convolutional-network-for-time-series-segmentation-applied-to-sleep-staging.pdf}
}

[2] U-Sleep

U-Sleep: Resilient High-Frequency Sleep Staging
Mathias Perslev (1), Sune Darkner (1), Lykke Kempfner (2), Miki Nikolic (2), Poul Jørgen Jennum (2) & Christian Igel (1)
npj Digital Medicine, 4, 72 (2021)
https://doi.org/10.1038/s41746-021-00440-5

(1) Department of Computer Science, University of Copenhagen, Denmark
(2) Danish Center for Sleep Medicine, Rigshospitalet, Glostrup, Denmark
Comments
  • AssertionError

    AssertionError

    I encountered such an error when I was running, can you tell me the reason?

    Traceback (most recent call last): File "/home/ubuntu/anaconda3/envs/tf2/bin/ut", line 33, in sys.exit(load_entry_point('utime', 'console_scripts', 'ut')()) File "/home/ubuntu/tf2/U-Time/utime/bin/ut.py", line 55, in entry_func mod.entry_func(parsed.args) File "/home/ubuntu/tf2/U-Time/utime/bin/train.py", line 221, in entry_func raise e File "/home/ubuntu/tf2/U-Time/utime/bin/train.py", line 218, in entry_func run(args=args, gpu_mon=gpu_mon) File "/home/ubuntu/tf2/U-Time/utime/bin/train.py", line 192, in run **hparams["fit"]) File "/home/ubuntu/tf2/U-Time/utime/train/trainer.py", line 118, in fit raise e File "/home/ubuntu/tf2/U-Time/utime/train/trainer.py", line 104, in fit self._fit(batch_size=batch_size, **fit_kwargs) File "/home/ubuntu/tf2/U-Time/utime/train/trainer.py", line 200, in _fit verbose=verbose File "/home/ubuntu/anaconda3/envs/tf2/lib/python3.7/site-packages/tensorflow/python/util/deprecation.py", line 324, in new_func return func(*args, **kwargs) File "/home/ubuntu/anaconda3/envs/tf2/lib/python3.7/site-packages/tensorflow/python/keras/engine/training.py", line 1479, in fit_generator initial_epoch=initial_epoch) File "/home/ubuntu/anaconda3/envs/tf2/lib/python3.7/site-packages/tensorflow/python/keras/engine/training.py", line 66, in _method_wrapper return method(self, *args, **kwargs) File "/home/ubuntu/anaconda3/envs/tf2/lib/python3.7/site-packages/tensorflow/python/keras/engine/training.py", line 876, in fit callbacks.on_epoch_end(epoch, epoch_logs) File "/home/ubuntu/anaconda3/envs/tf2/lib/python3.7/site-packages/tensorflow/python/keras/callbacks.py", line 365, in on_epoch_end callback.on_epoch_end(epoch, logs) File "/home/ubuntu/tf2/U-Time/utime/callbacks/callbacks.py", line 194, in on_epoch_end TPs, relevant, selected, metrics = self.predict() File "/home/ubuntu/tf2/U-Time/utime/callbacks/callbacks.py", line 87, in predict assert len(metrics_names)-1 == len(metrics) AssertionError 2020-07-19 21:34:52.871960: W tensorflow/core/kernels/data/generator_dataset_op.cc:103] Error occurred when finalizing GeneratorDataset iterator: Failed precondition: Python interpreter state is not initialized. The process may be terminated. [[{{node PyFunc}}]]

    opened by nengwp 9
  • Unexpected channel loading error

    Unexpected channel loading error

    I tried to run the code following the instructions on Google Colab using Python 3 and GPU.
    When I tried to run:

    ut train --num_GPUs=1 --channels 'EEG Fpz-Cz'

    I got the following error:

    utime.errors.ChannelNotFoundError: Unexpected channel loading error. Should have loaded 1 channels (['EEG Fpz-Cz']), but the PSG array has shape (8406000, 2). There might be an error in the code. Please rais an issue on GitHub.

    The previous steps were good. This is the whole message:

    2020-04-07 00:58:08.072685: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.1

    Logged by: 'run' in 'train.py' Args dump: {'num_GPUs': 1, 'force_GPU': '', 'continue_training': False, 'initialize_from': None, 'log_file_prefix': '', 'overwrite': False, 'just_one': False, 'no_val': False, 'max_train_samples_per_epoch': 500000.0, 'val_samples_per_epoch': 50000.0, 'n_epochs': None, 'channels': ['EEG Fpz-Cz'], 'final_weights_file_name': 'model_weights.h5', 'train_on_val': False}


    Logged by: 'init' in 'hparams.py' YAML path: /content/my_utime_project/hparams.yaml


    Logged by: 'log_version' in 'version_controller.py' utime version: 0.0.1 (master, f4038e8)


    Logged by: 'set_value' in 'hparams.py' Setting value '0.0.1' (type <class 'str'>) in subdir 'None' with name 'VERSION' Setting value 'master' (type <class 'str'>) in subdir 'None' with name 'BRANCH' Setting value 'f4038e8' (type <class 'str'>) in subdir 'None' with name 'COMMIT'


    Logged by: 'save_current' in 'hparams.py' Saving current YAML configuration to file: /content/my_utime_project/hparams.yaml Setting value '['EEG Fpz-Cz']' (type <class 'list'>) in subdir 'None' with name 'select_channels' Saving current YAML configuration to file: /content/my_utime_project/hparams.yaml


    Logged by: 'log' in 'sleep_study_dataset.py' [Dataset: dataset_1/TRAIN] SleepStudyDataset(identifier: dataset_1/TRAIN, N pairs: 91, N loaded: 0) [Dataset: dataset_1/VAL] SleepStudyDataset(identifier: dataset_1/VAL, N pairs: 32, N loaded: 0) [Dataset: dataset_1/TRAIN] Setting select channels: ['EEG Fpz-Cz'] [Dataset: dataset_1/VAL] Setting select channels: ['EEG Fpz-Cz'] [Dataset: dataset_1/TRAIN] Setting sample rate of 100 Hz [Dataset: dataset_1/VAL] Setting sample rate of 100 Hz [Dataset: dataset_1/TRAIN] Setting 'drop_class' strip function with parameters {'class_int': 5}... [Dataset: dataset_1/VAL] Setting 'drop_class' strip function with parameters {'class_int': 5}... [Dataset: dataset_1/TRAIN] Setting 'zero_out_noisy_epochs' quality control function with parameters {'max_times_global_iqr': 20}... [Dataset: dataset_1/VAL] Setting 'zero_out_noisy_epochs' quality control function with parameters {'max_times_global_iqr': 20}... [Dataset: dataset_1/TRAIN] Setting 'RobustScaler' scaler... [Dataset: dataset_1/VAL] Setting 'RobustScaler' scaler... [Dataset: dataset_1/TRAIN] Loading 91/91 SleepStudy objects... Traceback (most recent call last): File "/content/U-Time/utime/dataset/sleep_study.py", line 503, in _load_with_any_in load_channels=channel_set or None) File "/content/U-Time/utime/io/high_level_file_loaders.py", line 44, in load_psg data_dir=os.path.split(psg_file_path)[0]) File "/content/U-Time/utime/io/extractors/psg_extractors.py", line 105, in extract_psg_data len(load_channels), load_channels, psg_data.shape utime.errors.ChannelNotFoundError: Unexpected channel loading error. Should have loaded 1 channels (['EEG Fpz-Cz']), but the PSG array has shape (8406000, 2). There might be an error in the code. Please rais an issue on GitHub.

    The above exception was the direct cause of the following exception:

    Traceback (most recent call last): File "/content/U-Time/utime/dataset/sleep_study.py", line 595, in load self._load() File "/content/U-Time/utime/dataset/sleep_study.py", line 535, in _load self._psg, header, loaded_chanls = self._load_with_any_in(try_channels) File "/content/U-Time/utime/dataset/sleep_study.py", line 517, in _load_with_any_in raise err from e utime.errors.ChannelNotFoundError: Could not load select_channels ['EEG Fpz-Cz'] or alternative_select_channels [[]]

    The above exception was the direct cause of the following exception:

    Traceback (most recent call last): File "/content/U-Time/utime/dataset/sleep_study_dataset.py", line 158, in load for i, ss in enumerate(res): File "/usr/lib/python3.6/concurrent/futures/_base.py", line 586, in result_iterator yield fs.pop().result() File "/usr/lib/python3.6/concurrent/futures/_base.py", line 432, in result return self.__get_result() File "/usr/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result raise self._exception File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run result = self.fn(*self.args, **self.kwargs) File "/content/U-Time/utime/dataset/sleep_study_dataset.py", line 156, in res = pool.map(lambda x: x.load(), to_load) File "/content/U-Time/utime/dataset/sleep_study.py", line 600, in load study_id=self.identifier) from e utime.errors.CouldNotLoadError: Unexpected load error for sleep study SC4011E0. Please refer to the above traceback.

    The above exception was the direct cause of the following exception:

    Traceback (most recent call last): File "/usr/local/bin/ut", line 11, in load_entry_point('utime', 'console_scripts', 'ut')() File "/content/U-Time/utime/bin/ut.py", line 55, in entry_func mod.entry_func(parsed.args) File "/content/U-Time/utime/bin/train.py", line 209, in entry_func raise e File "/content/U-Time/utime/bin/train.py", line 206, in entry_func run(args=args, gpu_mon=gpu_mon) File "/content/U-Time/utime/bin/train.py", line 142, in run d.load(1 if args.just_one else None) File "/content/U-Time/utime/dataset/sleep_study_dataset.py", line 163, in load "traceback.".format(e.study_id)) from e utime.errors.CouldNotLoadError: Could not load sleep study SC4011E0. Please refer to the above traceback.

    opened by aluquecerp 9
  • Problems in training model

    Problems in training model

    I use a Mac computer without GPU. When training the model, I enter the following command: ”ut train --num_GPUs=0 --preprocessed --seed 123“

    report errors:

    File "/usr/local/anaconda3/envs/u-sleep/lib/python3.7/site-packages/mpunet/logging/logger.py", line 66, in new_log_file " writing to the existing file." % file_path) OSError: Logging path: /usr/local/anaconda3/condabin/demo/logs/log.txt already exists. Initialize Logger with overwrite_existing=True or append_existing=True to overwrite or continue writing to the existing file.

    I enter the following command: ”ut train --num_GPUs=0 --preprocessed --overwrite“

    report errors:

    File "/usr/local/anaconda3/envs/u-sleep/lib/python3.7/site-packages/utime/utils/scriptutils/train.py", line 169, in get_data_queues "The 'eager' data loading queue currently does not support datasets with " NotImplementedError: The 'eager' data loading queue currently does not support datasets with the 'load_time_channel_sampling_groups' or 'access_time_channel_sampling_groups' attributes set. If you want to train using random channel combinations, either pre-process the data using the 'ut preprocess' command and then re-run training using 'ut train --preprocessed', or run training with the limitation queue loader using the '--train_queue_type limitation' command.

    I've tried many times and I don't know how to deal with it.

    opened by TL730 8
  • numpy hypnogram format

    numpy hypnogram format

    Hi and sorry to bother you again Mathias!

    I'm not managing to launch training with numpy hypnograms (in my case, they represent binary labels).

    My np arrays contain 3 sub arrays of equal length corresponding to start, duration and label (I tried to follow the conventions mentionned in utime/hypnogram/formats.py) but I get an error when trying to train:

    Traceback (most recent call last): File "/opt/conda/lib/python3.7/site-packages/utime/dataset/sleep_study.py", line 595, in load self._load() File "/opt/conda/lib/python3.7/site-packages/utime/dataset/sleep_study.py", line 555, in _load sample_rate=header["sample_rate"]) File "/opt/conda/lib/python3.7/site-packages/utime/io/high_level_file_loaders.py", line 106, in load_hypnogram sample_rate=sample_rate) File "/opt/conda/lib/python3.7/site-packages/utime/io/hypnogram/hyp_extractors.py", line 144, in extract_hyp_data ann_to_class=annotation_dict File "/opt/conda/lib/python3.7/site-packages/utime/hypnogram/utils.py", line 280, in sparse_hypnogram_from_ids_format ann_class_ints = [ann_to_class[a] for a in annotations] File "/opt/conda/lib/python3.7/site-packages/utime/hypnogram/utils.py", line 280, in ann_class_ints = [ann_to_class[a] for a in annotations] KeyError: 0.0

    Am i formatting my data wrong?

    Best regards,

    opened by alexblnn 7
  • h5 model file unavailable?

    h5 model file unavailable?

    In CLI, after a quick attempt at running ut init --name <...> --model usleep followed by ut predict I get an error saying RuntimeError: Did not find any model parameter files in model subfolder <...>. Model files should have extension '.h5' to be recognized.

    Is it normal that no h5 file is located in the model subfolder after init?

    opened by nicoa47 6
  • Reproducing paper results

    Reproducing paper results

    Hi everybody!

    We are trying to reproduce S-EDF-39/U-Time results in table 2 in your paper. image

    We followed the exact instructions as ones on the repository's readme page for that purpose. (except --N_first 39 argument instead of 6, stated on the page)

    However, we are very far from your results. The tables below are what we get after evaluating the predictions.

    / | Pred 0 | Pred 1 | Pred 2 | Pred 3 | Pred 4 --- | --- | --- | --- | --- | --- True 0 | 1 | 135 | 103 | 1158 | 0
    True 1 | 0 | 107 | 92 | 2 | 0
    True 2 | 0 | 25 | 1193 | 4 | 0
    True 3 | 0 | 0 | 174 | 27 | 0
    True 4 | 0 | 142 | 201 | 3 | 0

    Raw Metrics:

    / | F1 | Precision | Recall/Sens. --- | --- | --- | --- Class 0 | 0.00 | 1.00 | 0.00 Class 1 | 0.35 | 0.26 | 0.53 Class 2 | 0.80 | 0.68 | 0.98 Class 3 | 0.04 | 0.02 | 0.13 Class 4 | 0.00 | 0.00 | 0.00 mean | 0.24 | 0.39 | 0.33

    Do you have any opinion on why we couldn't replicate the results above? Thx

    opened by adnanhd 6
  • An Error occurred when using 'ut predict' & 'ut evaluate' ( code updated on June 21st)

    An Error occurred when using 'ut predict' & 'ut evaluate' ( code updated on June 21st)

    I was able to run through predict.py a long time ago, but now the errors listed as follows occurred, and I am very confused about this.

    The code I used was the version updated on June 21st. When I used 'ut predict', I found the following error: 1. Report an error

    TypeError: init() got an unexpected keyword argument'warnings_file'

    By annotating the following code in bin/evaluate.py, I encountered the second error: # warnings_file=warnings_name,

    2. This error only occurred when using the newest code(updated on June 14 later):

    Logged by: 'run_pred' in 'predict.py'
    
    PREDICTING ON 2 STUDIES
    Traceback (most recent call last):
      File "/export/ljy/U-Time/utime/dataset/sleep_study/sleep_study.py", line 410, in load
        self._load()
      File "/export/ljy/U-Time/utime/dataset/sleep_study/sleep_study.py", line 339, in _load
        self._psg, header = self._load_with_any_in(self._try_channels)
      File "/export/ljy/U-Time/utime/dataset/sleep_study/sleep_study.py", line 311, in _load_with_any_in
        header_file_path=self.header_file_path)
      File "/export/ljy/U-Time/utime/io/high_level_file_loaders.py", line 73, in load_psg
        check_duplicates=True
      File "/export/ljy/U-Time/utime/io/channels/utils.py", line 87, in get_org_include_exclude_channel_montages
        check_duplicate_channels(load_channels, channels_in_file, raise_or_warn="raise")
      File "/export/ljy/U-Time/utime/io/channels/utils.py", line 22, in check_duplicate_channels
        channels = ChannelMontageTuple(channels, relax=True)
      File "/export/ljy/U-Time/utime/io/channels/channels.py", line 166, in __new__
        channels, type(channels)))
    TypeError: Input to ChannelMontageTuple should be a list, tuple or ndarray of channel names or ChannelMontage objects. Got None (type <class 'NoneType'>).
    
    The above exception was the direct cause of the following exception:
    
    Traceback (most recent call last):
      File "/export/anaconda3/envs/ljy_u-sleep2/bin/ut", line 33, in <module>
        sys.exit(load_entry_point('utime', 'console_scripts', 'ut')())
      File "/export/ljy/U-Time/utime/bin/ut.py", line 71, in entry_func
        mod.entry_func(script_args + help_agrs)
      File "/export/ljy/U-Time/utime/bin/predict.py", line 394, in entry_func
        run(parser.parse_args(args))
      File "/export/ljy/U-Time/utime/bin/predict.py", line 388, in run
        logger=logger)
      File "/export/ljy/U-Time/utime/bin/predict.py", line 300, in run_pred
        seq = get_sequencer(dataset, hparams)
      File "/export/ljy/U-Time/utime/bin/evaluate.py", line 374, in get_sequencer
        require_all_loaded=False)
      File "/export/ljy/U-Time/utime/sequences/utils.py", line 82, in get_batch_sequence
        data_per_epoch, n_channels = infer_dpe_and_chans(dataset_queue)
      File "/export/ljy/U-Time/utime/sequences/utils.py", line 56, in infer_dpe_and_chans
        with dataset_queue.get_random_study() as sleep_study:
      File "/export/anaconda3/envs/ljy_u-sleep2/lib/python3.7/contextlib.py", line 112, in __enter__
        return next(self.gen)
      File "/export/ljy/U-Time/utime/dataset/queue/lazy_queue.py", line 28, in get_random_study
        with study.loaded_in_context():
      File "/export/anaconda3/envs/ljy_u-sleep2/lib/python3.7/contextlib.py", line 112, in __enter__
        return next(self.gen)
      File "/export/ljy/U-Time/utime/dataset/sleep_study/abc_sleep_study.py", line 157, in loaded_in_context
        self.load()
      File "/export/ljy/U-Time/utime/dataset/sleep_study/sleep_study.py", line 415, in load
        study_id=self.identifier) from e
    utime.errors.CouldNotLoadError: Unexpected load error for sleep study tp026536b7_b8d5_44a5_adc6_87617520d5f2. Please refer to the above traceback.
    

    3、Similarly, An Error occurred when using 'ut evaluate' :

    Logged by: 'run_pred_and_eval' in 'evaluate.py'
    
    PREDICTING ON 2 STUDIES
    Setting augmenter: RegionalErase({'min_region_fraction': 0.001, 'max_region_fraction': 0.33, 'log_sample': True, 'apply_prob': 0.1})
    Setting augmenter: ChannelDropout({'drop_fraction': 0.5, 'apply_prob': 0.1})
    Traceback (most recent call last):
      File "/export/anaconda3/envs/ljy_u-sleep2/bin/ut", line 33, in <module>
        sys.exit(load_entry_point('utime', 'console_scripts', 'ut')())
      File "/export/ljy/U-Time0/utime/bin/ut.py", line 71, in entry_func
        mod.entry_func(script_args + help_agrs)
      File "/export/ljy/U-Time0/utime/bin/evaluate.py", line 542, in entry_func
        run(parser.parse_args(args))
      File "/export/ljy/U-Time0/utime/bin/evaluate.py", line 534, in run
        logger=logger)
      File "/export/ljy/U-Time0/utime/bin/evaluate.py", line 403, in run_pred_and_eval
        dice_eval_df = get_eval_df(seq)
      File "/export/ljy/U-Time0/utime/evaluation/dataframe.py", line 6, in get_eval_df
        ids = [ss.identifier for ss in sequencer.pairs]
    AttributeError: 'BatchSequence' object has no attribute 'pairs'
    

    Could some operating errors or code problems cause the above situation? thx a lot!

    opened by ljyljy 6
  • Error report of training model

    Error report of training model

    “ut train --num_GPUs=0 --preprocessed --seed 123”

    then :

    " writing to the existing file." % file_path) OSError: Logging path: /usr/local/anaconda3/condabin/demo/logs/log.txt already exists. Initialize Logger with overwrite_existing=True or append_existing=True to overwrite or continue writing to the existing file.

    opened by TL730 5
  • Margin & Periods?

    Margin & Periods?

    Hi,

    This is really a great repo! Looking thru the code & configs, I'm confused by two concept - margin and period (since I met an exception Margin too large for dataset length).

    Can you explain a bit more on those two concepts?

    opened by xiaoyongzhu 5
  • FileNotFoundError: [Errno 2] No such file or directory: '/home/zch/anaconda3/envs/u-sleep/lib/python3.7/site-packages/utime/bin/defaults'

    FileNotFoundError: [Errno 2] No such file or directory: '/home/zch/anaconda3/envs/u-sleep/lib/python3.7/site-packages/utime/bin/defaults'

    Hi, when I init a project, there is a problem.

    FileNotFoundError: [Errno 2] No such file or directory: '/home/zch/anaconda3/envs/u-sleep/lib/python3.7/site-packages/utime/bin/defaults'

    How can I solve it ,thank you! image

    opened by CandyZhao123 4
  • After the dataset is downloaded, it can be used directly, right?

    After the dataset is downloaded, it can be used directly, right?

    Hello! I ran demo on a Mac without GPU, and here's the end result.

    截屏2021-06-07 下午9 07 30

    I would like to ask:

    After the dataset is downloaded, it can be used directly, right? Just use your commands to segment, preprocess and train? No additional data processing? In the supplementary materials of this paper, the sampling rate and filtering of each data set are the data set's own? For example, sedf-sc & sedf-st: EEG and EOG signals were recorded at 100 Hz. DCSM: EEG and EOG signals were recorded at 256 Hz and bandpass filtered to interval 0.3 Hz - 70 Hz (3dB limits)

    opened by TL730 4
  • Error in ut init

    Error in ut init

    Hi, I ran into an error when running through the demo in the README

    ut init --name demo --model usleep_demo Traceback (most recent call last): File "\Anaconda3\envs\u-sleep\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "\Anaconda3\envs\u-sleep\lib\runpy.py", line 86, in run_code exec(code, run_globals) File "\Anaconda3\envs\u-sleep\Scripts\ut.exe_main.py", line 7, in File "\Anaconda3\envs\u-sleep\lib\site-packages\utime\bin\ut.py", line 103, in entry_func mod.entry_func(script_args + help_agrs) File "\Anaconda3\envs\u-sleep\lib\site-packages\utime\bin\init.py", line 134, in entry_func run(parser.parse_args(args)) File "\Anaconda3\envs\u-sleep\lib\site-packages\utime\bin\init.py", line 128, in run init_project_folder(default_folder, args.model, out_folder, data_dir) File "\Anaconda3\envs\u-sleep\lib\site-packages\utime\bin\init.py", line 104, in init_project_folder copy_yaml_and_set_data_dirs(in_file_path, out_file_path, data_dir) File "\Anaconda3\envs\u-sleep\lib\site-packages\utime\bin\init.py", line 71, in copy_yaml_and_set_data_dirs hparams.save_current(out_path) File "\Anaconda3\envs\u-sleep\lib\site-packages\yamlhparams\yaml_hparams.py", line 152, in save_current with open(out_path, "w") as out_f: FileNotFoundError: [Errno 2] No such file or directory: 'C:\dataset_configurations\dcsm.yaml'

    The issue is occurring in generating the out_file_path in init.py because when the sub directory dataset_configurations is derived there is a backslash "" at the beginning of the string, so os.path.join ignores the first entry.

    I was able to fix the issue by editing the line 101 in init.py sub_dir = dir_path.replace(hparams_in_dir, "").strip("/").strip('\\')

    opened by sindrijonsson 0
  • Issue while running uSleep

    Issue while running uSleep

    Hello Mr. Perslev,

    I want to run uSleep for the DCSM dataset. I have followed the provided instructions and ran ut fetch, extract, extract_hypno and cv_split for the given dataset, initialized the project, and modified the dataset configuration yaml. However when I want to train the model with ut train --num_gpus=1 --channels 'EEG Fpz-Cz' --overwrite --datasets dcsm I get the error below. Did I miss a step while setting up the dataset or do I need to add additional information for the appropriate regex somewhere?

    I really appreciate any help you can provide.

    Traceback (most recent call last): File "/home/burchert/miniconda3/envs/u-sleep/bin/ut", line 10, in sys.exit(entry_func()) File "/home/burchert/miniconda3/envs/u-sleep/lib/python3.10/site-packages/utime/bin/ut.py", line 103, in entry_func mod.entry_func(script_args + help_agrs) File "/home/burchert/miniconda3/envs/u-sleep/lib/python3.10/site-packages/utime/bin/train.py", line 306, in entry_func run(args=args) File "/home/burchert/miniconda3/envs/u-sleep/lib/python3.10/site-packages/utime/bin/train.py", line 216, in run train_datasets, val_datasets = dataset_func(hparams, args.no_val, args.train_on_val, args.datasets) File "/home/burchert/miniconda3/envs/u-sleep/lib/python3.10/site-packages/utime/utils/scriptutils/train.py", line 74, in get_train_and_val_datasets datasets = [*get_splits_from_all_datasets(hparams, load, dataset_ids=dataset_ids)] File "/home/burchert/miniconda3/envs/u-sleep/lib/python3.10/site-packages/utime/utils/scriptutils/scriptutils.py", line 221, in get_splits_from_all_datasets ds = get_dataset_splits_from_hparams( File "/home/burchert/miniconda3/envs/u-sleep/lib/python3.10/site-packages/utime/utils/scriptutils/scriptutils.py", line 166, in get_dataset_splits_from_hparams dataset = SleepStudyDataset(**hparams[data_key], File "/home/burchert/miniconda3/envs/u-sleep/lib/python3.10/site-packages/psg_utils/dataset/sleep_study_dataset/sleep_study_dataset.py", line 48, in init super(SleepStudyDataset, self).init( File "/home/burchert/miniconda3/envs/u-sleep/lib/python3.10/site-packages/psg_utils/dataset/sleep_study_dataset/subject_dir_sleep_study_dataset_base.py", line 72, in init ss = sleep_study_class( File "/home/burchert/miniconda3/envs/u-sleep/lib/python3.10/site-packages/psg_utils/dataset/sleep_study/sleep_study.py", line 76, in init super(SleepStudy, self).init( File "/home/burchert/miniconda3/envs/u-sleep/lib/python3.10/site-packages/psg_utils/dataset/sleep_study/subject_dir_sleep_study_base.py", line 67, in init raise ValueError("Could not uniquely infer PSG/HYP files in subject" ValueError: Could not uniquely infer PSG/HYP files in subject directory '/home/burchert/uSleep/datasets/processed/dcsm/views/fixed_split/train/tp7f6c419b_c612_40fb_8c83_1e63f5cd3f3d'. Consider specifying/correcting one or both of the psg_regex and hyp_regex parameters to explicitly select the appropriate file(s) within the subject dir. srun: error: test-000: task 0: Exited with exit code 1

    opened by JBurchert 0
  • ut train error

    ut train error

    Hi mathias,

    I am still working on the reproduction of the u-sleep model using these commands :). I started everything from scratch, cloned the repository, and created a conda environment u-sleep. Thereafter, first I downloaded and prepared the dataset, then, I started training the model.

    Here I get the following error, there are also log files that I shared with you below this error window.

    /home/aharun/miniconda3/envs/u-sleep/lib/python3.10/site-packages/tensorflow_addons/utils/ensure_tf_install.py:53: UserWarning: Tensorflow Addons supports using Python ops for all Tensorflow versions above or equal to 2.6.0 and strictly below 2.9.0 (nightly versions are not supported).
     The versions of TensorFlow you are currently using is 2.9.0 and is not supported.
    Some things might work, some things might not.
    If you were to encounter a bug, do not file an issue.
    If you want to make sure you're using a tested and supported configuration, either change the TensorFlow version or the TensorFlow Addons's version.
    You can find the compatibility matrix in TensorFlow Addon's readme:
    https://github.com/tensorflow/addons
      warnings.warn(
    Parent directory of the 'utime' package is not a git repository or Git is not installed. Git information will not be added to this hyperparameter file.
    Traceback (most recent call last):
      File "/home/aharun/miniconda3/envs/u-sleep/bin/ut", line 8, in <module>
        sys.exit(entry_func())
      File "/home/aharun/miniconda3/envs/u-sleep/lib/python3.10/site-packages/utime/bin/ut.py", line 103, in entry_func
        mod.entry_func(script_args + help_agrs)
      File "/home/aharun/miniconda3/envs/u-sleep/lib/python3.10/site-packages/utime/bin/train.py", line 296, in entry_func
        run(args=args)
      File "/home/aharun/miniconda3/envs/u-sleep/lib/python3.10/site-packages/utime/bin/train.py", line 239, in run
        train_seq, val_seq = get_generators(train_datasets_queues,
      File "/home/aharun/miniconda3/envs/u-sleep/lib/python3.10/site-packages/utime/utils/scriptutils/train.py", line 178, in get_generators
        train_seqs = [get_batch_sequence(dataset_queue=d,
      File "/home/aharun/miniconda3/envs/u-sleep/lib/python3.10/site-packages/utime/utils/scriptutils/train.py", line 178, in <listcomp>
        train_seqs = [get_batch_sequence(dataset_queue=d,
      File "/home/aharun/miniconda3/envs/u-sleep/lib/python3.10/site-packages/utime/sequences/utils.py", line 85, in get_batch_sequence
        data_per_epoch, n_channels = infer_dpe_and_chans(dataset_queue)
      File "/home/aharun/miniconda3/envs/u-sleep/lib/python3.10/site-packages/utime/sequences/utils.py", line 59, in infer_dpe_and_chans
        with dataset_queue.get_random_study() as sleep_study:
    AttributeError: 'list' object has no attribute 'get_random_study'
    

    Here is the content of a log file under /logs/training_log, which is the only log file under /logs directory

    INFO | 2022/05/17 07:39:41 | train:run:196 | Args dump: {'num_gpus': 1, 'force_gpus': '', 'continue_training': False, 'initialize_from': None, 'overwrite': True, 'log_file': 'training_log', 'datasets': None, 'just': None, 'no_val': False, 'max_val_studies_per_dataset': 20, 'max_train_samples_per_epoch': 500000.0, 'n_epochs': None, 'channels': None, 'train_queue_type': 'eager', 'val_queue_type': 'lazy', 'max_loaded_per_dataset': 40, 'num_access_before_reload': 32, 'preprocessed': False, 'final_weights_file_name': 'model_weights.h5', 'train_on_val': False}
    INFO | 2022/05/17 07:39:41 | abc_sleep_study_dataset:log:59 | [Dataset: dataset_1/TRAIN] SleepStudyDataset(identifier: dataset_1/TRAIN, N pairs: 91, N loaded: 0)
    INFO | 2022/05/17 07:39:41 | abc_sleep_study_dataset:log:59 | [Dataset: dataset_1/VAL] SleepStudyDataset(identifier: dataset_1/VAL, N pairs: 32, N loaded: 0)
    INFO | 2022/05/17 07:39:41 | abc_sleep_study_dataset:log:59 | [Dataset: dataset_1/TRAIN] Setting select channels: ['EEG Fpz-Cz']
    INFO | 2022/05/17 07:39:41 | abc_sleep_study_dataset:log:59 | [Dataset: dataset_1/VAL] Setting select channels: ['EEG Fpz-Cz']
    INFO | 2022/05/17 07:39:41 | abc_sleep_study_dataset:log:59 | [Dataset: dataset_1/TRAIN] Setting sample rate of 128 Hz
    INFO | 2022/05/17 07:39:41 | abc_sleep_study_dataset:log:59 | [Dataset: dataset_1/VAL] Setting sample rate of 128 Hz
    INFO | 2022/05/17 07:39:41 | abc_sleep_study_dataset:log:59 | [Dataset: dataset_1/TRAIN] Setting 'drop_class' strip function with parameters {'class_int': 5}...
    INFO | 2022/05/17 07:39:41 | abc_sleep_study_dataset:log:59 | [Dataset: dataset_1/VAL] Setting 'drop_class' strip function with parameters {'class_int': 5}...
    INFO | 2022/05/17 07:39:41 | abc_sleep_study_dataset:log:59 | [Dataset: dataset_1/TRAIN] Setting 'zero_out_noisy_epochs' quality control function with parameters {'max_times_global_iqr': 20}...
    INFO | 2022/05/17 07:39:41 | abc_sleep_study_dataset:log:59 | [Dataset: dataset_1/VAL] Setting 'zero_out_noisy_epochs' quality control function with parameters {'max_times_global_iqr': 20}...
    INFO | 2022/05/17 07:39:41 | abc_sleep_study_dataset:log:59 | [Dataset: dataset_1/TRAIN] Setting 'RobustScaler' scaler...
    INFO | 2022/05/17 07:39:41 | abc_sleep_study_dataset:log:59 | [Dataset: dataset_1/VAL] Setting 'RobustScaler' scaler...
    INFO | 2022/05/17 07:39:41 | utils:get_data_queues:33 | Using data queue type: EagerQueue
    INFO | 2022/05/17 07:39:41 | abc_sleep_study_dataset:log:59 | [Dataset: dataset_1/TRAIN] Loading 91/91 SleepStudy objects...
    INFO | 2022/05/17 07:41:17 | utils:get_data_queues:33 | Using data queue type: LazyQueue
    

    Is there anything I can do to fix this bug? thanks in advance -adnan

    opened by adnanhd 1
Owner
Mathias Perslev
Mathias Perslev
End-to-End Object Detection with Fully Convolutional Network

This project provides an implementation for "End-to-End Object Detection with Fully Convolutional Network" on PyTorch.

null 472 Dec 22, 2022
Dewarping Document Image By Displacement Flow Estimation with Fully Convolutional Network.

Dewarping Document Image By Displacement Flow Estimation with Fully Convolutional Network

null 111 Dec 27, 2022
Dewarping Document Image By Displacement Flow Estimation with Fully Convolutional Network

Dewarping Document Image By Displacement Flow Estimation with Fully Convolutional Network

null 39 Aug 2, 2021
Speech Separation Using an Asynchronous Fully Recurrent Convolutional Neural Network

Speech Separation Using an Asynchronous Fully Recurrent Convolutional Neural Network This repository is the official implementation of Speech Separati

Kai Li (李凯) 116 Nov 9, 2022
This project is a loose implementation of paper "Algorithmic Financial Trading with Deep Convolutional Neural Networks: Time Series to Image Conversion Approach"

Stock Market Buy/Sell/Hold prediction Using convolutional Neural Network This repo is an attempt to implement the research paper titled "Algorithmic F

Asutosh Nayak 136 Dec 28, 2022
TCNN Temporal convolutional neural network for real-time speech enhancement in the time domain

TCNN Pandey A, Wang D L. TCNN: Temporal convolutional neural network for real-time speech enhancement in the time domain[C]//ICASSP 2019-2019 IEEE Int

凌逆战 16 Dec 30, 2022
The official PyTorch implementation of the paper: *Xili Dai, Xiaojun Yuan, Haigang Gong, Yi Ma. "Fully Convolutional Line Parsing." *.

F-Clip — Fully Convolutional Line Parsing This repository contains the official PyTorch implementation of the paper: *Xili Dai, Xiaojun Yuan, Haigang

Xili Dai 115 Dec 28, 2022
Another pytorch implementation of FCN (Fully Convolutional Networks)

FCN-pytorch-easiest Trying to be the easiest FCN pytorch implementation and just in a get and use fashion Here I use a handbag semantic segmentation f

Y. Dong 158 Dec 21, 2022
PyTorch Implementation of Fully Convolutional Networks. (Training code to reproduce the original result is available.)

pytorch-fcn PyTorch implementation of Fully Convolutional Networks. Requirements pytorch >= 0.2.0 torchvision >= 0.1.8 fcn >= 6.1.5 Pillow scipy tqdm

Kentaro Wada 1.6k Jan 7, 2023
Another pytorch implementation of FCN (Fully Convolutional Networks)

FCN-pytorch-easiest Trying to be the easiest FCN pytorch implementation and just in a get and use fashion Here I use a handbag semantic segmentation f

Y. Dong 158 Dec 21, 2022
An implementation of the research paper "Retina Blood Vessel Segmentation Using A U-Net Based Convolutional Neural Network"

Retina Blood Vessels Segmentation This is an implementation of the research paper "Retina Blood Vessel Segmentation Using A U-Net Based Convolutional

Srijarko Roy 23 Aug 20, 2022
Code for "FPS-Net: A convolutional fusion network for large-scale LiDAR point cloud segmentation".

FPS-Net Code for "FPS-Net: A convolutional fusion network for large-scale LiDAR point cloud segmentation", accepted by ISPRS journal of Photogrammetry

null 15 Nov 30, 2022
This is a model made out of Neural Network specifically a Convolutional Neural Network model

This is a model made out of Neural Network specifically a Convolutional Neural Network model. This was done with a pre-built dataset from the tensorflow and keras packages. There are other alternative libraries that can be used for this purpose, one of which is the PyTorch library.

null 9 Oct 18, 2022
This repository implements and evaluates convolutional networks on the Möbius strip as toy model instantiations of Coordinate Independent Convolutional Networks.

Orientation independent Möbius CNNs This repository implements and evaluates convolutional networks on the Möbius strip as toy model instantiations of

Maurice Weiler 59 Dec 9, 2022
CoSMA: Convolutional Semi-Regular Mesh Autoencoder. From Paper "Mesh Convolutional Autoencoder for Semi-Regular Meshes of Different Sizes"

Mesh Convolutional Autoencoder for Semi-Regular Meshes of Different Sizes Implementation of CoSMA: Convolutional Semi-Regular Mesh Autoencoder arXiv p

Fraunhofer SCAI 10 Oct 11, 2022
Spectral Temporal Graph Neural Network (StemGNN in short) for Multivariate Time-series Forecasting

Spectral Temporal Graph Neural Network for Multivariate Time-series Forecasting This repository is the official implementation of Spectral Temporal Gr

Microsoft 306 Dec 29, 2022
Code for the CIKM 2019 paper "DSANet: Dual Self-Attention Network for Multivariate Time Series Forecasting".

Dual Self-Attention Network for Multivariate Time Series Forecasting 20.10.26 Update: Due to the difficulty of installation and code maintenance cause

Kyon Huang 223 Dec 16, 2022
A real world application of a Recurrent Neural Network on a binary classification of time series data

What is this This is a real world application of a Recurrent Neural Network on a binary classification of time series data. This project includes data

Josep Maria Salvia Hornos 2 Jan 30, 2022
BMW TechOffice MUNICH 148 Dec 21, 2022