Skip to content

Commit 489c083

Browse files
Update README.md
1 parent 252b9bc commit 489c083

File tree

1 file changed

+36
-22
lines changed

1 file changed

+36
-22
lines changed

README.md

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,67 @@
11
# Spectral Clustering with Graph Neural Networks for Graph Pooling
2-
Experimental results obtained with the MinCutPool layer as presented in the 2020 ICML paper [Spectral Clustering with Graph Neural Networks for Graph Pooling](https://arxiv.org/abs/1907.00481)
32

43
<img src="./figs/mincutpool.png" width="400" height="200">
54

6-
This repository is based on [MinCutPool implementation](https://graphneural.network/layers/pooling/#mincutpool) provided by [Spektral](https://graphneural.network/), the Keras/TensorFlow library for Graph Neural Networks. A Pytorch implementation of MinCutPool is also available in the [Pytorch Geometric](https://pytorch-geometric.readthedocs.io/en/latest/modules/nn.html#torch_geometric.nn.dense.mincut_pool.dense_mincut_pool) library.
5+
This code reproduces the experimental results obtained with the MinCutPool layer
6+
as presented in the ICML 2020 paper
77

8-
**Required libraries**
8+
[Spectral Clustering with Graph Neural Networks for Graph Pooling](https://arxiv.org/abs/1907.00481)
9+
F. M. Bianchi, D. Grattarola, C. Alippi
910

10-
- spektral (tested on v.1.2)
11-
- tensorflow (tested on v.1.14)
12-
- keras (tested on v.2.2.4)
13-
- scikit-learn (tested on v.0.22.1)
14-
- scikit-image (tested on v.0.16.2)
15-
- networkx (tested on v.2.4)
16-
- pygsp (tested on v.0.5.1 )
17-
- pandas
18-
- scipy
19-
- tqdm
20-
- numpy
21-
- matplotlib
11+
The official implementation of the MinCutPool layer can be found in
12+
[Spektral](https://graphneural.network/layers/pooling/#mincutpool).
13+
14+
An implementation of MinCutPool for PyTorch is also available in
15+
[Pytorch Geometric](https://pytorch-geometric.readthedocs.io/en/latest/modules/nn.html#torch_geometric.nn.dense.mincut_pool.dense_mincut_pool).
16+
17+
## Setup
18+
19+
The code is based on Python 3.5, TensorFlow 1.15, and Spektral 0.1.2.
20+
All required libraries are listed in `requirements.txt` and can be installed with
21+
22+
```bash
23+
pip install -r requirements.txt
24+
```
2225

2326
## Image segmentation
2427

2528
<img src="./figs/overseg_and_rag.png" width="700" height="150">
2629

27-
Run [Segmentation.py](https://github.com/FilippoMB/Spectral-Clustering-with-Graph-Neural-Networks-for-Graph-Pooling/blob/master/Segmentation.py) to perform hyper-segmentation, generate a Region Adjacency Graph from the resulting segments, and then cluster the nodes of the RAG graph by means of a GNN equipped with the MinCutPool layer.
30+
Run [Segmentation.py](https://github.com/FilippoMB/Spectral-Clustering-with-Graph-Neural-Networks-for-Graph-Pooling/blob/master/Segmentation.py)
31+
to perform hyper-segmentation, generate a Region Adjacency Graph from the
32+
resulting segments, and then cluster the nodes of the RAG graph with the
33+
MinCutPool layer.
2834

2935
## Clustering
3036

3137
<img src="./figs/clustering_stats.png" width="600" height="250">
3238

33-
Run [Clustering.py](https://github.com/FilippoMB/Spectral-Clustering-with-Graph-Neural-Networks-for-Graph-Pooling/blob/master/Clustering.py) to cluster the nodes of a citation network. The datasets ````cora````, ````citeseer````, and ````pubmed```` can be selected.
34-
Resutls are provided in terms of homogeneity score, completeness score, and normalized mutual information (v-score).
39+
Run [Clustering.py](https://github.com/FilippoMB/Spectral-Clustering-with-Graph-Neural-Networks-for-Graph-Pooling/blob/master/Clustering.py)
40+
to cluster the nodes of a citation network. The datasets `cora`, `citeseer`, and
41+
`pubmed` can be selected.
42+
Results are provided in terms of homogeneity score, completeness score, and
43+
normalized mutual information (v-score).
3544

3645
## Autoencoder
3746

3847
<img src="./figs/ae_ring.png" width="400" height="200">
3948
<img src="./figs/ae_grid.png" width="400" height="200">
4049

41-
Run [Autoencoder.py](https://github.com/FilippoMB/Spectral-Clustering-with-Graph-Neural-Networks-for-Graph-Pooling/blob/master/Autoencoder.py) to compute the reconstruction from an Autoencoder with bottleneck. It is possible to switch between the ````ring```` and ````grid````, but also the other [point-clouds datasets](https://pygsp.readthedocs.io/en/stable/reference/graphs.html?highlight=bunny#graph-models) from the [PyGSP](https://pygsp.readthedocs.io/en/stable/index.html) library are supported. Results are provided in terms of Mean Squared Error.
50+
Run [Autoencoder.py](https://github.com/FilippoMB/Spectral-Clustering-with-Graph-Neural-Networks-for-Graph-Pooling/blob/master/Autoencoder.py)
51+
to train an autoencoder with bottleneck and compute the reconstructed graph. It
52+
is possible to switch between the `ring` and `grid` graphs, but also any other
53+
[point clouds](https://pygsp.readthedocs.io/en/stable/reference/graphs.html?highlight=bunny#graph-models)
54+
from the [PyGSP](https://pygsp.readthedocs.io/en/stable/index.html) library
55+
are supported. Results are provided in terms of the Mean Squared Error.
4256

4357
## Graph Classification
4458

4559
Run [Classification.py](https://github.com/FilippoMB/Spectral-Clustering-with-Graph-Neural-Networks-for-Graph-Pooling/blob/master/Classification.py) to train a graph classifier. Additional classification datasets are available [here](https://chrsmrrs.github.io/datasets/) (drop them in ````data/classification/````) and [here](https://github.com/FilippoMB/Benchmark_dataset_for_graph_classification) (drop them in ````data/````).
46-
Results are provided in terms of classification accuray averaged over 10 folds.
60+
Results are provided in terms of classification accuracy averaged over 10 runs.
4761

4862
## Citation
4963

50-
Please, cite the original paper if you are using MinCutPool in your reasearch
64+
Please, cite the original paper if you are using MinCutPool in your research
5165

5266
@inproceedings{bianchi2020mincutpool,
5367
title={Spectral Clustering with Graph Neural Networks for Graph Pooling},
@@ -58,6 +72,6 @@ Please, cite the original paper if you are using MinCutPool in your reasearch
5872
organization={ACM}
5973
}
6074

61-
6275
## License
76+
6377
The code is released under the MIT License. See the attached LICENSE file.

0 commit comments

Comments
 (0)