# PLSC: PaddlePaddle Large Scale Classfication Package
# PLSC: PaddlePaddle Large Scale Classification Package
## Introduction
## Introduction
The last layer of deep neural networks for multi-class classfication tasks is often a combined layer of fully-connected function and softmax function, after which the corss-entropy function is used to compute the final loss. As the size of parameters for the fully-connected layer at the end of a nueral network increasing lineary with the increase in number of classes, the training of a neural network faces the following challenges when the task has a large number of classes to classify:
The fully-connected layer is usually used as the last layer of deep neural networks for multi-class classification tasks. As the memory occupied by parameters of the fully-connected layer increasing linearly with the increase in number of classes, the training of those kind of neural networks face the following challenges when tasks have a large number of classes:
* GPU memory exhausive:
* GPU memory limitation
* Heavy communication overhead: For data parallel training, gradients must be exchanged among GPUs,
**P**addlePaddle **L**arge **S**cale **C**lassification (PLSC) package is an end-to-end solution for large scale classification tasks based on [PaddlePaddle](https://github.com/PaddlePaddle/Paddle), which provides a total solution from model training to deployment for users.
* Support large scale classification problems:PLSC can support 2.5x more classes using 8 V100 GPU cards, and the maximum number of classes supported increases as the increase in number of GPU cards used;
* High training speed:With one million classes, the training speed is 2,122 images/sec using ResNet50 model and 8 V100 GPU cards are used, and PLSC supports mixed precision training and distributed training;
* Support the adjustment of number of GPU cards used for training:A training starts from checkpoints can use a different number of GPU cards from that used for the last training;
* Builtin pre-precessing tools for base64 format images:PLSC provides builtin pre-processing tools for images in base64 format,including global shuffle, dataset spliting, and so on;
| [resnet50_distarcface_ms1m_arcface](https://plsc.bj.bcebos.com/pretrained_model/resnet50_distarcface_ms1mv2.tar.gz) | This model is trained with ResNet50 and MS1M-ArcFace and the loss type used is dist_arcface. The validation accuracy on lfw dataset is 0.99817. |
### 训练性能
### Performance
| 模型 | 训练集 | lfw | agendb_30 | cfp_ff | cfp_fp |
| Model | Training Dataset | lfw | agendb_30 | cfp_ff | cfp_fp |
备注:上述模型训练使用的loss_type为'dist_arcface'。更多关于ArcFace的内容请参考[ArcFace: Additive Angular Margin Loss for Deep Face Recognition](https://arxiv.org/abs/1801.07698)
Note:The loss_type used is 'dist_arcface'. For more information about ArcFace please refer to [ArcFace: Additive Angular Margin Loss for Deep Face Recognition](https://arxiv.org/abs/1801.07698).
备注:上述模型训练使用的loss_type为'dist_arcface'。更多关于ArcFace的内容请参考[ArcFace: Additive Angular Margin Loss for Deep Face Recognition](https://arxiv.org/abs/1801.07698)
备注:上述模型训练使用的loss_type为'dist_arcface'。更多关于ArcFace的内容请参考[ArcFace: Additive Angular Margin Loss for Deep Face Recognition](https://arxiv.org/abs/1801.07698)