私の連絡先情報
郵便メール:
2024-07-12
한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina
1. データの強化
1. 既存のデータ セットを追加して、さまざまな背景ノイズを追加したり、画像の色や形状を変更したりするなど、多様性を高めます。
2. 強化されたデータはオンラインで生成されます
3. 強化タイプ:
(1) 反転
(2) 切断
(3) 色
(4) シャープにしてスポットを追加する
2. まとめ
1. データ拡張では、データを変形することで多様性を獲得し、それによってモデルをより一般化可能にします。
2. 一般的な画像補正には、反転、カット、変色などがあります。
3. データセットを変更するだけです
4. 予測プロセス中に正確な結果を得るために、通常はトレーニング サンプルに対して画像拡張のみを実行し、予測プロセス中にランダム操作による画像拡張を使用しません。
5. 深層学習フレームワークは、同時に適用できるさまざまな画像拡張手法を提供します。
3. コード
1.増強方法aug
def apply(img, aug, num_rows=2, num_cols=4, scale=1.5): Y = [aug(img) for _ in range(num_rows * num_cols)] d2l.show_images(Y, num_rows, num_cols, scale=scale)
2. フリップ
apply(img, torchvision.transforms.RandomHorizontalFlip()) apply(img, torchvision.transforms.RandomVerticalFlip())
3. 切断
#面积为原始面积10%到100%的区域,宽高比从0.5~2之间随机取值 shape_aug = torchvision.transforms.RandomResizedCrop( (200, 200), scale=(0.1, 1), ratio=(0.5, 2)) apply(img, shape_aug)
4.明るさ
apply(img, torchvision.transforms.ColorJitter( brightness=0.5, contrast=0, saturation=0, hue=0))
5. 色調
apply(img, torchvision.transforms.ColorJitter( brightness=0, contrast=0, saturation=0, hue=0.5))
輝度(brightness
)、 対比 (contrast
)、飽和(saturation
) と色相 (hue
)
6.ミックス
augs = torchvision.transforms.Compose([ torchvision.transforms.RandomHorizontalFlip(), color_aug, shape_aug]) apply(img, augs)