Skip to content

Repository files navigation

CV-Assignment

This repository contains the code and resources for a computer vision assignment involving object stability prediction using deep learning models. The project uses various backbones, training scripts, and evaluation methods to achieve optimal model performance.

Project Structure

  • backbones/
    Contains the backbone architectures used for model training, such as ResNet and InceptionV4.

  • data/
    Stores the training and test data:

    • train/: Directory containing training images.
    • test/: Directory containing test images.
    • train.csv: Training labels and metadata for the training set.
    • test.csv: Test set information.
    • sample-solution.csv: A sample submission file for the test data.
  • models/
    Contains experiments from 1-33 including various tuning and adaption techniques, maintaining checkpoints generated during training.

  • notebooks/
    Jupyter notebooks used for model evaluation and testing:

    • model_evaluation.ipynb: Notebook for evaluating the performance of trained models and result analysis.
    • test.ipynb: Notebook for testing the models and generate prediction csv files.
  • predict_results/
    Stores the prediction results in csv form generated by the trained models.

    1. predict_results_resnet18_singleTask_baseline_kaggle_62.40%.csv is SingleTask ResNet18 prediction results as baseline.

    2. predict_results_exp28_fold7_76.17%_epoch26(kaggle second best).csv is the final submitted version of prediction achieving accuracy of 78.44%.

    3. predict_results_exp30_fold17_79.43%_epoch25(kaggle best).csv is the highest submission achieveing accuracy of 78.65%.

  • scripts/
    Shell scripts for running various processes:

    • baseline.sh: Script for running the baseline model.
    • k_fold.sh: Script for training using k-fold cross-validation.
    • run.sh: General script for running training and evaluation processes.
  • utils/
    Utility functions and modules used throughout the project:

    • average.py: Helper class for avergaing purpose.
    • options.py: Configuration and command-line argument options.
  • baseline_train.py
    Script for training the baseline model.

  • train.py
    Main training script used for standard model training.

  • train_k_fold.py
    Script for training models using k-fold cross-validation.

  • baseline_dataset.py
    Dataset loader for the baseline model.

  • dataset.py
    General dataset loader used in the project.

Setup

  1. Clone this repository:

    git clone https://github.com/LilyWu06/CV-Assignment-.git
    
  2. Download raw data to data/

  3. Install dependencies:

    pip install -r requirements.txt
    
  4. Enjoy Model Training! : )

Training for recreate baselines

  1. resnet18_SingleTask:

    1.1 Change SingleTask boolean in resnet18_SE.py to True
    1.2 Change SingleTask boolean in baseline_dataset.py to True
    1.3 Change SingleTask boolean in baseline_train.py to True
    1.4 Change NETWORK parameter to "resnet18_SE" in baseline.sh
    1.5 Run in Linux/Unix shell: chmod +x scripts/baseline.sh
    1.6 Run in Linux/Unix shell: scripts/baseline.sh
    1.7 Waiting until midnight : )

  2. resnet18_MultiTask:

    2.1 Change SingleTask boolean in resnet18_SE.py to False
    2.2 Change SingleTask boolean in baseline_dataset.py to False
    2.3 Change SingleTask boolean in baseline_train.py to False
    2.4 Change NETWORK parameter to "resnet18_SE" in baseline.sh
    2.5 Run in Linux/Unix shell: chmod +x scripts/baseline.sh
    2.6 Run in Linux/Unix shell: scripts/baseline.sh
    2.7 Waiting until midnight : )

  3. inceptionv4_SingleTask:

    3.1 Change SingleTask boolean in pretrained_inceptionv4.py to True
    3.2 Change SingleTask boolean in baseline_dataset.py to True
    3.3 Change SingleTask boolean in baseline_train.py to True
    3.4 Change NETWORK parameter to "pretrained_inceptionv4" in baseline.sh
    3.5 Run in Linux/Unix shell: chmod +x scripts/baseline.sh
    3.6 Run in Linux/Unix shell: scripts/baseline.sh
    3.7 Waiting until midnight : )

  4. inceptionv4_MultiTask:

    4.1 Use dataset.py and train.py now : )
    4.2 Change NETWORK parameter to "pretrained_inceptionv4" in run.sh
    4.3 Run in Linux/Unix shell: chmod +x scripts/run.sh
    4.4 Run in Linux/Unix shell: scripts/run.sh
    4.5 Waiting until midnight : )

About

Developed a stability reasoning model based on ShapeStacks images, focusing on efficient data utilization and model performance.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages