Chainer Implementation of Semantic Segmentation using Adversarial Networks

Overview

Semantic Segmentation using Adversarial Networks

Requirements

Chainer (1.23.0)

Differences

Use of FCN-VGG16 instead of Dilated8 as Segmentor.

Caution

I have not tuned Discriminator's learning rate yet.

Comments
  • Evaluation of GAN

    Evaluation of GAN

    Hi, thanks for your implementation.

    Have you run the experiments in the original paper?

    Are there any improvements by using GAN in semantic segmentation tasks?

    GAN often generate weird results which seem like "ground truth", but poorly in the evaluation.

    opened by vinthony 2
  • ValueError: could not broadcast input array from shape (4096,25088) into shape (4096,512,7,7)

    ValueError: could not broadcast input array from shape (4096,25088) into shape (4096,512,7,7)

    Hi, When I tried ./03-inference.py -w pretrained_model/vgg16.npz -i JPEGImages/2012_001258.jpg I got the error: File "./03-inference.py", line 113, in <module> main() File "./03-inference.py", line 95, in main chainer.serializers.load_npz(args.weight, model) File "/media/vip/Data1/cj_project/chainer_ws/local/lib/python2.7/site-packages/chainer/serializers/npz.py", line 153, in load_npz d.load(obj) File "/media/vip/Data1/cj_project/chainer_ws/local/lib/python2.7/site-packages/chainer/serializer.py", line 83, in load obj.serialize(self) File "/media/vip/Data1/cj_project/chainer_ws/local/lib/python2.7/site-packages/chainer/link.py", line 795, in serialize d[name].serialize(serializer[name]) File "/media/vip/Data1/cj_project/chainer_ws/local/lib/python2.7/site-packages/chainer/link.py", line 551, in serialize data = serializer(name, param.data) File "/media/vip/Data1/cj_project/chainer_ws/local/lib/python2.7/site-packages/chainer/serializers/npz.py", line 123, in __call__ numpy.copyto(value, dataset) ValueError: could not broadcast input array from shape (4096,25088) into shape (4096,512,7,7) Could you tell me what should I did? Thank you so much.

    opened by Cuijie12358 1
  • weird when running train.py

    weird when running train.py

    Run the training /home/jcc/Semantic-Segmentation-using-Adversarial-Networks/utils.py:193: RuntimeWarning: invalid value encountered in true_divide acc_cls = np.diag(hist) / hist.sum(axis=1) /home/jcc/Semantic-Segmentation-using-Adversarial-Networks/utils.py:195: RuntimeWarning: invalid value encountered in true_divide iu = np.diag(hist) / (hist.sum(axis=1) + hist.sum(axis=0) - np.diag(hist))

    and the training just seems to stop here, and nothing indicating the training process is showing here! And if I ignore this by: import numpy as np np.seterr(divide='ignore', invalid='ignore'), the training stop here too. Is this cause by not finding the data? But my dataset is already here: image

    opened by brisker 0
  • How to choose model?

    How to choose model?

    Hello Oyam,

    You said you used FCN-VGG16. However, there is " n_class=1000 " in your models/vgg16.py code. It should use ImageNet with 1000 classes.

    If I add "-s fcn32s" in command, I always got the shape error " ValueError: could not broadcast input array from shape (4096,25088) into shape (4096,512,7,7)"

    Do I need to reshape the input data?

    opened by ldhl103 0
  • the loss turn into NaN after the 4th iteration

    the loss turn into NaN after the 4th iteration

    I only changed some parameters as follow, and change the dataset path. parser.add_argument('--iteration', '-i', type=int, default=5,... parser.add_argument('--evaluate_interval', type=int, default=1,... parser.add_argument('--snapshot_interval', type=int, default=5,... parser.add_argument('--display_interval', type=int, default=1,...

    I run the 02-train.py without command line parameter and just use the default setting.

    And if I set the iteration more than 5, the loss also start to become NaN after the 4th iteration. image

    Here is the log file { "dis/loss": 1.4394323825836182, "gen/loss": 549001.1875, "gen/accuracy": 0.8932809831192742, "gen/accuracy_cls": 0.5, "gen/iu": 0.4466404915596371, "gen/fwavacc": 0.797950914802537, "epoch": 0, "iteration": 1, "elapsed_time": 50.618666648864746 }, { "dis/loss": 1135330.0, "gen/loss": 487891.59375, "gen/accuracy": 0.8661764545563562, "gen/accuracy_cls": 0.5, "gen/iu": 0.4330882272781781, "gen/fwavacc": 0.7502616504278193, "epoch": 0, "iteration": 2, "elapsed_time": 96.50169348716736 }, { "dis/loss": 1.1617913440729532e+22, "gen/loss": 6.914105166024373e+21, "gen/accuracy": 0.0, "gen/accuracy_cls": 0.0, "gen/iu": 0.0, "gen/fwavacc": 0.0, "epoch": 0, "iteration": 3, "elapsed_time": 143.30005288124084 }, { "dis/loss": NaN, "gen/loss": NaN, "gen/accuracy": 0.46102918492009626, "gen/accuracy_cls": 0.3333333333333333, "gen/iu": 0.1536763949733654, "gen/fwavacc": 0.21254790934808832, "epoch": 0, "iteration": 4, "elapsed_time": 183.56889081001282 }

    I use chainer 1.23.0; numpy 1.15.2 matplotlib 3.0.0 Has anyone run into the same problem? need help ;)

    opened by kallyshall 0
  • doesn't work with new version of chainer

    doesn't work with new version of chainer

    The code isn't compatible with any version of chainer Version>=2.0 Specifically, this is the error that is being thrown ValueError: invoke_before_training has been removed since Chainer v2.0.0. Use initializer= instead.

    opened by sangeet259 1
  • bug

    bug

    1.python download_dataset.py emerging questions , File "download_dataset.py", line 7, in import utils ImportError: No module named utils ,I want know how to solve 2.I want to know How is this project used?

    opened by nannanliuliuliu 0
  • How about the performance?

    How about the performance?

    Thanks for sharing the implementation. My question is similar question #2 . Could you update/show the performance of the implementation with/without GAN? I would like to know if my running is correct or not. Thanks

    opened by John1231983 2
Dynamic Divide-and-Conquer Adversarial Training for Robust Semantic Segmentation (ICCV2021)

Dynamic Divide-and-Conquer Adversarial Training for Robust Semantic Segmentation This is a pytorch project for the paper Dynamic Divide-and-Conquer Ad

DV Lab 29 Nov 21, 2022
code for paper"A High-precision Semantic Segmentation Method Combining Adversarial Learning and Attention Mechanism"

PyTorch implementation of UAGAN(U-net Attention Generative Adversarial Networks) This repository contains the source code for the paper "A High-precis

Tong 8 Apr 25, 2022
Mae segmentation - Reproduction of semantic segmentation using masked autoencoder (mae)

ADE20k Semantic segmentation with MAE Getting started Install the mmsegmentation

null 97 Dec 17, 2022
Learning Pixel-level Semantic Affinity with Image-level Supervision for Weakly Supervised Semantic Segmentation, CVPR 2018

Learning Pixel-level Semantic Affinity with Image-level Supervision This code is deprecated. Please see https://github.com/jiwoon-ahn/irn instead. Int

Jiwoon Ahn 337 Dec 15, 2022
Instance Segmentation in 3D Scenes using Semantic Superpoint Tree Networks

SSTNet Instance Segmentation in 3D Scenes using Semantic Superpoint Tree Networks(ICCV2021) by Zhihao Liang, Zhihao Li, Songcen Xu, Mingkui Tan, Kui J

null 83 Nov 29, 2022
LBK 26 Dec 28, 2022
Super-Fast-Adversarial-Training - A PyTorch Implementation code for developing super fast adversarial training

Super-Fast-Adversarial-Training This is a PyTorch Implementation code for develo

LBK 26 Dec 2, 2022
Segmentation in Style: Unsupervised Semantic Image Segmentation with Stylegan and CLIP

Segmentation in Style: Unsupervised Semantic Image Segmentation with Stylegan and CLIP Abstract: We introduce a method that allows to automatically se

Daniil Pakhomov 134 Dec 19, 2022
TorchDistiller - a collection of the open source pytorch code for knowledge distillation, especially for the perception tasks, including semantic segmentation, depth estimation, object detection and instance segmentation.

This project is a collection of the open source pytorch code for knowledge distillation, especially for the perception tasks, including semantic segmentation, depth estimation, object detection and instance segmentation.

yifan liu 147 Dec 3, 2022
A PyTorch implementation of the paper "Semantic Image Synthesis via Adversarial Learning" in ICCV 2017

Semantic Image Synthesis via Adversarial Learning This is a PyTorch implementation of the paper Semantic Image Synthesis via Adversarial Learning. Req

Seonghyeon Nam 146 Nov 25, 2022
PyTorch implementation of "Image-to-Image Translation Using Conditional Adversarial Networks".

pix2pix-pytorch PyTorch implementation of Image-to-Image Translation Using Conditional Adversarial Networks. Based on pix2pix by Phillip Isola et al.

mrzhu 383 Dec 17, 2022
[CVPR2022] Representation Compensation Networks for Continual Semantic Segmentation

RCIL [CVPR2022] Representation Compensation Networks for Continual Semantic Segmentation Chang-Bin Zhang1, Jia-Wen Xiao1, Xialei Liu1, Ying-Cong Chen2

Chang-Bin Zhang 71 Dec 28, 2022
Code for the paper: Adversarial Training Against Location-Optimized Adversarial Patches. ECCV-W 2020.

Adversarial Training Against Location-Optimized Adversarial Patches arXiv | Paper | Code | Video | Slides Code for the paper: Sukrut Rao, David Stutz,

Sukrut Rao 32 Dec 13, 2022
Adversarial Color Enhancement: Generating Unrestricted Adversarial Images by Optimizing a Color Filter

ACE Please find the preliminary version published at BMVC 2020 in the folder BMVC_version, and its extended journal version in Journal_version. Datase

null 28 Dec 25, 2022
transfer attack; adversarial examples; black-box attack; unrestricted Adversarial Attacks on ImageNet; CVPR2021 天池黑盒竞赛

transfer_adv CVPR-2021 AIC-VI: unrestricted Adversarial Attacks on ImageNet CVPR2021 安全AI挑战者计划第六期赛道2:ImageNet无限制对抗攻击 介绍 : 深度神经网络已经在各种视觉识别问题上取得了最先进的性能。

null 25 Dec 8, 2022
LBK 35 Dec 26, 2022
Code for the CVPR2022 paper "Frequency-driven Imperceptible Adversarial Attack on Semantic Similarity"

Introduction This is an official release of the paper "Frequency-driven Imperceptible Adversarial Attack on Semantic Similarity" (arxiv link). Abstrac

Leo 21 Nov 23, 2022