Coder Social home page Coder Social logo

mulxcode / rock-art-transfer-learning Goto Github PK

View Code? Open in Web Editor NEW

This project forked from keeeal/rock-art-transfer-learning

0.0 1.0 0.0 19 KB

Reconstructing rock art chronology with transfer learning: A case study from Northern Australia.

License: BSD 3-Clause "New" or "Revised" License

Shell 6.25% Python 93.75%

rock-art-transfer-learning's Introduction

Reconstructing rock art chronology with transfer learning: A case study from Arnhem Land, Australia

by Jarrad Kowlessar, James Keal, Daryl Wesley, Ian Moffat, Dudley Lawrence, Abraham Weson, Alfred Nayinggul & Mimal Land Management Aboriginal Corporation

This repository contains the official implementation of the article Reconstructing rock art chronology with transfer learning: A case study from Arnhem Land, Australia. The images of rock art used in the publication were derived from cultural material that remains the property of the Marrku Traditional Owners and cannot be openly distributed. For this reason, the rock art data has not been included in this repository.

Figure 2

Requirements

The following example installs these with CUDA support using Conda:

conda install python=3.8
conda install pytorch torchvision cudatoolkit -c pytorch

Take care to match the version of Python to the requirements of the latest version of PyTorch. More details, including CPU only installation can be found here.

conda install scikit-learn seaborn tqdm

To use the "Quick, Draw!" dataset:

These are only required to download and rasterize Google's "Quick, Draw!" dataset.

sudo snap install google-cloud-sdk
conda install cairocffi

Usage

Download training data

Data must separated into training (background) and evaluation datasets. Each must be arranged in accordance with the PyTorch ImageFolder class. For example:

data/
├── my_dataset_background/
│   ├── class_A/
│   │   ├── xxx.png
│   │   ├── xxy.png
│   │   └── ...
│   ├── class_B/
│   │   ├── 123.png
│   │   ├── nsdf3.png
│   │   └── ...
│   ...
└── my_dataset_evaluation/
    ├── class_A/
    │   ├── xxz.png
    │   ├── xyx.png
    │   └── ...
    ├── class_B/
    │   ├── 456.png
    │   ├── asd932_.png
    │   └── ...
    ...

Images must be 224×224 pixels. Example bash scripts are provided that download, resize and correctly organize MNIST, Omniglot and Quick, Draw! datsets.

cd data
./get_mnist.sh
./get_omniglot.sh
./get_quickdraw.sh

Training

python train.py --model {kochnet, alexnet, vgg, resnet} --train-data my_dataset

Optional arguments:

  • --model {kochnet, alexnet, vgg, resnet} — The architecture to train.
  • --train-data DATASET_NAME — The prefix of the background data directory.
  • --eval-data DATASET_NAME — The prefix of the evaluation data directory, if different from training.
  • --epochs N — The number of epochs to train for.
  • --learn-rate LR — The initial learning rate.
  • --output-dir DIR — The folder in which to store trained parameters.
  • --seed X — Sets the random seed.

The expected output is a directory containing files 0.params ... N.params where N is the number of training epochs.

Evaluating

python evaluate.py --model {kochnet, alexnet, vgg, resnet} --eval-data my_dataset --params best.params

Optional arguments:

  • --model {kochnet, alexnet, vgg, resnet} — The architecture to evaluate.
  • --eval-data DATASET_NAME — The prefix of the evaluation data directory.
  • --params PARAMS — The trained parameters to load. Use "imagenet" to load parameters trained on the ImageNet dataset.
  • --train-classes N — The number of classes with which to initialize the architecture, if different from the number of classes in the eval data.
  • --distance {euclidean, cosine} — The distance metric to use.
  • --pca — Use PCA after neural net embedding.
  • --output-dir DIR — The folder in which to store results and plots.
  • --seed X — Sets the random seed.

The expected output is a directory containing accuracy.txt which stores the network accuracy in a one-shot setting. The output directory should also contain plots with and without a class legend, and one flattened in the Y axis. Finally, ordered_paths.txt should list the paths to the original image for each data point in order from left to right. This can be used to construct and interpret the inferred stylistic chronology.

Licence

All source code is made available under a BSD 3-clause license. You may freely use and modify this code, without warranty, so long as you provide attribution to the authors. The manuscript text is not open source. The article's content has been published in the journal Australian Archeology.

Citation

Jarrad Kowlessar, James Keal, Daryl Wesley, Ian Moffat, Dudley Lawrence, Abraham Weson, Alfred Nayinggul & Mimal Land Management Aboriginal Corporation. "Reconstructing rock art chronology with transfer learning: A case study from Arnhem Land, Australia", Australian Archaeology, 2021, DOI: 10.1080/03122417.2021.1895481

rock-art-transfer-learning's People

Contributors

jarrad-kowlessar avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.