{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"## Simple Data Augmentation Techniques Using Albumentation","metadata":{}},{"cell_type":"markdown","source":"Even though the dataset size seems large [119 GB] it is mostly because of DICOM images, if those images are stored as PNG, the dataset size would be 3 to 4 GB as it only contains about 6K images. \nThus, data augmentation will play as a game changer for training different model architectures in this competition.\n\n* As part of the article on [data augmentation techniques](https://www.kaggle.com/c/siim-covid19-detection/discussion/242760), this notebook shows different simple augmentation applied to different images.\n\n* Each section can be accessed from the right side by it's specific name.\n\n* Each Augmentation is also marked with it's Albumentation Definition so that one can change it's default parameters and play around with the data.\n\n* After applying the augmentation, one can save the augmented images [Code Present in Augmentation Utility Section] or can integrate these augmentation techniques on the fly with their models.\n\nPlease ask any questions in the comments below.\n\nThank You!!\n","metadata":{}},{"cell_type":"markdown","source":"## INIT","metadata":{}},{"cell_type":"code","source":"!conda install -c conda-forge gdcm -y","metadata":{"execution":{"iopub.status.busy":"2021-08-05T08:44:46.795247Z","iopub.execute_input":"2021-08-05T08:44:46.795636Z","iopub.status.idle":"2021-08-05T08:45:47.762611Z","shell.execute_reply.started":"2021-08-05T08:44:46.795604Z","shell.execute_reply":"2021-08-05T08:45:47.76142Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import numpy as np\nimport pandas as pd\nimport os\nfrom glob import glob\nfrom PIL import Image\nimport cv2\nimport random\nimport math\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as patches\nimport seaborn as sns\nimport json\nimport pydicom\nimport glob\nfrom tqdm.notebook import tqdm\nfrom pydicom.pixel_data_handlers.util import apply_voi_lut\nfrom skimage import exposure\nimport warnings\nfrom fastai.vision.all import *\nfrom fastai.medical.imaging import *\nwarnings.filterwarnings('ignore')","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2021-08-05T08:45:47.783344Z","iopub.execute_input":"2021-08-05T08:45:47.784063Z","iopub.status.idle":"2021-08-05T08:45:47.820589Z","shell.execute_reply.started":"2021-08-05T08:45:47.783993Z","shell.execute_reply":"2021-08-05T08:45:47.819283Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from albumentations import (\n    BboxParams,\n    HorizontalFlip,\n    VerticalFlip,\n    Resize,\n    CenterCrop,\n    RandomCrop,\n    Crop,\n    Compose,\n    Rotate,\n    CropNonEmptyMaskIfExists,\n    RandomSizedBBoxSafeCrop,\n    Blur,\n    ChannelDropout,\n    ChannelShuffle,\n    FancyPCA,\n    GaussNoise,\n    GaussianBlur,\n    GlassBlur,\n    HueSaturationValue,\n    ImageCompression,\n    InvertImg,\n    MedianBlur,\n    MotionBlur,\n    MultiplicativeNoise,\n    Normalize,\n    Posterize,\n    RGBShift,\n    RandomBrightnessContrast,\n    RandomFog,\n    RandomGamma,\n    RandomRain,\n    RandomSnow,\n    RandomSunFlare,\n    Solarize\n)","metadata":{"execution":{"iopub.status.busy":"2021-08-05T08:45:47.822896Z","iopub.execute_input":"2021-08-05T08:45:47.82341Z","iopub.status.idle":"2021-08-05T08:45:47.832748Z","shell.execute_reply.started":"2021-08-05T08:45:47.823308Z","shell.execute_reply":"2021-08-05T08:45:47.831536Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_folder = '../input/siim-covid19-detection/train'\ntest_folder = '../input/siim-covid19-detection/test'\ntrain_image_level = '../input/siim-covid19-detection/train_image_level.csv'\ntrain_study_level = '../input/siim-covid19-detection/train_study_level.csv'\nsample_submission = '../input/siim-covid19-detection/sample_submission.csv'","metadata":{"execution":{"iopub.status.busy":"2021-08-05T08:45:47.834736Z","iopub.execute_input":"2021-08-05T08:45:47.83525Z","iopub.status.idle":"2021-08-05T08:45:47.849085Z","shell.execute_reply.started":"2021-08-05T08:45:47.835148Z","shell.execute_reply":"2021-08-05T08:45:47.847922Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_data = pd.read_csv(train_image_level)","metadata":{"execution":{"iopub.status.busy":"2021-08-05T08:45:47.850914Z","iopub.execute_input":"2021-08-05T08:45:47.851356Z","iopub.status.idle":"2021-08-05T08:45:47.899048Z","shell.execute_reply.started":"2021-08-05T08:45:47.85131Z","shell.execute_reply":"2021-08-05T08:45:47.897931Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_data.describe()","metadata":{"execution":{"iopub.status.busy":"2021-08-05T08:55:44.053546Z","iopub.execute_input":"2021-08-05T08:55:44.05392Z","iopub.status.idle":"2021-08-05T08:55:45.471448Z","shell.execute_reply.started":"2021-08-05T08:55:44.05389Z","shell.execute_reply":"2021-08-05T08:55:45.470373Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## [Reference for Helper Functions](https://www.kaggle.com/tanlikesmath/siim-covid-19-detection-a-simple-eda#A-look-at-the-images)","metadata":{}},{"cell_type":"code","source":"# DICOM to NP.array conversion\ndef dicom2array(path, voi_lut=True, fix_monochrome=True):\n    '''\n    function to convert DICOM images into np.array.\n    :param path: path of the DICOM image.\n    :param VOI LUT: used to transform DICOM data to more simpler data.\n    :param fix_monochrome: used to fix the inversion of X-Ray images.\n    :return: the Grayscale image converted to np.array format from DICOM format. \n    '''\n    dicom = pydicom.read_file(path)\n    # VOI LUT (if available by DICOM device) is used to\n    # transform raw DICOM data to \"human-friendly\" view\n    if voi_lut:\n        data = apply_voi_lut(dicom.pixel_array, dicom)\n    else:\n        data = dicom.pixel_array\n    # depending on this value, X-ray may look inverted - fix that:\n    if fix_monochrome and dicom.PhotometricInterpretation == \"MONOCHROME1\":\n        data = np.amax(data) - data\n    data = data - np.min(data)\n    data = data / np.max(data)\n    data = (data * 255).astype(np.uint8)\n    \n    return data\n\n# Image Path Extraction\ndef image_path(row):\n    '''\n    function to retrieve DICOM image path from the given directory structure.\n    :param row: ith row of a dataframe which would be parsed to get the image's path.\n    :return: image path w.r.t. the given directory.\n    '''\n    study_path = train_folder + '/' + row.StudyInstanceUID\n    for i in get_dicom_files(study_path):\n        if row.id.split('_')[0] == i.stem: return i\n        \n# Image Visualization         \ndef plot_imgs(annotations, cols=4, size = 7, thickness = 13, img_resize = (500, 500)):\n    '''\n    function to display image using matplot-lib.\n    :param annotations: List of dictionaries containg the image, bboxes and category_ids to plot.\n    :param cols: number of columns to use for displaying the images.\n    :param size: to determine the size of the total plot w.r.t columns and rows.\n    :param thickness: the thickness of the rectangle border [bboxes] line in px. \n    :param img_resize: the new values for changing the size of the image\n    '''\n    rows = len(annotations)//cols + 1\n    fig = plt.figure(figsize=(cols*size, rows*size))\n    for i, annotation in enumerate(annotations):\n        img = annotation['image']\n        bboxes = annotation['bboxes']\n        for box in bboxes:    \n            '''\n            xmin = xmin\n            ymin = ymin\n            xmax = xmin + w\n            ymax = ymin + h\n            '''\n            xmin = int(box[0])\n            ymin = int(box[1])\n            xmax = int((box[0]+box[2]))\n            ymax = int((box[1]+box[3]))\n            cv2.rectangle(img, (xmin, ymin), (xmax, ymax), [255, 0, 0], thickness)\n        img = cv2.resize(img, img_resize)\n        ax = fig.add_subplot(rows, cols, i+1)\n        plt.imshow(img, cmap = 'gray')\n        ax.title.set_text('Image_'+str(i))\n    plt.show()\n    \n# Data Cleaning\ndef clean_data(data):\n    '''\n    function to format the dataframe in order to make the images and bounding boxes more accessible.\n    :param data: Dataframe containing the original image ids and bounding boxes.\n    :return: Cleaned Up dataframe of the dataset containing.\n    '''\n    # Drop images with no BBoxes\n    data = data.dropna()\n    #Forming all the image paths for easy access.\n    data['image_path'] = data.apply(image_path, axis=1)\n    #Formatting bboxes = [[x, y, w, h], [x, y, w, h]] for data augmentation.\n    data['bboxes'] = data.boxes.apply(lambda x: list(list(x.values()) for x in eval(str(x))))\n    \n    return data\n\n# Annotation Creation\ndef get_annotations(data , no_images=4):\n    '''\n    function to retrieve annotations i.e. list of dictionaries containing the image, bboxes. \n    and category_id for randomly selected 'no_images' images.\n    :param data: Dataframe from which the image path and bboxes are selected.\n    :param no_images: Number of images to be converted into annotations.\n    :return: Annotations as List of Dictionaries containing image as an np.array, list of bboxes, and category_id.\n    '''\n    # These Images will be used for augmentation display. \n    # We randomly select n images and then convert them into np.array format.\n    # We then create an annotation list of dictionaries, as the Albumentation takes values as annotations.\n    image_paths = random.choices(data['image_path'].values, k=no_images)\n    imgs = [dicom2array(path) for path in image_paths]\n    annotations = []\n    #file_list = []\n    for im in range(len(image_paths)):\n        image_path = image_paths[im]\n        # Get all the bound boxes as values to 'bboxes'.\n        bboxes_imgs = data.loc[data['image_path'] == image_path].bboxes.values.tolist()[0]\n        # Get all the images as values to 'image' in RGB 3 channels.\n        image = cv2.cvtColor(imgs[im], cv2.COLOR_GRAY2RGB)\n        annotations.append({'image': image, 'bboxes': bboxes_imgs, 'category_id': [1]*len(bboxes_imgs)})\n        file_name = image_path[len(\"../input/siim-covid19-detection/train/0b462ace8c37/2931e7ab9a29/\"):]\n        #file_list.append(file_name)\n    return annotations, file_name","metadata":{"execution":{"iopub.status.busy":"2021-08-05T08:59:35.698251Z","iopub.execute_input":"2021-08-05T08:59:35.69868Z","iopub.status.idle":"2021-08-05T08:59:35.720339Z","shell.execute_reply.started":"2021-08-05T08:59:35.698644Z","shell.execute_reply":"2021-08-05T08:59:35.71923Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Albumentation Utility Functions","metadata":{}},{"cell_type":"code","source":"def saveImage(path,annotations):\n    # Takes path and annotations and saves the images at that path.\n    img = annotations['image'].copy()\n    cv2.imwrite(path, img)\n\ndef get_albumentation_aug(aug, min_area=0., min_visibility=0.):\n    '''\n    function to get the transform object to apply albumentation transformation and handle all \n    transformations regarding bounding boxes.\n    :param aug: type of transformation object to create.\n    :param min_area: \n    :return: transform object \n    '''\n    return Compose(aug, bbox_params=BboxParams(format='coco', min_area=min_area, min_visibility=min_visibility, label_fields=['category_id']))\n\ndef augmentation(annotations, filter = 'VerticalFlip'):\n    '''\n    function to perform different augmentation on the images and then display them.\n    :param annotations: Image annotation containing image as np.array, bboxes and category id.\n    :param count: Number of Images to be augmentated \n    :param filter: Type of Filter to apply on images (RGB, Contrast, VerticalFlip, etc...)\n    '''\n    # Change default parameters for filters to see different effects on the data.\n    \n    # Save Augmented BBoxes and paths of data\n    augmented_BBoxes = []\n    path = []\n    augmented_annotations = []\n    for i, annotation in enumerate(annotations[0]):\n        # Use this for further saving images\n        filter_title = 'image_'+str(i)+'_'+filter\n        if filter == 'VerticalFlip':\n            aug = get_albumentation_aug([VerticalFlip(p=1)])\n        elif filter == 'HorizontalFlip':\n            aug = get_albumentation_aug([HorizontalFlip(p=1)])\n        elif filter == 'Blur':\n            aug = get_albumentation_aug([Blur(p=1)])\n        elif filter == 'ChannelDropout':\n            aug = get_albumentation_aug([ChannelDropout(p=1)])\n        elif filter == 'GaussianBlur':\n            aug = get_albumentation_aug([GaussianBlur(p=1)])\n        elif filter == 'GlassBlur':\n            aug = get_albumentation_aug([GlassBlur(p=1)])\n        elif filter == 'InvertImg':\n            aug = get_albumentation_aug([InvertImg(p=1)])\n        elif filter == 'RandomFog':\n            aug = get_albumentation_aug([RandomFog(p=1)])\n        elif filter == 'RandomGamma':\n            aug = get_albumentation_aug([RandomGamma(p=1)])\n        elif filter == 'RandomSunFlare':\n            aug = get_albumentation_aug([RandomSunFlare(p=1)])\n        elif filter == 'RGBShift':\n            aug = get_albumentation_aug([RGBShift(p=1)])\n        elif filter == 'RandomSizedBBoxSafeCrop':    \n            aug = get_albumentation_aug([RandomSizedBBoxSafeCrop(height=350,width=350,p=1)])\n        elif filter == 'GaussNoise':\n            aug = get_albumentation_aug([GaussNoise(p=1)])\n        elif filter == 'MultiplicativeNoise':\n            aug = get_albumentation_aug([MultiplicativeNoise(p=1)])\n        elif filter == 'RandomBrightnessContrast':\n            aug = get_albumentation_aug([RandomBrightnessContrast(p=1)])\n        augmented_annotation = aug(**annotation)\n        saveImage(annotations[1]+\"_\"+filter_title + \".png\", augmented_annotation)\n        augmented_BBoxes.append(augmented_annotation['bboxes'])\n        path.append(filter + \".png\")\n        augmented_annotations.append(augmented_annotation)\n    pd.DataFrame({\"bboxes\": augmented_BBoxes, \"path\": path}).to_csv(\"./Augmented_Data_\"+filter+\".csv\")\n    \n    plot_imgs(augmented_annotations)","metadata":{"execution":{"iopub.status.busy":"2021-08-05T08:59:40.101396Z","iopub.execute_input":"2021-08-05T08:59:40.101808Z","iopub.status.idle":"2021-08-05T08:59:40.119492Z","shell.execute_reply.started":"2021-08-05T08:59:40.101768Z","shell.execute_reply":"2021-08-05T08:59:40.118387Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Base Images","metadata":{}},{"cell_type":"code","source":"train_data = clean_data(train_data)\nannotationss = get_annotations(train_data, 8)\nannotations = annotationss[0]\nfile_n = annotationss[1]","metadata":{"execution":{"iopub.status.busy":"2021-08-05T08:55:45.619719Z","iopub.execute_input":"2021-08-05T08:55:45.620269Z","iopub.status.idle":"2021-08-05T08:55:54.45669Z","shell.execute_reply.started":"2021-08-05T08:55:45.620235Z","shell.execute_reply":"2021-08-05T08:55:54.4557Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Visualizing Base Images that will be used for augmentation\nplot_imgs(annotations)","metadata":{"execution":{"iopub.status.busy":"2021-08-05T08:55:54.458196Z","iopub.execute_input":"2021-08-05T08:55:54.458482Z","iopub.status.idle":"2021-08-05T08:55:55.991616Z","shell.execute_reply.started":"2021-08-05T08:55:54.458454Z","shell.execute_reply":"2021-08-05T08:55:55.990263Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## [Vertical Flip](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.VerticalFlip)","metadata":{}},{"cell_type":"code","source":"augmentation(annotations, filter = 'VerticalFlip')","metadata":{"execution":{"iopub.status.busy":"2021-08-05T08:48:17.882397Z","iopub.execute_input":"2021-08-05T08:48:17.882834Z","iopub.status.idle":"2021-08-05T08:48:23.157107Z","shell.execute_reply.started":"2021-08-05T08:48:17.882797Z","shell.execute_reply":"2021-08-05T08:48:23.155953Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## [Horizontal Flip](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.HorizontalFlip)","metadata":{}},{"cell_type":"code","source":"augmentation(annotations, filter = 'HorizontalFlip')","metadata":{"execution":{"iopub.status.busy":"2021-08-05T06:12:57.245566Z","iopub.execute_input":"2021-08-05T06:12:57.246073Z","iopub.status.idle":"2021-08-05T06:13:02.218318Z","shell.execute_reply.started":"2021-08-05T06:12:57.246041Z","shell.execute_reply":"2021-08-05T06:13:02.217298Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## [Blur](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.Blur)","metadata":{}},{"cell_type":"code","source":"augmentation(annotations, filter = 'Blur')","metadata":{"execution":{"iopub.status.busy":"2021-08-05T06:08:42.302003Z","iopub.execute_input":"2021-08-05T06:08:42.30243Z","iopub.status.idle":"2021-08-05T06:08:42.374673Z","shell.execute_reply.started":"2021-08-05T06:08:42.302392Z","shell.execute_reply":"2021-08-05T06:08:42.372773Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## [GlassBlur](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.GlassBlur)","metadata":{}},{"cell_type":"code","source":"augmentation(annotations, filter = 'GlassBlur')","metadata":{"execution":{"iopub.status.busy":"2021-08-05T06:08:43.075191Z","iopub.execute_input":"2021-08-05T06:08:43.075585Z","iopub.status.idle":"2021-08-05T06:08:46.716818Z","shell.execute_reply.started":"2021-08-05T06:08:43.075551Z","shell.execute_reply":"2021-08-05T06:08:46.715329Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## [GaussianBlur](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.GaussianBlur)","metadata":{}},{"cell_type":"code","source":"augmentation(annotations, filter = 'GaussianBlur')","metadata":{"execution":{"iopub.status.busy":"2021-08-05T06:08:46.717791Z","iopub.status.idle":"2021-08-05T06:08:46.718221Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## [InvertImg](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.InvertImg)","metadata":{}},{"cell_type":"code","source":"augmentation(annotations, filter = 'InvertImg')","metadata":{"execution":{"iopub.status.busy":"2021-08-05T06:06:26.883786Z","iopub.status.idle":"2021-08-05T06:06:26.884448Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## [RandomFog](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.RandomFog)","metadata":{}},{"cell_type":"code","source":"augmentation(annotations, filter = 'RandomFog')","metadata":{"execution":{"iopub.status.busy":"2021-08-05T06:06:26.885678Z","iopub.status.idle":"2021-08-05T06:06:26.886332Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## [RandomGamma](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.RandomGamma)","metadata":{}},{"cell_type":"code","source":"augmentation(annotations, filter = 'RandomGamma')","metadata":{"execution":{"iopub.status.busy":"2021-08-05T06:06:26.887538Z","iopub.status.idle":"2021-08-05T06:06:26.888179Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## [ChannelDropout](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.ChannelDropout)","metadata":{}},{"cell_type":"code","source":"augmentation(annotations, filter = 'ChannelDropout')","metadata":{"execution":{"iopub.status.busy":"2021-08-05T06:06:26.889301Z","iopub.status.idle":"2021-08-05T06:06:26.889929Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## [RGBShift](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.RGBShift)","metadata":{}},{"cell_type":"code","source":"augmentation(annotations, filter = 'RGBShift')","metadata":{"execution":{"iopub.status.busy":"2021-08-05T06:06:26.891081Z","iopub.status.idle":"2021-08-05T06:06:26.891773Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## [RandomSizedBBoxSafeCrop](https://albumentations.ai/docs/api_reference/augmentations/crops/transforms/#albumentations.augmentations.crops.transforms.RandomSizedBBoxSafeCrop)","metadata":{}},{"cell_type":"code","source":"augmentation(annotations, filter = 'RandomSizedBBoxSafeCrop')","metadata":{"execution":{"iopub.status.busy":"2021-08-05T06:06:26.89322Z","iopub.status.idle":"2021-08-05T06:06:26.893956Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## [RandomSunFlare](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.RandomSunFlare)","metadata":{}},{"cell_type":"code","source":"augmentation(annotations, filter = 'RandomSunFlare')","metadata":{"execution":{"iopub.status.busy":"2021-08-05T06:06:26.895197Z","iopub.status.idle":"2021-08-05T06:06:26.896231Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## [GaussianNoise](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.GaussNoise)","metadata":{}},{"cell_type":"code","source":"augmentation(annotations, filter = 'GaussNoise')","metadata":{"execution":{"iopub.status.busy":"2021-08-05T06:06:26.897589Z","iopub.status.idle":"2021-08-05T06:06:26.897998Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## End Note","metadata":{}},{"cell_type":"markdown","source":"* There are several other [augmentation techniques](https://albumentations.ai/docs/) as well as these techniques can be combined with each other and passed to a model for training. \n\n* Furthermore, one can also use [AutoAlbument](https://albumentations.ai/docs/autoalbument/) which learns image augmentation policies from image itself using Faster AutoAugment Algorithm. This allows us to automatically select the best augmentation techniques for the given task.\n\nPlease ask any questions in the comments below.\n\nThank You!!","metadata":{}},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}