Building edge extraction from aerial images using Mask R-CNN, to assist wireless network coverage planning tools to find potential CPE antenna mounting locations. The project uses WISDM (https://www.wirelesscoverage.com/) wireless coverage planning system to produce wireless coverage reports using the building edge locations extracted by Mask R-CNN. Any other wireless coverage planning tools which are capable of generating point-to-point path profiles should be compatible to this project.
The Mask R-CNN building edge detection part is built based on the torchvision object detection fine tuning tutorial for pedestrain detection, available at https://pytorch.org/tutorials/intermediate/torchvision_tutorial.html
The project can run under the conda environment, with a few required packages:
pytorch, torchvision, opencv, PIL, skimage
Some other packages may need to be installed as well depending on the local environment, the import list in TestAP.py should have some hints on that.
We have already trained a Mask R-CNN using an aerial image dataset (200 images) including rural and suburban residential properties in North Yorkshire, UK. The dataset is available at:
https://drive.google.com/file/d/1KKwxUfkRL3GYmyULLFLof0SDHBf11W1C/view?usp=sharing
Extract the dataset to your local folder if you would like to train with our dataset.
To train a Mask R-CNN use:
python3 train.py
Or you can add your own dataset (images and masks) into the folders /mapsamples/mapimages and /mapsamples/mapmasks.
We use Bingmap to acuiqre aerial image of the target property, you will need a valid Bingmap API key to download aerial images. If you have a valid key, modify bingapi.py with your own key.
The main script to extract building edges and produce wireless coverage maps is TestAP.py, help can be brought out by:
python3 TestAP.py -h
-P (postcode) and -A (address) should be given at the same time and the address needs to match one of the outputs of wisdm api of that postcode. Use this option only if you have access to WISDM!!!
if -L (latlon) is given, the latitude and longitude will be used as the map center point directly without calling wisdm api to search the addresses. We recommand using this option if you do not have WISDM. If -L is given, the location from -L will override -P and -A.
if -W is N (default is Y), wisdm network availability checker api will not be called, there will be a folder named with the center point latlon, inside the folder is a list of 50 edge point latlons in json format. We recommand using this option if you do not have WISDM.
if -W is Y, wisdm anetwork vailability checker api will be called for all 50 edge points, and in the folder there will be the original map and the avaiability images for APs, and also the individual latlon availability check results in json format. Use this option only if you have access to WISDM!!!
Download the Mask R-CNN we trained on our dataset here:
https://drive.google.com/file/d/17rC-bSpr2v3X9r2ymnSyW8DTk2gneS2V/view?usp=sharing
Line 154 in TestAP.py
model.load_state_dict(torch.load('MRCNNRes50(COCO).pth', map_location=device))
loads the weights of our trained Mask R-CNN if it is in your local folder. You can modify the name of the file if your trained network weights are saved in other names.
Here are some building edge detection results using our trained Mask R-CNN on residential properties:
Here are some examples of the coverage maps generated using the Mask R-CNN building detection and path profile results from WISDM:
If you have access to wireless coverage planning tools other than WISDM, modify line 251 in TestAP.py
ap_names, avis, avi_comb = wisdm_checkavi(latlon)
to call your coverage planning tool API to check coverage for the building edge latlon points provided by Mask R-CNN.
Cite the article
Chu, Yi, Hamed Ahmadi, David Grace, and David Burns. "Deep Learning Assisted Fixed Wireless Access Network Coverage Planning." IEEE Access 9 (2021): 124530-124540.