Skip to content

nagmakhan/multi-label-analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 

Repository files navigation

multi-label-analysis

This set of codes implements multi-label classification of images using graph convolution network (GCN). In this work, it is implemented for VHR airborne images using the multi-label annotated UCMERCED dataset (source: Chaudhuri et al) but it is a generic framework. The GCN used in this framework is inpired from Such et al. The codes are written using the TensorFlow framework (version 1.2.1) in Python 2.7.12. The input needed for the code is adjacency matrices of the graph, node features and label set.

To implement the code:

  1. Check the gpu being used and amount of gpu in src/graphcnn/experiment_multilabel.py file (look for this code snippet in the _init_ function, here 0.2 fraction of gpu0 is being used)
        os.environ["CUDA_VISIBLE_DEVICES"] = '0’
        self.config.gpu_options.per_process_gpu_memory_fraction = 0.2
  2. If needed change the path of snapshots and summary folders in ‘run’ function of src/graphcnn/experiment_multilabel.py by changing the ‘path’ variable
  3. Change the mat file locations in src/graphcnn/setup/ucmerced.py (the mat files holding the adjacency matrices and node features) i.e.
        dataset= scipy.io.loadmat('/path_to_mat_file/new_dataset.mat')
  4. While in src folder, run the run_graph.py file (for terminal based, type ‘python run_graph.py’ in terminal)

The various useful files and their details are:

  1. src/graphcnn/setup/ucmerced.py - the file which loads the mat file and sends it to run_graph.py which is used later. You need to load the graph’s adjacency matrix, features and training labels here.
  2. src/run_graph.py - the file to be run, from which load_ucmerced_data, preprocess_data and experiment_multilabel functions are called. Edit this if you want to change architecture and other misc parameters.
  3. src/graphcnn/experiment_multilabel.py - the main file, having the main functions called from run_graph.py. Edit the various functions, main function is run_experment from which others are called like create_test_train, create_data and run.
  4. src/graphcnn/network.py, Graph-CNN/src/graphcnn/layer.py - the back end files containing the details about graph cnn layers. DO NOT edit unless you want to make any change in architecture
  5. src/multi_label.py - to run the multi label comparison experiments with SVC, MLkNN and GaussianNB. Loads GCN’s train, test and val data and uses the same here.

The new_dataset.mat and features.mat files can be downloaded from this Dropbox link.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages