GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - nyunAI/PatchGD

BranchesTags
Open more actions menu

Latest commit

 

History

34 Commits
34 Commits

Folders and files

NameName
Last commit message
Last commit date
HAR_1d_example
HAR_1d_example
 
 
baselines
baselines
 
 
patch_gd
patch_gd
 
 
utility_codes
utility_codes
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
requirements.txt
requirements.txt
 
 

Repository files navigation

Pushing the Limits of Gradient Descent for Efficient Learning on Large Images

Deepak Gupta, Gowreesh Mago, Arnav Chavan, Dilip Prasad, Rajat Mani Thomas

🔥Accepted in TMLR (08/2024) OpenReview

Abstract

Traditional deep learning models are trained and tested on relatively low-resolution images ($<300$ px), and cannot be directly operated on large-scale images due to compute and memory constraints. We propose Patch Gradient Descent (PatchGD), an effective learning strategy that allows us to train the existing CNN and transformer architectures (hereby referred to as deep learning models) on large-scale images in an end-to-end manner. PatchGD is based on the hypothesis that instead of performing gradient-based updates on an entire image at once, it should be possible to achieve a good solution by performing model updates on only small parts of the image at a time, ensuring that the majority of it is covered over the course of iterations. PatchGD thus extensively enjoys better memory and compute efficiency when training models on large-scale images. PatchGD is thoroughly evaluated on PANDA, UltraMNIST, TCGA, and ImageNet datasets with ResNet50, MobileNetV2, ConvNeXtV2, and DeiT models under different memory constraints. Our evaluation clearly shows that PatchGD is much more stable and efficient than the standard gradient-descent method in handling large images, especially when the compute memory is limited.

Code usage details

Setup the environment

Create a conda envirnoment:

conda create -n pgd python=3.12
conda activate pgd

Install requirements using the following command:

pip install -r requirements.txt

Data

Experiments mentioned in the paper use the following datasets:

  1. Prostate cANcer graDe Assessment (PANDA)
  2. UltraMNIST
  3. ImageNet
  4. TCGA

PANDA and UltraMNIST dataset processing scripts are included in the utility_codes directory where folds for PANDA and full dataset for UltraMNIST can be generated.

For ImageNet and TCGA(LUAD and LUSC), the dataset can be downloaded from Kaggle (for ImageNet) and (LUAD & LUSC with setup instructions listed here) the splits can be made from the dataset.

File structure

  • baselines directory contains the code to run baseline experiments mentioned in the paper for PANDA and UltraMNIST
  • HAR_1d_example directory contains code to run experiments on the Human Activity Recognition dataset (1-d generalization of PatchGD)
  • patch_gd directory contains the code to run experiments using PatchGD algorithm for PANDA and UltraMNIST
  • utility_codes directory contains utitlity codes for PANDA and UltraMNIST including creating dataset and folds, calculation of stats, running multiple experiments on multiple gpus etc.

Citation

Please cite using the following citation:

@article{gupta2023patch,
  title={Patch gradient descent: Training neural networks on very large images},
  author={Gupta, Deepak K and Mago, Gowreesh and Chavan, Arnav and Prasad, Dilip K},
  journal={arXiv preprint arXiv:2301.13817},
  year={2023}
}

About

No description, website, or topics provided.

Resources

Readme
Activity
Custom properties

Stars

4 stars

Watchers

0 watching

Forks

1 fork
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.