lyffseba commited on
Commit
9a56540
·
verified ·
1 Parent(s): 17c0e08

Upload main.ipynb

Browse files

Model Architecture Description

🧠 Dual CNN Architecture for Interpretable Music Genre Classification

Model 1: Batch Normalization CNN (bn_model)
Architecture Overview:
• Base Model: ResNet152V2 pre-trained on ImageNet
• Input Shape: (300, 300, 3) RGB images
• Transfer Learning: Feature extraction + fine-tuning approach

Layer Architecture:
1. Feature Extractor: ResNet152V2 (frozen initially, then fine-tuned from conv5_block3_preact_bn)
2. Global Pooling: GlobalMaxPooling2D for spatial dimension reduction
3. Dense Layer 1: 512 neurons + ReLU + L1 regularization (0.01)
4. Dropout 1: 30% dropout for regularization
5. Dense Layer 2: 256 neurons + ReLU + L1 regularization (0.01)
6. Dropout 2: 30% dropout for regularization
7. Dense Layer 3: 128 neurons + ReLU + L1 regularization (0.01)
8. Dropout 3: 30% dropout for regularization
9. Output Layer: 3 neurons + Softmax for multi-class classification

Model 2: Concept Whitening CNN (cw_model)
Architecture Overview:
• Base Model: ResNet152V2 pre-trained on ImageNet
• Novel Component: Custom Concept Whitening layer for interpretability
• Input Shape: (300, 300, 3) RGB images

Layer Architecture:
1. Feature Extractor: ResNet152V2 (frozen initially, then fine-tuned from conv5_block3_preact_cw)
2. 🔬 Concept Whitening Layer: Custom interpretability layer performing:
• Covariance matrix computation of input activations
• Singular Value Decomposition (SVD) for whitening matrix calculation
• Feature decorrelation and normalization for enhanced interpretability
3. Global Pooling: GlobalMaxPooling2D for spatial dimension reduction
4. Dense Layer 1: 512 neurons + ReLU + L1 regularization (0.01)
5. Dropout 1: 30% dropout for regularization
6. Dense Layer 2: 256 neurons + ReLU + L1 regularization (0.01)
7. Dropout 2: 30% dropout for regularization
8. Dense Layer 3: 128 neurons + ReLU + L1 regularization (0.01)
9. Dropout 3: 30% dropout for regularization
10. Output Layer: 3 neurons + Softmax for multi-class classification

Training Configuration:
Optimizer: RMSprop (learning_rate=1e-4)
Loss Function: Categorical Crossentropy
Callbacks:
• Learning Rate Scheduler (step decay)
• ReduceLROnPlateau (factor=0.6, patience=8)
• ModelCheckpoint (save best model)
• EarlyStopping (patience=5)

Key Innovations:
🎯 Concept Whitening Layer Features:
• Interpretability: Makes CNN decision-making process more transparent
• Mathematical Foundation: SVD-based feature decorrelation
• Real-time Processing: Applied during forward pass without additional inference cost
• Research Contribution: Novel approach to explainable AI in music genre classification

Model Comparison:
• Performance: Both models achieve competitive accuracy on vinyl album cover classification
• Interpretability: Concept Whitening model provides enhanced feature visualization and understanding
• Architecture: Identical except for the custom whitening layer insertion
• Research Value: Empirical comparison of accuracy vs. interpretability trade-offs in deep learning

1 file changed +840
main.ipynbAdded+840