Skip to content

add change detection guide#865

Merged
AtmaMani merged 4 commits into
Esri:masterfrom
divyanshj16:change_det_guide
Jan 16, 2021
Merged

add change detection guide#865
AtmaMani merged 4 commits into
Esri:masterfrom
divyanshj16:change_det_guide

Conversation

@divyanshj16
Copy link
Copy Markdown
Contributor

@divyanshj16 divyanshj16 commented Dec 11, 2020

Guide for change detection.

@priyankatuteja, @guneetmutreja please review this.
cc @DavidJVitale

@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@AtmaMani AtmaMani added this to the Jan 28 2021 website release milestone Dec 14, 2020
@review-notebook-app
Copy link
Copy Markdown

review-notebook-app Bot commented Dec 15, 2020

View / edit / reply to this conversation on ReviewNB

priyankatuteja commented on 2020-12-15T10:31:10Z
----------------------------------------------------------------

We often get to see images that are of the same location but taken at different points of time of different points in times. We As humans, we can visually identify such changes quite effortlessly quickly. Let's consider a the task of identifying and segmenting buildings that are have been newly developed constructed in the last decade. We can quickly look at the changes between two different time periods and digitize them. This task is relatively tricky for machines where the machine has to ground its decision based on in both spatial and temporal information that it receives. Deep Learning has made significant progress in computer vision, and we have added several of these models to ArcGIS API for Python. The computer vision models in arcgis.learn can perform tasks like Object Detection, Semantic Segmentation, Instance Segmentation, Image Translation, etc. Starting v1.8.3 we have added another computer vision model for Binary Change Detection. Change detection is of primary importance in GIS, where we get lots of images of the same location but from different times. We can solve various problems, from identifying new illegal construction to finding changes in land cover.


divyanshj16 commented on 2021-01-06T11:51:12Z
----------------------------------------------------------------

Done

@review-notebook-app
Copy link
Copy Markdown

review-notebook-app Bot commented Dec 15, 2020

View / edit / reply to this conversation on ReviewNB

priyankatuteja commented on 2020-12-15T10:31:10Z
----------------------------------------------------------------

A caption like Before, After, Change


divyanshj16 commented on 2021-01-06T11:51:15Z
----------------------------------------------------------------

Done

@review-notebook-app
Copy link
Copy Markdown

review-notebook-app Bot commented Dec 15, 2020

View / edit / reply to this conversation on ReviewNB

priyankatuteja commented on 2020-12-15T10:31:11Z
----------------------------------------------------------------

involvement - spell check


divyanshj16 commented on 2021-01-06T11:52:07Z
----------------------------------------------------------------

Done

divyanshj16 commented on 2021-01-06T11:52:42Z
----------------------------------------------------------------

Done

@review-notebook-app
Copy link
Copy Markdown

review-notebook-app Bot commented Dec 15, 2020

View / edit / reply to this conversation on ReviewNB

priyankatuteja commented on 2020-12-15T10:31:13Z
----------------------------------------------------------------

We need to have data in a specific format,

The exported data needs to be in the specific folder format


@priyankatuteja priyankatuteja self-requested a review January 4, 2021 17:13
Copy link
Copy Markdown
Collaborator

@priyankatuteja priyankatuteja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@divyanshj16 Please have a look at the changes suggested

Copy link
Copy Markdown
Contributor Author

Done


View entire conversation on ReviewNB

3 similar comments
Copy link
Copy Markdown
Contributor Author

Done


View entire conversation on ReviewNB

Copy link
Copy Markdown
Contributor Author

Done


View entire conversation on ReviewNB

Copy link
Copy Markdown
Contributor Author

Done


View entire conversation on ReviewNB

@priyankatuteja priyankatuteja requested a review from BP-Ent January 11, 2021 06:23
@review-notebook-app
Copy link
Copy Markdown

review-notebook-app Bot commented Jan 11, 2021

View / edit / reply to this conversation on ReviewNB

BP-Ent commented on 2021-01-11T18:45:32Z
----------------------------------------------------------------

We often get to see images of the same location at different points in time, and as humans, we can visually identify temporal changes in these images quite effortlessly. For instance, we can quickly observe, analyze, and digitize imagery to identify and segment buildings that have been newly constructed over the last decade. While this task is simple for us, it is relatively tricky for machines that need to ground their decisions in both the spatial and temporal information they are provided. Deep learning has made significant progress in computer vision, and Esri has added several of these deep learning models to ArcGIS API for Python. The computer vision models in arcgis.learn can perform tasks like Object Detection, Semantic Segmentation, Instance Segmentation, Image Translation, etc., and starting at v1.8.3 , we have added another computer vision model for Binary Change Detection. Change detection is of primary importance in GIS, where we get many images of the same location but from different times. With this new model, we can solve various problems, from identifying new illegal construction to finding changes in land cover.


divyanshj16 commented on 2021-01-13T06:54:39Z
----------------------------------------------------------------

Done

@review-notebook-app
Copy link
Copy Markdown

review-notebook-app Bot commented Jan 11, 2021

View / edit / reply to this conversation on ReviewNB

BP-Ent commented on 2021-01-11T18:45:34Z
----------------------------------------------------------------

As the name suggests, a Binary Change Detection model will result in an output consisting of two distinct values, i.e., either change or no change. With the model, we can detect changes in specific features of interest and extract out a semantic map of those features. For example, if we want to determine which roads have been newly developed in the past five years, we need to pass two images from the respective points in time, i.e., a current image and an image of the same area from 5 years prior. Traditionally, intricate workflows and a significant amount human involvement were required to generate these change maps. However, with deep learning, we can now do that with some labeled data and little to no human involvement.


divyanshj16 commented on 2021-01-13T06:54:42Z
----------------------------------------------------------------

Done

@review-notebook-app
Copy link
Copy Markdown

review-notebook-app Bot commented Jan 11, 2021

View / edit / reply to this conversation on ReviewNB

BP-Ent commented on 2021-01-11T18:45:35Z
----------------------------------------------------------------

The change detection architecture that is implemented in arcgis.learn is based on the STANet Paper [2]. It can be trained on coupled images with a semantic map of change as its target. For example, In the case of change detection in buildings, the label for the pair of images will be the change map of footprints that have either developed or disappeared. This architecture uses a self-attention mechanism at activations from fina layer of a convolutional neural network. The base architecture is a UNet like architecture with an encoder and a decoder. The encoder is usually an Imagenet pre-trained ResNet-based architecture, and the decoder is a combination of upsampling, 1x1 convolution, and self-attention layers. The forward pass through the network is done on images from both timelines. Once it receives the features, it passes through the attention module, and we receive attended feature maps. Upon receiving these features from the model, a loss or error function is computed, indicating that the models updated their parameters. The output of the architecture is the semantic map of only the change in our feature of interest. In Figure 2, I* represent an image, X* are the features from the encoder, and Z* are the features after applying attention. The metric module block in Figure 2 is the loss function.


divyanshj16 commented on 2021-01-13T06:54:47Z
----------------------------------------------------------------

Done

@review-notebook-app
Copy link
Copy Markdown

review-notebook-app Bot commented Jan 11, 2021

View / edit / reply to this conversation on ReviewNB

BP-Ent commented on 2021-01-11T18:45:35Z
----------------------------------------------------------------

There are two types of attention modules proposed in the STANet paper, PAM and BAM. PAM stands for Pyramid spatial–temporal Attention Module, while BAM stands for Basic spatial–temporal Attention Module. As the name suggests, PAM is an extension of the basic attention module. Figure 3 explains what each of these modules consists of. BAM is an attention module that enables the model to learn locations in the feature map that the model should pay attention to. The PAM is a bigger and better version of BAM, as it uses the BAM module on the different resolutions of the final feature map. This pyramid technique is very similar to the one we discussed in the "How PSPNet Works" guide [3].


divyanshj16 commented on 2021-01-13T06:54:52Z
----------------------------------------------------------------

Done

@review-notebook-app
Copy link
Copy Markdown

review-notebook-app Bot commented Jan 11, 2021

View / edit / reply to this conversation on ReviewNB

BP-Ent commented on 2021-01-11T18:45:36Z
----------------------------------------------------------------

There are two types of the Spatial-Temporal Attention Module proposed in the paper. In arcgis.learn, you can switch to either one using the attention_type parameter when initializing the model. You can either set it to "PAM" or "BAM". The paper suggests using BAM to detect change in coarser features and using PAM to detect changes in finer features.


divyanshj16 commented on 2021-01-13T06:55:01Z
----------------------------------------------------------------

Done

@review-notebook-app
Copy link
Copy Markdown

review-notebook-app Bot commented Jan 11, 2021

View / edit / reply to this conversation on ReviewNB

BP-Ent commented on 2021-01-11T18:45:39Z
----------------------------------------------------------------

We can train a change detection model in a straightforward workflow that is explained in the change detection sample notebook. The exported data needs to be in a specific folder format, i.e., a folder having three folders: a) a folder named "images_before" containing images from the previous timeline, b) "images_after" including images of the later timeline and c) "labels" containing the change semantic map. We can pass the root path to the prepare_data function and specify the dataset_type to be "ChangeDetection".


divyanshj16 commented on 2021-01-13T06:55:20Z
----------------------------------------------------------------

Done

@review-notebook-app
Copy link
Copy Markdown

review-notebook-app Bot commented Jan 11, 2021

View / edit / reply to this conversation on ReviewNB

BP-Ent commented on 2021-01-11T18:45:40Z
----------------------------------------------------------------

We can then use this data object to see a batch using the data.show_batch() function and to initialize the ChangeDetector class.


divyanshj16 commented on 2021-01-13T06:55:41Z
----------------------------------------------------------------

Done.

Copy link
Copy Markdown
Collaborator

@BP-Ent BP-Ent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested changes made on ReviewNB.

Copy link
Copy Markdown
Contributor Author

Done


View entire conversation on ReviewNB

3 similar comments
Copy link
Copy Markdown
Contributor Author

Done


View entire conversation on ReviewNB

Copy link
Copy Markdown
Contributor Author

Done


View entire conversation on ReviewNB

Copy link
Copy Markdown
Contributor Author

Done


View entire conversation on ReviewNB

Copy link
Copy Markdown
Contributor Author

Done


View entire conversation on ReviewNB

1 similar comment
Copy link
Copy Markdown
Contributor Author

Done


View entire conversation on ReviewNB

Copy link
Copy Markdown
Contributor Author

Done.


View entire conversation on ReviewNB

@divyanshj16
Copy link
Copy Markdown
Contributor Author

@BP-Ent Incorporated all your comments.

@priyankatuteja priyankatuteja added the approved PR approved by reviewer label Jan 13, 2021
@AtmaMani AtmaMani requested a review from BP-Ent January 16, 2021 00:30
@AtmaMani AtmaMani merged commit f165f69 into Esri:master Jan 16, 2021
@mohi9282 mohi9282 added the added to build Label to identify PRs that have been added to local build for Dev Site label Jan 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

added to build Label to identify PRs that have been added to local build for Dev Site approved PR approved by reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants