Skip to main content

Start of the Coding Period

Start of the Coding Period

After the admission to the GSoC program, there is a time period to get started with the project, contact the mentors and so on. After this, the Coding Period starts. This year, it started on May 27th. In my case, I had already contributed to DeepForest, so I had already set up my working environment even before the proposal submission. Thus, I dedicated this period to add detail to my proposal and to discuss with my mentors who were actually very helpful and were always ready to guide and discussed how to tackle the different tasks.

I started by checking some papers on multi class object detection and how Resnet works, similar projects and going issue by issue in DeepForest to find all feature requests related to my project. Afterwards I outlined a list of all the methods with their priority and workflow for the whole project which was then discussed with my mentors. I immediately started with a pull request on making the model able to interact with multiple classes, trying to extend the functionality to all use cases I could think about in the most simple and natural way (for now natural to me, once the code is reviewed and used by other people, hopefully natural to everybody).

The first problem I came across that the use_bird_release model has 1 class 'Bird', imagine a user wants to start from that model, but has 5 classes of birds ('flamingo', 'ibis', 'egret','duck', 'goose'). We want them to start from a model that can make predictions of 'birds', but learn new classes.

So how it can be tackled is in init, we will load the regression head to the newly created 5 class model. I might also change the name, because its not that we care if the user freezes or not, its that we want them to start from the release model for regression weights which can be attained by few lines of code.

 
model=main.deepforest(num_classes=len(train.label.unique())
                                                          ,label_dict=label_dict)

# Use the backbone and regression head from the global bird detector to transfer
# learning about bird detection and bird related features 
 
global_bird_detector = main.deepforest()
global_bird_detector.use_bird_release()
 
model.model.backbone.load_state_dict(global_bird_detector.model.backbone
.state_dict())

model.model.head.regression_head.load_state_dict(global_bird_detector.model
.head.regression_head.state_dict())
 

 So basically no model training was needed. To create a DeepForest model, there is a classes argument.

 
def __init__(self, num_classes=1, label_dict = {"Tree":0}, transforms=None,
config_file='deepforest_config.yml'): 
 

so user know at time of model creation how many classes are desired. So I didn't made that from scratch. So we want to give the user an opportunity to load a baseline model, which has just a single class, and then replace the classification head. The snippet above is the implementation for this.

 And I started the research on wrapping of raster files on certain resolutions and how it can be evaluated taking results into consideration 

Comments

Popular posts from this blog

GSoC Final Report

GSoC Final Report My journey on the Google Summer of Code project passed by so fast, A lot of stuff happened during those three months, and as I’m writing this blog post, I feel quite nostalgic about these three months. GSoC was indeed a fantastic experience. It gave me an opportunity to grow as a developer in an open source community and I believe that I ended up GSoC with a better understanding of what open source is. I learned more about the community, how to communicate with them, and who are the actors in this workflow. So, this is a summary report of all my journey at GSoC 2022. Name : Ansh Dassani Organization:   NumFOCUS- Data Retriever Project title : Training and Evaluation of model on various resolutions Project link:  DeepForest Mentors :  Ben Weinstein ,  Henry Senyondo , Ethan White Introduction                                        DeepForest is a python package for training and predicting individual tree crowns from airborne RGB imagery. DeepForest comes with a prebuil

GSOC Project

DeepForest This project aims to make the model which would already be trained for the classification of species and detection of alive and dead, trees or birds using transfer learning on the current release model which is based on object detection, only detecting trees and birds, for now, It also involves improving the user interface for working with the multi-class model for a better understating of the species. Basic Understanding of project Through initial understanding and contribution to DeepForest, I have grasped a basic understanding that DeepForest uses Retinanet as a one-stage object detection model that utilizes a focal loss function to address class imbalance during training and which is composed of a backbone network. Backbone Network The backbone is responsible for computing a convolutional feature map over an entire input image and is an off-the-self convolutional network to predict individual tree crowns and birds from airborne RGB images. The pre-built model uses a semi