{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.12.13","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[],"dockerImageVersionId":28755,"isInternetEnabled":false,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import os, random, shutil, zipfile\nfrom pathlib import Path\n\nimport numpy as np\nimport matplotlib.pyplot as plt","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true,"execution":{"iopub.status.busy":"2026-09-10T07:32:20.911622Z","iopub.execute_input":"2026-09-10T07:32:20.912040Z","iopub.status.idle":"2026-09-10T07:32:20.920410Z","shell.execute_reply.started":"2026-09-10T07:32:20.912010Z","shell.execute_reply":"2026-09-10T07:32:20.919776Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"import os\nprint(os.listdir('/kaggle/input'))","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-09-10T07:32:20.921619Z","iopub.execute_input":"2026-09-10T07:32:20.921956Z","iopub.status.idle":"2026-09-10T07:32:20.932628Z","shell.execute_reply.started":"2026-09-10T07:32:20.921934Z","shell.execute_reply":"2026-09-10T07:32:20.931990Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"import tensorflow as tf\nfrom tensorflow import keras\nfrom tensorflow.keras.preprocessing.image import ImageDataGenerator, load_img, img_to_array\nfrom tensorflow.keras.applications.vgg16 import VGG16, preprocess_input\nfrom tensorflow.keras.layers import Flatten, Dense, Dropout\nfrom tensorflow.keras.models import Model\nfrom tensorflow.keras.optimizers import SGD","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-09-10T07:32:20.933547Z","iopub.execute_input":"2026-09-10T07:32:20.933869Z","iopub.status.idle":"2026-09-10T07:32:35.593100Z","shell.execute_reply.started":"2026-09-10T07:32:20.933847Z","shell.execute_reply":"2026-09-10T07:32:35.592498Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"SEED = 42\nrandom.seed(SEED)\nnp.random.seed(SEED)\ntf.random.set_seed(SEED)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-09-10T07:32:35.594735Z","iopub.execute_input":"2026-09-10T07:32:35.595151Z","iopub.status.idle":"2026-09-10T07:32:35.599247Z","shell.execute_reply.started":"2026-09-10T07:32:35.595126Z","shell.execute_reply":"2026-09-10T07:32:35.598454Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"print(\"TensorFlow:\", tf.__version__)\nprint(\"GPU available:\", tf.config.list_physical_devices('GPU'))","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-09-10T07:32:35.600317Z","iopub.execute_input":"2026-09-10T07:32:35.600791Z","iopub.status.idle":"2026-09-10T07:32:36.613184Z","shell.execute_reply.started":"2026-09-10T07:32:35.600754Z","shell.execute_reply":"2026-09-10T07:32:36.612493Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"!nvidia-smi","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-09-10T07:32:36.614108Z","iopub.execute_input":"2026-09-10T07:32:36.615046Z","iopub.status.idle":"2026-09-10T07:32:36.922081Z","shell.execute_reply.started":"2026-09-10T07:32:36.615018Z","shell.execute_reply":"2026-09-10T07:32:36.921093Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"KAGGLE_INPUT = Path('/kaggle/input/competitions/dogs-vs-cats')\n\nWORK = Path('/kaggle/working/data')\nWORK.mkdir(parents=True, exist_ok=True)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-09-10T07:32:36.923400Z","iopub.execute_input":"2026-09-10T07:32:36.923701Z","iopub.status.idle":"2026-09-10T07:32:36.928791Z","shell.execute_reply.started":"2026-09-10T07:32:36.923618Z","shell.execute_reply":"2026-09-10T07:32:36.928130Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"train_zip = KAGGLE_INPUT / 'train.zip'\nif train_zip.exists() and not (WORK / 'train').exists():\n    with zipfile.ZipFile(train_zip) as z:\n        z.extractall(WORK)\n\ntest_zip = KAGGLE_INPUT / 'test1.zip'\nif test_zip.exists() and not (WORK / 'test1').exists():\n    with zipfile.ZipFile(test_zip) as z:\n        z.extractall(WORK)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-09-10T07:32:36.929764Z","iopub.execute_input":"2026-09-10T07:32:36.930074Z","iopub.status.idle":"2026-09-10T07:32:46.685501Z","shell.execute_reply.started":"2026-09-10T07:32:36.930053Z","shell.execute_reply":"2026-09-10T07:32:46.684872Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"SRC_DIR = (WORK / 'train') if (WORK / 'train').exists() else KAGGLE_INPUT\nTEST_SRC_DIR = (WORK / 'test1') if (WORK / 'test1').exists() else None\n\nprint(\"Using SRC_DIR:\", SRC_DIR)\nprint(\"Sample files:\", os.listdir(SRC_DIR)[:5])","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-09-10T07:32:46.686413Z","iopub.execute_input":"2026-09-10T07:32:46.686727Z","iopub.status.idle":"2026-09-10T07:32:46.704124Z","shell.execute_reply.started":"2026-09-10T07:32:46.686681Z","shell.execute_reply":"2026-09-10T07:32:46.703393Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"DATASET_DIR = Path('/kaggle/working/dataset') if Path('/kaggle/working').exists() else Path('/content/dataset')\nTRAIN_DIR = DATASET_DIR / 'train'\nVAL_DIR = DATASET_DIR / 'val'\nVAL_SPLIT = 0.25  \n\nfor split_dir in [TRAIN_DIR, VAL_DIR]:\n    for cls in ['cats', 'dogs']:\n        (split_dir / cls).mkdir(parents=True, exist_ok=True)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-09-10T07:32:46.706536Z","iopub.execute_input":"2026-09-10T07:32:46.706838Z","iopub.status.idle":"2026-09-10T07:32:46.711971Z","shell.execute_reply.started":"2026-09-10T07:32:46.706816Z","shell.execute_reply":"2026-09-10T07:32:46.711341Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"if not any(TRAIN_DIR.glob('cats/*.jpg')): \n    all_files = sorted(os.listdir(SRC_DIR))\n    all_files = [f for f in all_files if f.lower().endswith('.jpg')]\n    random.shuffle(all_files)\n\n    n_val = int(len(all_files) * VAL_SPLIT)\n    val_files = set(all_files[:n_val])\n\n    for fname in all_files:\n        label = 'cats' if fname.startswith('cat') else 'dogs'\n        dest_root = VAL_DIR if fname in val_files else TRAIN_DIR\n        shutil.copyfile(SRC_DIR / fname, dest_root / label / fname)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-09-10T07:32:46.713034Z","iopub.execute_input":"2026-09-10T07:32:46.713561Z","iopub.status.idle":"2026-09-10T07:32:49.577079Z","shell.execute_reply.started":"2026-09-10T07:32:46.713531Z","shell.execute_reply":"2026-09-10T07:32:49.576495Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"print(\"Train cats/dogs:\", len(os.listdir(TRAIN_DIR/'cats')), len(os.listdir(TRAIN_DIR/'dogs')))\nprint(\"Val   cats/dogs:\", len(os.listdir(VAL_DIR/'cats')), len(os.listdir(VAL_DIR/'dogs')))","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-09-10T07:32:49.578021Z","iopub.execute_input":"2026-09-10T07:32:49.578304Z","iopub.status.idle":"2026-09-10T07:32:49.594960Z","shell.execute_reply.started":"2026-09-10T07:32:49.578281Z","shell.execute_reply":"2026-09-10T07:32:49.594341Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"IMG_SIZE = (224, 224)\nBATCH_SIZE = 32\n\ntrain_datagen = ImageDataGenerator(rescale=1.0/255.0,\n                                    horizontal_flip=True,\n                                    rotation_range=15,\n                                    zoom_range=0.1)\nval_datagen = ImageDataGenerator(rescale=1.0/255.0)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-09-10T07:32:49.595891Z","iopub.execute_input":"2026-09-10T07:32:49.596193Z","iopub.status.idle":"2026-09-10T07:32:49.600325Z","shell.execute_reply.started":"2026-09-10T07:32:49.596164Z","shell.execute_reply":"2026-09-10T07:32:49.599700Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"train_gen = train_datagen.flow_from_directory(TRAIN_DIR, class_mode='binary',\n                                               batch_size=BATCH_SIZE, target_size=IMG_SIZE)\nval_gen = val_datagen.flow_from_directory(VAL_DIR, class_mode='binary',\n                                           batch_size=BATCH_SIZE, target_size=IMG_SIZE, shuffle=False)\n\nprint(train_gen.class_indices)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-09-10T07:32:49.601086Z","iopub.execute_input":"2026-09-10T07:32:49.601294Z","iopub.status.idle":"2026-09-10T07:32:49.802947Z","shell.execute_reply.started":"2026-09-10T07:32:49.601264Z","shell.execute_reply":"2026-09-10T07:32:49.802378Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"def build_baseline(input_shape=(224,224,3)):\n    model = keras.Sequential([\n        keras.layers.Conv2D(32, (3,3), activation='relu', kernel_initializer='he_uniform', padding='same', input_shape=input_shape),\n        keras.layers.MaxPooling2D((2,2)),\n        keras.layers.Conv2D(64, (3,3), activation='relu', kernel_initializer='he_uniform', padding='same'),\n        keras.layers.MaxPooling2D((2,2)),\n        keras.layers.Conv2D(128, (3,3), activation='relu', kernel_initializer='he_uniform', padding='same'),\n        keras.layers.MaxPooling2D((2,2)),\n        keras.layers.Flatten(),\n        keras.layers.Dense(128, activation='relu', kernel_initializer='he_uniform'),\n        keras.layers.Dense(1, activation='sigmoid')\n    ])\n    model.compile(optimizer=SGD(learning_rate=0.001, momentum=0.9),\n                  loss='binary_crossentropy', metrics=['accuracy'])\n    return model","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-09-10T07:32:49.803780Z","iopub.execute_input":"2026-09-10T07:32:49.804133Z","iopub.status.idle":"2026-09-10T07:32:49.812836Z","shell.execute_reply.started":"2026-09-10T07:32:49.804073Z","shell.execute_reply":"2026-09-10T07:32:49.812152Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"baseline_model = build_baseline()\nbaseline_model.summary()\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-09-10T07:32:49.813632Z","iopub.execute_input":"2026-09-10T07:32:49.814144Z","iopub.status.idle":"2026-09-10T07:32:51.293181Z","shell.execute_reply.started":"2026-09-10T07:32:49.814112Z","shell.execute_reply":"2026-09-10T07:32:51.292448Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"BASELINE_EPOCHS = 10\n\nbaseline_history = baseline_model.fit(\n    train_gen,\n    steps_per_epoch=len(train_gen),\n    validation_data=val_gen,\n    validation_steps=len(val_gen),\n    epochs=BASELINE_EPOCHS\n)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-09-10T07:32:51.294184Z","iopub.execute_input":"2026-09-10T07:32:51.294540Z","iopub.status.idle":"2026-09-10T08:05:32.173745Z","shell.execute_reply.started":"2026-09-10T07:32:51.294517Z","shell.execute_reply":"2026-09-10T08:05:32.172881Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"def plot_history(history, title):\n    fig, axes = plt.subplots(1, 2, figsize=(12,4))\n    axes[0].plot(history.history['loss'], label='train')\n    axes[0].plot(history.history['val_loss'], label='val')\n    axes[0].set_title(f'{title} - Loss'); axes[0].legend()\n    axes[1].plot(history.history['accuracy'], label='train')\n    axes[1].plot(history.history['val_accuracy'], label='val')\n    axes[1].set_title(f'{title} - Accuracy'); axes[1].legend()\n    plt.show()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-09-10T08:05:32.174870Z","iopub.execute_input":"2026-09-10T08:05:32.175370Z","iopub.status.idle":"2026-09-10T08:05:32.181036Z","shell.execute_reply.started":"2026-09-10T08:05:32.175344Z","shell.execute_reply":"2026-09-10T08:05:32.180184Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"def plot_history(history, title):\n    fig, axes = plt.subplots(1, 2, figsize=(12,4))\n    axes[0].plot(history.history['loss'], label='train')\n    axes[0].plot(history.history['val_loss'], label='val')\n    axes[0].set_title(f'{title} - Loss'); axes[0].legend()\n    axes[1].plot(history.history['accuracy'], label='train')\n    axes[1].plot(history.history['val_accuracy'], label='val')\n    axes[1].set_title(f'{title} - Accuracy'); axes[1].legend()\n    plt.show()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-09-10T08:05:32.181974Z","iopub.execute_input":"2026-09-10T08:05:32.182234Z","iopub.status.idle":"2026-09-10T08:05:32.196049Z","shell.execute_reply.started":"2026-09-10T08:05:32.182213Z","shell.execute_reply":"2026-09-10T08:05:32.195345Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"def build_transfer_model(input_shape=(224,224,3)):\n    base = VGG16(include_top=False, weights='imagenet', input_shape=input_shape)\n    for layer in base.layers:\n        layer.trainable = False  # freeze the pretrained convolutional base\n\n    x = Flatten()(base.output)\n    x = Dense(128, activation='relu', kernel_initializer='he_uniform')(x)\n    x = Dropout(0.5)(x)\n    output = Dense(1, activation='sigmoid')(x)\n\n    model = Model(inputs=base.inputs, outputs=output)\n    model.compile(optimizer=SGD(learning_rate=0.001, momentum=0.9),\n                  loss='binary_crossentropy', metrics=['accuracy'])\n    return model","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-09-10T08:05:32.197199Z","iopub.execute_input":"2026-09-10T08:05:32.197895Z","iopub.status.idle":"2026-09-10T08:05:32.212773Z","shell.execute_reply.started":"2026-09-10T08:05:32.197860Z","shell.execute_reply":"2026-09-10T08:05:32.211915Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"transfer_model = build_transfer_model()\ntransfer_model.summary()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-09-10T08:05:32.213591Z","iopub.execute_input":"2026-09-10T08:05:32.213948Z","iopub.status.idle":"2026-09-10T08:05:36.607990Z","shell.execute_reply.started":"2026-09-10T08:05:32.213893Z","shell.execute_reply":"2026-09-10T08:05:36.607434Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"train_datagen_tl = ImageDataGenerator(preprocessing_function=preprocess_input,\n                                       horizontal_flip=True,\n                                       rotation_range=15,\n                                       zoom_range=0.1)\nval_datagen_tl = ImageDataGenerator(preprocessing_function=preprocess_input)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-09-10T08:05:36.608799Z","iopub.execute_input":"2026-09-10T08:05:36.609148Z","iopub.status.idle":"2026-09-10T08:05:36.613240Z","shell.execute_reply.started":"2026-09-10T08:05:36.609108Z","shell.execute_reply":"2026-09-10T08:05:36.612705Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"train_gen_tl = train_datagen_tl.flow_from_directory(TRAIN_DIR, class_mode='binary',\n                                                     batch_size=BATCH_SIZE, target_size=IMG_SIZE)\nval_gen_tl = val_datagen_tl.flow_from_directory(VAL_DIR, class_mode='binary',\n                                                 batch_size=BATCH_SIZE, target_size=IMG_SIZE, shuffle=False)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-09-10T08:05:36.614798Z","iopub.execute_input":"2026-09-10T08:05:36.615077Z","iopub.status.idle":"2026-09-10T08:05:36.819116Z","shell.execute_reply.started":"2026-09-10T08:05:36.615055Z","shell.execute_reply":"2026-09-10T08:05:36.818535Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"TL_EPOCHS = 10\n\nes = keras.callbacks.EarlyStopping(monitor='val_accuracy', patience=3, restore_best_weights=True)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-09-10T08:05:36.820006Z","iopub.execute_input":"2026-09-10T08:05:36.820296Z","iopub.status.idle":"2026-09-10T08:05:36.824185Z","shell.execute_reply.started":"2026-09-10T08:05:36.820275Z","shell.execute_reply":"2026-09-10T08:05:36.823432Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"transfer_history = transfer_model.fit(\n    train_gen_tl,\n    steps_per_epoch=len(train_gen_tl),\n    validation_data=val_gen_tl,\n    validation_steps=len(val_gen_tl),\n    epochs=TL_EPOCHS,\n    callbacks=[es]\n)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-09-10T08:05:36.825140Z","iopub.execute_input":"2026-09-10T08:05:36.825761Z","iopub.status.idle":"2026-09-10T08:40:08.066186Z","shell.execute_reply.started":"2026-09-10T08:05:36.825738Z","shell.execute_reply":"2026-09-10T08:40:08.065508Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"plot_history(transfer_history, 'Transfer Learning (VGG16)')\n\nbest_val_acc = max(transfer_history.history['val_accuracy'])\nprint(\"Best transfer-learning val accuracy: %.4f\" % best_val_acc)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-09-10T08:40:08.067086Z","iopub.execute_input":"2026-09-10T08:40:08.067412Z","iopub.status.idle":"2026-09-10T08:40:08.302770Z","shell.execute_reply.started":"2026-09-10T08:40:08.067370Z","shell.execute_reply":"2026-09-10T08:40:08.301920Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"assert best_val_acc >= 0.85, \"Val accuracy did not reach 0.85 - try more epochs, unfreezing top VGG16 block, or more augmentation.\"\nprint(\"Target of 0.85 val accuracy reached!\")","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-09-10T08:40:08.303756Z","iopub.execute_input":"2026-09-10T08:40:08.304079Z","iopub.status.idle":"2026-09-10T08:40:08.309362Z","shell.execute_reply.started":"2026-09-10T08:40:08.304053Z","shell.execute_reply":"2026-09-10T08:40:08.308467Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"def predict_and_show(model, test_dir, n=10):\n    test_dir = Path(test_dir)\n    all_test_files = [f for f in os.listdir(test_dir) if f.lower().endswith('.jpg')]\n    sample_files = random.sample(all_test_files, n)\n\n    cols = 5\n    rows = (n + cols - 1) // cols\n    plt.figure(figsize=(cols*3, rows*3))\n\n    class_names = {v: k for k, v in train_gen_tl.class_indices.items()}  # {0:'cats',1:'dogs'}\n\n    for i, fname in enumerate(sample_files):\n        img_path = test_dir / fname\n        img = load_img(img_path, target_size=IMG_SIZE)\n        arr = img_to_array(img)\n        arr = preprocess_input(np.expand_dims(arr, axis=0))\n\n        prob = model.predict(arr, verbose=0)[0][0]\n        pred_idx = int(prob > 0.5)\n        pred_label = class_names[pred_idx]\n        confidence = prob if pred_idx == 1 else 1 - prob\n\n        plt.subplot(rows, cols, i+1)\n        plt.imshow(img)\n        plt.title(f\"{pred_label} ({confidence:.2f})\", fontsize=10)\n        plt.axis('off')\n\n    plt.tight_layout()\n    plt.show()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-09-10T08:40:08.313474Z","iopub.execute_input":"2026-09-10T08:40:08.313821Z","iopub.status.idle":"2026-09-10T08:40:08.323395Z","shell.execute_reply.started":"2026-09-10T08:40:08.313795Z","shell.execute_reply":"2026-09-10T08:40:08.322611Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"if TEST_SRC_DIR is not None:\n    predict_and_show(transfer_model, TEST_SRC_DIR, n=10)\nelse:\n    # Fallback: sample from the validation set instead if a separate test folder isn't available\n    print(\"No unlabeled test1/ folder found - sampling from the validation set instead.\")\n    val_cats = list((VAL_DIR/'cats').glob('*.jpg'))\n    val_dogs = list((VAL_DIR/'dogs').glob('*.jpg'))\n    sample_paths = random.sample(val_cats + val_dogs, 10)\n\n    plt.figure(figsize=(15, 6))\n    class_names = {v: k for k, v in train_gen_tl.class_indices.items()}\n    for i, p in enumerate(sample_paths):\n        img = load_img(p, target_size=IMG_SIZE)\n        arr = preprocess_input(np.expand_dims(img_to_array(img), axis=0))\n        prob = transfer_model.predict(arr, verbose=0)[0][0]\n        pred_idx = int(prob > 0.5)\n        pred_label = class_names[pred_idx]\n        confidence = prob if pred_idx == 1 else 1 - prob\n        plt.subplot(2, 5, i+1)\n        plt.imshow(img)\n        plt.title(f\"{pred_label} ({confidence:.2f})\", fontsize=10)\n        plt.axis('off')\n    plt.tight_layout()\n    plt.show()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-09-10T08:41:35.448175Z","iopub.execute_input":"2026-09-10T08:41:35.448739Z","iopub.status.idle":"2026-09-10T08:41:36.954192Z","shell.execute_reply.started":"2026-09-10T08:41:35.448709Z","shell.execute_reply":"2026-09-10T08:41:36.951164Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"transfer_model.save('/kaggle/working/cats_vs_dogs_transfer_vgg16.keras')\nprint(\"Model saved.\")","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-09-10T08:41:38.916328Z","iopub.execute_input":"2026-09-10T08:41:38.917064Z","iopub.status.idle":"2026-09-10T08:41:39.259425Z","shell.execute_reply.started":"2026-09-10T08:41:38.917033Z","shell.execute_reply":"2026-09-10T08:41:39.258751Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"","metadata":{"trusted":true},"outputs":[],"execution_count":null}]}