{"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":"# ABOUT SIIM\n\n![image.png](attachment:d72d6dd9-7d44-4887-95f4-9f39975c84aa.png)\n\nSociety for Imaging Informatics in Medicine (SIIM) is the leading healthcare professional organization for those interested in the current and future use of informatics in medical imaging. The society's mission is to advance medical imaging informatics across the enterprise through education, research, and innovation in a multi-disciplinary community.","metadata":{},"attachments":{"d72d6dd9-7d44-4887-95f4-9f39975c84aa.png":{"image/png":"iVBORw0KGgoAAAANSUhEUgAAAS4AAACACAYAAAC1IYRpAAAgAElEQVR4Ae1dB3gVx7XOc2ycxL3XJHbi2CZx7MSO814S+8WO4+AEFyBO4jjOs0OvKiABEr0KRO/V9F5MMR3TOwIkIQkJJIQKEpJQQRLq5bzvP1cj9q723ru7917pltnv2293Z8vMnjnzz5kz55z5FslNUkBSQFLAyyjwLS8rryyupICkgKQASeCSTCApICngdRSQwOV1VSYLLCkgKSCBS/KApICkgNdRQAKX11WZLLCkgKSABC7JA5ICkgJeRwEJXF5XZbLAkgKSAhK4JA9ICkgKeB0FJHB5XZXJAksKSApI4JI8ICkgKeB1FJDA5XVVJgssKSApIIFL8oCkgKSA11FAApfXVZkssKSApIAELskDkgKSAl5HAQlcXldlssCSApICErgkD0gKSAp4HQUkcHldlckCSwpICkjgkjwgKSAp4HUUkMDldVUmCywpICkggUvygMdQoL6+nuqrK+jmhaOUs2YkXR76J0rs+hwl9v4ZpU/9nAoPLKeq3CtEVO8xZZYFaRkKSOBqGbrLXFUUqL1ZRKXn91PGzC6UHPYWJfZoTfGfP0HnP7mf4v71EF3o/AxdDHqVrkR8THmbJ1H19Qyqr6lWfUVe+gsFJHD5S0178H9WZl2i/F3zKXX0Xyn+s0cotsOdFNP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6yc/e+5i9meCC5CStoieJ3yWs85GvprQyIo4utdTbI7nZpGf5k0ywKOAQMNf1udPxopJjLWnTrD4YKaZEjE8cd2xCZwRwCAhLW6+jv2rkUeX587bzpqqFa5RBrqc298IpstmCmfuuyQtJ4NHsxhol3VuYmy4gjgQtDL1gNGEGbRjdIT5X0meDAv16b8rt5zrwIuvT8ln5MUkBTwbQpI4PLt+pV/JyngkxSQwOWT1Sp/SlLAtykggcu361f+naSAT1Lg/wE9dfeoCnHTRwAAAABJRU5ErkJggg=="}}},{"cell_type":"markdown","source":"# ABOUT THE DATA\n\nIn this competition, we are identifying and localizing COVID-19 abnormalities on chest radiographs. This is an object detection and classification problem.\n\nA chest radiograph, called a chest X-ray, or chest film, is a projection radiograph of the chest used to diagnose conditions affecting the chest, its contents, and nearby structures. Chest radiographs are the most common film taken in medicine. \n\n<img align=\"centre\" src=\"https://post.healthline.com/wp-content/uploads/2020/08/chest-x-ray_thumb-1-732x549.jpg\">\n\n## What is opacities in chest X-ray?\n\nOn a chest x-ray lung abnormalities will either present as areas of increased density or as areas of decreased density. Lung abnormalities with an increased density - also called opacities - are the most common.\n\n<img align=\"centre\" src=\"https://prod-images-static.radiopaedia.org/images/130233/8a64788a65af3e40cfcadc3ff9125a_gallery.jpg\">","metadata":{}},{"cell_type":"markdown","source":"# IMPORTS","metadata":{}},{"cell_type":"markdown","source":"Before staring the imports uncomment the below lines and run the for smooth execution of the script.","metadata":{}},{"cell_type":"code","source":"#pip install numpy==1.20.1","metadata":{"execution":{"iopub.status.busy":"2021-05-25T06:27:20.602839Z","iopub.execute_input":"2021-05-25T06:27:20.603103Z","iopub.status.idle":"2021-05-25T06:27:20.606520Z","shell.execute_reply.started":"2021-05-25T06:27:20.603081Z","shell.execute_reply":"2021-05-25T06:27:20.605746Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#pip install pylibjpeg pylibjpeg-libjpeg pydicom GDCM","metadata":{"execution":{"iopub.status.busy":"2021-05-25T06:27:20.624353Z","iopub.execute_input":"2021-05-25T06:27:20.624720Z","iopub.status.idle":"2021-05-25T06:27:20.628099Z","shell.execute_reply.started":"2021-05-25T06:27:20.624698Z","shell.execute_reply":"2021-05-25T06:27:20.627206Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"All, the necessary imports were made in the below cell.","metadata":{}},{"cell_type":"code","source":"import numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\nimport os\nimport ast\nimport matplotlib.pyplot as plt\nimport matplotlib\nimport seaborn as sns\nimport pydicom as dicom\nimport cv2\n%matplotlib inline","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2021-05-25T06:27:20.639142Z","iopub.execute_input":"2021-05-25T06:27:20.639504Z","iopub.status.idle":"2021-05-25T06:27:20.647767Z","shell.execute_reply.started":"2021-05-25T06:27:20.639466Z","shell.execute_reply":"2021-05-25T06:27:20.646986Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# LOAD DATA","metadata":{}},{"cell_type":"markdown","source":"Let's first define the input path.","metadata":{}},{"cell_type":"code","source":"path = '/kaggle/input/siim-covid19-detection/'","metadata":{"execution":{"iopub.status.busy":"2021-05-25T06:27:20.650800Z","iopub.execute_input":"2021-05-25T06:27:20.651192Z","iopub.status.idle":"2021-05-25T06:27:20.662415Z","shell.execute_reply.started":"2021-05-25T06:27:20.651169Z","shell.execute_reply":"2021-05-25T06:27:20.661883Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Next, let's read the train_image_level and train_study_level csv in two dataframes.","metadata":{}},{"cell_type":"code","source":"image_df = pd.read_csv(path + 'train_image_level.csv')\nstudy_df = pd.read_csv(path + 'train_study_level.csv')","metadata":{"execution":{"iopub.status.busy":"2021-05-25T06:27:20.663576Z","iopub.execute_input":"2021-05-25T06:27:20.664034Z","iopub.status.idle":"2021-05-25T06:27:20.716999Z","shell.execute_reply.started":"2021-05-25T06:27:20.664004Z","shell.execute_reply":"2021-05-25T06:27:20.716146Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Let's display the first 5 rows of both image_df and study_df.","metadata":{}},{"cell_type":"code","source":"image_df.head()","metadata":{"execution":{"iopub.status.busy":"2021-05-25T06:27:20.718684Z","iopub.execute_input":"2021-05-25T06:27:20.719042Z","iopub.status.idle":"2021-05-25T06:27:20.731921Z","shell.execute_reply.started":"2021-05-25T06:27:20.719005Z","shell.execute_reply":"2021-05-25T06:27:20.730250Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"study_df.head()","metadata":{"execution":{"iopub.status.busy":"2021-05-25T06:27:20.733801Z","iopub.execute_input":"2021-05-25T06:27:20.734167Z","iopub.status.idle":"2021-05-25T06:27:20.756026Z","shell.execute_reply.started":"2021-05-25T06:27:20.734129Z","shell.execute_reply":"2021-05-25T06:27:20.755115Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# EXPLORATORY DATA ANALYSIS","metadata":{}},{"cell_type":"markdown","source":"Next let's display the dataframe info for both the dataframes.","metadata":{}},{"cell_type":"code","source":"image_df.info()","metadata":{"execution":{"iopub.status.busy":"2021-05-25T06:27:20.756978Z","iopub.execute_input":"2021-05-25T06:27:20.757182Z","iopub.status.idle":"2021-05-25T06:27:20.777556Z","shell.execute_reply.started":"2021-05-25T06:27:20.757152Z","shell.execute_reply":"2021-05-25T06:27:20.776575Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"The boxes column seems to have null values.","metadata":{}},{"cell_type":"code","source":"study_df.info()","metadata":{"execution":{"iopub.status.busy":"2021-05-25T06:27:20.778901Z","iopub.execute_input":"2021-05-25T06:27:20.779090Z","iopub.status.idle":"2021-05-25T06:27:20.796662Z","shell.execute_reply.started":"2021-05-25T06:27:20.779070Z","shell.execute_reply":"2021-05-25T06:27:20.795856Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"There are no columns with null values in the study_df. Next let's display the number records in both the dataframes.","metadata":{}},{"cell_type":"code","source":"print(f\"Number of records provided in image level csv is {len(image_df)}\")\nprint(f\"Number of records provided in study level csv is {len(study_df)}\")","metadata":{"execution":{"iopub.status.busy":"2021-05-25T06:27:20.798261Z","iopub.execute_input":"2021-05-25T06:27:20.798659Z","iopub.status.idle":"2021-05-25T06:27:20.803927Z","shell.execute_reply.started":"2021-05-25T06:27:20.798626Z","shell.execute_reply":"2021-05-25T06:27:20.803130Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"From the above results it seems that the image level csv has more rows than study level csv. This indicates chances of duplicates in the image_df. Let's explore this more by finding out the unique values under StudyInstanceUID column of the image_df.","metadata":{}},{"cell_type":"code","source":"len(image_df.StudyInstanceUID.unique())","metadata":{"execution":{"iopub.status.busy":"2021-05-25T06:27:20.861185Z","iopub.execute_input":"2021-05-25T06:27:20.861409Z","iopub.status.idle":"2021-05-25T06:27:20.868463Z","shell.execute_reply.started":"2021-05-25T06:27:20.861389Z","shell.execute_reply":"2021-05-25T06:27:20.867216Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"len(study_df.id.unique())","metadata":{"execution":{"iopub.status.busy":"2021-05-25T06:27:20.870019Z","iopub.execute_input":"2021-05-25T06:27:20.870233Z","iopub.status.idle":"2021-05-25T06:27:20.883771Z","shell.execute_reply.started":"2021-05-25T06:27:20.870212Z","shell.execute_reply":"2021-05-25T06:27:20.882813Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"So, from the above results the unique values in the StudyInstanceUID matches the number of unique values in the id column of the study_df. So, it indicates some of the ids in the image_df has the same StudyInstanceUID. Let's explore this more by finding out the duplicate rows in the image_df.","metadata":{}},{"cell_type":"code","source":"dup_df = image_df[image_df.duplicated(['StudyInstanceUID'])==True]\nprint(f\"Number of duplicate rows are {len(dup_df)}\")","metadata":{"execution":{"iopub.status.busy":"2021-05-25T06:27:20.885354Z","iopub.execute_input":"2021-05-25T06:27:20.885575Z","iopub.status.idle":"2021-05-25T06:27:20.898209Z","shell.execute_reply.started":"2021-05-25T06:27:20.885553Z","shell.execute_reply":"2021-05-25T06:27:20.896913Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"So, there are 280 duplicate rows. Let's display the dup_df info to see if we can find some more information about the duplicates.","metadata":{}},{"cell_type":"code","source":"dup_df.info()","metadata":{"execution":{"iopub.status.busy":"2021-05-25T06:27:20.900744Z","iopub.execute_input":"2021-05-25T06:27:20.900945Z","iopub.status.idle":"2021-05-25T06:27:20.913451Z","shell.execute_reply.started":"2021-05-25T06:27:20.900924Z","shell.execute_reply":"2021-05-25T06:27:20.912838Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"So, from the above results we can see the boxes has only 89 non-null values. The boxes column contains the bounding box information of the annomalies found in the chest xray scans. A null value here kind of hints that the images corresponding to that rows  may not have any conditions of covid pneumonia. ","metadata":{}},{"cell_type":"code","source":"dup_df[dup_df.boxes.isnull() == True]['label'].value_counts()","metadata":{"execution":{"iopub.status.busy":"2021-05-25T06:27:20.914413Z","iopub.execute_input":"2021-05-25T06:27:20.914586Z","iopub.status.idle":"2021-05-25T06:27:20.928960Z","shell.execute_reply.started":"2021-05-25T06:27:20.914568Z","shell.execute_reply":"2021-05-25T06:27:20.928274Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"So, it seems all the rows in dup_df which has boxes as null have labels of none type. The images corresponding to those rows don't have any findings and don't have any conditions of covid pneumonia. This proves our assumption was true.","metadata":{}},{"cell_type":"markdown","source":"Next let's check if the study_df has any row with 0 in all the columns:- **Negative for Pneumonia, Typical Appearance, Indeterminate Appearance and Atypical Appearance**.","metadata":{}},{"cell_type":"code","source":"len(study_df[(study_df.T == 0).all()])","metadata":{"execution":{"iopub.status.busy":"2021-05-25T06:27:20.929845Z","iopub.execute_input":"2021-05-25T06:27:20.930085Z","iopub.status.idle":"2021-05-25T06:27:21.306092Z","shell.execute_reply.started":"2021-05-25T06:27:20.930060Z","shell.execute_reply":"2021-05-25T06:27:21.305479Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"So, from the above results it can be concluded that the study_df doesnot contain the information of the x-ray scans with no findings.","metadata":{}},{"cell_type":"markdown","source":"Next let's merge the study_df and image_df by the **StudyInstanceUID** column. For this following steps needs to be performed:-\n* The value in the id column of study_df would be split by underscore and we will only keep the part of the value before the underscore.\n* The id column in the study_df would next be renamed as StudyInstanceUID.\n* Next the two dataframes will be merged by the column StudyInstanceUID.\n* Lastly the resultant dataframe will be sorted by StudyInstanceUID.\n","metadata":{}},{"cell_type":"code","source":"study_df['id'] = study_df['id'].str.split('_').apply(lambda x : x[0])\nstudy_df = study_df.rename({'id':'StudyInstanceUID'}, axis=1)\ntrain_df = pd.merge(image_df, study_df, on='StudyInstanceUID') \ntrain_df = train_df.sort_values(by=['StudyInstanceUID'])\ntrain_df = train_df.reset_index(drop=True)\ntrain_df.head()","metadata":{"execution":{"iopub.status.busy":"2021-05-25T06:27:21.307129Z","iopub.execute_input":"2021-05-25T06:27:21.307366Z","iopub.status.idle":"2021-05-25T06:27:21.355705Z","shell.execute_reply.started":"2021-05-25T06:27:21.307341Z","shell.execute_reply":"2021-05-25T06:27:21.354685Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Next let's see what more information the column named label under the image_df has to offer. Many of the labels has the word opacity in it. Let's get the count of the word opacity for each record and make a separate column to store the information.","metadata":{}},{"cell_type":"code","source":"train_df['Opacity'] = train_df['label'].str.count('opacity')","metadata":{"execution":{"iopub.status.busy":"2021-05-25T06:27:21.358534Z","iopub.execute_input":"2021-05-25T06:27:21.358893Z","iopub.status.idle":"2021-05-25T06:27:21.377835Z","shell.execute_reply.started":"2021-05-25T06:27:21.358862Z","shell.execute_reply":"2021-05-25T06:27:21.376711Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"The dataframe now looks as below.","metadata":{}},{"cell_type":"code","source":"train_df.head()","metadata":{"execution":{"iopub.status.busy":"2021-05-25T06:27:21.381829Z","iopub.execute_input":"2021-05-25T06:27:21.382118Z","iopub.status.idle":"2021-05-25T06:27:21.399667Z","shell.execute_reply.started":"2021-05-25T06:27:21.382090Z","shell.execute_reply":"2021-05-25T06:27:21.398762Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Next let's display the value counts of the opacity column.","metadata":{}},{"cell_type":"code","source":"train_df['Opacity'].value_counts()","metadata":{"execution":{"iopub.status.busy":"2021-05-25T06:27:21.400792Z","iopub.execute_input":"2021-05-25T06:27:21.400986Z","iopub.status.idle":"2021-05-25T06:27:21.415650Z","shell.execute_reply.started":"2021-05-25T06:27:21.400965Z","shell.execute_reply":"2021-05-25T06:27:21.414617Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Next, let's find out the distribution of the findings for each opacity group.","metadata":{}},{"cell_type":"code","source":"Opacity_Count = sorted(list(train_df['Opacity'].value_counts().index))\nfor count in Opacity_Count:\n    print('Opacity Count = {}\\n------------------------------'.format(count))\n    print(train_df[train_df['Opacity'] == count].iloc[:,4:8].sum())\n    print(' ')","metadata":{"execution":{"iopub.status.busy":"2021-05-25T06:27:21.417124Z","iopub.execute_input":"2021-05-25T06:27:21.417439Z","iopub.status.idle":"2021-05-25T06:27:21.448902Z","shell.execute_reply.started":"2021-05-25T06:27:21.417406Z","shell.execute_reply":"2021-05-25T06:27:21.448193Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Next let's make visualization of the above information.","metadata":{}},{"cell_type":"code","source":"for count in Opacity_Count:\n    Count_Series = train_df[train_df['Opacity'] == count].iloc[:,4:8].sum()\n    fig = plt.figure(figsize=(12,3))\n    sns.barplot(x=Count_Series.index, y=Count_Series.values/sum(train_df['Opacity']==count))\n    plt.title('OpacityCount : {} '.format(count))\n    plt.plot();","metadata":{"execution":{"iopub.status.busy":"2021-05-25T06:27:21.449798Z","iopub.execute_input":"2021-05-25T06:27:21.449990Z","iopub.status.idle":"2021-05-25T06:27:22.205896Z","shell.execute_reply.started":"2021-05-25T06:27:21.449969Z","shell.execute_reply":"2021-05-25T06:27:22.205016Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"From the above results it can be concluded that other than opacity 0 none of the other opacity classes have samples belonging to **Negative for Pneumonia**.","metadata":{}},{"cell_type":"markdown","source":"Next let's display some images of each category of findings. For this we will write a function which can extract the bounding boxes of the images from the boxes column of the train_df and draw boxes on the image. The colors used to draw the bounding box for each category is given below:-\n\n* 'r' ---> Negative for Pneumonia\n* 'b' ---> Typical Appearance\n* 'g' ---> Indeterminate Appearance\n* 'y' ---> Atypical Appearance","metadata":{}},{"cell_type":"code","source":"def display_image(image_name, image_id, bounding_box, palet):\n    image_path = path + 'train/' + image_name\n    img_id = image_id.replace('_image','.dcm')\n    for (dirpath, dirnames,filenames) in os.walk(image_path):\n        if os.path.exists(dirpath+'/'+img_id) == True:\n            data_file = dicom.dcmread(dirpath+'/'+img_id)\n            img = data_file.pixel_array\n            fig, ax = plt.subplots(1,1, figsize=(8,4))\n            if pd.isnull(bounding_box) == False:\n                boxes = ast.literal_eval(bounding_box)\n                for box in boxes:\n                    p = matplotlib.patches.Rectangle((box['x'], box['y']),\n                                                      box['width'], box['height'],\n                                                      ec=palet, fc='none', lw=1.5)\n                    ax.add_patch(p)\n            ax.set_title(image_id) \n            ax.imshow(img, cmap='gray')\n            plt.show()","metadata":{"execution":{"iopub.status.busy":"2021-05-25T06:27:22.207012Z","iopub.execute_input":"2021-05-25T06:27:22.207197Z","iopub.status.idle":"2021-05-25T06:27:22.214815Z","shell.execute_reply.started":"2021-05-25T06:27:22.207176Z","shell.execute_reply":"2021-05-25T06:27:22.213588Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Before using this function to display some images, let's check if whether the images which are Negative for Pneumonia have bounding boxes.","metadata":{}},{"cell_type":"code","source":"len(train_df[(train_df['Negative for Pneumonia']==1) & (train_df['boxes'].isnull() == False)])","metadata":{"execution":{"iopub.status.busy":"2021-05-25T06:27:22.216097Z","iopub.execute_input":"2021-05-25T06:27:22.216316Z","iopub.status.idle":"2021-05-25T06:27:22.229420Z","shell.execute_reply.started":"2021-05-25T06:27:22.216295Z","shell.execute_reply":"2021-05-25T06:27:22.228794Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"So, it seems the images which are marked as Negative for Pneumonia don't have bounding boxes. Now, let's see some images which were diagonosed with Negative for Pneumonia.","metadata":{}},{"cell_type":"markdown","source":"Next let's try to find out how many duplicated StudyInstanceUID rows classified as Typical Appearance has more than one findings with positive for Typical Appearance.","metadata":{}},{"cell_type":"code","source":"temp_df  = train_df[(train_df['Typical Appearance']==1) & \n         (train_df.duplicated(['StudyInstanceUID'], keep=False))].sort_values(by=['StudyInstanceUID'])\nser1 = temp_df['StudyInstanceUID'].value_counts()\nnum_records = 0\nfor idx in ser1.index:\n    count = len(temp_df[(temp_df['StudyInstanceUID'] == idx) & (temp_df['boxes'].isnull() == False)])\n    if count > 1:\n        num_records = num_records + 1\nprint(f\"Number of Study instances with more than one image classified as Typical Appearance is {num_records}.\")\n        ","metadata":{"execution":{"iopub.status.busy":"2021-05-25T06:27:22.230360Z","iopub.execute_input":"2021-05-25T06:27:22.230542Z","iopub.status.idle":"2021-05-25T06:27:22.349226Z","shell.execute_reply.started":"2021-05-25T06:27:22.230522Z","shell.execute_reply":"2021-05-25T06:27:22.348349Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"So, from the above result it can be concluded that even in rows with duplicated StudyInstanceUID there is only one image which was classified as Typical Appearance and that drove the decision behind classifying that study as Typical Appearance.","metadata":{}},{"cell_type":"markdown","source":"Let's try to do the same test for Indeterminate Appearance.","metadata":{}},{"cell_type":"code","source":"temp_df  = train_df[(train_df['Indeterminate Appearance']==1) & \n         (train_df.duplicated(['StudyInstanceUID'], keep=False))].sort_values(by=['StudyInstanceUID'])\nser1 = temp_df['StudyInstanceUID'].value_counts()\nnum_records = 0\nfor idx in ser1.index:\n    count = len(temp_df[(temp_df['StudyInstanceUID'] == idx) & (temp_df['boxes'].isnull() == False)])\n    if count > 1:\n        num_records = num_records + 1\nprint(f\"Number of Study instances with more than one image classified as Indeterminate Appearance is {num_records}.\")\n        ","metadata":{"execution":{"iopub.status.busy":"2021-05-25T06:27:22.350666Z","iopub.execute_input":"2021-05-25T06:27:22.350920Z","iopub.status.idle":"2021-05-25T06:27:22.403806Z","shell.execute_reply.started":"2021-05-25T06:27:22.350894Z","shell.execute_reply":"2021-05-25T06:27:22.402462Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"So, from the above result it can be concluded that even in rows with duplicated StudyInstanceUID there is only one image which was classified as Indeterminate Appearance and that drove the decision behind classifying that study as Indeterminate Appearance.","metadata":{}},{"cell_type":"markdown","source":"Next, let's try the same test for  Atypical Appearance.","metadata":{}},{"cell_type":"code","source":"temp_df  = train_df[(train_df['Atypical Appearance']==1) & \n         (train_df.duplicated(['StudyInstanceUID'], keep=False))].sort_values(by=['StudyInstanceUID'])\nser1 = temp_df['StudyInstanceUID'].value_counts()\nnum_records = 0\nfor idx in ser1.index:\n    count = len(temp_df[(temp_df['StudyInstanceUID'] == idx) & (temp_df['boxes'].isnull() == False)])\n    if count > 1:\n        num_records = num_records + 1\nprint(f\"Number of Study instances with more than one image classified as Atypical Appearance is {num_records}.\")","metadata":{"execution":{"iopub.status.busy":"2021-05-25T06:27:22.405194Z","iopub.execute_input":"2021-05-25T06:27:22.405528Z","iopub.status.idle":"2021-05-25T06:27:22.423486Z","shell.execute_reply.started":"2021-05-25T06:27:22.405495Z","shell.execute_reply":"2021-05-25T06:27:22.422234Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"So, from the above result it can be concluded that even in rows with duplicated StudyInstanceUID there is only one image which was classified as Atypical Appearance and that drove the decision behind classifying that study as Atypical Appearance.","metadata":{}},{"cell_type":"code","source":"temp_df = train_df[(train_df['Negative for Pneumonia']==1)].sample(n=5)\nids = temp_df.id.to_list()\nnames = temp_df.StudyInstanceUID.to_list()\nboxes = temp_df.boxes.to_list()\npalet = 'r'\nfor image_name, image_id, box in zip(names, ids, boxes):\n    display_image(image_name, image_id, box, palet)","metadata":{"execution":{"iopub.status.busy":"2021-05-25T06:27:22.425126Z","iopub.execute_input":"2021-05-25T06:27:22.425444Z","iopub.status.idle":"2021-05-25T06:27:28.728179Z","shell.execute_reply.started":"2021-05-25T06:27:22.425413Z","shell.execute_reply":"2021-05-25T06:27:28.726864Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Next, lets look at some images which had Typical Appearance.","metadata":{}},{"cell_type":"code","source":"temp_df = train_df[(train_df['Typical Appearance']==1) & (train_df['boxes'].isnull()==False)].sample(n=5)\nids = temp_df.id.to_list()\nnames = temp_df.StudyInstanceUID.to_list()\nboxes = temp_df.boxes.to_list()\npalet = 'b'\nfor image_name, image_id, box in zip(names, ids, boxes):\n    display_image(image_name, image_id, box, palet)","metadata":{"execution":{"iopub.status.busy":"2021-05-25T06:27:28.729094Z","iopub.execute_input":"2021-05-25T06:27:28.729304Z","iopub.status.idle":"2021-05-25T06:27:35.589146Z","shell.execute_reply.started":"2021-05-25T06:27:28.729283Z","shell.execute_reply":"2021-05-25T06:27:35.587651Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Next, let's look at some images with Indeterminate Appearance.","metadata":{}},{"cell_type":"code","source":"temp_df = train_df[(train_df['Indeterminate Appearance']==1) & (train_df['boxes'].isnull()==False)].sample(n=5)\nids = temp_df.id.to_list()\nnames = temp_df.StudyInstanceUID.to_list()\nboxes = temp_df.boxes.to_list()\npalet = 'g'\nfor image_name, image_id, box in zip(names, ids, boxes):\n    display_image(image_name, image_id, box, palet)","metadata":{"execution":{"iopub.status.busy":"2021-05-25T06:27:35.590333Z","iopub.execute_input":"2021-05-25T06:27:35.590628Z","iopub.status.idle":"2021-05-25T06:27:39.461455Z","shell.execute_reply.started":"2021-05-25T06:27:35.590575Z","shell.execute_reply":"2021-05-25T06:27:39.460745Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Next, display the images which had Atypical Appearance.","metadata":{}},{"cell_type":"code","source":"temp_df = train_df[(train_df['Atypical Appearance']==1) & (train_df['boxes'].isnull()==False)].sample(n=5)\nids = temp_df.id.to_list()\nnames = temp_df.StudyInstanceUID.to_list()\nboxes = temp_df.boxes.to_list()\npalet = 'y'\nfor image_name, image_id, box in zip(names, ids, boxes):\n    display_image(image_name, image_id, box, palet)","metadata":{"execution":{"iopub.status.busy":"2021-05-25T06:27:39.462373Z","iopub.execute_input":"2021-05-25T06:27:39.462627Z","iopub.status.idle":"2021-05-25T06:27:45.821075Z","shell.execute_reply.started":"2021-05-25T06:27:39.462577Z","shell.execute_reply":"2021-05-25T06:27:45.820203Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# CONCLUSION\n\nFrom the above analysis following points can be concluded:-\n\n* **If, a study don't have opacity count 0 then it doesn't get classified as Negative for Pneumonia. In other words opacity count higher that 0 tells that the study has some conditions for pneumonia.**\n* **A study can have more than one image but it can be classified for a condition of pneumonia if it has atleast one image which has been clasified for that condition for pneumonia.**\n* **If no images in a study has bounding box then it is classified as Negative for Pneumonia.**","metadata":{"execution":{"iopub.status.busy":"2021-05-24T06:38:29.723821Z","iopub.execute_input":"2021-05-24T06:38:29.724319Z","iopub.status.idle":"2021-05-24T06:38:29.728064Z","shell.execute_reply.started":"2021-05-24T06:38:29.72429Z","shell.execute_reply":"2021-05-24T06:38:29.727062Z"}}},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}