Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

32 Commits

Folders and files

Repository files navigation

Neural Representations of the (Planar) ECT

This repository experiments with different neural network architectures for learning from the Euler Characteristic Transform (ECT). It compares ECC encoding strategies and representation models across several shape-classification benchmarks.

The code implements the experiments from the paper Encoding the Euler Characteristic Transform.

Requirements

  • Python 3.11
  • uv (package manager)

Install dependencies:

uv sync

Dependencies are declared in pyproject.toml and include PyTorch, PyTorch Geometric, torchvision, and the dect library.

Data

FashionMNIST (point cloud and cubical)

Downloaded automatically on first run via torchvision into data/FashionMNIST/.

Letter (graph dataset)

Downloaded automatically on first run via PyTorch Geometric into data/TUDataset/ when running with --dataname Letter-low, Letter-med, or Letter-high.

SwissBuildings3D (mesh dataset)

Requires manual preparation:

  1. Obtain the URL list file and place it at:

    data/SwissBuildings3d/raw/ch.swisstopo.swissbuildings3d_3_0-1CKf2kEX.csv
    
  2. Download the raw files:

    uv run download_swissbuildings.py
  3. Process the dataset using the notebook prepare-swissbuildings.ipynb. This reads the raw files and writes the processed train/val/test splits to data/SwissBuildings3d/processed/.

Running experiments

Single dataset

uv run main.py --dataname=<dataset> [--repeats=<n>]

<dataset> is one of: FashionMNISTPointCloud, FashionMNISTCubical, SwissBuildings, Letter-low, Letter-med, Letter-high.

--repeats controls how many independent runs are averaged (default: 5).

Each run appends a row to <dataset>_results.csv with columns variant, model, transform, angle, params, acc.

All datasets

bash runall.sh

Data-size ablation (FashionMNISTPointCloud)

bash runreduced.sh

Trains with training-set sizes from 100 to 2000 in steps of 300. Results are written to FashionMNISTPointCloud_reduced_results.csv with an additional size column.

Generalization experiment

Trains a backbone on SwissBuildings3D, then freezes it and retrains only the classification head on the other datasets:

uv run generalization_experiment.py

If sw_backbone.pt already exists in the working directory, Phase 1 (SwissBuildings training) is skipped. Results are written to generalization_results.csv.

ECC encodings

Variant Description
discrete Discrete ECC
discrete + transformer Discrete ECC with transformer encoder
delta_ect_unsorted Continuous (delta ECT)

ECT representation models

Model key Architecture
model1d 1D convolution
model2d 2D convolution
modelContour 1D complex (contour) convolution
modelSet Set-based
modelFF Feedforward
modelHybrid Hybrid

Analysing results

The notebook result-analysis.ipynb reads the CSV result files and produces the figures in figures/.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages