{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.11.13","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"nvidiaTeslaT4","dataSources":[{"sourceId":13836,"databundleVersionId":1718836,"sourceType":"competition"}],"dockerImageVersionId":31193,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":true}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\n\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true,"execution":{"iopub.status.busy":"2025-12-01T17:57:29.600701Z","iopub.execute_input":"2025-12-01T17:57:29.600936Z","iopub.status.idle":"2025-12-01T17:58:02.141291Z","shell.execute_reply.started":"2025-12-01T17:57:29.600912Z","shell.execute_reply":"2025-12-01T17:58:02.140279Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"import numpy as np\nimport pandas as pd\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nimport tensorflow as tf\nfrom tensorflow.keras import layers,models\nfrom sklearn.metrics import accuracy_score\nfrom tensorflow.keras.optimizers import Adam\nfrom tensorflow.keras.preprocessing.image import ImageDataGenerator\nfrom tensorflow.keras.applications.efficientnet import EfficientNetB3\nfrom tensorflow.keras import models, layers, optimizers\nimport warnings\nwarnings.simplefilter(\"ignore\")\nfrom PIL import Image\nfrom tensorflow.keras.callbacks import ModelCheckpoint, EarlyStopping, ReduceLROnPlateau","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-01T17:58:02.142975Z","iopub.execute_input":"2025-12-01T17:58:02.143293Z","iopub.status.idle":"2025-12-01T17:58:17.945024Z","shell.execute_reply.started":"2025-12-01T17:58:02.143275Z","shell.execute_reply":"2025-12-01T17:58:17.944389Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"import os\nDir = '../input/cassava-leaf-disease-classification'\nos.listdir(Dir)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-01T17:58:17.946019Z","iopub.execute_input":"2025-12-01T17:58:17.946578Z","iopub.status.idle":"2025-12-01T17:58:17.95238Z","shell.execute_reply.started":"2025-12-01T17:58:17.946551Z","shell.execute_reply":"2025-12-01T17:58:17.951496Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"print(len(os.listdir('../input/cassava-leaf-disease-classification/train_images')))","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-01T17:58:17.953327Z","iopub.execute_input":"2025-12-01T17:58:17.953584Z","iopub.status.idle":"2025-12-01T17:58:17.989805Z","shell.execute_reply.started":"2025-12-01T17:58:17.953568Z","shell.execute_reply":"2025-12-01T17:58:17.988972Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"print(len(os.listdir('../input/cassava-leaf-disease-classification/test_images')))","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-01T17:58:17.9905Z","iopub.execute_input":"2025-12-01T17:58:17.990727Z","iopub.status.idle":"2025-12-01T17:58:17.998607Z","shell.execute_reply.started":"2025-12-01T17:58:17.990685Z","shell.execute_reply":"2025-12-01T17:58:17.99796Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"train_df = pd.read_csv('../input/cassava-leaf-disease-classification/train.csv')\ntrain_df.head()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-01T17:58:18.000055Z","iopub.execute_input":"2025-12-01T17:58:18.000252Z","iopub.status.idle":"2025-12-01T17:58:18.044132Z","shell.execute_reply.started":"2025-12-01T17:58:18.000237Z","shell.execute_reply":"2025-12-01T17:58:18.043572Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"sns.countplot(train_df , x = 'label')","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-01T17:58:18.046068Z","iopub.execute_input":"2025-12-01T17:58:18.046285Z","iopub.status.idle":"2025-12-01T17:58:18.23818Z","shell.execute_reply.started":"2025-12-01T17:58:18.046269Z","shell.execute_reply":"2025-12-01T17:58:18.237623Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"train_df['label'].value_counts()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-01T17:58:18.238891Z","iopub.execute_input":"2025-12-01T17:58:18.239165Z","iopub.status.idle":"2025-12-01T17:58:18.248123Z","shell.execute_reply.started":"2025-12-01T17:58:18.239127Z","shell.execute_reply":"2025-12-01T17:58:18.247481Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"np.round((train_df['label'].value_counts()/len(train_df['label']))*100, 2)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-01T17:58:18.248826Z","iopub.execute_input":"2025-12-01T17:58:18.24905Z","iopub.status.idle":"2025-12-01T17:58:18.261343Z","shell.execute_reply.started":"2025-12-01T17:58:18.249012Z","shell.execute_reply":"2025-12-01T17:58:18.260767Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"len(train_df)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-01T17:58:18.262046Z","iopub.execute_input":"2025-12-01T17:58:18.262315Z","iopub.status.idle":"2025-12-01T17:58:18.27462Z","shell.execute_reply.started":"2025-12-01T17:58:18.262291Z","shell.execute_reply":"2025-12-01T17:58:18.273885Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"import json\nwith open('../input/cassava-leaf-disease-classification/label_num_to_disease_map.json') as file:\n    print(json.dumps(json.loads(file.read()), indent=4))","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-01T17:58:18.27549Z","iopub.execute_input":"2025-12-01T17:58:18.275771Z","iopub.status.idle":"2025-12-01T17:58:18.287274Z","shell.execute_reply.started":"2025-12-01T17:58:18.27575Z","shell.execute_reply":"2025-12-01T17:58:18.286621Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"import cv2\nsample = train_df[train_df.label == 0].sample(9)\nplt.figure(figsize=(12,12))\nfor ind, (image_id, label) in enumerate(zip(sample.image_id, sample.label)):\n    plt.subplot(3, 3, ind + 1)\n    image = cv2.imread(os.path.join(\"../input/cassava-leaf-disease-classification/train_images\", image_id))\n    image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)\n    plt.imshow(image)\n    plt.axis(\"off\")\n    \nplt.show()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-01T17:58:18.288113Z","iopub.execute_input":"2025-12-01T17:58:18.288357Z","iopub.status.idle":"2025-12-01T17:58:19.279482Z","shell.execute_reply.started":"2025-12-01T17:58:18.288341Z","shell.execute_reply":"2025-12-01T17:58:19.278372Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"sample = train_df[train_df.label == 1].sample(9)\nplt.figure(figsize=(12,12))\nfor ind, (image_id, label) in enumerate(zip(sample.image_id, sample.label)):\n    plt.subplot(4, 3, ind + 1)\n    image = cv2.imread(os.path.join(\"../input/cassava-leaf-disease-classification/train_images\", image_id))\n    image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)\n    plt.imshow(image)\n    plt.axis(\"off\")\n    \nplt.show()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-01T17:58:19.280562Z","iopub.execute_input":"2025-12-01T17:58:19.280843Z","iopub.status.idle":"2025-12-01T17:58:20.398203Z","shell.execute_reply.started":"2025-12-01T17:58:19.280817Z","shell.execute_reply":"2025-12-01T17:58:20.397281Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"sample = train_df[train_df.label == 2].sample(9)\nplt.figure(figsize=(12,12))\nfor ind, (image_id, label) in enumerate(zip(sample.image_id, sample.label)):\n    plt.subplot(3, 3, ind + 1)\n    image = cv2.imread(os.path.join(\"../input/cassava-leaf-disease-classification/train_images\", image_id))\n    image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)\n    plt.imshow(image)\n    plt.axis(\"off\")\n    \nplt.show()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-01T17:58:20.399198Z","iopub.execute_input":"2025-12-01T17:58:20.399541Z","iopub.status.idle":"2025-12-01T17:58:21.348772Z","shell.execute_reply.started":"2025-12-01T17:58:20.399511Z","shell.execute_reply":"2025-12-01T17:58:21.347893Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"sample = train_df[train_df.label == 3].sample(9)\nplt.figure(figsize=(12,12))\nfor ind, (img_id, lab) in enumerate(zip(sample.image_id, sample.label)):\n    plt.subplot(3,3,ind+1)\n    image = cv2.imread(os.path.join(\"../input/cassava-leaf-disease-classification/train_images\", img_id))\n    image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)\n    plt.imshow(image)\n    plt.axis(\"off\")\nplt.show()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-01T17:58:21.349627Z","iopub.execute_input":"2025-12-01T17:58:21.349973Z","iopub.status.idle":"2025-12-01T17:58:22.279137Z","shell.execute_reply.started":"2025-12-01T17:58:21.349947Z","shell.execute_reply":"2025-12-01T17:58:22.278174Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"sample = train_df[train_df.label == 4].sample(9)\nplt.figure(figsize=(12,12))\nfor ind, (img_id, lab) in enumerate(zip(sample.image_id, sample.label)):\n    plt.subplot(3,3,ind+1)\n    image = cv2.imread(os.path.join(\"../input/cassava-leaf-disease-classification/train_images\", img_id))\n    image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)\n    plt.imshow(image)\n    plt.axis(\"off\")\nplt.show()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-01T17:58:22.280049Z","iopub.execute_input":"2025-12-01T17:58:22.280269Z","iopub.status.idle":"2025-12-01T17:58:23.227862Z","shell.execute_reply.started":"2025-12-01T17:58:22.280252Z","shell.execute_reply":"2025-12-01T17:58:23.227078Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"y_pred = [3] * len(train_df.label)\nprint(\"The baseline accuracy is {}\".format(accuracy_score(y_pred, train_df.label)))","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-01T17:58:23.228844Z","iopub.execute_input":"2025-12-01T17:58:23.229068Z","iopub.status.idle":"2025-12-01T17:58:23.238904Z","shell.execute_reply.started":"2025-12-01T17:58:23.22905Z","shell.execute_reply":"2025-12-01T17:58:23.238211Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"Batch_size = 16\nimg_height, img_width = 300, 300","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-01T17:58:23.23969Z","iopub.execute_input":"2025-12-01T17:58:23.240005Z","iopub.status.idle":"2025-12-01T17:58:23.248674Z","shell.execute_reply.started":"2025-12-01T17:58:23.23998Z","shell.execute_reply":"2025-12-01T17:58:23.24795Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"train_df['label'].dtype","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-01T17:58:23.249491Z","iopub.execute_input":"2025-12-01T17:58:23.249757Z","iopub.status.idle":"2025-12-01T17:58:23.261058Z","shell.execute_reply.started":"2025-12-01T17:58:23.249734Z","shell.execute_reply":"2025-12-01T17:58:23.260373Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"train_df['label'] = train_df['label'].astype('str')\ngen = ImageDataGenerator(\n    horizontal_flip = True,\n    vertical_flip = True,\n    validation_split = 0.2,\n)\n\ntrain_datagen = gen.flow_from_dataframe(\n    train_df,\n    directory = os.path.join(Dir, \"train_images\"),\n    batch_size = Batch_size,\n    target_size = (img_height, img_width),\n    subset = \"training\",\n    seed = 42,\n    x_col = \"image_id\",\n    y_col = \"label\",\n    class_mode = \"categorical\"\n)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-01T17:58:23.261894Z","iopub.execute_input":"2025-12-01T17:58:23.26212Z","iopub.status.idle":"2025-12-01T17:58:32.492717Z","shell.execute_reply.started":"2025-12-01T17:58:23.262104Z","shell.execute_reply":"2025-12-01T17:58:32.492158Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"val_gen = ImageDataGenerator(\n    validation_split = 0.2\n)\n\nval_datagen = val_gen.flow_from_dataframe(\n    train_df,\n    directory = os.path.join(Dir, \"train_images\"),\n    batch_size = Batch_size,\n    target_size = (img_height, img_width),\n    subset = \"validation\",\n    seed = 42,\n    x_col = \"image_id\",\n    y_col = \"label\",\n    class_mode = \"categorical\"\n)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-01T17:58:32.493473Z","iopub.execute_input":"2025-12-01T17:58:32.493757Z","iopub.status.idle":"2025-12-01T17:58:41.532167Z","shell.execute_reply.started":"2025-12-01T17:58:32.493736Z","shell.execute_reply":"2025-12-01T17:58:41.53158Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"len(train_datagen), len(val_datagen) ","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-01T17:58:41.534896Z","iopub.execute_input":"2025-12-01T17:58:41.535094Z","iopub.status.idle":"2025-12-01T17:58:41.54007Z","shell.execute_reply.started":"2025-12-01T17:58:41.535077Z","shell.execute_reply":"2025-12-01T17:58:41.53947Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"img, label = next(train_datagen)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-01T17:58:41.541065Z","iopub.execute_input":"2025-12-01T17:58:41.541519Z","iopub.status.idle":"2025-12-01T17:58:41.690646Z","shell.execute_reply.started":"2025-12-01T17:58:41.541501Z","shell.execute_reply":"2025-12-01T17:58:41.690068Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"label","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-01T17:58:41.69139Z","iopub.execute_input":"2025-12-01T17:58:41.691612Z","iopub.status.idle":"2025-12-01T17:58:41.696809Z","shell.execute_reply.started":"2025-12-01T17:58:41.691595Z","shell.execute_reply":"2025-12-01T17:58:41.696216Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"Steps_per_train = float(train_datagen.n) / train_datagen.batch_size\nSteps_per_val = float(val_datagen.n) / val_datagen.batch_size","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-01T17:58:41.698236Z","iopub.execute_input":"2025-12-01T17:58:41.698492Z","iopub.status.idle":"2025-12-01T17:58:41.707179Z","shell.execute_reply.started":"2025-12-01T17:58:41.698475Z","shell.execute_reply":"2025-12-01T17:58:41.706555Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"Steps_per_train, Steps_per_val","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-01T17:58:41.707934Z","iopub.execute_input":"2025-12-01T17:58:41.708469Z","iopub.status.idle":"2025-12-01T17:58:41.718286Z","shell.execute_reply.started":"2025-12-01T17:58:41.70845Z","shell.execute_reply":"2025-12-01T17:58:41.717589Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"def create_model():\n    model = models.Sequential()\n    model.add(EfficientNetB3(\n        include_top=False, \n        weights='imagenet',\n        input_shape=(img_height, img_width, 3)\n    ))\n    model.add(layers.GlobalAveragePooling2D())\n    model.add(layers.Flatten())\n    model.add(layers.Dense(256, activation=\"relu\"))\n    model.add(layers.Dropout(0.3))\n    model.add(layers.Dense(5, activation='softmax'))\n    \n    loss = tf.keras.losses.CategoricalCrossentropy(label_smoothing=0.0001)\n    optimizer = optimizers.Adam(learning_rate=1e-4)\n    \n    model.compile(optimizer=optimizer,\n                  loss=loss,\n                  metrics=[\"categorical_accuracy\"])\n    return model\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-01T19:13:14.186917Z","iopub.execute_input":"2025-12-01T19:13:14.188244Z","iopub.status.idle":"2025-12-01T19:13:14.193534Z","shell.execute_reply.started":"2025-12-01T19:13:14.188216Z","shell.execute_reply":"2025-12-01T19:13:14.192762Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"model = create_model()\nmodel.summary()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-01T19:13:20.695137Z","iopub.execute_input":"2025-12-01T19:13:20.69541Z","iopub.status.idle":"2025-12-01T19:13:23.901364Z","shell.execute_reply.started":"2025-12-01T19:13:20.695389Z","shell.execute_reply":"2025-12-01T19:13:23.900639Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# Build the model\nmodel.build((None))\n\n# Plot the model\ntf.keras.utils.plot_model(model, show_shapes=True, show_layer_names=True)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-01T19:13:25.315837Z","iopub.execute_input":"2025-12-01T19:13:25.316093Z","iopub.status.idle":"2025-12-01T19:13:25.46612Z","shell.execute_reply.started":"2025-12-01T19:13:25.316074Z","shell.execute_reply":"2025-12-01T19:13:25.46551Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"rlronp=tf.keras.callbacks.ReduceLROnPlateau(monitor=\"val_loss\",\n                                            factor=0.2,\n                                            mode = \"min\",\n                                            min_lr=1e-7,\n                                            patience=2, \n                                            verbose=1)\n\nestop=tf.keras.callbacks.EarlyStopping(monitor=\"val_loss\", \n                                       mode= \"min\",\n                                       patience=3, \n                                       verbose=1,\n                                       restore_best_weights=True)\n\nhistory = model.fit(\n    train_datagen,\n    steps_per_epoch=int(Steps_per_train),\n    epochs=5,\n    verbose =1,\n    validation_data=val_datagen,\n    validation_steps=int(Steps_per_val),\n    callbacks=[rlronp, estop]\n)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-01T19:13:33.982863Z","iopub.execute_input":"2025-12-01T19:13:33.983129Z","iopub.status.idle":"2025-12-01T19:31:51.841281Z","shell.execute_reply.started":"2025-12-01T19:13:33.98311Z","shell.execute_reply":"2025-12-01T19:31:51.840593Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# #Saving the model\n# model.save(\"Casava_Model.h5\")","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-01T19:39:05.265585Z","iopub.execute_input":"2025-12-01T19:39:05.266271Z","iopub.status.idle":"2025-12-01T19:39:05.269173Z","shell.execute_reply.started":"2025-12-01T19:39:05.266247Z","shell.execute_reply":"2025-12-01T19:39:05.268514Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"history.history.keys()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-01T19:39:08.636983Z","iopub.execute_input":"2025-12-01T19:39:08.637261Z","iopub.status.idle":"2025-12-01T19:39:08.642313Z","shell.execute_reply.started":"2025-12-01T19:39:08.63724Z","shell.execute_reply":"2025-12-01T19:39:08.641527Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"train_acc = history.history[\"categorical_accuracy\"]\nval_acc = history.history[\"val_categorical_accuracy\"]\nepochs = range(1, len(train_acc)+1)\nplt.plot(epochs, train_acc, \"bo\", label = \"Training Accuracy\")\nplt.plot(epochs, val_acc, \"b\", label = \"Validation Accuracy\")\nplt.title(\"Training and Validation Accuracy\")\nplt.legend()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-01T19:39:12.339118Z","iopub.execute_input":"2025-12-01T19:39:12.339668Z","iopub.status.idle":"2025-12-01T19:39:12.555046Z","shell.execute_reply.started":"2025-12-01T19:39:12.339644Z","shell.execute_reply":"2025-12-01T19:39:12.554447Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"plt.figure(figsize=(8,6))\ntrain_loss = history.history[\"loss\"]\nval_loss = history.history[\"val_loss\"]\nepochs = range(1, len(train_loss)+1)\nplt.plot(epochs, train_loss, \"bo\", label = \"Training Loss\")\nplt.plot(epochs, val_loss, \"b\", label = \"Validation Loss\")\nplt.title(\"Training and Validation Loss\")\nplt.legend()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-12-01T19:39:28.454505Z","iopub.execute_input":"2025-12-01T19:39:28.455236Z","iopub.status.idle":"2025-12-01T19:39:28.656659Z","shell.execute_reply.started":"2025-12-01T19:39:28.455211Z","shell.execute_reply":"2025-12-01T19:39:28.656116Z"}},"outputs":[],"execution_count":null}]}