Skip to content

David-IChunLin/MorphoMap

Repository files navigation

MorphoMap: The Architectural Manifold Engine 🌌

A high-dimensional visual projection pipeline grounded in the Pritzker Laureate Style Corpus.

MorphoMap is the core intelligence behind the SoftMarket visualization. It transforms complex architectural project data (1536D embeddings) into a stable, semantically meaningful 2D "Galaxy" map using a dual-stage Manifold Learning pipeline.

🚀 The Pipeline (Galaxy v3)

Unlike standard dimensionality reduction, MorphoMap uses a Two-Stage Refinement process to preserve both architectural style and visual layout:

  1. Stage 1: Semantic Compression (1536D → 10D)
    • Uses UMAP trained on architectural style similarities.
    • Compresses the "raw" visual data into a 10-dimensional manifold that preserves high-level stylistic archetypes.
  2. Stage 2: HDBSCAN Clustering (10D)
    • Identifies architectural "neighborhoods" in the 10D semantic space.
    • Finds natural groupings without forcing every point into a cluster (allowing for a "continuum" of style).
  3. Stage 3: Visual Projection (10D → 2D)
    • Project the 10D manifold into the final 2D Cartesian space used by Deck.GL.
    • This ensures that dots close on the map are stylistically related, not just visually similar.

🧠 Semantic Grounding (Pritzker Corpus)

The Manifold models included in this API are trained on a high-fidelity benchmark dataset of projects by Pritzker Architecture Prize Laureates.

  • Training Integrity: By using the Pritzker corpus as the "Golden Set," the 10D semantic space is grounded in the globally recognized discourse of architectural excellence.
  • Style Manifold: New uploads are projected relative to these "Landmarks," allowing designers and firms to identify their unique market position within the architectural galaxy.

🛠️ Tech Stack

  • Logic: Python 3.9+
  • Framework: FastAPI
  • ML Libraries: umap-learn, hdbscan, scikit-learn, numpy
  • Deployment: Google Cloud Run (Dockerized)

📦 API Endpoints

POST /calculate

Transforms a batch of project embeddings into coordinates and calculates user centroids.

Input:

[
  {
    "id": "proj_123",
    "userId": "user_abc",
    "imageEmbedding": [0.12, -0.05, ...] // 1536-dim
  }
]

Output:

{
  "coordinates": [
    { "id": "proj_123", "userId": "user_abc", "coord_x": 4.5, "coord_y": -2.1, "clusterId": 5 }
  ],
  "centroids": [
    { "sessionId": "user_abc", "centroid_x": 4.5, "centroid_y": -2.1, "variance_x": 0, ... }
  ]
}

🏗️ Local Development

  1. Install dependencies:
    pip install -r requirements.txt
  2. Run locally:
    uvicorn main:app --reload --port 8080

🔗 GitHub Integration

This repository is designed to be standalone. It can be paired with any frontend using Deck.GL or D3.js to create interactive semantic maps.


Created by David Lin/HappyCluster - 2026

About

High-speed architectural style manifold using UMAP and HDBSCAN. Projects 1536D multimodal embeddings into a stable 2D semantic galaxy.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors