图像分类:来自Kaggle中13个项目的Tips和Tricks
共 5799字,需浏览 12分钟
·
2021-06-28 10:28
导读
这些比赛是:
Intel Image Classification: https://www.kaggle.com/puneet6060/intel-image-classification Recursion Cellular Image Classification: https://www.kaggle.com/c/recursion-cellular-image-classification SIIM-ISIC Melanoma Classification: https://www.kaggle.com/c/siim-isic-melanoma-classification APTOS 2019 Blindness Detection: https://www.kaggle.com/c/aptos2019-blindness-detection/notebooks Diabetic Retinopathy Detection: https://www.kaggle.com/c/diabetic-retinopathy-detection ML Project — Image Classification: https://www.kaggle.com/c/image-classification-fashion-mnist/notebooks Cdiscount’s Image Classification Challenge: https://www.kaggle.com/c/cdiscount-image-classification-challenge/notebooks
Plant seedlings classifications: https://www.kaggle.com/c/plant-seedlings-classification/notebooks
Aesthetic Visual Analysis: https://www.kaggle.com/c/aesthetic-visual-analysis/notebooks
我们会讨论调试深度学习解决方案的三个主要方面:
数据
模型
损失函数
还有很多例子项目(和参考资料)供你参考。
数据
图像预处理 + EDA
Visualisation: https://www.kaggle.com/allunia/protein-atlas-exploration-and-baseline#Building-a-baseline-model-
Dealing with Class imbalance: https://www.kaggle.com/rohandeysarkar/ultimate-image-classification-guide-2020 Fill missing values (labels, features and, etc.): https://www.kaggle.com/datafan07/analysis-of-melanoma-metadata-and-effnet-ensemble Normalisation : https://www.kaggle.com/vincee/intel-image-classification-cnn-keras Pre-processing: https://www.kaggle.com/ratthachat/aptos-eye-preprocessing-in-diabetic-retinopathy#3.A-Important-Update-on-Color-Version-of-Cropping-&-Ben's-Preprocessing
数据增强
Horizontal Flip: https://www.kaggle.com/datafan07/analysis-of-melanoma-metadata-and-effnet-ensemble
Random Rotate and Random Dihedral: https://www.kaggle.com/iafoss/pretrained-resnet34-with-rgby-0-460-public-lb Hue, Saturation, Contrast, Brightness, Crop: https://www.kaggle.com/cdeotte/triple-stratified-kfold-with-tfrecords Colour jitter: https://www.kaggle.com/nroman/melanoma-pytorch-starter-efficientnet
模型
开发一个基线
用Jeremy Howard的名言:“你应该能够在15分钟内使用50%或更少的数据集快速测试你是否正在朝着一个有希望的方向前进,如果没有,你必须重新考虑一切。”
开发一个足够大可以过拟合的模型
添加更多层
使用更好的结构
更完善的训练流程
结构
Residual Networks
Wide Residual Networks
Inception
EfficientNet
Swish activation
Residual Attention Network
训练过程
Mixed-Precision Training
Large Batch-Size Training
Cross-Validation Set
Weight Initialization
Self-Supervised Training (Knowledge Distillation)
Learning Rate Scheduler
Learning Rate Warmup
Early Stopping
Differential Learning Rates
Ensemble
Transfer Learning
Fine-Tuning
超参数调试
正则化
Adding Dropout: https://www.kaggle.com/allunia/protein-atlas-exploration-and-baseline Adding or changing the position of Batch Norm: https://www.kaggle.com/allunia/protein-atlas-exploration-and-baseline Data augmentation: https://www.kaggle.com/cdeotte/triple-stratified-kfold-with-tfrecords Mixup: https://arxiv.org/abs/1710.09412 Weight regularization: https://www.kaggle.com/allunia/protein-atlas-exploration-and-baseline Gradient clipping: https://www.kaggle.com/allunia/protein-atlas-exploration-and-baseline
损失函数
这里是一些最流行的损失函数,与项目实例,你会发现一些技巧,以提高你的模型的能力:
Label smoothing Focal loss SparseMax loss and Weighted cross-entropy BCE loss, BCE with logits loss and Categorical cross-entropy loss Additive Angular Margin Loss for Deep Face Recognition
评估 + 错误分析
在这里,我们做消融研究,并分析我们的实验结果。我们确定了我们的模型的弱点和长处,并确定了未来需要改进的地方。在这个阶段,你可以使用以下技术,并在链接的示例中查看它们是如何实现的:
Tracking metrics and Confusion matrix: https://www.kaggle.com/vincee/intel-image-classification-cnn-keras
Grad CAM: https://arxiv.org/pdf/1610.02391v1.pdf Test Time Augmentation (TTA): https://www.kaggle.com/iafoss/pretrained-resnet34-with-rgby-0-460-public-lb
最后
有许多方法来调整你的模型,并且新的想法总是会出现。深度学习是一个快速发展的领域,没有什么灵丹妙药。我们必须做很多实验,足够的试验和错误会带来突破。
—版权声明—
来源丨AI公园 作者 | Prince Canuma 编译 | ronghuaiyang
仅用于学术分享,版权属于原作者。
若有侵权,请联系微信号:yiyang-sy 删除或修改!