David: Multi-Scale Crystal Classifier
David is a multi-scale deep learning classifier that uses crystal geometry (pentachora/4-simplexes) as class prototypes with role-weighted similarity computation (Rose Loss).
Model Details
Architecture
- Preset: clip_vit_bigg14
- Sharing Mode: partial_shared
- Fusion Mode: deep_efficiency
- Scales: [384, 512, 768, 1024, 1280, 1536, 1792, 2048]
- Feature Dim: 1280
- Parameters: 60,814,373
Training Configuration
- Dataset: AbstractPhil/imagenet-clip-features-orderly
- Model Variant: clip_vit_laion_bigg14
- Epochs: 10
- Batch Size: 1024
- Learning Rate: 0.001
- Rose Loss Weight: 0.1 β 0.5
- Cayley Loss: False
Performance
Best Results
- Validation Accuracy: 84.73%
- Best Epoch: 2
- Final Train Accuracy: 96.34%
Per-Scale Performance
- Scale 384: 84.39%
- Scale 512: 84.67%
- Scale 768: 84.52%
- Scale 1024: 84.71%
- Scale 1280: 84.73%
- Scale 1536: 84.57%
- Scale 1792: 84.58%
- Scale 2048: 84.59%
Usage
Quick Model Lookup
Check MODELS_INDEX.json in the repo root - it lists all trained models sorted by accuracy with links to weights and configs.
Repository Structure
AbstractPhil/gated-david/
βββ MODELS_INDEX.json # π Master index of all models (sorted by accuracy)
βββ README.md # This file
βββ best_model.json # Latest best model info
βββ weights/
β βββ david_clip_vit_bigg14/
β βββ 20251012_181608/
β βββ MODEL_SUMMARY.txt # π― Human-readable performance summary
β βββ training_history.json # π Epoch-by-epoch training curve
β βββ best_model_acc84.73.safetensors # β Accuracy in filename!
β βββ best_model_acc84.73_metadata.json
β βββ final_model.safetensors
β βββ checkpoint_epoch_X_accYY.YY.safetensors
β βββ david_config.json
β βββ train_config.json
βββ runs/
βββ david_clip_vit_bigg14/
βββ 20251012_181608/
βββ events.out.tfevents.* # TensorBoard logs
Loading the Model
The description below is terrible.
Load a clip-vit and then load one of the pretrains. There is no anchors file nor any of that anymore.
I don't know why this piece of the readme got preserved, but I'll need to fix it.
- Install the repo in your environment
try:
!pip uninstall -qy geometricvocab
except:
pass
!pip install -q git+https://github.com/AbstractEyes/lattice_vocabulary.git
Find your target model, likely not all of this below will work currently.
from geovocab2.train.model.core.david import David, DavidArchitectureConfig
from huggingface_hub import hf_hub_download
# Browse available models in MODELS_INDEX.json first!
# Specify model variant and run
model_name = "david_clip_vit_bigg14"
run_id = "20251012_181608"
accuracy = "84.73" # From MODELS_INDEX.json
# Download config
config_path = hf_hub_download(
repo_id="AbstractPhil/gated-david",
filename=f"weights/{model_name}/{run_id}/david_config.json"
)
config = DavidArchitectureConfig.from_json(config_path)
# Download weights (accuracy in filename!)
weights_path = hf_hub_download(
repo_id="AbstractPhil/gated-david",
filename=f"weights/{model_name}/{run_id}/best_model_acc{accuracy}.safetensors"
)
# Download training history (optional - see full training curve)
history_path = hf_hub_download(
repo_id="AbstractPhil/gated-david",
filename=f"weights/{model_name}/{run_id}/training_history.json"
)
# Load model
from safetensors.torch import load_file
david = David.from_config(config)
david.load_state_dict(load_file(weights_path))
david.eval()
- When in eval mode pass the output from clip-vit's feature into david. The feature does not require the token nor the label, simply pass the feature in and assess the outputs.
I'll need to ensure this process is perfected later, so the trainings can actually be utilized.
Architecture Overview
Multi-Scale Processing
David processes inputs at multiple scales (384, 512, 768, 1024, 1280, 1536, 1792, 2048), allowing it to capture both coarse and fine-grained features.
Crystal Geometry
Each class is represented by a pentachoron (4-simplex) in embedding space with 5 vertices:
- Anchor: Primary class representative
- Need: Complementary direction
- Relation: Contextual alignment
- Purpose: Functional direction
- Observer: Meta-perspective
Rose Loss
Similarity computation uses role-weighted cosine similarities:
score = w_anchor * sim(z, anchor) + w_need * sim(z, need) + ...
Fusion Strategy
deep_efficiency: Intelligently combines predictions from multiple scales.
Training Details
Loss Components
- Cross-Entropy: Standard classification loss
- Rose Loss: Pentachora role-weighted margin loss (weight: 0.1β0.5)
- Cayley Loss: Geometric regularization (disabled)
Optimization
- Optimizer: AdamW
- Weight Decay: 1e-05
- Scheduler: cosine_restarts
- Gradient Clip: 10.0
- Mixed Precision: False
Citation
@software{david_classifier_2025,
title = {David: Multi-Scale Crystal Classifier},
author = {AbstractPhil},
year = {2025},
url = {https://huggingface.co/AbstractPhil/gated-david},
note = {Run ID: 20251012_181608}
}
License
MIT License
Acknowledgments
Built with crystal lattice geometry and multi-scale deep learning. Special thanks to Claude (Anthropic) for debugging assistance.
Generated on 2025-10-12 18:49:29