# color space **Repository Path**: genvex/color-space ## Basic Information - **Project Name**: color space - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-08-21 - **Last Updated**: 2026-08-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Caviar Color Grading System ## Structure ``` caviar-grading/ ├── PAPER.md ← Paper (v1.0, verified) ├── grade.py ← Grading CLI (production) ├── models/ │ ├── model.joblib ← RandomForest (RGB mean+std → 6 classes) │ └── mixed_cnn.pth ← ResNet18 (mixed vs non-mixed) ├── fig1_pca_2d.png ← PCA scatter ├── fig2_pc1_hist.png ← Brightness histogram ├── fig3_confusion.png ← Confusion matrix ├── fig4_metrics.png ← Precision/Recall/F1 └── experiments/ ← Full experiment scripts (numbered) 01_extract_features.py 02_pca.py 03_visualize.py 04_variance_analysis.py 05_rf_classifier.py 06_cnn_baseline.py 07_cnn_focalloss.py 08_cnn_5fold.py 09_generate_figs.py 10_validate_pipeline.py ``` ## Usage ### Grading (production) ```bash # Prerequisites pip install torch torchvision scikit-learn joblib pillow numpy # Grade a single image python3 grade.py /path/to/caviar.jpg # Grade batch python3 grade.py img1.jpg img2.jpg img3.jpg ... ``` **Output**: Prints CNN mixed probability, RF 6-class predictions with confidence, and final verdict (grade or REVIEW). ### Reproduce experiments ```bash # Step 0: Data at /data1/usb_backup/ (7-class JPG folders) # Run in order python3 experiments/01_extract_features.py # → /tmp/fish_features.npy python3 experiments/02_pca.py # → /tmp/fish_pca.npy python3 experiments/03_visualize.py # → figs python3 experiments/05_rf_classifier.py # → /tmp/caviar_model/ python3 experiments/07_cnn_focalloss.py # → /tmp/mixed_cnn_v2.pth python3 experiments/10_validate_pipeline.py # → full validation ``` ## Dependencies | Package | Min Version | |---|---| | torch | 2.11.0+cu130 | | torchvision | ≥0.16 | | scikit-learn | 1.9 | | numpy | 1.26 | | Pillow | 10 | | matplotlib | 3.11 | ## Requirements - GPU: NVIDIA (RTX 5090 used, but any CUDA GPU works) - Disk: ~60 GB for models + data - Training CNN: ~10 min on 5090 ## Key Numbers | Metric | Value | |---|---| | CNN mixed detection | 92.1% recall (58/63) | | RF 6-class (5-fold CV) | 84.2% ± 0.97% | | Full pipeline (3027 imgs) | 90.3% | | Single image latency | < 200ms |