All Projects → tqtg → zalo-landmark

tqtg / zalo-landmark

Licence: other
Zalo AI Challenge - Landmark Identification

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to zalo-landmark

Idenprof
IdenProf dataset is a collection of images of identifiable professionals. It is been collected to enable the development of AI systems that can serve by identifying people and the nature of their job by simply looking at an image, just like humans can do.
Stars: ✭ 149 (+282.05%)
Mutual labels:  image-classification, image-recognition
TensorFlow-Binary-Image-Classification-using-CNN-s
Binary Image Classification in TensorFlow
Stars: ✭ 26 (-33.33%)
Mutual labels:  image-classification, image-recognition
Iresnet
Improved Residual Networks (https://arxiv.org/pdf/2004.04989.pdf)
Stars: ✭ 163 (+317.95%)
Mutual labels:  image-classification, image-recognition
Rostensorflow
TensorFlow ImageNet demo using ROS sensor_msgs/Image
Stars: ✭ 59 (+51.28%)
Mutual labels:  image-classification, image-recognition
jpetstore-kubernetes
Modernize and Extend: JPetStore on IBM Cloud Kubernetes Service
Stars: ✭ 21 (-46.15%)
Mutual labels:  image-classification, image-recognition
Image classifier
CNN image classifier implemented in Keras Notebook 🖼️.
Stars: ✭ 139 (+256.41%)
Mutual labels:  image-classification, image-recognition
Transfer Learning Suite
Transfer Learning Suite in Keras. Perform transfer learning using any built-in Keras image classification model easily!
Stars: ✭ 212 (+443.59%)
Mutual labels:  image-classification, image-recognition
Dmsmsgrcg
A photo OCR project aims to output DMS messages contained in sign structure images.
Stars: ✭ 18 (-53.85%)
Mutual labels:  image-classification, image-recognition
TensorFlow-Multiclass-Image-Classification-using-CNN-s
Balanced Multiclass Image Classification with TensorFlow on Python.
Stars: ✭ 57 (+46.15%)
Mutual labels:  image-classification, image-recognition
Image-Classification
Pre-trained VGG-Net Model for image classification using tensorflow
Stars: ✭ 29 (-25.64%)
Mutual labels:  image-classification, image-recognition
BottleneckTransformers
Bottleneck Transformers for Visual Recognition
Stars: ✭ 231 (+492.31%)
Mutual labels:  image-classification, image-recognition
UnityProminentColor
Tool to gather main colors of an image using Unity.
Stars: ✭ 40 (+2.56%)
Mutual labels:  image-classification, image-recognition
Channel Pruning
Channel Pruning for Accelerating Very Deep Neural Networks (ICCV'17)
Stars: ✭ 979 (+2410.26%)
Mutual labels:  image-classification, image-recognition
Nsfw Resnet
🔥🔥NSFW implement in pytorch(色情图&性感图识别,本程序经过了线上大数据集测试,性能优异效果良好)🔥🔥
Stars: ✭ 142 (+264.1%)
Mutual labels:  image-classification, image-recognition
Deep learning projects
Stars: ✭ 28 (-28.21%)
Mutual labels:  image-classification, image-recognition
Vit
An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
Stars: ✭ 176 (+351.28%)
Mutual labels:  image-classification, image-recognition
Artificio
Deep Learning Computer Vision Algorithms for Real-World Use
Stars: ✭ 326 (+735.9%)
Mutual labels:  image-classification, image-recognition
Basic cnns tensorflow2
A tensorflow2 implementation of some basic CNNs(MobileNetV1/V2/V3, EfficientNet, ResNeXt, InceptionV4, InceptionResNetV1/V2, SENet, SqueezeNet, DenseNet, ShuffleNetV2, ResNet).
Stars: ✭ 374 (+858.97%)
Mutual labels:  image-classification, image-recognition
tensorflow-image-recognition-chrome-extension
Chrome browser extension for using TensorFlow image recognition on web pages
Stars: ✭ 88 (+125.64%)
Mutual labels:  image-classification, image-recognition
Paper-Notes
Paper notes in deep learning/machine learning and computer vision
Stars: ✭ 37 (-5.13%)
Mutual labels:  image-classification, image-recognition

Zalo AI Challenge - Landmark Identification

This code is ranked top-1 Final Leaderboard of the challenge.

Required Packages

$ pip3 install -r requirements.txt

Data

Data Preparation

Let's assume that the provided dataset is already in data folder:

  • data/train_val2018.zip
  • data/train_val2018.json

After extracting train_val2018.zip, we will have TrainVal folder containing all images inside data.

We run the code to prepare data for training:

  • train/validation with the ratio of 92%/8%.
  • splitting it into 10 folds in the cross-validation manner.
$ python3 src/data_prepare.py

After finished, all needed files are in data folder and ready for training. The class_dis.txt file contains distribution over all classes, which is also created inside data and later used for weighted loss in training.

Data Augmentation

  • Random rotation
  • Central cropping
  • Color distortion
  • Aspect distortion
  • Random cropping
  • Random horizontal flipping

Training

Model Architectures

  • Inception-ResNet
  • ResNet-152

Other architectures are also available: ResNet-50, ResNet-101, ResNet-200, Inception-V4, DenseNet-161, NASNet, PNASNet with pre-trained weights can be downloaded from Slim package.

Model Training

First, we need to download pre-trained weights of Inception-ResNet and ResNet-152 from Slim.

$ chmod 700 download.sh
$ ./download.sh

All downloaded weights will be stored in pretrained folder.

To trained a new model with Inception-ResNet architecture:

$ python3 src/train.py --net "inception_resnet_v2" --checkpoint_exclude_scopes "InceptionResnetV2/Logits,InceptionResnetV2/AuxLogits" --loss_weighted "linear"

With ResNet-152:

$ python3 src/train.py --net "resnet_v2_152" --checkpoint_exclude_scopes "resnet_v2_152/logits" --loss_weighted "linear"
optional arguments:
  -h, --help                show this help message and exit
  --data_dir                DATA_DIR
                              Path to data folder (default: data)
  --log_dir                 LOG_DIR
                              Path to data folder (default: log)
  --checkpoint_dir          CHECKPOINT_DIR
                              Path to checkpoint folder (default: checkpoints)
  --num_checkpoints         NUM_CHECKPOINTS
                              Number of checkpoints to store (default: 1)
  --num_epochs              NUM_EPOCHS
                              Number of training epochs (default: 50)        
  --num_threads             NUM_THREADS
                              Number of threads for data processing (default: 8)
  --batch_size              BATCH_SIZE
                              Batch Size (default: 16)
  --image_size              IMAGE_SIZE
                              Size of images after pre-processed (default: 299)
  --net                     NETWORK ARCHITECTURE
                              Network architecture to use (default: inception_resnet_v2)
  --learning_rate           LEARNING_RATE
                              Starting learning rate (default: 0.01)       
  --train_mode              TRAINING_MODE
                              Training mode (default: 2)
  --fold                    DATA_FOLD
                              Fold of data to train from (default: -1)   
  --optimizer               OPTIMIZER
                              Weight update rule (default: momentum)    
  --lr_decay_rule           LR_DECAY_RULE
                              Decay rule for learning rate (default: step)    
  --loss_weighted           LOSS_WEIGHTED
                              Cross entropy weighted loss mechanism (default: linear)
  --pretrained_dir          PRETRAINED_DIR
                              Path to pre-trained weights (default: pretrained)
  --trainable_scopes        TRAINABLE_SCOPES
                              Scopes of variables to be fixed (default: None)
  --ignore_mixing_vars      IGNORE_MIXING_VARS
                              When restoring a checkpoint would ignore missing variables (default: False)
  --allow_soft_placement    ALLOW_SOFT_PLACEMENT
                              Allow device soft device placement (default: True)

After training, all models will be stored in checkpoints folder.

Final Ensemble Models

  • 2 Inception-ResNet and 1 ResNet-152 models trained on 92% and tested on 8% of data.
  • 10 Inception-ResNet models trained on 10 folds of cross-validation.

Prediction

Run predict.sh script with an argument which is the path to the data folder containing images. For example, all test images are in data/test:

$ chmod 700 predict.sh
$ ./predict.sh data/test

The final predictions will be in submission.csv file right under current directory.

The code are partially borrowed from Slim package including model architectures and data augmentation with some modifications.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].