{"id":49670069,"url":"https://github.com/moenick1/intel-dataset-classification","last_synced_at":"2026-05-06T22:01:59.763Z","repository":{"id":286177911,"uuid":"960623173","full_name":"Moenick1/Intel-Dataset-Classification","owner":"Moenick1","description":"Classification using advanced Convolution Neural Networks and the Intel Image dataset, featuring 6 classes of color pictures in 150x150 pixels resolution.  Topics","archived":false,"fork":false,"pushed_at":"2025-04-04T18:56:54.000Z","size":166,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-13T11:42:21.754Z","etag":null,"topics":["ai","classification","ml","python","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Moenick1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-04-04T18:55:42.000Z","updated_at":"2025-04-04T18:58:20.000Z","dependencies_parsed_at":"2025-04-09T19:20:05.876Z","dependency_job_id":null,"html_url":"https://github.com/Moenick1/Intel-Dataset-Classification","commit_stats":null,"previous_names":["abbaszaidi123/intel-dataset-classification","moenick1/intel-dataset-classification"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Moenick1/Intel-Dataset-Classification","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Moenick1%2FIntel-Dataset-Classification","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Moenick1%2FIntel-Dataset-Classification/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Moenick1%2FIntel-Dataset-Classification/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Moenick1%2FIntel-Dataset-Classification/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Moenick1","download_url":"https://codeload.github.com/Moenick1/Intel-Dataset-Classification/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Moenick1%2FIntel-Dataset-Classification/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32713820,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T19:35:05.142Z","status":"ssl_error","status_checked_at":"2026-05-06T19:35:03.996Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","classification","ml","python","tensorflow"],"created_at":"2026-05-06T22:01:48.438Z","updated_at":"2026-05-06T22:01:59.744Z","avatar_url":"https://github.com/Moenick1.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Intel Classification Dataset\r\n\r\n\r\n## Using the code\r\nYou can use the jupyter version of the project with the file ```Advanced CNN.ipynb```.\r\nThe dataset used in the code can be found on the kaggle website: https://www.kaggle.com/datasets/puneet6060/intel-image-classification\r\n\r\n## Presentation of the task\r\n\r\nIn this project, we tackle a classification problem using advanced Convolutional Neural Networks (CNN) and the Intel Image dataset. \r\nThe Intel classification dataset groups pictures from 6 different classes : 'mountain', 'street', 'glacier', 'buildings', 'sea' and 'forest'. Those pictures are in average in medium resolution of 150x150 pixels and RGB colors (compared to 28x28 pixels in black and white for the MNIST dataset).\r\n\r\nMountain:\r\n\r\n![20107](https://github.com/Jean-BaptisteAC/Intel-Dataset-Classification/assets/66775006/3e33a508-ed13-4ed9-9c2b-cb91d3e2a231)\r\n\r\nSea:\r\n\r\n![20168](https://github.com/Jean-BaptisteAC/Intel-Dataset-Classification/assets/66775006/4c866201-6716-4111-811e-208727963546)\r\n\r\nStreet:\r\n\r\n![20066](https://github.com/Jean-BaptisteAC/Intel-Dataset-Classification/assets/66775006/4dea78a9-4754-4f22-bbf7-d41dc2a03a56)\r\n\r\n\r\n## Importing data\r\n\r\nThis part of the code handles the data loading from the specific folder in the user's computer. One needs to change the path at line 24 to be able to charge the data properly.\r\nThe data is retrieved from the train dataset and test dataset in order to provide testing at the end of the training process.\r\nFor the rest of the project, we will be using ```tensorflow``` as the main library for neural network creation.\r\n\r\n```\r\nimport numpy as np\r\nimport tensorflow as tf\r\nimport os\r\nfrom sklearn.utils import shuffle           \r\nimport matplotlib.pyplot as plt             \r\nimport cv2                                               \r\nfrom tqdm import tqdm\r\n\r\nIMAGE_SIZE = (150, 150)\r\n# Chargement des données d'entraînement\r\ndef load_data():\r\n    datasets = ['C:\\\\Users\\\\etern\\\\Documents\\\\PROJET_CNN_JB_1\\\\seg_train\\\\seg_train', 'C:\\\\Users\\\\etern\\\\Documents\\\\PROJET_CNN_JB_1\\\\seg_test\\\\seg_test']\r\n\r\n    output = []\r\n    #\r\n    class_names = ['mountain', 'street', 'glacier', 'buildings', 'sea', 'forest']\r\n    class_names_label = {class_name: i for i, class_name in enumerate(class_names)}\r\n    nb_classes = len(class_names)\r\n\r\n#TRANSFORMATION image matric + label en vector one-hot\r\n    for dataset in datasets:\r\n        images = []\r\n        labels = []\r\n        print(\"Loading {}\".format(dataset))\r\n\r\n        for folder in os.listdir(dataset):\r\n            label = class_names_label[folder]\r\n\r\n            for file in tqdm(os.listdir(os.path.join(dataset, folder))):\r\n                img_path = os.path.join(os.path.join(dataset, folder), file)\r\n                image = cv2.imread(img_path)\r\n                image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)\r\n                image = cv2.resize(image, IMAGE_SIZE)\r\n                images.append(image/255)\r\n                labels.append(label)\r\n\r\n        images = np.array(images, dtype='float32')\r\n        labels = np.array(labels, dtype='int32')\r\n        labels = tf.keras.utils.to_categorical(labels, nb_classes)  # Convert labels to one-hot vectors\r\n\r\n        output.append((images, labels))\r\n\r\n    return output\r\n    \r\n(train_images, train_labels), (test_images, test_labels) = load_data()\r\n```\r\n\r\n## Modeling\r\n\r\nFor the creation of our CNN, we used different layers of convolutions, max pooling and dense layer for class prediction. We inspired ourselves from the VGG-architecture and here is the link from the paper: \r\n\r\nVery Deep Convolutional Networks for Large-Scale Image Recognition: (https://arxiv.org/abs/1409.1556)\r\n\r\nThe most important points from this architecture are:\r\n- The great number of convolution stacks, comprising convolutions layers with a small (3x3) kernel .\r\n- A stride of 1 with padding set to 'same', in order to keep the same resolution between convolution layers.\r\n- Max Pooling layers with a size of (2x2).\r\n\r\nFor compilation of our model, we used the standard *Adam* optimizer, the *categorical cross-entropy* loss function which is great for classification, and the *accuracy* metric for evaluation of our model. \r\n\r\nThe summary of the model is then displayed thanks to the tensorflow method in order to visualize our architecture.\r\nWe have, in total, around half a million parameters in our model.\r\n\r\n```\r\nModel: \"sequential\"\r\n_________________________________________________________________\r\n Layer (type)                Output Shape              Param #   \r\n=================================================================\r\n conv2d (Conv2D)             (None, 150, 150, 32)      896       \r\n                                                                 \r\n conv2d_1 (Conv2D)           (None, 150, 150, 32)      9248      \r\n                                                                 \r\n max_pooling2d (MaxPooling2D  (None, 75, 75, 32)       0         \r\n )                                                               \r\n                                                                 \r\n conv2d_2 (Conv2D)           (None, 75, 75, 64)        18496     \r\n                                                                 \r\n conv2d_3 (Conv2D)           (None, 75, 75, 64)        36928     \r\n                                                                 \r\n max_pooling2d_1 (MaxPooling  (None, 37, 37, 64)       0         \r\n 2D)                                                             \r\n                                                                 \r\n conv2d_4 (Conv2D)           (None, 37, 37, 128)       73856     \r\n                                                                 \r\n conv2d_5 (Conv2D)           (None, 37, 37, 128)       147584    \r\n                                                                 \r\n max_pooling2d_2 (MaxPooling  (None, 18, 18, 128)      0         \r\n 2D)                                                             \r\n                                                                 \r\n conv2d_6 (Conv2D)           (None, 18, 18, 64)        73792     \r\n                                                                 \r\n conv2d_7 (Conv2D)           (None, 18, 18, 64)        36928     \r\n                                                                 \r\n max_pooling2d_3 (MaxPooling  (None, 9, 9, 64)         0         \r\n 2D)                                                             \r\n                                                                 \r\n reshape (Reshape)           (None, 5184)              0         \r\n                                                                 \r\n dense (Dense)               (None, 16)                82960     \r\n                                                                 \r\n dense_1 (Dense)             (None, 6)                 102       \r\n                                                                 \r\n=================================================================\r\nTotal params: 480,790\r\nTrainable params: 480,790\r\nNon-trainable params: 0\r\n_________________________________________________________________\r\n````\r\n\r\n## Results\r\n\r\nAt the end of the training, we achieved around 96% accuracy on the train set, and around 81% accuracy on the test set, which is a good result for the classification task. \r\nThe time needed for total computation is rather small with around 1h for 10 epochs (our computer has 128Go RAM with a strong CPU, and we didn't use GPU acceleration).\r\n\r\n![image](https://github.com/Jean-BaptisteAC/Intel-Dataset-Classification/assets/66775006/5f65ffe4-4eea-412b-9875-2f22d9f6b5e8)\r\n\r\nWhen looking at the confusion matrix below, we can see that there is no particular class imbalance in our predictions. The most errors occur between the classes \"Glacier\" and \"Mountain\", which is expected as a mountain covered in snow is very close to a glacier, and between the classes \"Street\" and \"Building\" due to the similarity of artificial landscapes.\r\n\r\n![image](https://github.com/Jean-BaptisteAC/Intel-Dataset-Classification/assets/66775006/f318bf98-37a3-43f7-9410-cebeab968395)\r\n\r\n## Conclusion\r\n\r\nThe intel dataset is a rather heavy dataset to work on, and needed the implementation of a very deep CNN with around 14 layers in order to yield good results.\r\nOverall, this project was really fun to make because the pictures used are highly detailed and could be pictures from everyone's personal photos, adding to the significance of this classification task.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoenick1%2Fintel-dataset-classification","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoenick1%2Fintel-dataset-classification","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoenick1%2Fintel-dataset-classification/lists"}