{"metadata":{"kaggle":{"accelerator":"nvidiaTeslaT4","dataSources":[{"sourceId":3362,"databundleVersionId":31148,"sourceType":"competition"}],"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":true},"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.10.13"},"papermill":{"default_parameters":{},"duration":10821.383027,"end_time":"2024-02-04T06:14:24.574675","environment_variables":{},"exception":null,"input_path":"__notebook__.ipynb","output_path":"__notebook__.ipynb","parameters":{},"start_time":"2024-02-04T03:14:03.191648","version":"2.4.0"}},"nbformat_minor":4,"nbformat":4,"cells":[{"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\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))","metadata":{"_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","execution":{"iopub.execute_input":"2024-02-04T03:14:07.054963Z","iopub.status.busy":"2024-02-04T03:14:07.054590Z","iopub.status.idle":"2024-02-04T03:14:08.245458Z","shell.execute_reply":"2024-02-04T03:14:08.244393Z"},"papermill":{"duration":1.218208,"end_time":"2024-02-04T03:14:08.248094","exception":false,"start_time":"2024-02-04T03:14:07.029886","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import os\nprint(os.listdir(\"../input\"))\n\nimport zipfile\n\nwith zipfile.ZipFile(\"/kaggle/input/dogs-vs-cats/test1.zip\",\"r\") as z:\n    z.extractall(\".\")\n    \nwith zipfile.ZipFile(\"/kaggle/input/dogs-vs-cats/train.zip\",\"r\") as z:\n    z.extractall(\".\")","metadata":{"execution":{"iopub.execute_input":"2024-02-04T03:14:08.279657Z","iopub.status.busy":"2024-02-04T03:14:08.279316Z","iopub.status.idle":"2024-02-04T03:14:23.998351Z","shell.execute_reply":"2024-02-04T03:14:23.997373Z"},"papermill":{"duration":15.737453,"end_time":"2024-02-04T03:14:24.000923","exception":false,"start_time":"2024-02-04T03:14:08.263470","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# plot dog photos from the dogs vs cats dataset\nfrom matplotlib import pyplot\nfrom matplotlib.image import imread\n# define location of dataset\nfolder = 'train/'\n# plot first few images\nfor i in range(9):\n\t# define subplot\n\tpyplot.subplot(330 + 1 + i)\n\t# define filename\n\tfilename = folder + 'dog.' + str(i) + '.jpg'\n\t# load image pixels\n\timage = imread(filename)\n\t# plot raw pixel data\n\tpyplot.imshow(image)\n# show the figure\npyplot.show()","metadata":{"execution":{"iopub.execute_input":"2024-02-04T03:14:24.238349Z","iopub.status.busy":"2024-02-04T03:14:24.237972Z","iopub.status.idle":"2024-02-04T03:14:25.395248Z","shell.execute_reply":"2024-02-04T03:14:25.394314Z"},"papermill":{"duration":1.185112,"end_time":"2024-02-04T03:14:25.400515","exception":false,"start_time":"2024-02-04T03:14:24.215403","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# plot cat photos from the dogs vs cats dataset\nfrom matplotlib import pyplot\nfrom matplotlib.image import imread\n# define location of dataset\nfolder = 'train/'\n# plot first few images\nfor i in range(9):\n\t# define subplot\n\tpyplot.subplot(330 + 1 + i)\n\t# define filename\n\tfilename = folder + 'cat.' + str(i) + '.jpg'\n\t# load image pixels\n\timage = imread(filename)\n\t# plot raw pixel data\n\tpyplot.imshow(image)\n# show the figure\npyplot.show()","metadata":{"execution":{"iopub.execute_input":"2024-02-04T03:14:25.439572Z","iopub.status.busy":"2024-02-04T03:14:25.439312Z","iopub.status.idle":"2024-02-04T03:14:26.483500Z","shell.execute_reply":"2024-02-04T03:14:26.482576Z"},"papermill":{"duration":1.068594,"end_time":"2024-02-04T03:14:26.488097","exception":false,"start_time":"2024-02-04T03:14:25.419503","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# load dogs vs cats dataset, reshape and save to a new file\nfrom os import listdir\nfrom numpy import asarray\nfrom numpy import save\nfrom keras.preprocessing.image import load_img\nfrom keras.preprocessing.image import img_to_array","metadata":{"execution":{"iopub.execute_input":"2024-02-04T03:14:26.535085Z","iopub.status.busy":"2024-02-04T03:14:26.534792Z","iopub.status.idle":"2024-02-04T03:14:46.802487Z","shell.execute_reply":"2024-02-04T03:14:46.801668Z"},"papermill":{"duration":20.293454,"end_time":"2024-02-04T03:14:46.804858","exception":false,"start_time":"2024-02-04T03:14:26.511404","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from os import makedirs\nfrom os import listdir\nfrom shutil import copyfile\nfrom random import seed\nfrom random import random","metadata":{"execution":{"iopub.execute_input":"2024-02-04T03:14:46.855312Z","iopub.status.busy":"2024-02-04T03:14:46.854218Z","iopub.status.idle":"2024-02-04T03:14:46.859376Z","shell.execute_reply":"2024-02-04T03:14:46.858451Z"},"papermill":{"duration":0.03358,"end_time":"2024-02-04T03:14:46.861369","exception":false,"start_time":"2024-02-04T03:14:46.827789","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Create directories\ndataset_home = 'dataset_dogs_vs_cats/'\nsubdirs = ['train/', 'test/']\nfor subdir in subdirs:\n    labeldirs = ['dogs/', 'cats/']\n    for labldir in labeldirs:\n        newdir = dataset_home + subdir + labldir\n        makedirs(newdir, exist_ok=True)","metadata":{"execution":{"iopub.execute_input":"2024-02-04T03:14:46.908366Z","iopub.status.busy":"2024-02-04T03:14:46.908125Z","iopub.status.idle":"2024-02-04T03:14:46.913027Z","shell.execute_reply":"2024-02-04T03:14:46.912267Z"},"papermill":{"duration":0.030638,"end_time":"2024-02-04T03:14:46.914825","exception":false,"start_time":"2024-02-04T03:14:46.884187","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Seed random number generator\nseed(1)\n# Define ratio of pictures to use for validation\nval_ratio = 0.25\n# Copy training dataset images into subdirectories\nsrc_directory = 'train/'\nfor file in listdir(src_directory):\n    src = src_directory + '/' + file\n    dst_dir = 'train/'\n    if random() < val_ratio:\n        dst_dir = 'test/'\n    if file.startswith('cat'):\n        dst = dataset_home + dst_dir + 'cats/' + file\n        copyfile(src, dst)\n    elif file.startswith('dog'):\n        dst = dataset_home + dst_dir + 'dogs/' + file\n        copyfile(src, dst)","metadata":{"execution":{"iopub.execute_input":"2024-02-04T03:14:46.959908Z","iopub.status.busy":"2024-02-04T03:14:46.959665Z","iopub.status.idle":"2024-02-04T03:14:49.449457Z","shell.execute_reply":"2024-02-04T03:14:49.448709Z"},"papermill":{"duration":2.515287,"end_time":"2024-02-04T03:14:49.451747","exception":false,"start_time":"2024-02-04T03:14:46.936460","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!ls -l dataset_dogs_vs_cats/train/dogs | wc -l\n!ls -l dataset_dogs_vs_cats/train/cats | wc -l","metadata":{"execution":{"iopub.execute_input":"2024-02-04T03:14:49.497729Z","iopub.status.busy":"2024-02-04T03:14:49.497461Z","iopub.status.idle":"2024-02-04T03:14:51.634802Z","shell.execute_reply":"2024-02-04T03:14:51.633760Z"},"papermill":{"duration":2.162641,"end_time":"2024-02-04T03:14:51.636930","exception":false,"start_time":"2024-02-04T03:14:49.474289","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!pip -q install livelossplot","metadata":{"execution":{"iopub.execute_input":"2024-02-04T03:14:51.685521Z","iopub.status.busy":"2024-02-04T03:14:51.684797Z","iopub.status.idle":"2024-02-04T03:15:07.787994Z","shell.execute_reply":"2024-02-04T03:15:07.786918Z"},"papermill":{"duration":16.129882,"end_time":"2024-02-04T03:15:07.790336","exception":false,"start_time":"2024-02-04T03:14:51.660454","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Prepare Final Dataset","metadata":{"papermill":{"duration":0.022497,"end_time":"2024-02-04T03:15:07.835612","exception":false,"start_time":"2024-02-04T03:15:07.813115","status":"completed"},"tags":[]}},{"cell_type":"code","source":"# save the final model to file\nfrom os import listdir\nfrom numpy import asarray, save\nfrom keras.preprocessing.image import load_img, img_to_array\nfrom os import makedirs\nfrom shutil import copyfile\nfrom random import seed, random\nfrom livelossplot import PlotLossesKeras\nfrom keras.applications.vgg16 import VGG16\nfrom keras.models import Model\nfrom keras.layers import Dense, Flatten\nfrom keras.optimizers import SGD\nfrom keras.models import load_model","metadata":{"execution":{"iopub.execute_input":"2024-02-04T03:15:07.881457Z","iopub.status.busy":"2024-02-04T03:15:07.881122Z","iopub.status.idle":"2024-02-04T03:15:07.896391Z","shell.execute_reply":"2024-02-04T03:15:07.895624Z"},"papermill":{"duration":0.040712,"end_time":"2024-02-04T03:15:07.898316","exception":false,"start_time":"2024-02-04T03:15:07.857604","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"xcep_model = Xception(include_top=False, input_shape=(299, 299, 3))\nxcep_model.summary()","metadata":{"execution":{"iopub.execute_input":"2024-01-27T04:11:23.495217Z","iopub.status.busy":"2024-01-27T04:11:23.494572Z","iopub.status.idle":"2024-01-27T04:11:26.579883Z","shell.execute_reply":"2024-01-27T04:11:26.578335Z","shell.execute_reply.started":"2024-01-27T04:11:23.495182Z"},"papermill":{"duration":0.021579,"end_time":"2024-02-04T03:15:07.942388","exception":false,"start_time":"2024-02-04T03:15:07.920809","status":"completed"},"tags":[]}},{"cell_type":"code","source":"from keras.preprocessing.image import ImageDataGenerator\n# create data generator\ndatagen = ImageDataGenerator(\n    rescale=1./255,\n    rotation_range=40,\n    width_shift_range=0.2,\n    height_shift_range=0.2,\n    shear_range=0.2,\n    zoom_range=0.2,\n    horizontal_flip=True,\n    fill_mode='nearest'\n)","metadata":{"execution":{"iopub.execute_input":"2024-02-04T03:15:07.987317Z","iopub.status.busy":"2024-02-04T03:15:07.986992Z","iopub.status.idle":"2024-02-04T03:15:07.991935Z","shell.execute_reply":"2024-02-04T03:15:07.991061Z"},"papermill":{"duration":0.029761,"end_time":"2024-02-04T03:15:07.993888","exception":false,"start_time":"2024-02-04T03:15:07.964127","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Prepare iterator\ntrain_it = datagen.flow_from_directory('dataset_dogs_vs_cats/train/',\n                                       class_mode='binary', batch_size=64, target_size=(224, 224))\ntest_it = datagen.flow_from_directory('dataset_dogs_vs_cats/test/',\n                                      class_mode='binary', batch_size=64, target_size=(224, 224))","metadata":{"execution":{"iopub.execute_input":"2024-02-04T03:15:08.039492Z","iopub.status.busy":"2024-02-04T03:15:08.039249Z","iopub.status.idle":"2024-02-04T03:15:09.005141Z","shell.execute_reply":"2024-02-04T03:15:09.004370Z"},"papermill":{"duration":0.991414,"end_time":"2024-02-04T03:15:09.007086","exception":false,"start_time":"2024-02-04T03:15:08.015672","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# VGG16","metadata":{"papermill":{"duration":0.023135,"end_time":"2024-02-04T03:15:09.053243","exception":false,"start_time":"2024-02-04T03:15:09.030108","status":"completed"},"tags":[]}},{"cell_type":"code","source":"# Load VGG16 model\nmodelVGG16 = VGG16(\n    include_top=False,\n    input_shape=(224, 224, 3)\n)\nmodelVGG16.summary()","metadata":{"execution":{"iopub.execute_input":"2024-02-04T03:15:09.100052Z","iopub.status.busy":"2024-02-04T03:15:09.099743Z","iopub.status.idle":"2024-02-04T03:15:10.993903Z","shell.execute_reply":"2024-02-04T03:15:10.993045Z"},"papermill":{"duration":1.934719,"end_time":"2024-02-04T03:15:11.010166","exception":false,"start_time":"2024-02-04T03:15:09.075447","status":"completed"},"tags":[],"collapsed":true,"jupyter":{"outputs_hidden":true}},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Mark loaded layers as not trainable\nfor index, layer in enumerate(modelVGG16.layers[:15]):\n    print(index, layer.name, layer.output_shape)\n    layer.trainable = False\n    \nfor index, layer in enumerate(modelVGG16.layers[15:]):\n    print(index, layer.name, layer.output_shape)\n    layer.trainable = True","metadata":{"execution":{"iopub.execute_input":"2024-02-04T03:15:11.067280Z","iopub.status.busy":"2024-02-04T03:15:11.066547Z","iopub.status.idle":"2024-02-04T03:15:11.074377Z","shell.execute_reply":"2024-02-04T03:15:11.073508Z"},"papermill":{"duration":0.039164,"end_time":"2024-02-04T03:15:11.076543","exception":false,"start_time":"2024-02-04T03:15:11.037379","status":"completed"},"tags":[],"collapsed":true,"jupyter":{"outputs_hidden":true}},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"modelVGG16.layers[-1].output","metadata":{"execution":{"iopub.execute_input":"2024-02-04T03:15:11.131834Z","iopub.status.busy":"2024-02-04T03:15:11.131570Z","iopub.status.idle":"2024-02-04T03:15:11.137365Z","shell.execute_reply":"2024-02-04T03:15:11.136557Z"},"papermill":{"duration":0.0351,"end_time":"2024-02-04T03:15:11.139289","exception":false,"start_time":"2024-02-04T03:15:11.104189","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Add new classifier layers\nflat1 = Flatten()(modelVGG16.layers[-1].output)\nclass1 = Dense(128, activation='relu', kernel_initializer='he_uniform')(flat1)\noutput = Dense(1, activation='sigmoid')(class1)\n# Define new model\nvgg16_model = Model(inputs=modelVGG16.inputs, outputs=output)","metadata":{"execution":{"iopub.execute_input":"2024-02-04T03:15:11.196620Z","iopub.status.busy":"2024-02-04T03:15:11.196360Z","iopub.status.idle":"2024-02-04T03:15:11.236543Z","shell.execute_reply":"2024-02-04T03:15:11.235850Z"},"papermill":{"duration":0.070839,"end_time":"2024-02-04T03:15:11.238374","exception":false,"start_time":"2024-02-04T03:15:11.167535","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Compile model\nopt = SGD(lr=0.0001, momentum=0.9)\nvgg16_model.compile(optimizer=opt, loss='binary_crossentropy', metrics=['accuracy'])\nvgg16_model.summary()","metadata":{"execution":{"iopub.execute_input":"2024-02-04T03:15:11.294481Z","iopub.status.busy":"2024-02-04T03:15:11.294190Z","iopub.status.idle":"2024-02-04T03:15:11.358876Z","shell.execute_reply":"2024-02-04T03:15:11.358055Z"},"papermill":{"duration":0.108652,"end_time":"2024-02-04T03:15:11.374379","exception":false,"start_time":"2024-02-04T03:15:11.265727","status":"completed"},"tags":[],"collapsed":true,"jupyter":{"outputs_hidden":true}},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Fit model\nvgg16_model.reset_states()\nhistory = vgg16_model.fit(train_it, \n                          validation_data=test_it, \n                          epochs=3, verbose=1, \n                          callbacks=[PlotLossesKeras()])\n\n\n# Evaluate model\n_, acc = vgg16_model.evaluate_generator(test_it, steps=len(test_it), verbose=1)\nprint('Accuracy > %.3f' % (acc * 100.0))","metadata":{"execution":{"iopub.execute_input":"2024-02-04T03:15:11.480074Z","iopub.status.busy":"2024-02-04T03:15:11.479729Z","iopub.status.idle":"2024-02-04T03:34:53.903722Z","shell.execute_reply":"2024-02-04T03:34:53.902667Z"},"papermill":{"duration":1182.45812,"end_time":"2024-02-04T03:34:53.905681","exception":false,"start_time":"2024-02-04T03:15:11.447561","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Save the model to a file\nvgg16_model.save('vgg16_model.h5')\n\n# Load the model from the file\nloaded_model = load_model('vgg16_model.h5')\n\n# Evaluate the loaded model\nloaded_model.evaluate(test_it, verbose=1)","metadata":{"execution":{"iopub.execute_input":"2024-02-04T03:34:53.986615Z","iopub.status.busy":"2024-02-04T03:34:53.986032Z","iopub.status.idle":"2024-02-04T03:36:24.241088Z","shell.execute_reply":"2024-02-04T03:36:24.240062Z"},"papermill":{"duration":90.297513,"end_time":"2024-02-04T03:36:24.243302","exception":false,"start_time":"2024-02-04T03:34:53.945789","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Make Prediction","metadata":{"papermill":{"duration":0.047316,"end_time":"2024-02-04T03:36:24.341408","exception":false,"start_time":"2024-02-04T03:36:24.294092","status":"completed"},"tags":[]}},{"cell_type":"code","source":"import random","metadata":{"execution":{"iopub.execute_input":"2024-02-04T03:36:24.438065Z","iopub.status.busy":"2024-02-04T03:36:24.437765Z","iopub.status.idle":"2024-02-04T03:36:24.441838Z","shell.execute_reply":"2024-02-04T03:36:24.440986Z"},"papermill":{"duration":0.054725,"end_time":"2024-02-04T03:36:24.443854","exception":false,"start_time":"2024-02-04T03:36:24.389129","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Function to load and prepare the image\ndef load_image(filename):\n    img = load_img(filename, target_size=(224, 224))\n    img = img_to_array(img)\n    img = img.reshape(1, 224, 224, 3)\n    img = img.astype('float32')\n    img = img / 255.0\n    return img\n\n# Function to predict the class\ndef predict_image(model, filename):\n    img = load_image(filename)\n    result = model.predict(img)\n    return result[0]\n\n# Load the VGG16 model\nvgg16_model = load_model('vgg16_model.h5')\n\n# Directory containing the images\nimage_directory = '/kaggle/working/test1/'\n\n# List all files in the directory\nimage_files = os.listdir(image_directory)\n\n# Randomly select 8 images\nselected_images = random.sample(image_files, 8)\n\n# Perform predictions for each selected image\nfor image_file in selected_images:\n    image_path = os.path.join(image_directory, image_file)\n    prediction = predict_image(vgg16_model, image_path)\n\n    # Print the prediction\n    print(f'Image: {image_file}, Prediction: {prediction[0]}')\n","metadata":{"execution":{"iopub.execute_input":"2024-02-04T03:36:24.541662Z","iopub.status.busy":"2024-02-04T03:36:24.541386Z","iopub.status.idle":"2024-02-04T03:36:26.883191Z","shell.execute_reply":"2024-02-04T03:36:26.882195Z"},"papermill":{"duration":2.393867,"end_time":"2024-02-04T03:36:26.885592","exception":false,"start_time":"2024-02-04T03:36:24.491725","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Xception","metadata":{"papermill":{"duration":0.059055,"end_time":"2024-02-04T03:36:26.997522","exception":false,"start_time":"2024-02-04T03:36:26.938467","status":"completed"},"tags":[]}},{"cell_type":"code","source":"from keras.applications.xception import Xception\n# Load the Xception model\nbase_xception = Xception(include_top=False, \n                         input_shape=(224, 224, 3))","metadata":{"execution":{"iopub.execute_input":"2024-02-04T03:36:27.108738Z","iopub.status.busy":"2024-02-04T03:36:27.108386Z","iopub.status.idle":"2024-02-04T03:36:29.216833Z","shell.execute_reply":"2024-02-04T03:36:29.216048Z"},"papermill":{"duration":2.162146,"end_time":"2024-02-04T03:36:29.219103","exception":false,"start_time":"2024-02-04T03:36:27.056957","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"for layer in base_xception.layers:\n    layer.trainable = False","metadata":{"execution":{"iopub.execute_input":"2024-02-04T03:36:29.319836Z","iopub.status.busy":"2024-02-04T03:36:29.319468Z","iopub.status.idle":"2024-02-04T03:36:29.329046Z","shell.execute_reply":"2024-02-04T03:36:29.328209Z"},"papermill":{"duration":0.06176,"end_time":"2024-02-04T03:36:29.330822","exception":false,"start_time":"2024-02-04T03:36:29.269062","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Create a new model on top of Xception\nflat1_xception = Flatten()(base_xception.layers[-1].output)\nclass1_xception = Dense(128, activation='relu', kernel_initializer='he_uniform')(flat1_xception)\noutput_xception = Dense(1, activation='sigmoid')(class1_xception)\n\nxception_model = Model(inputs=base_xception.inputs, outputs=output_xception)","metadata":{"execution":{"iopub.execute_input":"2024-02-04T03:36:29.430954Z","iopub.status.busy":"2024-02-04T03:36:29.430679Z","iopub.status.idle":"2024-02-04T03:36:29.474098Z","shell.execute_reply":"2024-02-04T03:36:29.473234Z"},"papermill":{"duration":0.09585,"end_time":"2024-02-04T03:36:29.475885","exception":false,"start_time":"2024-02-04T03:36:29.380035","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Compile the model\nopt_xception = SGD(lr=0.0001, momentum=0.9)\nxception_model.compile(optimizer=opt_xception, loss='binary_crossentropy', metrics=['accuracy'])\nxception_model.summary()","metadata":{"execution":{"iopub.execute_input":"2024-02-04T03:36:29.575868Z","iopub.status.busy":"2024-02-04T03:36:29.575572Z","iopub.status.idle":"2024-02-04T03:36:29.941680Z","shell.execute_reply":"2024-02-04T03:36:29.940591Z"},"papermill":{"duration":0.532054,"end_time":"2024-02-04T03:36:30.057151","exception":false,"start_time":"2024-02-04T03:36:29.525097","status":"completed"},"tags":[],"collapsed":true,"jupyter":{"outputs_hidden":true}},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Fit the model\nhistory_xception = xception_model.fit(train_it,\n                                      validation_data=test_it,\n                                      epochs=3, verbose=1,\n                                      callbacks=[PlotLossesKeras()])\n\n# Evaluate model\n_, acc = xception_model.evaluate_generator(test_it, steps=len(test_it), verbose=1)\nprint('Accuracy > %.3f' % (acc * 100.0))","metadata":{"execution":{"iopub.execute_input":"2024-02-04T03:36:30.247652Z","iopub.status.busy":"2024-02-04T03:36:30.246823Z","iopub.status.idle":"2024-02-04T03:55:43.465833Z","shell.execute_reply":"2024-02-04T03:55:43.465056Z"},"papermill":{"duration":1153.314605,"end_time":"2024-02-04T03:55:43.467841","exception":false,"start_time":"2024-02-04T03:36:30.153236","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Save the model to a file\nxception_model.save('xception_model.h5')\n# Load the model from the file\nloaded_xception_model = load_model('xception_model.h5')","metadata":{"execution":{"iopub.execute_input":"2024-02-04T03:55:43.650574Z","iopub.status.busy":"2024-02-04T03:55:43.650264Z","iopub.status.idle":"2024-02-04T03:55:46.099672Z","shell.execute_reply":"2024-02-04T03:55:46.098732Z"},"papermill":{"duration":2.544466,"end_time":"2024-02-04T03:55:46.102120","exception":false,"start_time":"2024-02-04T03:55:43.557654","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Make Prediction","metadata":{"papermill":{"duration":0.088446,"end_time":"2024-02-04T03:55:46.281288","exception":false,"start_time":"2024-02-04T03:55:46.192842","status":"completed"},"tags":[]}},{"cell_type":"code","source":"# Function to load and prepare the image\ndef load_image(filename):\n    img = load_img(filename, target_size=(224, 224))\n    img = img_to_array(img)\n    img = img.reshape(1, 224, 224, 3)\n    img = img.astype('float32')\n    img = img / 255.0\n    return img\n\n# Function to predict the class\ndef predict_image(model, filename):\n    img = load_image(filename)\n    result = model.predict(img)\n    return result[0]\n\n# Load the VGG16 model\nxception_model = load_model('xception_model.h5')\n\n# Directory containing the images\nimage_directory = '/kaggle/working/test1/'\n\n# List all files in the directory\nimage_files = os.listdir(image_directory)\n\n# Randomly select 8 images\nselected_images = random.sample(image_files, 8)\n\n# Perform predictions for each selected image\nfor image_file in selected_images:\n    image_path = os.path.join(image_directory, image_file)\n    prediction = predict_image(xception_model, image_path)\n\n    # Print the prediction\n    print(f'Image: {image_file}, Prediction: {prediction[0]}')\n","metadata":{"execution":{"iopub.execute_input":"2024-02-04T03:55:46.460572Z","iopub.status.busy":"2024-02-04T03:55:46.459829Z","iopub.status.idle":"2024-02-04T03:55:50.460343Z","shell.execute_reply":"2024-02-04T03:55:50.459501Z"},"papermill":{"duration":4.092276,"end_time":"2024-02-04T03:55:50.462250","exception":false,"start_time":"2024-02-04T03:55:46.369974","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# ResNet50V2","metadata":{"papermill":{"duration":0.09444,"end_time":"2024-02-04T03:55:50.647989","exception":false,"start_time":"2024-02-04T03:55:50.553549","status":"completed"},"tags":[]}},{"cell_type":"code","source":"from keras.applications.resnet_v2 import ResNet50V2\n\n# Load the ResNet50V2 model\nbase_resnet50v2 = ResNet50V2(include_top=False, \n                             input_shape=(224, 224, 3))","metadata":{"execution":{"iopub.execute_input":"2024-02-04T03:55:50.832222Z","iopub.status.busy":"2024-02-04T03:55:50.831491Z","iopub.status.idle":"2024-02-04T03:55:53.191762Z","shell.execute_reply":"2024-02-04T03:55:53.190959Z"},"papermill":{"duration":2.454501,"end_time":"2024-02-04T03:55:53.193927","exception":false,"start_time":"2024-02-04T03:55:50.739426","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"for layer in base_resnet50v2.layers:\n    layer.trainable = False","metadata":{"execution":{"iopub.execute_input":"2024-02-04T03:55:53.377369Z","iopub.status.busy":"2024-02-04T03:55:53.377050Z","iopub.status.idle":"2024-02-04T03:55:53.390100Z","shell.execute_reply":"2024-02-04T03:55:53.389359Z"},"papermill":{"duration":0.106659,"end_time":"2024-02-04T03:55:53.392019","exception":false,"start_time":"2024-02-04T03:55:53.285360","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"flat1_resnet50v2 = Flatten()(base_resnet50v2.output)\nclass1_resnet50v2 = Dense(128, activation='relu', kernel_initializer='he_uniform')(flat1_resnet50v2)\noutput_resnet50v2 = Dense(1, activation='sigmoid')(class1_resnet50v2)\n\nresnet50v2_model = Model(inputs=base_resnet50v2.input, outputs=output_resnet50v2)","metadata":{"execution":{"iopub.execute_input":"2024-02-04T03:55:53.575485Z","iopub.status.busy":"2024-02-04T03:55:53.575212Z","iopub.status.idle":"2024-02-04T03:55:53.622561Z","shell.execute_reply":"2024-02-04T03:55:53.621848Z"},"papermill":{"duration":0.141411,"end_time":"2024-02-04T03:55:53.624383","exception":false,"start_time":"2024-02-04T03:55:53.482972","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"opt_resnet50v2 = SGD(lr=0.0001, momentum=0.9)\nresnet50v2_model.compile(optimizer=opt_resnet50v2, loss='binary_crossentropy', metrics=['accuracy'])\nresnet50v2_model.summary()","metadata":{"execution":{"iopub.execute_input":"2024-02-04T03:55:53.808949Z","iopub.status.busy":"2024-02-04T03:55:53.808426Z","iopub.status.idle":"2024-02-04T03:55:54.300944Z","shell.execute_reply":"2024-02-04T03:55:54.300051Z"},"papermill":{"duration":0.73828,"end_time":"2024-02-04T03:55:54.454360","exception":false,"start_time":"2024-02-04T03:55:53.716080","status":"completed"},"tags":[],"collapsed":true,"jupyter":{"outputs_hidden":true}},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Fit the model\nhistory_resnet50v2 = resnet50v2_model.fit(train_it,\n                                          validation_data=test_it,\n                                          epochs=3, verbose=1,\n                                          callbacks=[PlotLossesKeras()])\n# Evaluate model\n_, acc = resnet50v2_model.evaluate_generator(test_it, steps=len(test_it), verbose=1)\nprint('Accuracy > %.3f' % (acc * 100.0))","metadata":{"execution":{"iopub.execute_input":"2024-02-04T03:55:54.751221Z","iopub.status.busy":"2024-02-04T03:55:54.750886Z","iopub.status.idle":"2024-02-04T04:14:43.062140Z","shell.execute_reply":"2024-02-04T04:14:43.061050Z"},"papermill":{"duration":1128.458517,"end_time":"2024-02-04T04:14:43.063970","exception":false,"start_time":"2024-02-04T03:55:54.605453","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Save the model to a file\nresnet50v2_model.save('resnet50v2_model.h5')\n# Load the model from the file\nloaded_resnet50v2_model = load_model('resnet50v2_model.h5')","metadata":{"execution":{"iopub.execute_input":"2024-02-04T04:14:43.358153Z","iopub.status.busy":"2024-02-04T04:14:43.357813Z","iopub.status.idle":"2024-02-04T04:14:46.146990Z","shell.execute_reply":"2024-02-04T04:14:46.146179Z"},"papermill":{"duration":2.938899,"end_time":"2024-02-04T04:14:46.149283","exception":false,"start_time":"2024-02-04T04:14:43.210384","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Make Prediction","metadata":{"papermill":{"duration":0.14274,"end_time":"2024-02-04T04:14:46.436797","exception":false,"start_time":"2024-02-04T04:14:46.294057","status":"completed"},"tags":[]}},{"cell_type":"code","source":"# Function to load and prepare the image\ndef load_image(filename):\n    img = load_img(filename, target_size=(224, 224))\n    img = img_to_array(img)\n    img = img.reshape(1, 224, 224, 3)\n    img = img.astype('float32')\n    img = img / 255.0\n    return img\n\n# Function to predict the class\ndef predict_image(model, filename):\n    img = load_image(filename)\n    result = model.predict(img)\n    return result[0]\n\n# Load the VGG16 model\nresnet50v2_model = load_model('resnet50v2_model.h5')\n\n# Directory containing the images\nimage_directory = '/kaggle/working/test1/'\n\n# List all files in the directory\nimage_files = os.listdir(image_directory)\n\n# Randomly select 8 images\nselected_images = random.sample(image_files, 8)\n\n# Perform predictions for each selected image\nfor image_file in selected_images:\n    image_path = os.path.join(image_directory, image_file)\n    prediction = predict_image(resnet50v2_model, image_path)\n\n    # Print the prediction\n    print(f'Image: {image_file}, Prediction: {prediction[0]}')\n","metadata":{"execution":{"iopub.execute_input":"2024-02-04T04:14:46.730160Z","iopub.status.busy":"2024-02-04T04:14:46.729493Z","iopub.status.idle":"2024-02-04T04:14:51.544678Z","shell.execute_reply":"2024-02-04T04:14:51.543605Z"},"papermill":{"duration":4.965497,"end_time":"2024-02-04T04:14:51.546648","exception":false,"start_time":"2024-02-04T04:14:46.581151","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# EfficientNetB1","metadata":{"papermill":{"duration":0.146568,"end_time":"2024-02-04T04:14:51.840363","exception":false,"start_time":"2024-02-04T04:14:51.693795","status":"completed"},"tags":[]}},{"cell_type":"code","source":"from keras.applications import EfficientNetB1\n\n# Load the EfficientNetB1 model\nbase_efficientnetb1 = EfficientNetB1(include_top=False, input_shape=(224, 224, 3))","metadata":{"execution":{"iopub.execute_input":"2024-02-04T04:14:52.132743Z","iopub.status.busy":"2024-02-04T04:14:52.132400Z","iopub.status.idle":"2024-02-04T04:14:55.673272Z","shell.execute_reply":"2024-02-04T04:14:55.672450Z"},"papermill":{"duration":3.690439,"end_time":"2024-02-04T04:14:55.675848","exception":false,"start_time":"2024-02-04T04:14:51.985409","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"for layer in base_efficientnetb1.layers:\n    layer.trainable = False","metadata":{"execution":{"iopub.execute_input":"2024-02-04T04:14:56.020730Z","iopub.status.busy":"2024-02-04T04:14:56.020371Z","iopub.status.idle":"2024-02-04T04:14:56.038267Z","shell.execute_reply":"2024-02-04T04:14:56.037508Z"},"papermill":{"duration":0.167054,"end_time":"2024-02-04T04:14:56.040143","exception":false,"start_time":"2024-02-04T04:14:55.873089","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"flat1_efficientnetb1 = Flatten()(base_efficientnetb1.output)\nclass1_efficientnetb1 = Dense(128, activation='relu', kernel_initializer='he_uniform')(flat1_efficientnetb1)\noutput_efficientnetb1 = Dense(1, activation='sigmoid')(class1_efficientnetb1)\n\nefficientnetb1_model = Model(inputs=base_efficientnetb1.input, outputs=output_efficientnetb1)","metadata":{"execution":{"iopub.execute_input":"2024-02-04T04:14:56.334723Z","iopub.status.busy":"2024-02-04T04:14:56.334406Z","iopub.status.idle":"2024-02-04T04:14:56.393225Z","shell.execute_reply":"2024-02-04T04:14:56.392487Z"},"papermill":{"duration":0.209206,"end_time":"2024-02-04T04:14:56.395074","exception":false,"start_time":"2024-02-04T04:14:56.185868","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Compile the model\nopt_efficientnetb1 = SGD(lr=0.0001, momentum=0.9)\nefficientnetb1_model.compile(optimizer=opt_efficientnetb1, loss='binary_crossentropy', metrics=['accuracy'])\n\n# Print the model summary\nefficientnetb1_model.summary()","metadata":{"execution":{"iopub.execute_input":"2024-02-04T04:14:56.690994Z","iopub.status.busy":"2024-02-04T04:14:56.690344Z","iopub.status.idle":"2024-02-04T04:14:57.557228Z","shell.execute_reply":"2024-02-04T04:14:57.556185Z"},"papermill":{"duration":1.273024,"end_time":"2024-02-04T04:14:57.815289","exception":false,"start_time":"2024-02-04T04:14:56.542265","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Fit the model\nhistory_efficientnetb1 = efficientnetb1_model.fit(train_it, \n                                                  validation_data=test_it, \n                                                  epochs=10, verbose=1,\n                                                  callbacks=[PlotLossesKeras()])\n# Evaluate model\n_, acc = efficientnetb1_model.evaluate_generator(test_it, steps=len(test_it), verbose=1)\nprint('Accuracy > %.3f' % (acc * 100.0))","metadata":{"execution":{"iopub.execute_input":"2024-02-04T04:14:58.257696Z","iopub.status.busy":"2024-02-04T04:14:58.256882Z","iopub.status.idle":"2024-02-04T05:13:56.392070Z","shell.execute_reply":"2024-02-04T05:13:56.391066Z"},"papermill":{"duration":3538.356693,"end_time":"2024-02-04T05:13:56.394079","exception":false,"start_time":"2024-02-04T04:14:58.037386","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Save the model to a file\nefficientnetb1_model.save('efficientnetb1_model.h5')\n# Load the model from the file\nloaded_efficientnetb1_model = load_model('efficientnetb1_model.h5')","metadata":{"execution":{"iopub.execute_input":"2024-02-04T05:13:56.873933Z","iopub.status.busy":"2024-02-04T05:13:56.873577Z","iopub.status.idle":"2024-02-04T05:14:00.993211Z","shell.execute_reply":"2024-02-04T05:14:00.992367Z"},"papermill":{"duration":4.369015,"end_time":"2024-02-04T05:14:00.995575","exception":false,"start_time":"2024-02-04T05:13:56.626560","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Make Prediction","metadata":{"papermill":{"duration":0.227513,"end_time":"2024-02-04T05:14:01.451048","exception":false,"start_time":"2024-02-04T05:14:01.223535","status":"completed"},"tags":[]}},{"cell_type":"code","source":"# Function to load and prepare the image\ndef load_image(filename):\n    img = load_img(filename, target_size=(224, 224))\n    img = img_to_array(img)\n    img = img.reshape(1, 224, 224, 3)\n    img = img.astype('float32')\n    img = img / 255.0\n    return img\n\n# Function to predict the class\ndef predict_image(model, filename):\n    img = load_image(filename)\n    result = model.predict(img)\n    return result[0]\n\n# Load the VGG16 model\nefficientnetb1_model = load_model('efficientnetb1_model.h5')\n\n# Directory containing the images\nimage_directory = '/kaggle/working/test1/'\n\n# List all files in the directory\nimage_files = os.listdir(image_directory)\n\n# Randomly select 8 images\nselected_images = random.sample(image_files, 8)\n\n# Perform predictions for each selected image\nfor image_file in selected_images:\n    image_path = os.path.join(image_directory, image_file)\n    prediction = predict_image(efficientnetb1_model, image_path)\n\n    # Print the prediction\n    print(f'Image: {image_file}, Prediction: {prediction[0]}')","metadata":{"execution":{"iopub.execute_input":"2024-02-04T05:14:01.916058Z","iopub.status.busy":"2024-02-04T05:14:01.915043Z","iopub.status.idle":"2024-02-04T05:14:09.599427Z","shell.execute_reply":"2024-02-04T05:14:09.598441Z"},"papermill":{"duration":7.919925,"end_time":"2024-02-04T05:14:09.601330","exception":false,"start_time":"2024-02-04T05:14:01.681405","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# DenseNet169","metadata":{"papermill":{"duration":0.301147,"end_time":"2024-02-04T05:14:10.134967","exception":false,"start_time":"2024-02-04T05:14:09.833820","status":"completed"},"tags":[]}},{"cell_type":"code","source":"from keras.applications import DenseNet169\n\n# Load the DenseNet169 model\nbase_densenet169 = DenseNet169(include_top=False, input_shape=(224, 224, 3))","metadata":{"execution":{"iopub.execute_input":"2024-02-04T05:14:10.596927Z","iopub.status.busy":"2024-02-04T05:14:10.596118Z","iopub.status.idle":"2024-02-04T05:14:16.078105Z","shell.execute_reply":"2024-02-04T05:14:16.077289Z"},"papermill":{"duration":5.715616,"end_time":"2024-02-04T05:14:16.080346","exception":false,"start_time":"2024-02-04T05:14:10.364730","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"for layer in base_densenet169.layers:\n    layer.trainable = False","metadata":{"execution":{"iopub.execute_input":"2024-02-04T05:14:16.546471Z","iopub.status.busy":"2024-02-04T05:14:16.545669Z","iopub.status.idle":"2024-02-04T05:14:16.571293Z","shell.execute_reply":"2024-02-04T05:14:16.570459Z"},"papermill":{"duration":0.260222,"end_time":"2024-02-04T05:14:16.573253","exception":false,"start_time":"2024-02-04T05:14:16.313031","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"flat1_densenet169 = Flatten()(base_densenet169.output)\nclass1_densenet169 = Dense(128, activation='relu', kernel_initializer='he_uniform')(flat1_densenet169)\noutput_densenet169 = Dense(1, activation='sigmoid')(class1_densenet169)\n\ndensenet169_model = Model(inputs=base_densenet169.input, outputs=output_densenet169)","metadata":{"execution":{"iopub.execute_input":"2024-02-04T05:14:17.068708Z","iopub.status.busy":"2024-02-04T05:14:17.068371Z","iopub.status.idle":"2024-02-04T05:14:17.145841Z","shell.execute_reply":"2024-02-04T05:14:17.145133Z"},"papermill":{"duration":0.339465,"end_time":"2024-02-04T05:14:17.147718","exception":false,"start_time":"2024-02-04T05:14:16.808253","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"opt_densenet169 = SGD(lr=0.0001, momentum=0.9)\ndensenet169_model.compile(optimizer=opt_densenet169, loss='binary_crossentropy', metrics=['accuracy'])\ndensenet169_model.summary()","metadata":{"execution":{"iopub.execute_input":"2024-02-04T05:14:17.608960Z","iopub.status.busy":"2024-02-04T05:14:17.608622Z","iopub.status.idle":"2024-02-04T05:14:19.141350Z","shell.execute_reply":"2024-02-04T05:14:19.140404Z"},"papermill":{"duration":2.209341,"end_time":"2024-02-04T05:14:19.587633","exception":false,"start_time":"2024-02-04T05:14:17.378292","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Fit the model\nhistory_densenet169 = densenet169_model.fit(train_it,\n                                            validation_data=test_it,\n                                            epochs=10, verbose=1,\n                                            callbacks=[PlotLossesKeras()])\n# Evaluate model\n_, acc = densenet169_model.evaluate_generator(test_it, steps=len(test_it), verbose=1)\nprint('Accuracy > %.3f' % (acc * 100.0))","metadata":{"execution":{"iopub.execute_input":"2024-02-04T05:14:20.415616Z","iopub.status.busy":"2024-02-04T05:14:20.414792Z","iopub.status.idle":"2024-02-04T06:14:00.125793Z","shell.execute_reply":"2024-02-04T06:14:00.124764Z"},"papermill":{"duration":3580.155584,"end_time":"2024-02-04T06:14:00.127872","exception":false,"start_time":"2024-02-04T05:14:19.972288","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Save the model to a file\ndensenet169_model.save('densenet169_model.h5')\n\n# Load the model from the file\nloaded_densenet169_model = load_model('densenet169_model.h5')","metadata":{"execution":{"iopub.execute_input":"2024-02-04T06:14:00.945927Z","iopub.status.busy":"2024-02-04T06:14:00.945564Z","iopub.status.idle":"2024-02-04T06:14:07.702750Z","shell.execute_reply":"2024-02-04T06:14:07.701908Z"},"papermill":{"duration":7.138651,"end_time":"2024-02-04T06:14:07.705034","exception":false,"start_time":"2024-02-04T06:14:00.566383","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Make Prediction","metadata":{"papermill":{"duration":0.376471,"end_time":"2024-02-04T06:14:08.466440","exception":false,"start_time":"2024-02-04T06:14:08.089969","status":"completed"},"tags":[]}},{"cell_type":"code","source":"# Function to load and prepare the image\ndef load_image(filename):\n    img = load_img(filename, target_size=(224, 224))\n    img = img_to_array(img)\n    img = img.reshape(1, 224, 224, 3)\n    img = img.astype('float32')\n    img = img / 255.0\n    return img\n\n# Function to predict the class\ndef predict_image(model, filename):\n    img = load_image(filename)\n    result = model.predict(img)\n    return result[0]\n\n# Load the VGG16 model\ndensenet169_model = load_model('densenet169_model.h5')\n\n# Directory containing the images\nimage_directory = '/kaggle/working/test1/'\n\n# List all files in the directory\nimage_files = os.listdir(image_directory)\n\n# Randomly select 8 images\nselected_images = random.sample(image_files, 8)\n\n# Perform predictions for each selected image\nfor image_file in selected_images:\n    image_path = os.path.join(image_directory, image_file)\n    prediction = predict_image(densenet169_model, image_path)\n\n    # Print the prediction\n    print(f'Image: {image_file}, Prediction: {prediction[0]}')","metadata":{"execution":{"iopub.execute_input":"2024-02-04T06:14:09.225059Z","iopub.status.busy":"2024-02-04T06:14:09.224714Z","iopub.status.idle":"2024-02-04T06:14:20.519122Z","shell.execute_reply":"2024-02-04T06:14:20.517977Z"},"papermill":{"duration":11.674992,"end_time":"2024-02-04T06:14:20.521315","exception":false,"start_time":"2024-02-04T06:14:08.846323","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{"papermill":{"duration":0.377699,"end_time":"2024-02-04T06:14:21.306487","exception":false,"start_time":"2024-02-04T06:14:20.928788","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]}]}