This project was developed as part of the Master's program in Computer Science and Big Data, option Recherche Big Data, in the course Recherche en Big Data with M. Touati.
The goal is to build a Convolutional Neural Network (CNN) to analyze and classify images of Jackson Wang (Wang Jia Er), a Hong Kong rapper, singer, and performer, member of the K-pop group GOT7. Jackson Wang has a successful international solo career and is also active in fashion and entertainment. This project aims to help identify him correctly, as people sometimes mistake him for other idols.
The CNN architecture used in this project is as follows:
- Input: (3, 128, 128) RGB image
- Conv Layer 1: 3 → 32 filters, 3x3, ReLU, MaxPool2d(2x2) → 64x64
- Conv Layer 2: 32 → 64 filters, 3x3, ReLU, MaxPool2d(2x2) → 32x32
- Conv Layer 3: 64 → 128 filters, 3x3, ReLU, MaxPool2d(2x2) → 16x16
- Classifier: Flatten → Linear(1281616 → 256) → ReLU → Dropout → Linear(256 → 2)
- Input: (3, 128, 128) RGB image
- Conv Layer 1: 3 → 32 filters, 3x3, ReLU, MaxPool2d(2x2) → 64x64
- Conv Layer 2: 32 → 64 filters, 3x3, ReLU, MaxPool2d(2x2) → 32x32
- Classifier: Flatten → Linear(643232 → 256) → ReLU → Dropout → Linear(256 → 2)
The optimized model is lighter and faster to train while keeping good accuracy.
The dataset contains images of Jackson Wang and "other" images (labeled divers), split into:
dataset/
├─ train/
│ ├─ jackson/
│ └─ divers/
├─ test/
│ ├─ jackson/
│ └─ divers/
- Training set: 160 Jackson, 160 divers
- Test set: 40 Jackson, 40 divers
- Clone this repository:
git clone <repo-url>
cd CNN-Jackson-or-notpip install -r requirements.txtTraining the model Run the main training script:
python or python3 src/main.pyThis will train the CNN model on the dataset and save the trained weights as model.pth
Launch the interactive app to classify images:
streamlit run app.py- Upload an image of Jackson or someone else.
- Click Analyse to see the prediction and confidence.
- Provide feedback if the prediction is correct or not.
Chloé Makoundou / Cholorsplash This project was created as part of a Master's program in Computer Science and Big Data, option Recherche Big Data.