Git Product home page Git Product logo

cs-433-project-2-cwx's Introduction

CS-433 Machine Learning Project 2

A LinkNet Based Model to Classify Statellite Images Segments

Team Member (CWX):

Project Description

We implemented a model based on the LinkNet architecture to classify the road segments with the satellite images from Google Maps. We evaluate the performance of LinkNet, U-Net and their variants. We finally decided to develop our model on the top of LinkNet architecture.

In addition, we implemented U-Net architecture (and its variants: U-Net++) as a comparison to show the performance of our model.

File/Folder Description

/data: The folder that contains the training and the testing images, it is also used to save the prediction masks.

/log: The folder that contains the evaluation results of different models.

Losses.py: Loss Functions including BCE Loss, Dice Loss, Focal Loss and a mix loss combined by Focal Loss and Dice Loss.

dataset.py: Load images and perform data augment on images.

Helper.py: Some helper functions and image transformation.

mask_to_submission.py: Convert the prediction results into a submission file.

model.py: Model implementation.

  • Unet
  • LinkNet
  • LinkNet1
  • DinkNet
  • UnetPP
  • LinkNetPP
  • DoubleUnet

run.py: It creates a model and train it, or loads a pre-trained model, and it makes predictions on the test set.

submission_to_mask.py: Convert the submission file into prediction images.

train.py: It trains the model.

utile.py: It contains some utile functions, such as:

  • get_loader: Create the DataLoader class
  • f1: Compute F1 score
  • accuracy: Compute F1 score, Precision and Recall
  • create_different_prospective: Apply transformations to the image and return different prospectives
  • combine_different_prospective: Combine predictions of different prospectives
  • img_crop: Crop the image into patches of a given size
  • combine_img: Combine cropped patches into the original image

visualization.ipynb: A visualization of performance of different models.

Running requirements

Environment

  • Python 3.8.5
  • Jupyter Notebook 6.1.4

Required libraries

  • Numpy 1.20.3
  • PyTorch 1.8.2
  • PIL 8.2.0
  • albumentations 1.1.0
  • tqdm 4.59.0
  • matplotlib 3.3.4
  • torchsummary
  • pandas 1.2.4
  • torchvision

To install all the required libraries, you can run the following command from the terminal.

pip install -r requirement

Checkpoints

Our pre-trained models can be found here:

https://drive.google.com/drive/folders/1VPxJjSSlY1VeJWWgAL2eXIICsWvUjpjo?usp=sharing

cs-433-project-2-cwx's People

Contributors

xuzewei28 avatar caoganyuan avatar haoxuan7 avatar

Watchers

Matteo Pagliardini avatar Roberto Castello avatar ztzthu avatar  avatar  avatar

Forkers

xuzewei28

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.