Course description
We will learn how to use deep learning in R with the torch package (a wrapper for the python PyTorch library). The main goal is to classify images from the Museum of Cultural History. The scientific field is computer science but with data from the humanities (cultural history).
Target audience
- Anyone, across disciplines, that wants to learn a little bit about deep learning, and how to construct neural networks in R.
- In particular for those that work with any kind of image data.
Learning outcomes
- Learn how to set up neural networks for image classification, specifically, convolutional neural network (CNN) in R using torch.
- Basics of the torch package and a conceptual overview of deep learning.
- Very briefly how to evaluate model performance.
- Secondary learning outcomes include loading images into R, converting these to a torch dataset, and batch processing.
Prerequisites and required materials
- Know the basics of R, in particular, the tidyverse style of programming. Some knowledge of machine learning and/or deep learning is helpful but not necessary.
- Laptop.
- If participants are to run code during the workshop: R >= 4.1.3 R-packages (we will send some sort of requirements.txt prior to the course: torch and related packages) Dataset will be made available.
Lunch
- There will be a complementary buffet-lunch at 12:00-13:00 from the Sverdrups spiseri (Georg Sverdrups Hus, 2nd floor).
- After you get your lunch, join us at Store møterom where we have reserved seats for #DSDays25 participants.
Installation instruction
R version >= 4.1.3
Required packages
torch (>= 0.13.0), torchvision (>= 0.6.0), luz (>=0.4.0), magic (>= 2.8.5)
Note: given the R version requirement is satisfied, you should not have to specify the package versions
Additional details:
The torch package may require an additional installation step. See instructions here:
https://torch.mlverse.org/docs/articles/installation
You may get a warning after installation, and asked to complete it by doing:
`torch::install_torch()`
Note: if your PC has CUDA compatible GPU, torch will install and run with GPU. Otherwise, it will run with CPU
For linux based distros, the magick package requires additional software to be manually installed. See details here:
https://cran.r-project.org/web/packages/magick/vignettes/intro.html
Dataset and code
Dataset: It contains a folder “torch_data” with a subfolder “images” containing image files (JPG) that comprise the dataset. The file “metadata.csv” has the labels for each image (used in model fitting).
Code: Contains the R-scripts “musit_binary.r” and “utils.R”
File structure:
parent_folder/ (e.g. your desktop)
--- torch_data/
------ images/
------ metadata.csv
--- code/ (or any desired name)
----- musit_binary.R
----- utils.R
Number of participants
After the soft deadline, a waiting list will be automatically handled upon de-registrations.
Contact
If you have any questions regarding this course, or anything else about the DSDays25 event, please contact us per email: digitalscholarship@ub.uio.no
Sign up for this workshop!