{"id":26105337,"url":"https://github.com/arasgungore/car-brand-recognition","last_synced_at":"2026-04-22T13:33:31.990Z","repository":{"id":216218310,"uuid":"740761883","full_name":"arasgungore/car-brand-recognition","owner":"arasgungore","description":"Final project assigned for the Introduction to Image Processing (EE 475) course in the Spring 2023 semester.","archived":false,"fork":false,"pushed_at":"2024-01-09T10:48:53.000Z","size":5010,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-16T21:21:21.307Z","etag":null,"topics":["car-brand-classification","car-brands","car-classification","car-recognition","cnn","cnn-classification","computer-vision","convolutional-neural-network","convolutional-neural-networks","deep-learning","image-classification","image-processing","image-processing-python","image-recognition","residual-networks","residual-neural-network","resnet","resnet-50","stanford-car-dataset","stanford-cars"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arasgungore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2024-01-09T02:26:12.000Z","updated_at":"2025-01-29T21:00:39.000Z","dependencies_parsed_at":"2024-01-15T09:05:05.860Z","dependency_job_id":"542a5df5-1b04-4ee1-b0c2-9ad34eaa0c88","html_url":"https://github.com/arasgungore/car-brand-recognition","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"6a1af4b14d32cfe6a04dec2c0e00024b4a576b60"},"previous_names":["arasgungore/car-brand-recognition"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/arasgungore/car-brand-recognition","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arasgungore%2Fcar-brand-recognition","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arasgungore%2Fcar-brand-recognition/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arasgungore%2Fcar-brand-recognition/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arasgungore%2Fcar-brand-recognition/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arasgungore","download_url":"https://codeload.github.com/arasgungore/car-brand-recognition/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arasgungore%2Fcar-brand-recognition/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32139417,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T13:27:12.868Z","status":"ssl_error","status_checked_at":"2026-04-22T13:26:44.791Z","response_time":58,"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":["car-brand-classification","car-brands","car-classification","car-recognition","cnn","cnn-classification","computer-vision","convolutional-neural-network","convolutional-neural-networks","deep-learning","image-classification","image-processing","image-processing-python","image-recognition","residual-networks","residual-neural-network","resnet","resnet-50","stanford-car-dataset","stanford-cars"],"created_at":"2025-03-09T21:05:31.324Z","updated_at":"2026-04-22T13:33:31.974Z","avatar_url":"https://github.com/arasgungore.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# car-brand-recognition\n\nFinal project titled \"Car Brand Recognition Using ResNet50 Architecture\" assigned for the Introduction to Image Processing (EE 475) course in the Spring 2023 semester.\n\n\n\n## Abstract\n\nCar brand recognition is an important task in\nvarious applications such as automated parking systems, traffic\nmonitoring, and surveillance. In this project, we develop a deep\nlearning model to recognize car brands using the Stanford\nCar Dataset. We employ transfer learning with the ResNet-\narchitecture and fine-tune the model to improve its performance.\nThe dataset consists of images of cars belonging to 196 different\nbrands. We preprocess the images, train the model on the\ncombined training dataset, and evaluate its performance on the\ntest dataset. The results show that our model achieves high\naccuracy and demonstrate the effectiveness of using transfer\nlearning for car brand recognition.\n\nIndex Terms — Car brand recognition, deep learning, transfer\nlearning, ResNet-50, Stanford Car Dataset\n\n\n\n## I. INTRODUCTION\n\nCar brand recognition is the task of identifying the brand\nor make of a car based on its image. It has various practical\napplications, such as automated parking systems, traffic\nmonitoring, and surveillance. With the advancements in deep\nlearning and computer vision, it is now possible to develop\naccurate and robust models for car brand recognition.\n\nIn this project, we focus on car brand recognition using the\nStanford Car Dataset [1]. The dataset contains images of cars\nfrom 196 different brands, making it a challenging task due to\nthe large number of classes and variations in car appearances.\n\nOur approach involves using transfer learning with the\nResNet-50 architecture [3]. We leverage the pre-trained\nweights of ResNet-50, which has been trained on a large-\nscale image classification dataset (ImageNet). By fine-tuning\nthe model on the Stanford Car Dataset, we aim to leverage\nthe knowledge learned from the pre-training to improve the\nperformance on our specific task of car brand recognition.\n\nThe remainder of this paper is organized as follows. Section\nII provides an overview of the Stanford Car Dataset and our\ndata preprocessing steps. Section IV describes the architecture\nof our deep learning model and the training process. Section\nVI presents the evaluation results, including accuracy and\nperformance metrics. Finally, Section VII concludes the paper\nand discusses potential future improvements.\n\n\n\n## II. DATASET\n\nThe Stanford Car Dataset [1] is a large-scale dataset containing\nimages of cars from 196 different brands. The dataset is\ndivided into a training set and a test set, with images captured\nfrom various angles and under different conditions. Each brand\ncategory consists of a variable number of images.\n\nTo prepare the dataset for training, we combined the training\nand test sets into a single directory, referred to as the combined\ndataset directory [2]. This ensures that the model has access\nto all available data during the training process.\n\nWe performed image preprocessing using the ImageData-\nGenerator class from the TensorFlow library. The preprocessing\nsteps include resizing the images to a fixed size of 256x\npixels, applying data augmentation techniques such as rotation,\nzooming, and shifting, and normalizing the pixel values [2].\n\nThe resizing step is necessary to ensure that all input images\nhave a consistent size, which is required by the ResNet-\narchitecture. Data augmentation helps increase the robustness\nof the model by introducing variations in the training data.\nIt allows the model to learn invariant features and generalize\nbetter to unseen images. Normalizing the pixel values to a\nrange of [0, 1] helps in stabilizing the training process and\nimproving convergence.\n\n\n\n## III. PREPROCESSING\n\nIn order to enhance the performance of the model and improve\nits ability to generalize, several preprocessing techniques\nwere applied to the dataset. These techniques include rotation,\nzoom, width/height shift, and normalization for ResNet50.\n\n\n### A. Rotation\n\nEach image in the dataset was randomly rotated by an angle\nwithin the range of -20 to 20 degrees. This rotation helps the\nmodel generalize to images where the car may not be perfectly\nupright. By introducing variations in the orientation of the cars,\nthe model becomes more robust and can better handle different\nviewpoints.\n\n\n### B. Zoom\n\nTo further improve the model’s ability to recognize cars at\ndifferent scales, each image was zoomed in on by up to 10%.\nThis zooming effect allows the model to learn to recognize\ncars even when they occupy a larger or smaller portion of the\nimage than in the training data. By introducing variations in\nthe scale of the cars, the model becomes more adaptable to\ndifferent image resolutions.\n\n\n### C. Width/Height Shift\n\nIn addition to rotation and zoom, each image underwent\nhorizontal and vertical shifts. These shifts were randomly\napplied by a percentage of up to 10% of the image’s width and\nheight, respectively. This technique helps the model learn to\nrecognize cars even when they’re not perfectly centered in the\nframe. By introducing variations in the car’s position within\nthe image, the model becomes more robust to different car\nplacements.\n\n\n### D. Normalization for ResNet\n\nTo prepare the images for training with the ResNet50 model,\na crucial step of normalization was performed. The pixel\nvalues of each image were zero-centered by subtracting the\nmean pixel value of each channel. The mean pixel value was\ncalculated over the whole ImageNet training set. Specifically,\nfor the BGR channels, the channel-wise mean to subtract is\n[103.939, 116.779, 123.68]. This step is essential because it\nmakes the input features (pixel intensities) have zero mean,\nwhich is a common preprocessing step for machine learning\nmodels.\n\nThese preprocessing techniques collectively contribute to\nthe robustness and generalization capabilities of the model,\nenabling it to better handle variations in car orientation, scale,\nposition, and pixel intensities.\n\n\n\n## IV. MODEL ARCHITECTURE\n\nOur deep learning model for car brand recognition is\nbased on transfer learning with the ResNet-50 architecture.\nResNet-50 is a deep convolutional neural network (CNN) with\n50 layers that has achieved state-of-the-art performance on\nvarious image classification tasks [3].\n\n\n### A. Base Model: ResNet-50 Architecture\n\nThe ResNet-50 architecture is a deep convolutional neural\nnetwork (CNN) that has achieved state-of-the-art performance\non various image classification tasks. It was introduced by\nHe et al. in their paper ”Deep Residual Learning for Image\nRecognition” in 2015 [3].\n\nThe key innovation of the ResNet-50 architecture is the\nintroduction of residual connections, also known as skip\nconnections. These connections allow information from earlier\nlayers to bypass subsequent layers and be directly propagated\nto deeper layers. This enables the network to learn residual\nmappings, which are easier to optimize than learning the\noriginal mappings. The residual connections help mitigate the\ndegradation problem encountered in deeper networks, where\nadding more layers leads to decreasing accuracy due to the\ndifficulty of training.\n\nThe ResNet-50 architecture consists of 50 layers, including\nconvolutional layers, pooling layers, and fully connected layers.\nThe architecture can be divided into several stages, each\ncontaining multiple residual blocks.\n\nEach residual block in ResNet-50 has the following structure:\n\n- Convolutional layer: A 1x1 convolutional layer is applied\n    to reduce the number of channels (dimensionality reduction).\n- Convolutional layer: A 3x3 convolutional layer with\n    padding to maintain spatial dimensions.\n- Convolutional layer: A 1x1 convolutional layer to restore\n    the number of channels.\n- Skip connection: The input to the block is added element-\n    wise to the output of the last convolutional layer, forming\n    the residual connection.\n- Activation function: ReLU (Rectified Linear Unit) activation\n    is applied to the output of the skip connection.\n  \nThese residual blocks are repeated multiple times in different\nstages of the network. The number of residual blocks and\nthe number of filters (channels) in each block vary depending\non the stage. The ResNet-50 architecture also includes max\npooling layers and fully connected layers at the end to perform\nclassification.\n\nThe ResNet-50 architecture has been pre-trained on a large-\nscale image classification dataset called ImageNet, which\nconsists of millions of labeled images from thousands of\ncategories. By using the pre-trained weights of ResNet-50 as\nthe initial weights for our car brand recognition model, we can\nleverage the knowledge learned from ImageNet to improve the\nperformance on our specific task.\n\nDuring the training process, we freeze the weights of the\nResNet-50 base model up to a certain layer (typically up to the\nlast pooling layer) to preserve the learned low-level features.\nThis freezing ensures that these lower layers do not undergo\nsignificant changes during training. We then add additional\nlayers on top of the ResNet-50 base model (such as fully\nconnected layers) and train these added layers on our car brand\nrecognition dataset.\n\nBy using transfer learning with the ResNet-50 architecture,\nwe can benefit from both the powerful feature extraction\ncapabilities of the pre-trained model and the ability to adapt\nthe model to our specific task. This combination allows us\nto develop an accurate and robust car brand recognition\nmodel with fewer training data and computational resources\ncompared to training a deep network from scratch.\n\nIn summary, the ResNet-50 architecture is a deep CNN\nthat introduced residual connections to address the degradation\nproblem in deep networks. By leveraging pre-trained weights\nfrom ImageNet and fine-tuning the model on our car brand\nrecognition dataset, we can achieve high accuracy in car brand\nrecognition tasks.\n\n\n### B. Overall Model Architecture\n\nOur model consists of the following layers:\n\n- ResNet-50 base model: The pre-trained ResNet-50 model\n    serves as the feature extractor. We use the weights learned\n    from ImageNet as the initial weights for this model [3].\n- MaxPooling: We apply max pooling with a pool size\n    of 2x2 to reduce the spatial dimensions of the extracted\n    features.\n- Dropout: We apply dropout regularization with a rate\n    of 0.2 to mitigate overfitting. Dropout randomly sets a\n    fraction of the input units to 0 during training, which\n    helps in preventing the model from relying too heavily\n    on specific features.\n- Flatten: We flatten the output from the previous layer to\n    prepare it for the fully connected layers.\n- Fully connected layers: We add two fully connected\n    layers with 512 units and ReLU activation function. The\n    final fully connected layer has 196 units, corresponding to\n    the number of car brand classes in the dataset. We use the\n    softmax activation function to obtain class probabilities.\n  \nDuring the training process, we freeze the weights of the\nResNet-50 base model and only update the weights of the\nadded fully connected layers. This allows us to leverage the\nknowledge learned from pre-training and focus on adapting\nthe model to the specific task of car brand recognition.\n\nWe use the Adam optimizer with a learning rate of 0.\nand the categorical cross-entropy loss function. The model is\ntrained for 10 epochs with a batch size of 16.\n\n\n\n## V. TRAINING AND FINE-TUNING\n\n### A. Training\n\nIn the training phase, we train the car brand recognition\nmodel using a labeled dataset. The dataset is divided into\ntraining, validation, and test sets. The training set is used to\nupdate the model’s parameters through an iterative process. We\nemploy data augmentation techniques to increase the dataset’s\ndiversity and enhance generalization. The model is initialized\nwith pre-trained weights from ImageNet, and the early layers\nare frozen to preserve low-level features. We define a loss\nfunction, typically categorical cross-entropy, and select an\noptimizer algorithm. The training loop involves feeding batches\nof images into the model, computing the loss, performing\nbackpropagation, and updating the model’s parameters using\nthe optimizer. We monitor the model’s performance on the\nvalidation set and adjust hyperparameters accordingly. Finally,\nwe evaluate the trained model on the test set to assess its\nperformance on unseen data.\n\n\n### B. Fine-tuning\n\nFine-tuning is performed on the pre-trained car brand\nrecognition model to adapt it to our specific task. We start by\nunfreezing some of the layers in the model, allowing them\nto be updated during training. This allows the model to learn\ntask-specific features while still benefiting from the pre-trained\nweights. We then repeat the training process using the labeled\ndataset, but with a 10% smaller learning rate 0.00001 to avoid\ndrastic changes to the pre-trained weights. Fine-tuning helps\nthe model to specialize in car brand recognition by leveraging\nthe general knowledge it acquired from ImageNet pre-training\nand adapting it to our specific domain.\n\nFigure 4 and 5 shows the training and validation accuracy\nand loss curves during the training process. Figure 6 and 7\nshows the training and validation accuracy and loss curves\nduring the training process. It demonstrates the model’s learning\nprogress and the extent of overfitting.\n\nBoth the training and fine-tuning stages are crucial in developing\nan accurate and robust car brand recognition model.\nTraining enables the model to learn from a large labeled\ndataset, while fine-tuning tailors the model to our specific\ntask, striking a balance between transfer learning and task\nspecialization.\n\n\n\n## VI. RESULTS\n\nThe performance of our car brand recognition model is\nevaluated using accuracy as the primary metric. Additionally,\nwe calculate precision, recall, and F1 score to assess the\nmodel’s performance for each class.\n\nAfter training the model on the combined dataset, we\nachieve an accuracy of 86.4% on the test dataset. The con-\nfusion matrix provides insights into the model’s performance\nfor each car brand class. Table I presents the precision, recall,\nand F1 score for selected car brand classes.\n\nThe precision measures the model’s ability to correctly\nidentify positive instances for a given class, while recall measures\nthe model’s ability to correctly detect positive instances\nfor a given class. The F1 score is the harmonic mean of\nprecision and recall, providing a single metric to assess overall\nperformance for a class.\n\nOverall, the results indicate that our deep learning model\nachieves high accuracy in car brand recognition, demonstrating\nthe effectiveness of transfer learning with the ResNet-\narchitecture.\n\nFigures 8, 9, and 10 show the precision, recall, and F1 score\nfor each car brand class, respectively.\n\n\n\n## VII. CONCLUSION\n\nIn this project, we developed a deep learning model for\ncar brand recognition using the Stanford Car Dataset. We\nemployed transfer learning with the ResNet-50 architecture\nand fine-tuned the model on the combined dataset. The results\ndemonstrated high accuracy in car brand recognition, indicating\nthe effectiveness of transfer learning for this task.\n\nWe described the data preprocessing steps, including image\nresizing, data augmentation, and normalization. The use of\ndata augmentation helps in increasing the robustness of the\nmodel, and normalization aids in better convergence during\ntraining.\n\nThe model architecture, based on ResNet-50, leverages pre-\ntrained weights learned from ImageNet to extract meaningful\nfeatures from car images. By freezing the base model and\nupdating the weights of the added fully connected layers, we\nfocused on adapting the model to the car brand recognition\ntask.\n\nThe evaluation results showed high accuracy and provided\nperformance metrics such as precision, recall, and F1 score\nfor selected car brand classes. The achieved performance\nindicates the potential of the developed model for real-world\napplications such as traffic monitoring, parking systems, and\nsurveillance.\n\nFuture improvements to the project could include exploring\ndifferent architectures and hyperparameter tuning to further\nenhance the model’s performance. Additionally, collecting\nand incorporating more diverse data could help improve the\nmodel’s ability to generalize to different car brand appearances.\n\nCar brand recognition has numerous potential applications,\nand with further advancements and refinements, the developed\nmodel can contribute to the development of intelligent systems\nin the automotive industry.\n\n\n\n## References\n\n- [1] J. Krause, J. Deng, M. Stark, and L. Fei-Fei, ”Collecting a Large-\nScale Dataset of Fine-Grained Cars,” Computer Science Department,\nStanford University, and Max Planck Institute for Informatics. Available:\nhttps://ai.stanford.edu/jkrause/papers/fgvc13.pdf.\n- [2] N. Benavides and C. Tae, ”Fine Grained Image Classification\nfor Vehicle Makes Models using Convolutional\nNeural Networks,” Stanford University, 2019. Available:\nhttp://cs230.stanford.edu/projectsspring2019/reports/18681590.pdf.\n- [3] K. He, X. Zhang, S. Ren, and J. Sun, ”Deep Residual Learning for\nImage Recognition,”arXiv preprint arXiv:1512.03385(2015). Available:\nhttps://arxiv.org/pdf/1512.03385.pdf.\n\n\n\n## Author\n\n👤 **Aras Güngöre**\n\n* LinkedIn: [@arasgungore](https://www.linkedin.com/in/arasgungore)\n* GitHub: [@arasgungore](https://github.com/arasgungore)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farasgungore%2Fcar-brand-recognition","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farasgungore%2Fcar-brand-recognition","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farasgungore%2Fcar-brand-recognition/lists"}