How falcon97/celeba-face-classification works
Project type and purpose
• This is a machine-learning / neural-network project whose goal is to train and evaluate two models (a single‐layer neural network and a deep neural network) on the CelebA face dataset (binary classification: glasses vs. no-glasses).
• Key artifacts:
• deep_nn.py – implements and runs a multi‐layer network
• single_layer_nn.py – implements and runs a perceptron-style network
• face_all.pickle – preprocessed image data in serialized form
Main components
a. Data Source
• face_all.pickle (serialized dataset)
b. Data Pipeline
• Loading module (unpickle, reshape, normalize)
• (Optional) train/test split logic
c. Model Definitions
• SingleLayerNN component
• DeepNN component
d. Training / Evaluation Engine
• Training loop (forward pass, backprop, parameter updates)
• Evaluation (compute loss, accuracy metrics)
e. External Libraries
• NumPy (array ops), pickle
f. Outputs
• Trained model parameters (in-memory or saved)
• Performance metrics (printed/logged)
Relationships & data flow
• Data file → Data loader → Preprocessed arrays
• Preprocessed arrays ↔ Model component (forward/backward)
• Model component → Updated parameters (training)
• Trained model → Evaluation module → Metrics → Console/log
Architectural patterns & design principles
• Pipeline pattern: clear separation of concerns (I/O vs. preprocessing vs. model vs. training)
• Modularization: two distinct model modules share the same training and evaluation engine
• Single responsibility: each script (deep_nn.py, single_layer_nn.py) orchestrates data + model + training
Detail
• Hyperparameters (learning rate, epochs, layer sizes) near the training loop.
• Data splits if implemented (train vs. test).
• That both deep_nn.py and single_layer_nn.py share the loader/preprocessor and evaluator modules.