{"id":16840579,"url":"https://github.com/mitmul/ssai-cnn","last_synced_at":"2025-10-05T10:22:30.540Z","repository":{"id":141385656,"uuid":"46626681","full_name":"mitmul/ssai-cnn","owner":"mitmul","description":"Semantic Segmentation for Aerial / Satellite Images with Convolutional Neural Networks including an unofficial implementation of Volodymyr Mnih's methods","archived":false,"fork":false,"pushed_at":"2021-07-22T12:18:28.000Z","size":134,"stargazers_count":261,"open_issues_count":16,"forks_count":75,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-04-02T12:04:18.402Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://www.ingentaconnect.com/content/ist/jist/2016/00000060/00000001/art00003","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mitmul.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2015-11-21T17:56:11.000Z","updated_at":"2025-03-21T16:05:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"336b69df-6128-4619-8ef1-bda5314bf8f8","html_url":"https://github.com/mitmul/ssai-cnn","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitmul%2Fssai-cnn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitmul%2Fssai-cnn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitmul%2Fssai-cnn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitmul%2Fssai-cnn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mitmul","download_url":"https://codeload.github.com/mitmul/ssai-cnn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248045245,"owners_count":21038554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T12:37:17.978Z","updated_at":"2025-10-05T10:22:25.505Z","avatar_url":"https://github.com/mitmul.png","language":"Python","funding_links":[],"categories":["Papers for Aerial Scene"],"sub_categories":["Typical Element Extraction"],"readme":"This is an implementation of [Volodymyr Mnih's dissertation](https://www.cs.toronto.edu/~vmnih/docs/Mnih_Volodymyr_PhD_Thesis.pdf) methods on his [Massachusetts road \u0026 building dataset](https://www.cs.toronto.edu/~vmnih/data/) and my original methods that are published in [this paper](http://www.ingentaconnect.com/content/ist/jist/2016/00000060/00000001/art00003).\n\n# Requirements\n\n- Python 3.5 (anaconda with python 3.5.1 is recommended)\n  - Chainer 1.5.0.2\n  - Cython 0.23.4\n  - NumPy 1.10.1\n  - tqdm\n- OpenCV 3.0.0\n- lmdb 0.87\n- Boost 1.59.0\n- Boost.NumPy ([26aaa5b](https://github.com/ndarray/Boost.NumPy/tree/26aaa5b62e6170f2ccde179b46f1a49c4011fc9d))\n\n# Build Libraries\n\n## OpenCV 3.0.0\n\n```\n$ wget https://github.com/Itseez/opencv/archive/3.0.0.zip\n$ unzip 3.0.0.zip \u0026\u0026 rm -rf 3.0.0.zip\n$ cd opencv-3.0.0 \u0026\u0026 mkdir build \u0026\u0026 cd build\n$ bash $SSAI_HOME/shells/build_opencv.sh\n$ make -j32 install\n```\n\nIf some libraries are missing, do below before compiling 3.0.0.\n\n```\n$ sudo apt-get install -y libopencv-dev libtbb-dev\n```\n\n## Boost 1.59\\. 0\n\n```\n$ wget http://downloads.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.bz2\n$ tar xvf boost_1_59_0.tar.bz2 \u0026\u0026 rm -rf boost_1_59_0.tar.bz2\n$ cd boost_1_59_0\n$ ./bootstrap.sh\n$ ./b2 -j32 install cxxflags=\"-I/home/ubuntu/anaconda3/include/python3.5m\"\n```\n\n## Boost.NumPy\n\n```\n$ git clone https://github.com/ndarray/Boost.NumPy.git\n$ cd Boost.NumPy \u0026\u0026 mkdir build \u0026\u0026 cd build\n$ cmake -DPYTHON_LIBRARY=$HOME/anaconda3/lib/libpython3.5m.so ../\n$ make install\n```\n\n## Build utils\n\n```\n$ cd $SSAI_HOME/scripts/utils\n$ bash build.sh\n```\n\n# Create Dataset\n\n```\n$ bash shells/download.sh\n$ bash shells/create_dataset.sh\n```\n\nDataset         | Training | Validation |  Test\n:-------------: | :------: | :--------: | :---:\n  mass_roads    | 8580352  |   108416   | 379456\nmass_roads_mini | 1060928  |   30976    | 77440\nmass_buildings  | 1060928  |   30976    | 77440\n  mass_merged   | 1060928  |   30976    | 77440\n\n# Start Training\n\n```\n$ CHAINER_TYPE_CHECK=0 CHAINER_SEED=$1 \\\nnohup python scripts/train.py \\\n--seed 0 \\\n--gpu 0 \\\n--model models/MnihCNN_multi.py \\\n--train_ortho_db data/mass_merged/lmdb/train_sat \\\n--train_label_db data/mass_merged/lmdb/train_map \\\n--valid_ortho_db data/mass_merged/lmdb/valid_sat \\\n--valid_label_db data/mass_merged/lmdb/valid_map \\\n--dataset_size 1.0 \\\n\u003e mnih_multi.log 2\u003e\u00261 \u003c /dev/null \u0026\n```\n\n# Prediction\n\n```\npython scripts/predict.py \\\n--model results/MnihCNN_multi_2016-02-03_03-34-58/MnihCNN_multi.py \\\n--param results/MnihCNN_multi_2016-02-03_03-34-58/epoch-400.model \\\n--test_sat_dir data/mass_merged/test/sat \\\n--channels 3 \\\n--offset 8 \\\n--gpu 0 \u0026\n```\n\n# Evaluation\n\n```\n$ PYTHONPATH=\".\":$PYTHONPATH python scripts/evaluate.py \\\n--map_dir data/mass_merged/test/map \\\n--result_dir results/MnihCNN_multi_2016-02-03_03-34-58/ma_prediction_400 \\\n--channel 3 \\\n--offset 8 \\\n--relax 3 \\\n--steps 1024\n```\n\n# Results\n\n## Conventional methods\n\nModel                         | Mass. Buildings | Mass. Roads            | Mass.Roads-Mini\n:---------------------------- | :-------------- | :--------------------- | :--------------\nMnihCNN                       | 0.9150          | 0.8873                 | N/A\nMnihCNN + CRF                 | 0.9211          | 0.8904                 | N/A\nMnihCNN + Post-processing net | 0.9203          | 0.9006                 | N/A\nSingle-channel                | 0.9503062       | 0.91730195 (epoch 120) | 0.89989258\nSingle-channel with MA        | 0.953766        | 0.91903522 (epoch 120) | 0.902895\n\n## Multi-channel models (epoch = 400, step = 1024)\n\nModel                       | Building-channel | Road-channel | Road-channel (fixed)\n:-------------------------- | :--------------- | :----------- | :-------------------\nMulti-channel               | 0.94346856       | 0.89379946   | 0.9033020025\nMulti-channel with MA       | 0.95231262       | 0.89971473   | 0.90982972\nMulti-channel with CIS      | 0.94417078       | 0.89415726   | 0.9039476538\nMulti-channel with CIS + MA | 0.95280431       | 0.90071099   | 0.91108087\n\n## Test on urban areas (epoch = 400, step = 1024)\n\nModel                       | Building-channel | Road-channel\n:-------------------------- | :--------------- | :-----------\nSingle-channel with MA      | 0.962133         | 0.944748\nMulti-channel with MA       | 0.962797         | 0.947224\nMulti-channel with CIS + MA | 0.964499         | 0.950465\n\n# x0_sigma for inverting feature maps\n\n```\n159.348674296\n```\n\n# After prediction for single MA\n\n```\n$ bash shells/predict.sh\n$ python scripts/integrate.py --result_dir results --epoch 200 --size 7,60\n$ PYTHONPATH=\".\":$PYTHONPATH python scripts/evaluate.py --map_dir data/mass_merged/test/map --result_dir results/integrated_200 --channel 3 --offset 8 --relax 3 --steps 256\n$ PYTHONPATH=\".\" python scripts/eval_urban.py --result_dir results/integrated_200 --test_map_dir data/mass_merged/test/map --steps 256\n```\n\n# Pre-trained models and Predicted results\n\n- [Pre-trained models](https://github.com/mitmul/ssai-cnn/wiki/Pre-trained-models)\n- [Predicted results](https://github.com/mitmul/ssai-cnn/wiki/Predicted-results)\n\n# Reference\n\nIf you use this code for your project, please cite this journal paper:\n\n- [Multiple Object Extraction from Aerial Imagery with Convolutional Neural Networks](http://www.ingentaconnect.com/content/ist/jist/2016/00000060/00000001/art00003) ([bibtex](http://www.ingentaconnect.com/content/ist/jist/2016/00000060/00000001/art00003;jsessionid=3bmr095n0lb07.alice?format=bib))\n\n```Shunta Saito, Takayoshi Yamashita, Yoshimitsu Aoki, \"Multiple Object Extraction from Aerial Imagery with Convolutional Neural Networks\", Journal of Imaging Science and Technology, Vol. 60, No. 1, pp. 10402-1-10402-9, 2015```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitmul%2Fssai-cnn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmitmul%2Fssai-cnn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitmul%2Fssai-cnn/lists"}