Commit Graph

5 Commits

Author SHA1 Message Date
5a62c6e689 Implement fully homomorphic encryption (FHE) based KNN classifier
This commit adds a complete FHE-based K-nearest neighbors implementation using TFHE:

Key Features:
- Encrypts training data and query vectors using FheInt32 and FheUint8
- Implements encrypted Euclidean distance calculation with 100x scaling for precision
- Uses bitonic sorting with encrypted conditional swaps for secure k-selection
- Includes comprehensive progress tracking and timing for long-running operations
- Memory optimizations: pre-allocated vectors and reused encrypted constants

Algorithm Implementation:
- Encrypted distance computation with homomorphic arithmetic operations
- Bitonic sort algorithm adapted for encrypted data structures
- Secure index tracking with encrypted FheUint8 values
- Select API usage for conditional swaps maintaining data privacy

Performance:
- Handles 100 training points with 10 dimensions in ~98 minutes on consumer hardware
- Includes detailed progress bars and time estimation
- Results validated against plain-text implementation (8/10 match rate)

Documentation:
- Comprehensive function documentation for all core algorithms
- Time complexity analysis and performance benchmarking notes
- Clear separation between client-side encryption/decryption and server-side computation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-07 09:16:41 +08:00
d58adda9ab Implement plain KNN classifier and testing infrastructure
- Add plain KNN implementation with JSONL data processing
- Create Docker deployment setup with python:3.13-slim base
- Add comprehensive OJ-style testing system with accuracy validation
- Update README with detailed scoring mechanism explanation
- Add run.sh script following competition manual requirements

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-05 21:11:22 +08:00
136583715e Add project documentation and training dataset
- Add manual.md documentation
- Include train.jsonl dataset for FHE-KNN training
- Update README.md with project details

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-04 16:18:29 +08:00
4c155d8bf4 Initial Rust project setup with dependencies and dataset
- Add Cargo.toml with TFHE, CSV, and Serde dependencies
- Add .gitignore for Rust target directory
- Include Iris dataset for machine learning experiments
- Add plain KNN implementation binary
- Update LICENSE to MIT and improve README

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-29 18:11:40 +08:00
e73cc21d01 Initial commit 2025-06-16 15:29:24 +08:00