{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.12","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":61446,"databundleVersionId":6962461,"sourceType":"competition"}],"dockerImageVersionId":30587,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"# Librares","metadata":{}},{"cell_type":"code","source":"import numpy as np\nimport pandas as pd\n\nimport matplotlib.pyplot as plt\nfrom matplotlib.image import imread \nfrom matplotlib import animation, rc\nimport seaborn as sns\n\nimport cv2\nfrom colorama import Fore, Style, init\nfrom PIL import Image\nfrom os import listdir\nfrom tqdm.auto import tqdm\nfrom pathlib import Path\n\npd.options.mode.chained_assignment = None\n\n\n%matplotlib inline\nrc('animation', html='jshtml')","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:14:30.549465Z","iopub.execute_input":"2023-11-30T15:14:30.549932Z","iopub.status.idle":"2023-11-30T15:14:30.558050Z","shell.execute_reply.started":"2023-11-30T15:14:30.549905Z","shell.execute_reply":"2023-11-30T15:14:30.556735Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"BASE_DIR = Path('/kaggle/input/blood-vessel-segmentation')","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:14:30.719557Z","iopub.execute_input":"2023-11-30T15:14:30.719875Z","iopub.status.idle":"2023-11-30T15:14:30.724551Z","shell.execute_reply.started":"2023-11-30T15:14:30.719849Z","shell.execute_reply":"2023-11-30T15:14:30.723567Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Functions","metadata":{}},{"cell_type":"code","source":"def show_train_count_data(train_df):\n    df_mask_empty =  train_df.groupby('data_set')['mask_is_empty'].value_counts(normalize=True) * 100\n    df_mask_empty = df_mask_empty.rename('percent').reset_index()\n    df_mask_empty['mask_is_empty'] = df_mask_empty['mask_is_empty'].map({False : \"Not empty\", True : \"Empty\"})\n    fig, ax = plt.subplots(nrows=2, ncols=2, figsize=(13,10))\n\n\n    sns.barplot(y=\"kidney\", x=\"type\",  \n            data= pd.DataFrame(train_df[['data_set','kidney','type','rle']].groupby(['kidney'])['type'].count()).reset_index(), \n          ax = ax[0,0]);\n    for patch in ax[0,0].patches:\n    # Variables\n        height = patch.get_height() \n        width = patch.get_width()\n        percent = 100*width/len(train_df)\n        y_pos = patch.get_y()\n        text = f'{int(width)} ({percent:.1f}%)'\n        ax[0,0].text(width,  y_pos + height/2, text)\n    ax[0,0].set_xlabel('count')\n    ax[0,0].set_ylabel('')\n    ax[0,0].set_title(\"Аmount of data in folders kidney\")\n\n\n    pd.DataFrame(train_df[['data_set', 'kidney','type','rle']]\\\n             .groupby(['kidney'])['type'].count()).reset_index().set_index('kidney')\\\n            .plot.pie(y='type', autopct='%.1f%%', legend=False, ax = ax[0,1])\n    ax[0,1].set_title(\"Аmount of data in folders kidney\")\n    plt.ylabel('');\n    plt.xlabel('');\n\n\n    sns.countplot(data = train_df, y = 'data_set',  palette=\"deep\", ax = ax[1,0])\n    for patch in ax[1,0].patches:\n    # Variables\n        height = patch.get_height()\n        width = patch.get_width()\n        percent = 100*width/len(train_df)\n        y_pos = patch.get_y()\n        text = f'{int(width)} ({percent:.1f}%)'\n        ax[1,0].text(width ,  y_pos + height/2, text)\n    ax[1,0].set_xlabel('count')\n    ax[1,0].set_ylabel('')\n    ax[1,0].set_title(\"Аmount of data in each folder\")\n\n\n    sns.barplot(data = df_mask_empty , x = 'percent',\n              y = 'data_set',  hue = 'mask_is_empty', palette=\"deep\" , ax = ax[1,1]);\n    ax[1,1].legend(bbox_to_anchor=(1.02, 0.3), loc='center left')\n    ax[1,1].set_ylabel('')\n    ax[1,1].set_title(\"Percentage of empty images in each folder\")\n\n    for patch in ax[1,1].patches:\n        height = patch.get_height() \n        y_loc = patch.get_y()\n        width = patch.get_width()\n        if width == 0:\n            continue\n\n        ax[1,1].text(width, y_loc + height/2, f'{width:.1f}%')\n    plt.subplots_adjust(wspace = 0.6, hspace = 0.3);\n    plt.show();","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:14:31.026229Z","iopub.execute_input":"2023-11-30T15:14:31.026609Z","iopub.status.idle":"2023-11-30T15:14:31.041185Z","shell.execute_reply.started":"2023-11-30T15:14:31.026582Z","shell.execute_reply":"2023-11-30T15:14:31.039569Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def rle_decode(mask_rle, shape):\n    '''\n    mask_rle: run-length as string formated (start length)\n    shape: (height,width) of array to return \n    Returns numpy array, 1 - mask, 0 - background\n\n    '''\n    s = mask_rle.split()\n    starts, lengths = [np.asarray(x, dtype=int) for x in (s[0:][::2], s[1:][::2])]\n    starts -= 1\n    ends = starts + lengths\n    img = np.zeros(shape[0]*shape[1], dtype=np.uint8)\n    for lo, hi in zip(starts, ends):\n        img[lo:hi] = 1\n    return img.reshape(shape)","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:14:31.169037Z","iopub.execute_input":"2023-11-30T15:14:31.169377Z","iopub.status.idle":"2023-11-30T15:14:31.176068Z","shell.execute_reply.started":"2023-11-30T15:14:31.169338Z","shell.execute_reply":"2023-11-30T15:14:31.174943Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def mask_pixels_ratio(rle, size):\n    img = rle_decode(rle , size)\n    total = size[0] * size[1]\n    return round((img == 1).sum() / total * 100,4)","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:14:31.322584Z","iopub.execute_input":"2023-11-30T15:14:31.322952Z","iopub.status.idle":"2023-11-30T15:14:31.328953Z","shell.execute_reply.started":"2023-11-30T15:14:31.322923Z","shell.execute_reply":"2023-11-30T15:14:31.327573Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def subset_df(train_df, base_dir, im_dir='kidney_1_dense',lb_dir='kidney_1_dense'):\n\n    \n    micro_df = train_df[train_df['id'].str.startswith(lb_dir)]\n    \n    micro_df['images'] = micro_df['img_name'].map(lambda x: base_dir / im_dir / 'images' / f'{x}.tif')\n    micro_df['labels'] = micro_df['img_name'].map(lambda x: base_dir / lb_dir / 'labels' / f'{x}.tif')\n    micro_df['images_width'] = micro_df['images'].map(lambda x: Image.open(x).size[0])\n    micro_df['images_height'] = micro_df['images'].map(lambda x: Image.open(x).size[1])\n\n    micro_df['labels_width'] = micro_df['labels'].map(lambda x: Image.open(x).size[0])\n    micro_df['labels_height'] = micro_df['labels'].map(lambda x: Image.open(x).size[1])\n\n    return micro_df","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:14:31.493344Z","iopub.execute_input":"2023-11-30T15:14:31.494023Z","iopub.status.idle":"2023-11-30T15:14:31.502366Z","shell.execute_reply.started":"2023-11-30T15:14:31.493986Z","shell.execute_reply":"2023-11-30T15:14:31.500717Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def animate(mini_df, id_range , figsize):\n    \n    dataset = str(mini_df['data_set'][0])\n    \n    images = []\n    fig, [ax1,ax2] = plt.subplots(nrows=1, ncols=2, figsize =  figsize)\n    ax1.axis('off')\n    ax2.axis('off')\n    #ax3.axis('off')\n    for i in tqdm(id_range):\n\n        data_set_im = mini_df['images'][i].parents[1].name  \n        data_set_lb = mini_df['labels'][i].parents[1].name \n        \n        images_width = mini_df['images_width'][i]\n        images_height = mini_df['images_height'][i]\n        #shape = (images_height, images_width)\n        #mask_rle =  mini_df['rle'][i]\n        #img_rle = rle_decode(mask_rle, shape)\n        #im3 = ax3.imshow(img_rle)\n        \n        image = imread(mini_df['images'][i])\n        label = imread(mini_df['labels'][i])\n        img_name = mini_df['img_name'][i]\n        \n        title_str1 = f\"{data_set_im} image {img_name}.tif slice\"\n        title_str2 = f\"{data_set_lb} label {img_name}.tif slice\"\n        title_str3 = \"RLE Encoded\"\n        title1 = ax1.text(x = 0.5,y = 1.05, s = title_str1, size = 10,  ha = \"center\",transform = ax1.transAxes)\n        title2 = ax2.text(x = 0.5,y = 1.05, s = title_str2, size = 10,  ha = \"center\",transform = ax2.transAxes)\n        #title3 = ax3.text(x = 0.5,y = 1.05, s = title_str3, size = 10,  ha = \"center\",transform = ax3.transAxes)\n        im1 = ax1.imshow(image, animated=True)\n        im2 = ax2.imshow(label, animated=True)\n        if i==0:\n            ax1.imshow(image)\n            ax2.imshow(label)\n            #ax3.imshow(img_rle)\n        images.append([im1,im2, title1, title2])#, im3, title3])\n\n\n    ani = animation.ArtistAnimation(fig, images, interval=500, blit=True,\n                                    repeat_delay=1000)\n    plt.close()\n    return ani","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:14:31.681012Z","iopub.execute_input":"2023-11-30T15:14:31.681435Z","iopub.status.idle":"2023-11-30T15:14:31.690108Z","shell.execute_reply.started":"2023-11-30T15:14:31.681375Z","shell.execute_reply":"2023-11-30T15:14:31.689115Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def animate_kidney_3_d(mini_df, id_range , figsize):\n    \n    dataset = str(mini_df['data_set'][0])\n    \n    images = []\n    fig, [ax1,ax2, ax3] = plt.subplots(nrows=1, ncols=3, figsize =  figsize)\n    ax1.axis('off')\n    ax2.axis('off')\n    ax3.axis('off')\n    for i in tqdm(id_range):\n\n        data_set_im = mini_df['images'][i].parents[1].name  \n        data_set_lb = mini_df['labels'][i].parents[1].name\n        data_set_lb_s = mini_df['labels_sparse'][i].parents[1].name \n        \n        images_width = mini_df['images_width'][i]\n        images_height = mini_df['images_height'][i]\n        #shape = (images_height, images_width)\n        #mask_rle =  mini_df['rle'][i]\n        #img_rle = rle_decode(mask_rle, shape)\n        #im3 = ax3.imshow(img_rle)\n        \n        image = imread(mini_df['images'][i])\n        label = imread(mini_df['labels'][i])\n        label_s = imread(mini_df['labels_sparse'][i])\n        img_name = mini_df['img_name'][i]\n        \n        title_str1 = f\"{data_set_im} image {img_name}.tif slice\"\n        title_str2 = f\"{data_set_lb} label {img_name}.tif slice\"\n        title_str3 = f\"{data_set_lb_s} label {img_name}.tif slice\"\n        title1 = ax1.text(x = 0.5,y = 1.05, s = title_str1, size = 10,  ha = \"center\",transform = ax1.transAxes)\n        title2 = ax2.text(x = 0.5,y = 1.05, s = title_str2, size = 10,  ha = \"center\",transform = ax2.transAxes)\n        title3 = ax3.text(x = 0.5,y = 1.05, s = title_str3, size = 10,  ha = \"center\",transform = ax3.transAxes)\n        im1 = ax1.imshow(image, animated=True)\n        im2 = ax2.imshow(label, animated=True)\n        im3 = ax3.imshow(label_s, animated=True)\n        if i==0:\n            ax1.imshow(image)\n            ax2.imshow(label)\n            ax3.imshow(label_s)\n        images.append([im1,im2, title1, title2, im3, title3])\n\n\n    ani = animation.ArtistAnimation(fig, images, interval=500, blit=True,\n                                    repeat_delay=1000)\n    plt.close()\n    return ani","metadata":{"execution":{"iopub.status.busy":"2023-11-30T16:11:03.443722Z","iopub.execute_input":"2023-11-30T16:11:03.444099Z","iopub.status.idle":"2023-11-30T16:11:03.455846Z","shell.execute_reply.started":"2023-11-30T16:11:03.444069Z","shell.execute_reply":"2023-11-30T16:11:03.454717Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Analysis of training data\n","metadata":{}},{"cell_type":"code","source":"train_df = pd.read_csv(BASE_DIR / 'train_rles.csv')","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:14:32.007805Z","iopub.execute_input":"2023-11-30T15:14:32.008428Z","iopub.status.idle":"2023-11-30T15:14:32.979302Z","shell.execute_reply.started":"2023-11-30T15:14:32.008376Z","shell.execute_reply":"2023-11-30T15:14:32.978014Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df.shape[0]","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:14:32.981238Z","iopub.execute_input":"2023-11-30T15:14:32.981548Z","iopub.status.idle":"2023-11-30T15:14:32.993261Z","shell.execute_reply.started":"2023-11-30T15:14:32.981522Z","shell.execute_reply":"2023-11-30T15:14:32.991779Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"There are ***7429*** images in the dataset. Let's do a little preparation of the training data.","metadata":{}},{"cell_type":"code","source":"train_df['data_set'] = train_df['id'].map(lambda x: x[:-5] )\ntrain_df['kidney'] = train_df['id'].map(lambda x: '_'.join(x.split('_')[:2] ))\ntrain_df['type'] = train_df['id'].map(lambda x: x.split('_')[2] if '_'.join(x.split('_')[:2]) != 'kidney_2' else '')\ntrain_df['img_name'] = train_df['id'].map(lambda x: x.split('_')[-1] )\ntrain_df['mask_is_empty'] = train_df['rle'] == '1 0'\n\n","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:14:32.994740Z","iopub.execute_input":"2023-11-30T15:14:32.995028Z","iopub.status.idle":"2023-11-30T15:14:33.031537Z","shell.execute_reply.started":"2023-11-30T15:14:32.994999Z","shell.execute_reply":"2023-11-30T15:14:33.030618Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"show_train_count_data(train_df)   ","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:14:33.034060Z","iopub.execute_input":"2023-11-30T15:14:33.034534Z","iopub.status.idle":"2023-11-30T15:14:33.731777Z","shell.execute_reply.started":"2023-11-30T15:14:33.034496Z","shell.execute_reply":"2023-11-30T15:14:33.730864Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"There are three types of data set: **dense, voi, sparse**: \n- **Sparse and dense segmentation** is *50um* resolution segmentation. \n- **Voi** segmentation is *5.2um* resolution segmentation. It is contained only for **kidney 1** and makes up approximately **19% of all training data**.\n- According to the discussion, https://www.kaggle.com/competitions/blood-vessel-segmentation/discussion/454353, **sparse segmentation** is **manual** segmentation by several independent specialists. **Sparse segmentation is not contained in kidney_1**.\n- **All data from the kidney 2** and **2/3 data of the  kidney 3** are segmented **sparsely**. This is **43.7% of all training data**.\n- **49%** of training data is **kidney_1**. **Densely** segmented data **37.4%** of all training datа.\n\n**Empty** pictures:\n- **Not** contained only in **kidney 1 voi**.\n- In **kidney 1 only 2.4%** of empty pictures.\n- The largest percentage (**13%**) of empty pictures in **kidney 3 sparse**.","metadata":{}},{"cell_type":"markdown","source":"**Let's look at pictures in each folder**","metadata":{}},{"cell_type":"markdown","source":" # Kidney_1_dense","metadata":{}},{"cell_type":"code","source":"kidney_1 = subset_df(train_df, base_dir = BASE_DIR / 'train', im_dir='kidney_1_dense',lb_dir='kidney_1_dense')","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:14:33.732991Z","iopub.execute_input":"2023-11-30T15:14:33.733267Z","iopub.status.idle":"2023-11-30T15:15:45.977372Z","shell.execute_reply.started":"2023-11-30T15:14:33.733239Z","shell.execute_reply":"2023-11-30T15:15:45.976668Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"kidney_1[['images_width', 'images_height', 'labels_width', 'labels_height', 'images_height', ]].apply(['unique'])","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:15:45.979038Z","iopub.execute_input":"2023-11-30T15:15:45.979357Z","iopub.status.idle":"2023-11-30T15:15:46.000039Z","shell.execute_reply.started":"2023-11-30T15:15:45.979328Z","shell.execute_reply":"2023-11-30T15:15:45.998879Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**All pictures are the same size**. Let's take a look at them.","metadata":{}},{"cell_type":"code","source":"animate(kidney_1, range(0, 2279, 23), (9, 13))","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:15:46.001938Z","iopub.execute_input":"2023-11-30T15:15:46.002441Z","iopub.status.idle":"2023-11-30T15:16:25.043447Z","shell.execute_reply.started":"2023-11-30T15:15:46.002413Z","shell.execute_reply":"2023-11-30T15:16:25.042361Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"- The masks of the first pictures look empty. Visually, the first 70 pictures have empty masks. Although actually the first 49.\n- Visually, the last 10 pictures have empty masks. Although actually the first 4.\n- Visually, the size of the segmented area is very small.","metadata":{}},{"cell_type":"markdown","source":"**Consider the length of the RLE encoding.**","metadata":{}},{"cell_type":"code","source":"kidney_1['mask_length'] = kidney_1['rle'].apply(lambda x: len(str(x).split()))","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:16:25.044731Z","iopub.execute_input":"2023-11-30T15:16:25.045466Z","iopub.status.idle":"2023-11-30T15:16:25.166765Z","shell.execute_reply.started":"2023-11-30T15:16:25.045420Z","shell.execute_reply":"2023-11-30T15:16:25.165362Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(15,8))\nsns.displot( x='mask_length',  data=kidney_1, bins = 30);\nplt.title('RLE mask length histogram')\nplt.show();","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:16:25.167988Z","iopub.execute_input":"2023-11-30T15:16:25.168304Z","iopub.status.idle":"2023-11-30T15:16:25.644841Z","shell.execute_reply.started":"2023-11-30T15:16:25.168275Z","shell.execute_reply":"2023-11-30T15:16:25.643948Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"kidney_1['mask_length'].describe()","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:16:25.646201Z","iopub.execute_input":"2023-11-30T15:16:25.646576Z","iopub.status.idle":"2023-11-30T15:16:25.661099Z","shell.execute_reply.started":"2023-11-30T15:16:25.646545Z","shell.execute_reply":"2023-11-30T15:16:25.659456Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"The median is 1740. From the analysis of statistics it follows that most of the pictures have a mask length greater than 1000.","metadata":{}},{"cell_type":"markdown","source":"**Percentage of segment part in mask.**","metadata":{}},{"cell_type":"code","source":"kidney_1['mask_pixels_ratio'] = kidney_1[['rle','labels_width', 'labels_height']].apply(lambda x: mask_pixels_ratio(x['rle'], (x['labels_width'], x['labels_height'])), axis = 1)","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:16:25.662871Z","iopub.execute_input":"2023-11-30T15:16:25.663357Z","iopub.status.idle":"2023-11-30T15:16:28.286423Z","shell.execute_reply.started":"2023-11-30T15:16:25.663314Z","shell.execute_reply":"2023-11-30T15:16:28.285459Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(15,8))\nsns.displot( x='mask_pixels_ratio',  data=kidney_1, bins = 30);\nplt.xlabel('Percentage of units in mask')\nplt.title('Percentage of units in mask')\nplt.show();","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:16:28.289365Z","iopub.execute_input":"2023-11-30T15:16:28.289672Z","iopub.status.idle":"2023-11-30T15:16:28.611990Z","shell.execute_reply.started":"2023-11-30T15:16:28.289649Z","shell.execute_reply":"2023-11-30T15:16:28.610657Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"kidney_1['mask_pixels_ratio'].describe()","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:16:28.613823Z","iopub.execute_input":"2023-11-30T15:16:28.614153Z","iopub.status.idle":"2023-11-30T15:16:28.627930Z","shell.execute_reply.started":"2023-11-30T15:16:28.614125Z","shell.execute_reply":"2023-11-30T15:16:28.626938Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**The segment part occupies an extremely small portion of the image.**","metadata":{}},{"cell_type":"markdown","source":"# Kidney_1_voi","metadata":{}},{"cell_type":"code","source":"kidney_1_v = subset_df(train_df, base_dir = BASE_DIR / 'train', im_dir='kidney_1_voi',lb_dir='kidney_1_voi')\nkidney_1_v = kidney_1_v.reset_index()","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:16:28.629080Z","iopub.execute_input":"2023-11-30T15:16:28.629372Z","iopub.status.idle":"2023-11-30T15:17:14.240115Z","shell.execute_reply.started":"2023-11-30T15:16:28.629347Z","shell.execute_reply":"2023-11-30T15:17:14.238918Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"kidney_1_v[['images_width', 'images_height', 'labels_width', 'labels_height', 'images_height', ]].apply(['unique'])","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:17:14.241526Z","iopub.execute_input":"2023-11-30T15:17:14.241809Z","iopub.status.idle":"2023-11-30T15:17:14.259413Z","shell.execute_reply.started":"2023-11-30T15:17:14.241784Z","shell.execute_reply":"2023-11-30T15:17:14.258254Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**All pictures are the same size**. Let's take a look at them.","metadata":{}},{"cell_type":"code","source":"animate(kidney_1_v, range(0, 1397, 14), (8,8))","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:17:14.261171Z","iopub.execute_input":"2023-11-30T15:17:14.262526Z","iopub.status.idle":"2023-11-30T15:18:39.886090Z","shell.execute_reply.started":"2023-11-30T15:17:14.262480Z","shell.execute_reply":"2023-11-30T15:18:39.885174Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**Visually the image has a larger segmented part than kidney_1_dense.**","metadata":{}},{"cell_type":"markdown","source":"Consider the length of the RLE encoding.","metadata":{}},{"cell_type":"code","source":"kidney_1_v['mask_length'] = kidney_1_v['rle'].apply(lambda x: len(str(x).split()))","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:18:39.887332Z","iopub.execute_input":"2023-11-30T15:18:39.887955Z","iopub.status.idle":"2023-11-30T15:18:39.980633Z","shell.execute_reply.started":"2023-11-30T15:18:39.887922Z","shell.execute_reply":"2023-11-30T15:18:39.979360Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(20,8))\nsns.displot( x='mask_length',  data=kidney_1_v, bins = 30);\nplt.title('RLE mask length histogram')\nplt.show();","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:18:39.982191Z","iopub.execute_input":"2023-11-30T15:18:39.983165Z","iopub.status.idle":"2023-11-30T15:18:40.324034Z","shell.execute_reply.started":"2023-11-30T15:18:39.983134Z","shell.execute_reply":"2023-11-30T15:18:40.323378Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"kidney_1_v['mask_length'].describe()","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:18:40.325127Z","iopub.execute_input":"2023-11-30T15:18:40.326189Z","iopub.status.idle":"2023-11-30T15:18:40.337333Z","shell.execute_reply.started":"2023-11-30T15:18:40.326152Z","shell.execute_reply":"2023-11-30T15:18:40.336402Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"The median is 1740. From the analysis of statistics it follows that most of the pictures have a mask length greater than 1000. There are not very many images with a mask length less than 1000.","metadata":{}},{"cell_type":"markdown","source":"**Percentage of segment part in mask.**","metadata":{}},{"cell_type":"code","source":"kidney_1_v['mask_pixels_ratio'] = kidney_1_v[['rle','labels_width', 'labels_height']].apply(lambda x: mask_pixels_ratio(x['rle'], (x['labels_width'], x['labels_height'])), axis = 1)","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:18:40.338877Z","iopub.execute_input":"2023-11-30T15:18:40.339227Z","iopub.status.idle":"2023-11-30T15:18:43.547135Z","shell.execute_reply.started":"2023-11-30T15:18:40.339196Z","shell.execute_reply":"2023-11-30T15:18:43.545687Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(15,8))\nsns.displot( x='mask_pixels_ratio',  data=kidney_1_v, bins = 20);\nplt.title('Percentage of units in mask')\nplt.show();","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:18:43.548533Z","iopub.execute_input":"2023-11-30T15:18:43.548829Z","iopub.status.idle":"2023-11-30T15:18:43.833761Z","shell.execute_reply.started":"2023-11-30T15:18:43.548805Z","shell.execute_reply":"2023-11-30T15:18:43.832429Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"kidney_1_v['mask_pixels_ratio'].describe()","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:18:43.835082Z","iopub.execute_input":"2023-11-30T15:18:43.835453Z","iopub.status.idle":"2023-11-30T15:18:43.847103Z","shell.execute_reply.started":"2023-11-30T15:18:43.835418Z","shell.execute_reply":"2023-11-30T15:18:43.845965Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"In the kidney_1_voi dataset the size of the segmentation part is larger than kidney_1_dense.","metadata":{}},{"cell_type":"markdown","source":"# Kidney_2","metadata":{}},{"cell_type":"code","source":"kidney_2 = subset_df(train_df, base_dir = BASE_DIR / 'train', im_dir='kidney_2',lb_dir='kidney_2')\nkidney_2 = kidney_2.reset_index()","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:18:43.848071Z","iopub.execute_input":"2023-11-30T15:18:43.848428Z","iopub.status.idle":"2023-11-30T15:19:57.359856Z","shell.execute_reply.started":"2023-11-30T15:18:43.848375Z","shell.execute_reply":"2023-11-30T15:19:57.358508Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"kidney_2[['images_width', 'images_height', 'labels_width', 'labels_height', 'images_height', ]].apply(['unique'])","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:19:57.361571Z","iopub.execute_input":"2023-11-30T15:19:57.362048Z","iopub.status.idle":"2023-11-30T15:19:57.384055Z","shell.execute_reply.started":"2023-11-30T15:19:57.362010Z","shell.execute_reply":"2023-11-30T15:19:57.382487Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"animate(kidney_2, range(0, 2217, 22), (9,6))","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:19:57.386089Z","iopub.execute_input":"2023-11-30T15:19:57.387110Z","iopub.status.idle":"2023-11-30T15:20:41.146968Z","shell.execute_reply.started":"2023-11-30T15:19:57.387056Z","shell.execute_reply":"2023-11-30T15:20:41.145714Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"-  Visually, the first 84 pictures have empty masks. Although actually the first 65.\n- Visually, the last 80 pictures have empty masks. Although actually the last 71.\n- Visually, the size of the segmented area is very small","metadata":{}},{"cell_type":"markdown","source":"**Consider the length of the RLE encoding.**","metadata":{}},{"cell_type":"code","source":"kidney_2['mask_length'] = kidney_2['rle'].apply(lambda x: len(str(x).split()))","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:20:41.148670Z","iopub.execute_input":"2023-11-30T15:20:41.149098Z","iopub.status.idle":"2023-11-30T15:20:41.215587Z","shell.execute_reply.started":"2023-11-30T15:20:41.149064Z","shell.execute_reply":"2023-11-30T15:20:41.214504Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(20,8))\nsns.displot( x='mask_length',  data=kidney_2, bins = 50);\nplt.title('RLE mask length histogram')\nplt.show();","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:20:41.219599Z","iopub.execute_input":"2023-11-30T15:20:41.220442Z","iopub.status.idle":"2023-11-30T15:20:41.587754Z","shell.execute_reply.started":"2023-11-30T15:20:41.220404Z","shell.execute_reply":"2023-11-30T15:20:41.586250Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"kidney_2['mask_length'].describe()","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:20:41.589500Z","iopub.execute_input":"2023-11-30T15:20:41.589867Z","iopub.status.idle":"2023-11-30T15:20:41.601882Z","shell.execute_reply.started":"2023-11-30T15:20:41.589835Z","shell.execute_reply":"2023-11-30T15:20:41.600827Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"The median is 972. From the analysis of statistics it follows that for most pictures the length of the rle mask is in the range of 200-1500.","metadata":{}},{"cell_type":"markdown","source":"**Percentage of segment part in mask.**","metadata":{}},{"cell_type":"code","source":"kidney_2['mask_pixels_ratio'] = kidney_2[['rle','labels_width', 'labels_height']].apply(lambda x: mask_pixels_ratio(x['rle'], (x['labels_width'], x['labels_height'])), axis = 1)","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:20:41.603617Z","iopub.execute_input":"2023-11-30T15:20:41.604149Z","iopub.status.idle":"2023-11-30T15:20:43.856145Z","shell.execute_reply.started":"2023-11-30T15:20:41.604116Z","shell.execute_reply":"2023-11-30T15:20:43.854567Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(15,8))\nsns.displot( x='mask_pixels_ratio',  data=kidney_2, bins = 20);\nplt.title('Percentage of units in mask')\nplt.show();","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:20:43.857739Z","iopub.execute_input":"2023-11-30T15:20:43.858081Z","iopub.status.idle":"2023-11-30T15:20:44.176914Z","shell.execute_reply.started":"2023-11-30T15:20:43.858050Z","shell.execute_reply":"2023-11-30T15:20:44.176166Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"kidney_2['mask_pixels_ratio'].describe()","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:20:44.178144Z","iopub.execute_input":"2023-11-30T15:20:44.179201Z","iopub.status.idle":"2023-11-30T15:20:44.189576Z","shell.execute_reply.started":"2023-11-30T15:20:44.179172Z","shell.execute_reply":"2023-11-30T15:20:44.188476Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**The segment part occupies an extremely small portion of the image.**","metadata":{}},{"cell_type":"markdown","source":"# Kidney_3_sparse","metadata":{}},{"cell_type":"code","source":"kidney_3_s = subset_df(train_df, base_dir = BASE_DIR / 'train', im_dir='kidney_3_sparse',lb_dir='kidney_3_sparse')\nkidney_3_s = kidney_3_s.reset_index()","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:20:44.191073Z","iopub.execute_input":"2023-11-30T15:20:44.191494Z","iopub.status.idle":"2023-11-30T15:21:26.746692Z","shell.execute_reply.started":"2023-11-30T15:20:44.191460Z","shell.execute_reply":"2023-11-30T15:21:26.745450Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":" kidney_3_s[['images_width', 'images_height', 'labels_width', 'labels_height', 'images_height', ]].apply(['unique'])","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:21:26.747833Z","iopub.execute_input":"2023-11-30T15:21:26.748886Z","iopub.status.idle":"2023-11-30T15:21:26.769551Z","shell.execute_reply.started":"2023-11-30T15:21:26.748832Z","shell.execute_reply":"2023-11-30T15:21:26.768093Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**All pictures are the same size**. Let's take a look at them.","metadata":{}},{"cell_type":"code","source":"animate( kidney_3_s, range(0, 1035, 10), (8,8))","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:21:26.773911Z","iopub.execute_input":"2023-11-30T15:21:26.774322Z","iopub.status.idle":"2023-11-30T15:22:31.377330Z","shell.execute_reply.started":"2023-11-30T15:21:26.774287Z","shell.execute_reply":"2023-11-30T15:22:31.373920Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"-  Visually, the first 50 pictures have empty masks. Although actually the first 50.\n- Visually, the last 83 pictures have empty masks. Although actually the last 82.\n- Visually, the size of the segmented area is very small","metadata":{}},{"cell_type":"markdown","source":"**Consider the length of the RLE encoding.**","metadata":{}},{"cell_type":"code","source":" kidney_3_s['mask_length'] =  kidney_3_s['rle'].apply(lambda x: len(str(x).split()))","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:22:31.378989Z","iopub.execute_input":"2023-11-30T15:22:31.379328Z","iopub.status.idle":"2023-11-30T15:22:31.427308Z","shell.execute_reply.started":"2023-11-30T15:22:31.379298Z","shell.execute_reply":"2023-11-30T15:22:31.426553Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(10,4))\nsns.displot( x='mask_length',  data= kidney_3_s, bins = 40);\nplt.title('RLE mask length histogram')\nplt.show();","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:23:37.746446Z","iopub.execute_input":"2023-11-30T15:23:37.746819Z","iopub.status.idle":"2023-11-30T15:23:38.100412Z","shell.execute_reply.started":"2023-11-30T15:23:37.746789Z","shell.execute_reply":"2023-11-30T15:23:38.098999Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"kidney_3_s['mask_length'].describe()","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:24:12.511248Z","iopub.execute_input":"2023-11-30T15:24:12.511671Z","iopub.status.idle":"2023-11-30T15:24:12.524003Z","shell.execute_reply.started":"2023-11-30T15:24:12.511640Z","shell.execute_reply":"2023-11-30T15:24:12.522847Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"The median is 1574. From the analysis of statistics it follows that for most pictures the length of the rle mask is in the range of 800-2000.","metadata":{}},{"cell_type":"markdown","source":"**Percentage of segment part in mask.**","metadata":{}},{"cell_type":"code","source":"kidney_3_s['mask_pixels_ratio'] = kidney_3_s[['rle','labels_width', 'labels_height']].apply(lambda x: mask_pixels_ratio(x['rle'], (x['labels_width'], x['labels_height'])), axis = 1)","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:29:41.471633Z","iopub.execute_input":"2023-11-30T15:29:41.472018Z","iopub.status.idle":"2023-11-30T15:29:43.150041Z","shell.execute_reply.started":"2023-11-30T15:29:41.471989Z","shell.execute_reply":"2023-11-30T15:29:43.148956Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(15,8))\nsns.displot( x='mask_pixels_ratio',  data=kidney_3_s, bins = 20);\nplt.title('Percentage of units in mask')\nplt.show();","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:30:03.212682Z","iopub.execute_input":"2023-11-30T15:30:03.213452Z","iopub.status.idle":"2023-11-30T15:30:03.837429Z","shell.execute_reply.started":"2023-11-30T15:30:03.213352Z","shell.execute_reply":"2023-11-30T15:30:03.835329Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**The segment part occupies an extremely small portion of the image.**","metadata":{}},{"cell_type":"markdown","source":"# Kidney_3_dense","metadata":{}},{"cell_type":"markdown","source":"**Kidney_3_dense is part of kidney_3_sparse. kidney_3_sparse - a dataset that is marked up manually. Therefore, these datasets will have similar statistics** Let's look at the difference in masks.","metadata":{}},{"cell_type":"code","source":"kidney_3_d = subset_df(train_df, base_dir = BASE_DIR / 'train', im_dir='kidney_3_sparse',lb_dir='kidney_3_dense')\nkidney_3_d = kidney_3_d.reset_index()","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:45:23.490428Z","iopub.execute_input":"2023-11-30T15:45:23.490988Z","iopub.status.idle":"2023-11-30T15:45:32.614673Z","shell.execute_reply.started":"2023-11-30T15:45:23.490958Z","shell.execute_reply":"2023-11-30T15:45:32.613480Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Let's add labels from kidney_3_sparse.","metadata":{}},{"cell_type":"code","source":"indexes = kidney_3_s['img_name'].isin(kidney_3_d['img_name'])\nkidney_3_d['labels_sparse'] = kidney_3_s['labels'][indexes].values","metadata":{"execution":{"iopub.status.busy":"2023-11-30T15:57:39.427777Z","iopub.execute_input":"2023-11-30T15:57:39.428187Z","iopub.status.idle":"2023-11-30T15:57:39.435131Z","shell.execute_reply.started":"2023-11-30T15:57:39.428154Z","shell.execute_reply":"2023-11-30T15:57:39.433017Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"animate_kidney_3_d(kidney_3_d, range(100), (12,12))","metadata":{"execution":{"iopub.status.busy":"2023-11-30T16:11:16.637492Z","iopub.execute_input":"2023-11-30T16:11:16.637860Z","iopub.status.idle":"2023-11-30T16:12:40.336292Z","shell.execute_reply.started":"2023-11-30T16:11:16.637830Z","shell.execute_reply":"2023-11-30T16:12:40.334719Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**Visually, the masks are not much different.** Let's look at the difference in masks.","metadata":{}},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def perecent_diff(lb1, lb2):\n    im1 = imread(lb1)\n    im2 = imread(lb2)\n    x = cv2.absdiff(im1, im2)\n    return round((x == 255).sum() / (1e-6 + (im1 == 255).sum()) * 100, 4)","metadata":{"execution":{"iopub.status.busy":"2023-11-30T16:24:42.444790Z","iopub.execute_input":"2023-11-30T16:24:42.445166Z","iopub.status.idle":"2023-11-30T16:24:42.450800Z","shell.execute_reply.started":"2023-11-30T16:24:42.445136Z","shell.execute_reply":"2023-11-30T16:24:42.449761Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"kidney_3_d['percent_diff'] = kidney_3_d.apply(lambda x: perecent_diff(x['labels'], x['labels_sparse']), axis = 1)","metadata":{"execution":{"iopub.status.busy":"2023-11-30T16:26:09.248097Z","iopub.execute_input":"2023-11-30T16:26:09.248514Z","iopub.status.idle":"2023-11-30T16:26:13.843888Z","shell.execute_reply.started":"2023-11-30T16:26:09.248482Z","shell.execute_reply":"2023-11-30T16:26:13.842703Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(10,4))\nsns.displot( x='percent_diff',  data= kidney_3_d, bins = 40);\nplt.title('Percentage difference in masks')\nplt.show();","metadata":{"execution":{"iopub.status.busy":"2023-11-30T16:27:50.552174Z","iopub.execute_input":"2023-11-30T16:27:50.552508Z","iopub.status.idle":"2023-11-30T16:27:50.876018Z","shell.execute_reply.started":"2023-11-30T16:27:50.552485Z","shell.execute_reply":"2023-11-30T16:27:50.874458Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"kidney_3_d['percent_diff'].describe()","metadata":{"execution":{"iopub.status.busy":"2023-11-30T16:28:48.083769Z","iopub.execute_input":"2023-11-30T16:28:48.084199Z","iopub.status.idle":"2023-11-30T16:28:48.096264Z","shell.execute_reply.started":"2023-11-30T16:28:48.084168Z","shell.execute_reply":"2023-11-30T16:28:48.095178Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**The masks differ slightly. On average by 1.6%. However, there are images with a difference of more than 10%.**\n\n***Images in which the masks differ by more than 10%.***","metadata":{}},{"cell_type":"code","source":"kidney_3_d.columns","metadata":{"execution":{"iopub.status.busy":"2023-11-30T16:39:20.998824Z","iopub.execute_input":"2023-11-30T16:39:20.999179Z","iopub.status.idle":"2023-11-30T16:39:21.006567Z","shell.execute_reply.started":"2023-11-30T16:39:20.999154Z","shell.execute_reply":"2023-11-30T16:39:21.005253Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"kidney_3_d[kidney_3_d['percent_diff'] > 10 ][['id', 'percent_diff']]","metadata":{"execution":{"iopub.status.busy":"2023-11-30T16:31:46.366343Z","iopub.execute_input":"2023-11-30T16:31:46.367420Z","iopub.status.idle":"2023-11-30T16:31:46.381383Z","shell.execute_reply.started":"2023-11-30T16:31:46.367355Z","shell.execute_reply":"2023-11-30T16:31:46.380004Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fig, [ax1,ax2] = plt.subplots(nrows=1, ncols=2)\nax1.axis('off')\nax2.axis('off')\n\ni = 447\nlb1 = kidney_3_d[kidney_3_d['percent_diff'] > 10 ]['labels'][i] \nlb2 = kidney_3_d[kidney_3_d['percent_diff'] > 10 ]['labels_sparse'][i]\n\nim1 = imread(lb1)\nim2 = imread(lb2)\ntitle_str1 = 'label'\ntitle_str2 = 'label sparse'\nax1.set_title(title_str1)\nax2.set_title(title_str2 )\n#title2 = ax2.text(title_str2, size = 10,  ha = \"center\")\n\nax1.imshow(im1)\nax2.imshow(im2)\n\nplt.show()\n","metadata":{"execution":{"iopub.status.busy":"2023-11-30T16:44:51.977707Z","iopub.execute_input":"2023-11-30T16:44:51.978081Z","iopub.status.idle":"2023-11-30T16:44:52.372933Z","shell.execute_reply.started":"2023-11-30T16:44:51.978051Z","shell.execute_reply":"2023-11-30T16:44:52.371993Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Conclusion","metadata":{}},{"cell_type":"markdown","source":"- Pictures of different kidneys have different sizes.\n- There are manually marked data for kidneys 2 and 3.\n- The size of the segmentation mask is small.\n- The difference between the masks created manually and those specified for kidney 3 is insignificant.","metadata":{}},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}