From 7ecee0d3178f3a73da44e4bd2151f5e98a684479 Mon Sep 17 00:00:00 2001 From: Ronak Dedhiya Date: Mon, 30 Sep 2024 10:29:16 +0530 Subject: [PATCH] blur detection code --- Code/BlurDetection/BlurDetection.ipynb | 719 +++++++++++++++++ Code/BlurDetection/TrainNetwork.ipynb | 646 +++++++++++++++ Code/BlurDetection/TrainNetwork1.ipynb | 504 ++++++++++++ Code/BlurDetection/TrainNetworkMulti.ipynb | 754 ++++++++++++++++++ Code/BlurDetection/X_test_fft.csv | 36 + Code/BlurDetection/X_test_hwt.csv | 36 + Code/BlurDetection/X_test_laplacian.csv | 36 + .../X_test_modified_laplacian.csv | 36 + Code/BlurDetection/X_test_tenengrad.csv | 36 + Code/BlurDetection/X_train_fft.csv | 91 +++ Code/BlurDetection/X_train_hwt.csv | 91 +++ Code/BlurDetection/X_train_laplacian.csv | 91 +++ .../X_train_modified_laplacian.csv | 91 +++ Code/BlurDetection/X_train_tenengrad.csv | 91 +++ Code/BlurDetection/lap.sav | 0 Code/BlurDetection/test.xlsx | Bin 0 -> 5358 bytes Code/BlurDetection/time_fft.csv | 3 + Code/BlurDetection/time_hwt.csv | 3 + Code/BlurDetection/time_laplacian.csv | 3 + .../BlurDetection/time_modified_laplacian.csv | 3 + Code/BlurDetection/train.xlsx | Bin 0 -> 6145 bytes Code/BlurDetection/y_test_fft.csv | 36 + Code/BlurDetection/y_test_hwt.csv | 36 + Code/BlurDetection/y_test_laplacian.csv | 36 + .../y_test_modified_laplacian.csv | 36 + Code/BlurDetection/y_test_tenengrad.csv | 36 + Code/BlurDetection/y_train_fft.csv | 91 +++ Code/BlurDetection/y_train_hwt.csv | 91 +++ Code/BlurDetection/y_train_laplacian.csv | 91 +++ .../y_train_modified_laplacian.csv | 91 +++ Code/BlurDetection/y_train_tenengrad.csv | 91 +++ 31 files changed, 3905 insertions(+) create mode 100644 Code/BlurDetection/BlurDetection.ipynb create mode 100644 Code/BlurDetection/TrainNetwork.ipynb create mode 100644 Code/BlurDetection/TrainNetwork1.ipynb create mode 100644 Code/BlurDetection/TrainNetworkMulti.ipynb create mode 100644 Code/BlurDetection/X_test_fft.csv create mode 100644 Code/BlurDetection/X_test_hwt.csv create mode 100644 Code/BlurDetection/X_test_laplacian.csv create mode 100644 Code/BlurDetection/X_test_modified_laplacian.csv create mode 100644 Code/BlurDetection/X_test_tenengrad.csv create mode 100644 Code/BlurDetection/X_train_fft.csv create mode 100644 Code/BlurDetection/X_train_hwt.csv create mode 100644 Code/BlurDetection/X_train_laplacian.csv create mode 100644 Code/BlurDetection/X_train_modified_laplacian.csv create mode 100644 Code/BlurDetection/X_train_tenengrad.csv create mode 100644 Code/BlurDetection/lap.sav create mode 100644 Code/BlurDetection/test.xlsx create mode 100644 Code/BlurDetection/time_fft.csv create mode 100644 Code/BlurDetection/time_hwt.csv create mode 100644 Code/BlurDetection/time_laplacian.csv create mode 100644 Code/BlurDetection/time_modified_laplacian.csv create mode 100644 Code/BlurDetection/train.xlsx create mode 100644 Code/BlurDetection/y_test_fft.csv create mode 100644 Code/BlurDetection/y_test_hwt.csv create mode 100644 Code/BlurDetection/y_test_laplacian.csv create mode 100644 Code/BlurDetection/y_test_modified_laplacian.csv create mode 100644 Code/BlurDetection/y_test_tenengrad.csv create mode 100644 Code/BlurDetection/y_train_fft.csv create mode 100644 Code/BlurDetection/y_train_hwt.csv create mode 100644 Code/BlurDetection/y_train_laplacian.csv create mode 100644 Code/BlurDetection/y_train_modified_laplacian.csv create mode 100644 Code/BlurDetection/y_train_tenengrad.csv diff --git a/Code/BlurDetection/BlurDetection.ipynb b/Code/BlurDetection/BlurDetection.ipynb new file mode 100644 index 0000000..0691935 --- /dev/null +++ b/Code/BlurDetection/BlurDetection.ipynb @@ -0,0 +1,719 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "id": "2F8AObaEJwI1", + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "executionInfo": { + "elapsed": 26493, + "status": "ok", + "timestamp": 1649545852078, + "user": { + "displayName": "Pragya Roy", + "userId": "05540828895945034913" + }, + "user_tz": -330 + }, + "id": "2F8AObaEJwI1", + "outputId": "7b5c65ae-7144-4b45-831a-35db0e305f7f" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Mounted at /gdrive\n" + ] + } + ], + "source": [ + "from google.colab import drive\n", + "drive.mount('/gdrive')" + ] + }, + { + "cell_type": "markdown", + "id": "RQL2PaJdh-pi", + "metadata": { + "id": "RQL2PaJdh-pi" + }, + "source": [] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "a2b42893-d3bf-474f-8a23-6ed591c87755", + "metadata": { + "id": "a2b42893-d3bf-474f-8a23-6ed591c87755" + }, + "outputs": [], + "source": [ + "import cv2\n", + "import matplotlib.pyplot as plt\n", + "import numpy as np\n", + "import pandas as pd\n", + "from sklearn.preprocessing import StandardScaler\n", + "from sklearn.pipeline import make_pipeline\n", + "from sklearn.svm import SVC\n", + "from sklearn.metrics import precision_score, recall_score, f1_score, balanced_accuracy_score\n", + "import time\n", + "import pywt" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "kFZakClBrDKE", + "metadata": { + "id": "kFZakClBrDKE" + }, + "outputs": [], + "source": [ + "rootPath = \"./\"\n", + "# rootPath = \"/gdrive/MyDrive/ICALML/\"" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "NsN2CD0KOrzr", + "metadata": { + "id": "NsN2CD0KOrzr" + }, + "outputs": [], + "source": [ + "### Define your algorithm here\n", + "\n", + "def laplacian(frame):\n", + " image = cv2.cvtColor(frame,cv2.COLOR_BGR2GRAY)\n", + " val = cv2.Laplacian(image, cv2.CV_64F).var()\n", + " return val\n" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "bpPC5o47tDnw", + "metadata": { + "id": "bpPC5o47tDnw" + }, + "outputs": [], + "source": [ + "def HWT(img, threshold = 35):\n", + " \n", + " # Convert image to grayscale\n", + " Y = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)\n", + " \n", + " \n", + " M, N = Y.shape\n", + " \n", + " # Crop input image to be 3 divisible by 2\n", + " Y = Y[0:int(M/16)*16, 0:int(N/16)*16]\n", + " \n", + " # Step 1, compute Haar wavelet of input image\n", + " LL1,(LH1,HL1,HH1)= pywt.dwt2(Y, 'haar')\n", + " # Another application of 2D haar to LL1\n", + " LL2,(LH2,HL2,HH2)= pywt.dwt2(LL1, 'haar') \n", + " # Another application of 2D haar to LL2\n", + " LL3,(LH3,HL3,HH3)= pywt.dwt2(LL2, 'haar')\n", + " \n", + " # Construct the edge map in each scale Step 2\n", + " E1 = np.sqrt(np.power(LH1, 2)+np.power(HL1, 2)+np.power(HH1, 2))\n", + " E2 = np.sqrt(np.power(LH2, 2)+np.power(HL2, 2)+np.power(HH2, 2))\n", + " E3 = np.sqrt(np.power(LH3, 2)+np.power(HL3, 2)+np.power(HH3, 2))\n", + " \n", + " M1, N1 = E1.shape\n", + "\n", + " # Sliding window size level 1\n", + " sizeM1 = 8\n", + " sizeN1 = 8\n", + " \n", + " # Sliding windows size level 2\n", + " sizeM2 = int(sizeM1/2)\n", + " sizeN2 = int(sizeN1/2)\n", + " \n", + " # Sliding windows size level 3\n", + " sizeM3 = int(sizeM2/2)\n", + " sizeN3 = int(sizeN2/2)\n", + " \n", + " # Number of edge maps, related to sliding windows size\n", + " N_iter = int((M1/sizeM1)*(N1/sizeN1))\n", + " \n", + " Emax1 = np.zeros((N_iter))\n", + " Emax2 = np.zeros((N_iter))\n", + " Emax3 = np.zeros((N_iter))\n", + " \n", + " \n", + " count = 0\n", + " \n", + " # Sliding windows index of level 1\n", + " x1 = 0\n", + " y1 = 0\n", + " # Sliding windows index of level 2\n", + " x2 = 0\n", + " y2 = 0\n", + " # Sliding windows index of level 3\n", + " x3 = 0\n", + " y3 = 0\n", + " \n", + " # Sliding windows limit on horizontal dimension\n", + " Y_limit = N1-sizeN1\n", + " \n", + " while count < N_iter:\n", + " # Get the maximum value of slicing windows over edge maps \n", + " # in each level\n", + " Emax1[count] = np.max(E1[x1:x1+sizeM1,y1:y1+sizeN1])\n", + " Emax2[count] = np.max(E2[x2:x2+sizeM2,y2:y2+sizeN2])\n", + " Emax3[count] = np.max(E3[x3:x3+sizeM3,y3:y3+sizeN3])\n", + " \n", + " # if sliding windows ends horizontal direction\n", + " # move along vertical direction and resets horizontal\n", + " # direction\n", + " if y1 == Y_limit:\n", + " x1 = x1 + sizeM1\n", + " y1 = 0\n", + " \n", + " x2 = x2 + sizeM2\n", + " y2 = 0\n", + " \n", + " x3 = x3 + sizeM3\n", + " y3 = 0\n", + " \n", + " count += 1\n", + " \n", + " # windows moves along horizontal dimension\n", + " else:\n", + " \n", + " y1 = y1 + sizeN1\n", + " y2 = y2 + sizeN2\n", + " y3 = y3 + sizeN3\n", + " count += 1\n", + " \n", + " # Step 3\n", + " EdgePoint1 = Emax1 > threshold;\n", + " EdgePoint2 = Emax2 > threshold;\n", + " EdgePoint3 = Emax3 > threshold;\n", + " \n", + " # Rule 1 Edge Pojnts\n", + " EdgePoint = EdgePoint1 + EdgePoint2 + EdgePoint3\n", + " \n", + " n_edges = EdgePoint.shape[0]\n", + " \n", + " # Rule 2 Dirak-Structure or Astep-Structure\n", + " DAstructure = (Emax1[EdgePoint] > Emax2[EdgePoint]) * (Emax2[EdgePoint] > Emax3[EdgePoint]);\n", + " \n", + " # Rule 3 Roof-Structure or Gstep-Structure\n", + " \n", + " RGstructure = np.zeros((n_edges))\n", + "\n", + " for i in range(n_edges):\n", + " \n", + " if EdgePoint[i] == 1:\n", + " \n", + " if Emax1[i] < Emax2[i] and Emax2[i] < Emax3[i]:\n", + " \n", + " RGstructure[i] = 1\n", + " \n", + " # Rule 4 Roof-Structure\n", + " \n", + " RSstructure = np.zeros((n_edges))\n", + "\n", + " for i in range(n_edges):\n", + " \n", + " if EdgePoint[i] == 1:\n", + " \n", + " if Emax2[i] > Emax1[i] and Emax2[i] > Emax3[i]:\n", + " \n", + " RSstructure[i] = 1\n", + "\n", + " # Rule 5 Edge more likely to be in a blurred image \n", + "\n", + " BlurC = np.zeros((n_edges));\n", + "\n", + " for i in range(n_edges):\n", + " \n", + " if RGstructure[i] == 1 or RSstructure[i] == 1:\n", + " \n", + " if Emax1[i] < threshold:\n", + " \n", + " BlurC[i] = 1 \n", + " \n", + " # Step 6\n", + " Per = np.sum(DAstructure)/np.sum(EdgePoint)\n", + " \n", + " # Step 7\n", + " if (np.sum(RGstructure) + np.sum(RSstructure)) == 0:\n", + " \n", + " BlurExtent = 100\n", + " else:\n", + " BlurExtent = np.sum(BlurC) / (np.sum(RGstructure) + np.sum(RSstructure))\n", + " \n", + " return BlurExtent" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "26JsH7FaZrUg", + "metadata": { + "id": "26JsH7FaZrUg" + }, + "outputs": [], + "source": [ + "## Define dictionary of algo with name\n", + "algorithms = {'laplacian':laplacian,\n", + " 'HWT':HWT}" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "fMQUtNvrRQ7o", + "metadata": { + "id": "fMQUtNvrRQ7o" + }, + "outputs": [], + "source": [ + "def processVideo(file,algo):\n", + " value = []\n", + " cap = cv2.VideoCapture(file)\n", + " while(1):\n", + " ret,frame = cap.read()\n", + " if ret:\n", + " val = algorithms[algo](frame) \n", + " value.append(val)\n", + " else:\n", + " break\n", + " return np.min(value),np.mean(value),np.max(value),np.std(value)" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "tGEUVdzh1bUE", + "metadata": { + "id": "tGEUVdzh1bUE" + }, + "outputs": [], + "source": [ + "## Get features\n", + "def getFeatures(data,types = 'laplacian'):\n", + " X_data = []\n", + " y_data = []\n", + " time_logs = []\n", + " for items in zip(data[\"Filename\"],data[\"Label\"]):\n", + " print(\"Processing video:\",items[0])\n", + " start = time.time()\n", + " res = processVideo(items[0],types)\n", + " end = time.time()\n", + " X_data.append([res[0],res[1],res[2],res[3]])\n", + " y_data.append(items[1])\n", + " time_logs.append([end-start])\n", + " return X_data,y_data,time_logs" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "FyfkWYycMoRV", + "metadata": { + "id": "FyfkWYycMoRV" + }, + "outputs": [], + "source": [ + "def trainModel(data,label):\n", + " clf = make_pipeline(SVC(kernel = 'linear', gamma='auto'))\n", + " clf.fit(data, label)\n", + " return clf\n", + "\n", + "def trainModelMulti(data,label):\n", + " clf = make_pipeline(OneVsRestClassifier(SVC(kernel = 'linear', gamma='auto')))\n", + " clf.fit(data, label)\n", + " return clf\n", + "\n", + "def testModel(model,data,label):\n", + " y_pred = model.predict(data)\n", + " pr = precision_score(label,y_pred) \n", + " re = recall_score(label,y_pred)\n", + " f1 = f1_score(label,y_pred) \n", + " acc = balanced_accuracy_score(label,y_pred)\n", + " return {'precision':pr,'recall':re,\"F1\":f1,\"acc\":acc}\n", + "\n", + "def testModelMulti(model,data,label):\n", + " y_pred = model.predict(data)\n", + " pr = precision_score(label,y_pred,average=None) \n", + " re = recall_score(label,y_pred,average=None)\n", + " f1 = f1_score(label,y_pred,average=None) \n", + " return {'precision':pr,'recall':re,\"F1\":f1}" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "CkQ-wzjP9kSa", + "metadata": { + "id": "CkQ-wzjP9kSa" + }, + "outputs": [], + "source": [ + "train = pd.read_excel(rootPath + \"train.xlsx\")\n", + "test = pd.read_excel(rootPath + \"test.xlsx\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "rBXgUukU8R6s", + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "executionInfo": { + "elapsed": 1595280, + "status": "ok", + "timestamp": 1649547579161, + "user": { + "displayName": "Pragya Roy", + "userId": "05540828895945034913" + }, + "user_tz": -330 + }, + "id": "rBXgUukU8R6s", + "outputId": "87b183a3-ab87-42c0-a9c4-5efafec92ba9" + }, + "outputs": [], + "source": [ + "## Train Data\n", + "X_train,y_train,train_logs = getFeatures(train,'laplacian')\n", + "pd.DataFrame(X_train,columns=[\"min\",\"mean\",\"max\",\"std\"]).to_csv(rootPath + \"X_train_laplacian.csv\",index=None)\n", + "pd.DataFrame(y_train,columns=[\"label\"]).to_csv(rootPath + \"y_train_laplacian.csv\",index=None)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "k3tIh-EZ26Oo", + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "executionInfo": { + "elapsed": 575026, + "status": "ok", + "timestamp": 1649548164370, + "user": { + "displayName": "Pragya Roy", + "userId": "05540828895945034913" + }, + "user_tz": -330 + }, + "id": "k3tIh-EZ26Oo", + "outputId": "2a4b8d95-5adc-4825-cf65-07373a277a8c" + }, + "outputs": [], + "source": [ + "## Test Data\n", + "X_test,y_test,test_logs = getFeatures(test,'laplacian')\n", + "pd.DataFrame(X_test,columns=[\"min\",\"mean\",\"max\",\"std\"]).to_csv(rootPath + \"X_test_laplacian.csv\",index=None)\n", + "pd.DataFrame(y_test,columns=[\"label\"]).to_csv(rootPath + \"y_test_laplacian.csv\",index=None)\n", + "pd.DataFrame([train_logs,test_logs]).to_csv(rootPath + \"time_laplacian.csv\",index=None)" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "id": "UDXRcrRn_Qzk", + "metadata": { + "id": "UDXRcrRn_Qzk" + }, + "outputs": [], + "source": [ + "X_train = pd.read_csv(rootPath + \"X_train_laplacian.csv\")\n", + "X_test = pd.read_csv(rootPath + \"X_test_laplacian.csv\")\n", + "y_train = pd.read_csv(rootPath + \"y_train_laplacian.csv\").values.reshape(-1)\n", + "y_test = pd.read_csv(rootPath + \"y_test_laplacian.csv\").values.reshape(-1)" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "id": "uj5UaMObZXOA", + "metadata": { + "id": "uj5UaMObZXOA" + }, + "outputs": [], + "source": [ + "## Make binary labels\n", + "y_train1 = np.array(y_train)\n", + "y_train1[y_train1 > 0] = 1\n", + "\n", + "y_test1 = np.array(y_test)\n", + "y_test1[y_test1 > 0] = 1" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "id": "4p6gigykZafh", + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "executionInfo": { + "elapsed": 358, + "status": "ok", + "timestamp": 1648150212858, + "user": { + "displayName": "DEDHIYA RONAK DINESH", + "photoUrl": "https://lh3.googleusercontent.com/a/default-user=s64", + "userId": "17898322514602072598" + }, + "user_tz": -330 + }, + "id": "4p6gigykZafh", + "outputId": "35394144-55fc-4a67-b1f1-76dbff0957dc" + }, + "outputs": [ + { + "data": { + "text/plain": [ + "{'precision': 0.8709677419354839,\n", + " 'recall': 0.9642857142857143,\n", + " 'F1': 0.9152542372881356,\n", + " 'acc': 0.6964285714285714}" + ] + }, + "execution_count": 29, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "model = trainModel(X_train,y_train1)\n", + "testModel(model,X_test,y_test1)" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "id": "22727021-2708-40c6-ac65-bd21c90ce400", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([0., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 0., 1.,\n", + " 1., 1., 1., 1., 1., 1., 1., 1., 0., 0., 1., 1., 1., 1., 1., 1., 1.,\n", + " 1.])" + ] + }, + "execution_count": 32, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "model.predict(X_test)" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "id": "Q5JuXfmraKLF", + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "executionInfo": { + "elapsed": 384, + "status": "ok", + "timestamp": 1648179532931, + "user": { + "displayName": "DEDHIYA RONAK DINESH", + "photoUrl": "https://lh3.googleusercontent.com/a/default-user=s64", + "userId": "17898322514602072598" + }, + "user_tz": -330 + }, + "id": "Q5JuXfmraKLF", + "outputId": "7348bdd6-f095-430a-8c19-a63e9baf8ffa" + }, + "outputs": [ + { + "data": { + "text/plain": [ + "{'precision': 0.8709677419354839,\n", + " 'recall': 0.9642857142857143,\n", + " 'F1': 0.9152542372881356,\n", + " 'acc': 0.6964285714285714}" + ] + }, + "execution_count": 31, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "### HWT\n", + "## Train Data\n", + "# X_train,y_train,train_logs = getFeatures(train,'HWT')\n", + "# pd.DataFrame(X_train,columns=[\"min\",\"mean\",\"max\",\"std\"]).to_csv(rootPath + \"X_train_hwt.csv\",index=None)\n", + "# pd.DataFrame(y_train,columns=[\"label\"]).to_csv(rootPath + \"y_train_hwt.csv\",index=None)\n", + "# # ## Test Data\n", + "# X_test,y_test,test_logs = getFeatures(test,'HWT')\n", + "# pd.DataFrame(X_test,columns=[\"min\",\"mean\",\"max\",\"std\"]).to_csv(rootPath + \"X_test_hwt.csv\",index=None)\n", + "# pd.DataFrame(y_test,columns=[\"label\"]).to_csv(rootPath + \"y_test_hwt.csv\",index=None)\n", + "# pd.DataFrame([train_logs,test_logs]).to_csv(rootPath + \"time_hwt.csv\",index=None)\n", + "## Save features\n", + "X_train = pd.read_csv(rootPath + \"X_train_hwt.csv\")\n", + "X_test = pd.read_csv(rootPath + \"X_test_hwt.csv\")\n", + "y_train = pd.read_csv(rootPath + \"y_train_hwt.csv\").values.reshape(-1)\n", + "y_test = pd.read_csv(rootPath + \"y_test_hwt.csv\").values.reshape(-1)\n", + "## Make binary labels\n", + "y_train1 = np.array(y_train)\n", + "y_train1[y_train1 > 0] = 1\n", + "y_test1 = np.array(y_test)\n", + "y_test1[y_test1 > 0] = 1\n", + "## Train test SVM model\n", + "model = trainModel(X_train,y_train1)\n", + "testModel(model,X_test,y_test1)" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "yImq3TEdK8J-", + "metadata": { + "id": "yImq3TEdK8J-" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "laplacian {'precision': 0.8709677419354839, 'recall': 0.9642857142857143, 'F1': 0.9152542372881356, 'acc': 0.6964285714285714}\n", + "fft {'precision': 0.8, 'recall': 1.0, 'F1': 0.888888888888889, 'acc': 0.5}\n", + "hwt {'precision': 0.8709677419354839, 'recall': 0.9642857142857143, 'F1': 0.9152542372881356, 'acc': 0.6964285714285714}\n", + "modified_laplacian {'precision': 0.8, 'recall': 1.0, 'F1': 0.888888888888889, 'acc': 0.5}\n" + ] + } + ], + "source": [ + "## Check all methods:\n", + "output = []\n", + "methods = [\"laplacian\",\"fft\",\"hwt\",\"modified_laplacian\"]\n", + "for ext in methods:\n", + " X_train = pd.read_csv(rootPath + \"X_train_\" + ext+ \".csv\")\n", + " X_test = pd.read_csv(rootPath + \"X_test_\" + ext + \".csv\")\n", + " y_train = pd.read_csv(rootPath + \"y_train_\" + ext + \".csv\").values.reshape(-1)\n", + " y_test = pd.read_csv(rootPath + \"y_test_\" + ext + \".csv\").values.reshape(-1)\n", + " ## Make binary labels\n", + " y_train1 = np.array(y_train)\n", + " y_train1[y_train1 > 0] = 1\n", + " y_test1 = np.array(y_test)\n", + " y_test1[y_test1 > 0] = 1\n", + " \n", + " data = X_train.iloc[:,:]\n", + " label = y_train1\n", + " ## Train test SVM model\n", + " model = make_pipeline(SVC(kernel = 'linear', gamma='auto'))\n", + " model.fit(data, label)\n", + " \n", + " data = X_test.iloc[:,:]\n", + " label = y_test1\n", + " val = testModel(model,data,label)\n", + " output.append(val)\n", + " print(ext,val)" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "id": "3da84d06-ad7a-4743-826b-a4256e0403ca", + "metadata": {}, + "outputs": [], + "source": [ + "pd.DataFrame(output,index=methods).to_csv(\"result/svm.csv\")" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "id": "e1839658-df44-4c72-8f6b-28a84fad0cf2", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "0 124.596774\n", + "1 122.967120\n", + "2 120.067307\n", + "3 118.074145\n", + "4 117.785813\n", + " ... \n", + "85 124.917373\n", + "86 124.593396\n", + "87 123.607062\n", + "88 122.272332\n", + "89 121.901565\n", + "Name: min, Length: 90, dtype: float64" + ] + }, + "execution_count": 42, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "X_train.iloc[:,0]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "SjTPshC2BmAM", + "metadata": { + "id": "SjTPshC2BmAM" + }, + "outputs": [], + "source": [ + "## Multiclass \n", + "from sklearn.preprocessing import OneHotEncoder\n", + "from sklearn.multiclass import OneVsRestClassifier\n", + "encoder = OneHotEncoder()\n", + "model = trainModelMulti(X_train,encoder.fit_transform(y_train).toarray())\n", + "testModelMulti(model,X_test,encoder.fit_transform(y_test).toarray())" + ] + } + ], + "metadata": { + "colab": { + "collapsed_sections": [], + "name": "BlurDetection.ipynb", + "provenance": [] + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "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.9.7" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/Code/BlurDetection/TrainNetwork.ipynb b/Code/BlurDetection/TrainNetwork.ipynb new file mode 100644 index 0000000..09f82c3 --- /dev/null +++ b/Code/BlurDetection/TrainNetwork.ipynb @@ -0,0 +1,646 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "b35f6090-2f61-41b6-aabc-a8d80ad518e5", + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "from sklearn.linear_model import LogisticRegression\n", + "from sklearn.svm import SVC\n", + "from sklearn.ensemble import RandomForestClassifier\n", + "from sklearn.ensemble import GradientBoostingClassifier\n", + "from sklearn.pipeline import Pipeline\n", + "from sklearn.model_selection import GridSearchCV, RandomizedSearchCV\n", + "from sklearn.model_selection import train_test_split\n", + "from sklearn.tree import DecisionTreeClassifier\n", + "from sklearn.naive_bayes import MultinomialNB\n", + "from sklearn.neighbors import KNeighborsClassifier\n", + "from sklearn.neural_network import MLPClassifier\n", + "from sklearn.metrics import *\n", + "import numpy as np\n", + "from itertools import combinations\n", + "from sklearn.model_selection import PredefinedSplit\n", + "import glob\n", + "pd.set_option('display.max_rows', None)" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "994b1e27-c89a-4ee9-85dc-292eddc4f38c", + "metadata": {}, + "outputs": [], + "source": [ + "# Initialze the estimators\n", + "clf1 = RandomForestClassifier(random_state=42)\n", + "# clf2 = SVC(kernel='sigmoid',probability=True, random_state=42)\n", + "clf3 = LogisticRegression(random_state=42)\n", + "clf4 = DecisionTreeClassifier(random_state=42)\n", + "clf5 = KNeighborsClassifier()\n", + "clf6 = MultinomialNB()\n", + "# clf7 = GradientBoostingClassifier(random_state=42)\n", + "clf8 = MLPClassifier(max_iter=2000,random_state=42)\n", + "clf9 = SVC(kernel='poly',probability=True, random_state=42)\n", + "# clf10 = SVC(kernel='rbf',probability=True, random_state=42)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "89c51e29-4ee9-44b3-a0e1-0743a99e778c", + "metadata": {}, + "outputs": [], + "source": [ + "class ColumnExtractor(object):\n", + " def __init__(self, cols=None):\n", + " self.cols = cols\n", + " def transform(self, X):\n", + " return X[:,self.cols]\n", + " def fit(self, X, y=None):\n", + " return self\n", + " def get_params(self,deep=True):\n", + " return {\"cols\" : self.cols}\n", + " \n", + " def set_params(self, **parameters):\n", + " for parameter, value in parameters.items():\n", + " setattr(self, parameter, value)" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "ad2da986-2722-4e42-a24e-3a2b713f5089", + "metadata": {}, + "outputs": [], + "source": [ + "# Initiaze the hyperparameters for each dictionary\n", + "param1 = {}\n", + "param1['feat_select__cols'] = sum([list(combinations(np.arange(0,20,1), i)) for i in range(1,5)], [])\n", + "# param1['feat_select__cols'] = [(0,2,4,6,8,10,12,14,16,18)]\n", + "param1['classifier__n_estimators'] = [10, 20, 30, 40]\n", + "param1['classifier__max_depth'] = [2, 3, 4]\n", + "param1['classifier__class_weight'] = [None, 'balanced']\n", + "# param1['classifier'] = [clf1]\n", + "\n", + "param2 = {}\n", + "# param2['feat_select__cols'] = sum([list(combinations(np.arange(0,20,1), i)) for i in range(1,5)], [])\n", + "param2['classifier__C'] = [10**-2, 10**-1, 10**0, 10**1, 10**2]\n", + "# param2['Classifier__kernel'] = [ 'linear']\n", + "param2['classifier__class_weight'] = [None, 'balanced']\n", + "param2['classifier__degree'] = [2,3]\n", + "# param2['classifier'] = [clf2]\n", + "\n", + "param3 = {}\n", + "param3['feat_select__cols'] = [(0,2,4,6,8,10,12,14,16,18)]\n", + "param3['feat_select__cols'] = sum([list(combinations(np.arange(0,20,1), i)) for i in range(1,5)], [])\n", + "param3['classifier__C'] = [10**-2, 10**-1, 10**0, 10**1, 10**2]\n", + "param3['classifier__penalty'] = ['l1', 'l2']\n", + "param3['classifier__class_weight'] = [None, 'balanced']\n", + "# param3['classifier'] = [clf3]\n", + "\n", + "param4 = {}\n", + "param4['feat_select__cols'] = sum([list(combinations(np.arange(0,20,1), i)) for i in range(1,4)], [])\n", + "param4['classifier__max_depth'] = [2,3,4,None]\n", + "param4['classifier__min_samples_split'] = [2,3,4]\n", + "param4['classifier__class_weight'] = [None, 'balanced']\n", + "# param4['classifier'] = [clf4]\n", + "\n", + "param5 = {}\n", + "param5['feat_select__cols'] = sum([list(combinations(np.arange(0,20,1), i)) for i in range(1,5)], [])\n", + "param5['classifier__n_neighbors'] = [2,3,4,5]\n", + "# param5['classifier'] = [clf5]\n", + "\n", + "param6 = {}\n", + "param6['feat_select__cols'] = sum([list(combinations(np.arange(0,20,1), i)) for i in range(1,5)], [])\n", + "param6['classifier__alpha'] = [10**0, 10**1, 10**2]\n", + "# param6['classifier'] = [clf6]\n", + "\n", + "param7 = {}\n", + "param7['feat_select__cols'] = sum([list(combinations(np.arange(0,20,1), i)) for i in range(1,5)], [])\n", + "param7['classifier__n_estimators'] = [10, 20, 30, 40]\n", + "param7['classifier__max_depth'] = [2, 3, 4]\n", + "# param7['classifier'] = [clf7]\n", + "\n", + "param8 = {}\n", + "# param8['feat_select__cols'] = sum([list(combinations(np.arange(0,20,1), i)) for i in range(1,5)], [])\n", + "param8['feat_select__cols'] = [(0,2,4,6,8,10,12,14,16,18)]\n", + "param8['classifier__hidden_layer_sizes'] = [(10),(10,10),(10,10,10)]\n", + "param8['classifier__solver'] = ['adam', 'sgd']\n", + "param8['classifier__alpha'] = [0.0001, 0.0005,0.001,0.005,0.01,0.05] \n", + "# param8['classifier'] = [clf8]" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "f8377b0d-68ef-46cc-9309-892ac57acbea", + "metadata": {}, + "outputs": [], + "source": [ + "pipeline1 = Pipeline([('feat_select',ColumnExtractor()),('classifier', clf1)])\n", + "# pipeline2 = Pipeline([('feat_select',ColumnExtractor()),('classifier', clf2)])\n", + "pipeline3 = Pipeline([('feat_select',ColumnExtractor()),('classifier', clf3)])\n", + "pipeline4 = Pipeline([('feat_select',ColumnExtractor()),('classifier', clf4)])\n", + "pipeline5 = Pipeline([('feat_select',ColumnExtractor()),('classifier', clf5)])\n", + "pipeline6 = Pipeline([('feat_select',ColumnExtractor()),('classifier', clf6)])\n", + "# pipeline7 = Pipeline([('feat_select',ColumnExtractor()),('classifier', clf7)])\n", + "pipeline8 = Pipeline([('feat_select',ColumnExtractor()),('classifier', clf8)])\n", + "pipeline9 = Pipeline([('feat_select',ColumnExtractor()),('classifier', clf9)])\n", + "# pipeline10 = Pipeline([('feat_select',ColumnExtractor()),('classifier', clf10)])\n" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "45b07060-759f-412a-8dbb-520bc23d3bfb", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['X_train_fft.csv',\n", + " 'X_train_hwt.csv',\n", + " 'X_train_laplacian.csv',\n", + " 'X_train_modified_laplacian.csv',\n", + " 'X_train_tenengrad.csv']" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "glob.glob(\"X_train*\")" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "5eef0bf1-1679-4fee-9e16-990691c3aa6b", + "metadata": {}, + "outputs": [], + "source": [ + "X_train_list = []\n", + "X_test_list = []\n", + "\n", + "for files in glob.glob(\"X_train*\"):\n", + " X_train_list.append(pd.read_csv(files))\n", + "X_train = np.hstack(X_train_list)\n", + "\n", + "for files in glob.glob(\"X_test*\"):\n", + " X_test_list.append(pd.read_csv(files))\n", + "X_test = np.hstack(X_test_list)\n", + "\n", + "y_train = pd.read_csv(\"y_train_laplacian.csv\").values.reshape(-1)\n", + "y_test = pd.read_csv(\"y_test_laplacian.csv\").values.reshape(-1)\n", + "## Make binary labels\n", + "y_train1 = np.array(y_train)\n", + "y_train1[y_train1 > 0] = 1\n", + "\n", + "y_test1 = np.array(y_test)\n", + "y_test1[y_test1 > 0] = 1" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "71d68ca3-e271-47e6-88e3-0d2ede7cae20", + "metadata": {}, + "outputs": [], + "source": [ + "indices = np.zeros(len(y_train1) + len(y_test1))\n", + "indices[:len(y_train1)] = -1\n", + "Data_X = np.vstack([X_train,X_test])\n", + "Data_Y = np.hstack([y_train1,y_test1])\n", + "\n", + "ps = PredefinedSplit(indices)\n", + "score = { \"Accuracy\":\"balanced_accuracy\" ,\"Recall\":\"recall\",\"Precision\":\"precision\",\"F1_Score\":\"f1\"}" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "id": "f08c52e3-7708-4bad-a261-bbbdd2194ae8", + "metadata": {}, + "outputs": [], + "source": [ + "grid1 = GridSearchCV(pipeline1, n_jobs=-1, param_grid=[param1],scoring=score,refit=\"F1_Score\",cv=ps)\n", + "# grid2 = GridSearchCV(pipeline2, n_jobs=-1, param_grid=[param2],scoring=score,refit=\"F1_Score\",cv=ps)\n", + "grid3 = GridSearchCV(pipeline3, n_jobs=-1, param_grid=[param3],scoring=score,refit=\"F1_Score\",cv=ps)\n", + "grid4 = GridSearchCV(pipeline4, n_jobs=-1, param_grid=[param4],scoring=score,refit=\"F1_Score\",cv=ps)\n", + "grid5 = GridSearchCV(pipeline5, n_jobs=-1, param_grid=[param5],scoring=score,refit=\"F1_Score\",cv=ps)\n", + "grid6 = GridSearchCV(pipeline6, n_jobs=-1, param_grid=[param6],scoring=score,refit=\"F1_Score\",cv=ps)\n", + "# grid7 = GridSearchCV(pipeline7, n_jobs=-1, param_grid=[param7],scoring=score,refit=\"F1_Score\",cv=ps)\n", + "grid8 = GridSearchCV(pipeline8, n_jobs=-1, param_grid=[param8],scoring=score,refit=\"F1_Score\",cv=ps)\n", + "grid9 = GridSearchCV(pipeline9, n_jobs=-1, param_grid=[param2],scoring=score,refit=\"F1_Score\",cv=ps)\n", + "# grid10 = GridSearchCV(pipeline10, n_jobs=-1, param_grid=[param2],scoring=score,refit=\"F1_Score\",cv=ps)" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "id": "c0f85649-e85b-4410-8f74-403ad6a64727", + "metadata": {}, + "outputs": [], + "source": [ + "grids = [grid1,grid3,grid4,grid5,grid6,grid8,grid9]" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "id": "02c53b2f-af67-4173-a290-0b4ce09fd333", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "GridSearchCV(cv=PredefinedSplit(test_fold=array([-1, -1, ..., 0, 0])),\n", + " estimator=Pipeline(steps=[('feat_select',\n", + " <__main__.ColumnExtractor object at 0x000002D554A93970>),\n", + " ('classifier',\n", + " RandomForestClassifier(random_state=42))]),\n", + " n_jobs=-1,\n", + " param_grid=[{'classifier__class_weight': [None, 'balanced'],\n", + " 'classifier__max_depth': [2, 3, 4],\n", + " 'classifier__n_estimators': [10, 20, 30, 40],\n", + " 'feat_select__cols': [(0,), (1,), (2,), (3,), (4,),\n", + " (5,), (6,), (7,), (8,), (9,),\n", + " (10,), (11,), (12,), (13,),\n", + " (14,), (15,), (16,), (17,),\n", + " (18,), (19,), (0, 1), (0, 2),\n", + " (0, 3), (0, 4), (0, 5), (0, 6),\n", + " (0, 7), (0, 8), (0, 9), (0, 10), ...]}],\n", + " refit='F1_Score',\n", + " scoring={'Accuracy': 'balanced_accuracy', 'F1_Score': 'f1',\n", + " 'Precision': 'precision', 'Recall': 'recall'})" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "grid1.fit(Data_X,Data_Y)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1ce542b8-60ba-4d2f-a92b-a182f791e06e", + "metadata": {}, + "outputs": [], + "source": [ + "for pipe in grids:\n", + " print(\"Yes Done\")\n", + " pipe.fit(Data_X,Data_Y)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7ccb5756-436b-4f6c-9c28-581d50dcaff4", + "metadata": {}, + "outputs": [], + "source": [ + "grid = grids[0]\n", + "print(grid.best_estimator_)\n", + "# print(pd.DataFrame(grid.cv_results_).iloc[grid.best_index_])" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "id": "9a9dddba-2d70-4703-9900-b86bd2665815", + "metadata": {}, + "outputs": [], + "source": [ + "df = pd.DataFrame(grid1.cv_results_).drop(columns=[\"mean_fit_time\",\"std_fit_time\",\"mean_score_time\",\"std_score_time\",\"params\",\n", + " \"mean_test_Accuracy\",\"std_test_Accuracy\",\"rank_test_Accuracy\",\n", + " \"mean_test_Recall\",\"std_test_Recall\",\"rank_test_Recall\",\n", + " \"mean_test_Precision\",\"std_test_Precision\",\"rank_test_Precision\",\n", + " \"mean_test_F1_Score\",\"std_test_F1_Score\",\"rank_test_F1_Score\"])" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "id": "ac7ce343-61ec-404c-ad5e-7de603dd97ad", + "metadata": {}, + "outputs": [], + "source": [ + "df[\"sum\"] = df[\"split0_test_Accuracy\"] + df[\"split0_test_Recall\"] + df[\"split0_test_Precision\"] + df[\"split0_test_F1_Score\"]" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "id": "ef62b998-fe69-4a0b-a179-b53f95b1ea31", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
param_classifier__class_weightparam_classifier__max_depthparam_classifier__n_estimatorsparam_feat_select__colssplit0_test_Accuracysplit0_test_Recallsplit0_test_Precisionsplit0_test_F1_Scoresum
62116None430(10, 12)0.8571431.00.9333330.9655173.755993
345None210(0, 11, 12)0.8571431.00.9333330.9655173.755993
128163balanced410(3, 10, 12, 13)0.8571431.00.9333330.9655173.755993
68311None440(10, 12)0.8571431.00.9333330.9655173.755993
67963None430(10, 12, 13, 14)0.8571431.00.9333330.9655173.755993
55433None410(9, 10, 12, 13)0.8571431.00.9333330.9655173.755993
63181None430(10, 11, 13)0.8571431.00.9333330.9655173.755993
30380None310(7, 10, 13, 19)0.8571431.00.9333330.9655173.755993
61768None420(10, 12, 13, 14)0.8571431.00.9333330.9655173.755993
26024None310(10, 12, 19)0.8571431.00.9333330.9655173.755993
30368None310(7, 10, 12, 13)0.8571431.00.9333330.9655173.755993
59654None420(3, 4, 13, 14)0.7857141.00.9032260.9491533.638093
100365balanced310(10, 13, 14)0.7857141.00.9032260.9491533.638093
\n", + "
" + ], + "text/plain": [ + " param_classifier__class_weight param_classifier__max_depth \\\n", + "62116 None 4 \n", + "345 None 2 \n", + "128163 balanced 4 \n", + "68311 None 4 \n", + "67963 None 4 \n", + "55433 None 4 \n", + "63181 None 4 \n", + "30380 None 3 \n", + "61768 None 4 \n", + "26024 None 3 \n", + "30368 None 3 \n", + "59654 None 4 \n", + "100365 balanced 3 \n", + "\n", + " param_classifier__n_estimators param_feat_select__cols \\\n", + "62116 30 (10, 12) \n", + "345 10 (0, 11, 12) \n", + "128163 10 (3, 10, 12, 13) \n", + "68311 40 (10, 12) \n", + "67963 30 (10, 12, 13, 14) \n", + "55433 10 (9, 10, 12, 13) \n", + "63181 30 (10, 11, 13) \n", + "30380 10 (7, 10, 13, 19) \n", + "61768 20 (10, 12, 13, 14) \n", + "26024 10 (10, 12, 19) \n", + "30368 10 (7, 10, 12, 13) \n", + "59654 20 (3, 4, 13, 14) \n", + "100365 10 (10, 13, 14) \n", + "\n", + " split0_test_Accuracy split0_test_Recall split0_test_Precision \\\n", + "62116 0.857143 1.0 0.933333 \n", + "345 0.857143 1.0 0.933333 \n", + "128163 0.857143 1.0 0.933333 \n", + "68311 0.857143 1.0 0.933333 \n", + "67963 0.857143 1.0 0.933333 \n", + "55433 0.857143 1.0 0.933333 \n", + "63181 0.857143 1.0 0.933333 \n", + "30380 0.857143 1.0 0.933333 \n", + "61768 0.857143 1.0 0.933333 \n", + "26024 0.857143 1.0 0.933333 \n", + "30368 0.857143 1.0 0.933333 \n", + "59654 0.785714 1.0 0.903226 \n", + "100365 0.785714 1.0 0.903226 \n", + "\n", + " split0_test_F1_Score sum \n", + "62116 0.965517 3.755993 \n", + "345 0.965517 3.755993 \n", + "128163 0.965517 3.755993 \n", + "68311 0.965517 3.755993 \n", + "67963 0.965517 3.755993 \n", + "55433 0.965517 3.755993 \n", + "63181 0.965517 3.755993 \n", + "30380 0.965517 3.755993 \n", + "61768 0.965517 3.755993 \n", + "26024 0.965517 3.755993 \n", + "30368 0.965517 3.755993 \n", + "59654 0.949153 3.638093 \n", + "100365 0.949153 3.638093 " + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df.sort_values(\"split0_test_F1_Score\")[-13:][::-1]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "12ac5d48-cb46-4db3-94f3-51de47c264e9", + "metadata": {}, + "outputs": [], + "source": [ + "fft - 0-3\n", + "hwt - 4-7\n", + "laplacian - 8-11\n", + "modified laplacian - 12-15\n", + "tenengrad - 16-19" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "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.9.7" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/Code/BlurDetection/TrainNetwork1.ipynb b/Code/BlurDetection/TrainNetwork1.ipynb new file mode 100644 index 0000000..a4ff6b7 --- /dev/null +++ b/Code/BlurDetection/TrainNetwork1.ipynb @@ -0,0 +1,504 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "b35f6090-2f61-41b6-aabc-a8d80ad518e5", + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "from sklearn.linear_model import LogisticRegression\n", + "from sklearn.svm import SVC\n", + "from sklearn.ensemble import RandomForestClassifier\n", + "from sklearn.ensemble import GradientBoostingClassifier\n", + "from sklearn.pipeline import Pipeline\n", + "from sklearn.model_selection import GridSearchCV, RandomizedSearchCV\n", + "from sklearn.model_selection import train_test_split\n", + "from sklearn.tree import DecisionTreeClassifier\n", + "from sklearn.naive_bayes import MultinomialNB\n", + "from sklearn.neighbors import KNeighborsClassifier\n", + "from sklearn.neural_network import MLPClassifier\n", + "from sklearn.metrics import *\n", + "import numpy as np\n", + "from itertools import combinations\n", + "from sklearn.model_selection import PredefinedSplit\n", + "pd.set_option('display.max_rows', None)" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "994b1e27-c89a-4ee9-85dc-292eddc4f38c", + "metadata": {}, + "outputs": [], + "source": [ + "# Initialze the estimators\n", + "clf1 = RandomForestClassifier(random_state=42)\n", + "clf2 = SVC(kernel='sigmoid',probability=True, random_state=42)\n", + "clf3 = LogisticRegression(random_state=42)\n", + "clf4 = DecisionTreeClassifier(random_state=42)\n", + "clf5 = KNeighborsClassifier()\n", + "clf6 = MultinomialNB()\n", + "clf7 = GradientBoostingClassifier(random_state=42)\n", + "clf8 = MLPClassifier(max_iter=2000,random_state=42)\n", + "clf9 = SVC(kernel='poly',probability=True, random_state=42)\n", + "clf10 = SVC(kernel='rbf',probability=True, random_state=42)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "89c51e29-4ee9-44b3-a0e1-0743a99e778c", + "metadata": {}, + "outputs": [], + "source": [ + "class ColumnExtractor(object):\n", + " def __init__(self, cols=None):\n", + " self.cols = cols\n", + " def transform(self, X):\n", + " return X[:,self.cols]\n", + " def fit(self, X, y=None):\n", + " return self\n", + " def get_params(self,deep=True):\n", + " return {\"cols\" : self.cols}\n", + " \n", + " def set_params(self, **parameters):\n", + " for parameter, value in parameters.items():\n", + " setattr(self, parameter, value)" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "ad2da986-2722-4e42-a24e-3a2b713f5089", + "metadata": {}, + "outputs": [], + "source": [ + "# Initiaze the hyperparameters for each dictionary\n", + "param1 = {}\n", + "param1['feat_select__cols'] = sum([list(combinations(np.arange(0,4,1), i)) for i in range(1,5)], [])\n", + "param1['classifier__n_estimators'] = [10, 20, 30, 40]\n", + "param1['classifier__max_depth'] = [2, 3, 4]\n", + "param1['classifier__class_weight'] = [None, 'balanced']\n", + "# param1['classifier'] = [clf1]\n", + "\n", + "param2 = {}\n", + "param2['feat_select__cols'] = sum([list(combinations(np.arange(0,4,1), i)) for i in range(1,5)], [])\n", + "param2['classifier__C'] = [10**-2, 10**-1, 10**0, 10**1, 10**2]\n", + "# param2['Classifier__kernel'] = [ 'linear']\n", + "param2['classifier__class_weight'] = [None, 'balanced']\n", + "param2['classifier__degree'] = [2,3]\n", + "# param2['classifier'] = [clf2]\n", + "\n", + "param3 = {}\n", + "param3['feat_select__cols'] = sum([list(combinations(np.arange(0,4,1), i)) for i in range(1,5)], [])\n", + "param3['classifier__C'] = [10**-2, 10**-1, 10**0, 10**1, 10**2]\n", + "param3['classifier__penalty'] = ['l1', 'l2']\n", + "param3['classifier__class_weight'] = [None, 'balanced']\n", + "# param3['classifier'] = [clf3]\n", + "\n", + "param4 = {}\n", + "param4['feat_select__cols'] = sum([list(combinations(np.arange(0,4,1), i)) for i in range(1,5)], [])\n", + "param4['classifier__max_depth'] = [2,3,4,None]\n", + "param4['classifier__min_samples_split'] = [2,3,4]\n", + "param4['classifier__class_weight'] = [None, 'balanced']\n", + "# param4['classifier'] = [clf4]\n", + "\n", + "param5 = {}\n", + "param5['feat_select__cols'] = sum([list(combinations(np.arange(0,4,1), i)) for i in range(1,5)], [])\n", + "param5['classifier__n_neighbors'] = [2,3,4,5]\n", + "# param5['classifier'] = [clf5]\n", + "\n", + "param6 = {}\n", + "param6['feat_select__cols'] = sum([list(combinations(np.arange(0,4,1), i)) for i in range(1,5)], [])\n", + "param6['classifier__alpha'] = [10**0, 10**1, 10**2]\n", + "# param6['classifier'] = [clf6]\n", + "\n", + "param7 = {}\n", + "param7['feat_select__cols'] = sum([list(combinations(np.arange(0,4,1), i)) for i in range(1,5)], [])\n", + "param7['classifier__n_estimators'] = [10, 20, 30, 40]\n", + "param7['classifier__max_depth'] = [2, 3, 4]\n", + "# param7['classifier'] = [clf7]\n", + "\n", + "param8 = {}\n", + "param8['feat_select__cols'] = sum([list(combinations(np.arange(0,4,1), i)) for i in range(1,5)], [])\n", + "param8['classifier__hidden_layer_sizes'] = [(10),(10,10),(10,10,10)]\n", + "param8['classifier__solver'] = ['adam', 'sgd']\n", + "param8['classifier__alpha'] = [0.0001, 0.0005,0.001,0.005,0.01,0.05] \n", + "# param8['classifier'] = [clf8]" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "f8377b0d-68ef-46cc-9309-892ac57acbea", + "metadata": {}, + "outputs": [], + "source": [ + "pipeline1 = Pipeline([('feat_select',ColumnExtractor()),('classifier', clf1)])\n", + "pipeline2 = Pipeline([('feat_select',ColumnExtractor()),('classifier', clf2)])\n", + "pipeline3 = Pipeline([('feat_select',ColumnExtractor()),('classifier', clf3)])\n", + "pipeline4 = Pipeline([('feat_select',ColumnExtractor()),('classifier', clf4)])\n", + "pipeline5 = Pipeline([('feat_select',ColumnExtractor()),('classifier', clf5)])\n", + "pipeline6 = Pipeline([('feat_select',ColumnExtractor()),('classifier', clf6)])\n", + "pipeline7 = Pipeline([('feat_select',ColumnExtractor()),('classifier', clf7)])\n", + "pipeline8 = Pipeline([('feat_select',ColumnExtractor()),('classifier', clf8)])\n", + "pipeline9 = Pipeline([('feat_select',ColumnExtractor()),('classifier', clf9)])\n", + "pipeline10 = Pipeline([('feat_select',ColumnExtractor()),('classifier', clf10)])\n" + ] + }, + { + "cell_type": "code", + "execution_count": 177, + "id": "5eef0bf1-1679-4fee-9e16-990691c3aa6b", + "metadata": {}, + "outputs": [], + "source": [ + "rootPath = \"./\"\n", + "X_train = pd.read_csv(rootPath + \"X_train_tenengrad.csv\")\n", + "X_test = pd.read_csv(rootPath + \"X_test_tenengrad.csv\")\n", + "y_train = pd.read_csv(rootPath + \"y_train_tenengrad.csv\").values.reshape(-a1)\n", + "y_test = pd.read_csv(rootPath + \"y_test_tenengrad.csv\").values.reshape(-1)" + ] + }, + { + "cell_type": "code", + "execution_count": 178, + "id": "d9a7b032-bb87-4f6e-8979-d5729acf3a83", + "metadata": {}, + "outputs": [], + "source": [ + "## Make binary labels\n", + "y_train1 = np.array(y_train)\n", + "y_train1[y_train1 > 0] = 1\n", + "\n", + "y_test1 = np.array(y_test)\n", + "y_test1[y_test1 > 0] = 1" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "71d68ca3-e271-47e6-88e3-0d2ede7cae20", + "metadata": {}, + "outputs": [], + "source": [ + "indices = np.zeros(len(y_train1) + len(y_test1))\n", + "indices[:len(y_train1)] = -1\n", + "Data_X = X_train.append(X_test).reset_index(drop=True)\n", + "Data_Y = np.hstack([y_train1,y_test1])\n", + "\n", + "ps = PredefinedSplit(indices)\n", + "score = { \"Accuracy\":\"balanced_accuracy\" ,\"Recall\":\"recall\",\"Precision\":\"precision\",\"F1_Score\":\"f1\"}" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "id": "f08c52e3-7708-4bad-a261-bbbdd2194ae8", + "metadata": {}, + "outputs": [], + "source": [ + "grid1 = GridSearchCV(pipeline1, n_jobs=-1, param_grid=[param1],scoring=score,refit=\"F1_Score\",cv=ps)\n", + "grid2 = GridSearchCV(pipeline2, n_jobs=-1, param_grid=[param2],scoring=score,refit=\"F1_Score\",cv=ps)\n", + "grid3 = GridSearchCV(pipeline3, n_jobs=-1, param_grid=[param3],scoring=score,refit=\"F1_Score\",cv=ps)\n", + "grid4 = GridSearchCV(pipeline4, n_jobs=-1, param_grid=[param4],scoring=score,refit=\"F1_Score\",cv=ps)\n", + "grid5 = GridSearchCV(pipeline5, n_jobs=-1, param_grid=[param5],scoring=score,refit=\"F1_Score\",cv=ps)\n", + "grid6 = GridSearchCV(pipeline6, n_jobs=-1, param_grid=[param6],scoring=score,refit=\"F1_Score\",cv=ps)\n", + "grid7 = GridSearchCV(pipeline7, n_jobs=-1, param_grid=[param7],scoring=score,refit=\"F1_Score\",cv=ps)\n", + "grid8 = GridSearchCV(pipeline8, n_jobs=-1, param_grid=[param8],scoring=score,refit=\"F1_Score\",cv=ps)\n", + "grid9 = GridSearchCV(pipeline9, n_jobs=-1, param_grid=[param2],scoring=score,refit=\"F1_Score\",cv=ps)\n", + "grid10 = GridSearchCV(pipeline10, n_jobs=-1, param_grid=[param2],scoring=score,refit=\"F1_Score\",cv=ps)" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "id": "c0f85649-e85b-4410-8f74-403ad6a64727", + "metadata": {}, + "outputs": [], + "source": [ + "grids = [grid1,grid2,grid3,grid4,grid5,grid6,grid7,grid8,grid9,grid10]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1ce542b8-60ba-4d2f-a92b-a182f791e06e", + "metadata": {}, + "outputs": [], + "source": [ + "for pipe in grids:\n", + " pipe.fit(Data_X,Data_Y)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7ccb5756-436b-4f6c-9c28-581d50dcaff4", + "metadata": {}, + "outputs": [], + "source": [ + "grid = grids[0]\n", + "print(grid.best_estimator_)\n", + "# print(pd.DataFrame(grid.cv_results_).iloc[grid.best_index_])" + ] + }, + { + "cell_type": "code", + "execution_count": 221, + "id": "9a9dddba-2d70-4703-9900-b86bd2665815", + "metadata": {}, + "outputs": [], + "source": [ + "df = pd.DataFrame(grid.cv_results_).drop(columns=[\"mean_fit_time\",\"std_fit_time\",\"mean_score_time\",\"std_score_time\",\"params\",\n", + " \"mean_test_Accuracy\",\"std_test_Accuracy\",\"rank_test_Accuracy\",\n", + " \"mean_test_Recall\",\"std_test_Recall\",\"rank_test_Recall\",\n", + " \"mean_test_Precision\",\"std_test_Precision\",\"rank_test_Precision\",\n", + " \"mean_test_F1_Score\",\"std_test_F1_Score\",\"rank_test_F1_Score\"])" + ] + }, + { + "cell_type": "code", + "execution_count": 223, + "id": "ac7ce343-61ec-404c-ad5e-7de603dd97ad", + "metadata": {}, + "outputs": [], + "source": [ + "df[\"sum\"] = df[\"split0_test_Accuracy\"] + df[\"split0_test_Recall\"] + df[\"split0_test_Precision\"] + df[\"split0_test_F1_Score\"]" + ] + }, + { + "cell_type": "code", + "execution_count": 224, + "id": "40f8c948-0199-47c1-8133-202b68885f1c", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
param_classifier__Cparam_classifier__class_weightparam_classifier__degreeparam_feat_select__colssplit0_test_Accuracysplit0_test_Recallsplit0_test_Precisionsplit0_test_F1_Scoresum
320.01balanced2(2,)0.7321430.8928570.8928570.8928573.410714
390.01balanced2(2, 3)0.7321430.8928570.8928570.8928573.410714
1591balanced2(2, 3)0.7321430.8928570.8928570.8928573.410714
272100balanced2(2,)0.7321430.8928570.8928570.8928573.410714
920.1balanced2(2,)0.7321430.8928570.8928570.8928573.410714
1521balanced2(2,)0.7321430.8928570.8928570.8928573.410714
21210balanced2(2,)0.7321430.8928570.8928570.8928573.410714
1020.1balanced2(0, 2, 3)0.7321430.8928570.8928570.8928573.410714
1711balanced3(0, 3)0.6785710.9285710.8666670.8965523.370361
440.01balanced2(0, 1, 2, 3)0.6785710.9285710.8666670.8965523.370361
\n", + "
" + ], + "text/plain": [ + " param_classifier__C param_classifier__class_weight \\\n", + "32 0.01 balanced \n", + "39 0.01 balanced \n", + "159 1 balanced \n", + "272 100 balanced \n", + "92 0.1 balanced \n", + "152 1 balanced \n", + "212 10 balanced \n", + "102 0.1 balanced \n", + "171 1 balanced \n", + "44 0.01 balanced \n", + "\n", + " param_classifier__degree param_feat_select__cols split0_test_Accuracy \\\n", + "32 2 (2,) 0.732143 \n", + "39 2 (2, 3) 0.732143 \n", + "159 2 (2, 3) 0.732143 \n", + "272 2 (2,) 0.732143 \n", + "92 2 (2,) 0.732143 \n", + "152 2 (2,) 0.732143 \n", + "212 2 (2,) 0.732143 \n", + "102 2 (0, 2, 3) 0.732143 \n", + "171 3 (0, 3) 0.678571 \n", + "44 2 (0, 1, 2, 3) 0.678571 \n", + "\n", + " split0_test_Recall split0_test_Precision split0_test_F1_Score sum \n", + "32 0.892857 0.892857 0.892857 3.410714 \n", + "39 0.892857 0.892857 0.892857 3.410714 \n", + "159 0.892857 0.892857 0.892857 3.410714 \n", + "272 0.892857 0.892857 0.892857 3.410714 \n", + "92 0.892857 0.892857 0.892857 3.410714 \n", + "152 0.892857 0.892857 0.892857 3.410714 \n", + "212 0.892857 0.892857 0.892857 3.410714 \n", + "102 0.892857 0.892857 0.892857 3.410714 \n", + "171 0.928571 0.866667 0.896552 3.370361 \n", + "44 0.928571 0.866667 0.896552 3.370361 " + ] + }, + "execution_count": 224, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df.sort_values(\"sum\")[-10:][::-1]" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "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.9.7" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/Code/BlurDetection/TrainNetworkMulti.ipynb b/Code/BlurDetection/TrainNetworkMulti.ipynb new file mode 100644 index 0000000..1cdff11 --- /dev/null +++ b/Code/BlurDetection/TrainNetworkMulti.ipynb @@ -0,0 +1,754 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 16, + "id": "b35f6090-2f61-41b6-aabc-a8d80ad518e5", + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "from sklearn.linear_model import LogisticRegression\n", + "from sklearn.svm import SVC\n", + "from sklearn.ensemble import RandomForestClassifier\n", + "from sklearn.ensemble import GradientBoostingClassifier\n", + "from sklearn.pipeline import Pipeline\n", + "from sklearn.model_selection import GridSearchCV, RandomizedSearchCV\n", + "from sklearn.model_selection import train_test_split\n", + "from sklearn.tree import DecisionTreeClassifier\n", + "from sklearn.naive_bayes import MultinomialNB\n", + "from sklearn.neighbors import KNeighborsClassifier\n", + "from sklearn.neural_network import MLPClassifier\n", + "from sklearn.metrics import *\n", + "import numpy as np\n", + "from itertools import combinations\n", + "from sklearn.model_selection import PredefinedSplit\n", + "from sklearn.preprocessing import OneHotEncoder\n", + "\n", + "import glob\n", + "pd.set_option('display.max_rows', None)" + ] + }, + { + "cell_type": "code", + "execution_count": 56, + "id": "994b1e27-c89a-4ee9-85dc-292eddc4f38c", + "metadata": {}, + "outputs": [], + "source": [ + "# Initialze the estimators\n", + "clf1 = RandomForestClassifier(random_state=42)\n", + "# clf2 = SVC(kernel='sigmoid',probability=True, random_state=42)\n", + "clf3 = LogisticRegression(random_state=42)\n", + "clf4 = DecisionTreeClassifier(random_state=42)\n", + "clf5 = KNeighborsClassifier()\n", + "clf6 = MultinomialNB()\n", + "# clf7 = GradientBoostingClassifier(random_state=42)\n", + "clf8 = MLPClassifier(max_iter=2000,random_state=42)\n", + "clf9 = SVC(kernel='poly',probability=True, random_state=42)\n", + "# clf10 = SVC(kernel='rbf',probability=True, random_state=42)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "89c51e29-4ee9-44b3-a0e1-0743a99e778c", + "metadata": {}, + "outputs": [], + "source": [ + "class ColumnExtractor(object):\n", + " def __init__(self, cols=None):\n", + " self.cols = cols\n", + " def transform(self, X):\n", + " return X[:,self.cols]\n", + " def fit(self, X, y=None):\n", + " return self\n", + " def get_params(self,deep=True):\n", + " return {\"cols\" : self.cols}\n", + " \n", + " def set_params(self, **parameters):\n", + " for parameter, value in parameters.items():\n", + " setattr(self, parameter, value)" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "ad2da986-2722-4e42-a24e-3a2b713f5089", + "metadata": {}, + "outputs": [], + "source": [ + "# Initiaze the hyperparameters for each dictionary\n", + "param1 = {}\n", + "param1['feat_select__cols'] = sum([list(combinations(np.arange(0,4,1), i)) for i in range(1,5)], [])\n", + "param1['classifier__n_estimators'] = [10, 20, 30, 40]\n", + "param1['classifier__max_depth'] = [2, 3, 4]\n", + "param1['classifier__class_weight'] = [None, 'balanced']\n", + "# param1['classifier'] = [clf1]\n", + "\n", + "param2 = {}\n", + "param2['feat_select__cols'] = sum([list(combinations(np.arange(0,4,1), i)) for i in range(1,5)], [])\n", + "param2['classifier__C'] = [10**-2, 10**-1, 10**0, 10**1, 10**2]\n", + "# param2['Classifier__kernel'] = [ 'linear']\n", + "param2['classifier__class_weight'] = [None, 'balanced']\n", + "param2['classifier__degree'] = [2,3]\n", + "# param2['classifier'] = [clf2]\n", + "\n", + "param3 = {}\n", + "param3['feat_select__cols'] = sum([list(combinations(np.arange(0,4,1), i)) for i in range(1,5)], [])\n", + "param3['classifier__C'] = [10**-2, 10**-1, 10**0, 10**1, 10**2]\n", + "param3['classifier__penalty'] = ['l1', 'l2']\n", + "param3['classifier__class_weight'] = [None, 'balanced']\n", + "# param3['classifier'] = [clf3]\n", + "\n", + "param4 = {}\n", + "param4['feat_select__cols'] = sum([list(combinations(np.arange(0,4,1), i)) for i in range(1,4)], [])\n", + "param4['classifier__max_depth'] = [2,3,4,None]\n", + "param4['classifier__min_samples_split'] = [2,3,4]\n", + "param4['classifier__class_weight'] = [None, 'balanced']\n", + "# param4['classifier'] = [clf4]\n", + "\n", + "param5 = {}\n", + "param5['feat_select__cols'] = sum([list(combinations(np.arange(0,4,1), i)) for i in range(1,5)], [])\n", + "param5['classifier__n_neighbors'] = [2,3,4,5]\n", + "# param5['classifier'] = [clf5]\n", + "\n", + "param6 = {}\n", + "param6['feat_select__cols'] = sum([list(combinations(np.arange(0,4,1), i)) for i in range(1,5)], [])\n", + "param6['classifier__alpha'] = [10**0, 10**1, 10**2]\n", + "# param6['classifier'] = [clf6]\n", + "\n", + "param7 = {}\n", + "param7['feat_select__cols'] = sum([list(combinations(np.arange(0,4,1), i)) for i in range(1,5)], [])\n", + "param7['classifier__n_estimators'] = [10, 20, 30, 40]\n", + "param7['classifier__max_depth'] = [2, 3, 4]\n", + "# param7['classifier'] = [clf7]\n", + "\n", + "param8 = {}\n", + "param8['feat_select__cols'] = sum([list(combinations(np.arange(0,4,1), i)) for i in range(1,5)], [])\n", + "param8['classifier__hidden_layer_sizes'] = [(10),(10,10),(10,10,10)]\n", + "param8['classifier__solver'] = ['adam', 'sgd']\n", + "param8['classifier__alpha'] = [0.0001, 0.0005,0.001,0.005,0.01,0.05] \n", + "# param8['classifier'] = [clf8]" + ] + }, + { + "cell_type": "code", + "execution_count": 93, + "id": "f8377b0d-68ef-46cc-9309-892ac57acbea", + "metadata": {}, + "outputs": [], + "source": [ + "pipeline1 = Pipeline([('feat_select',ColumnExtractor()),('classifier', clf1)])\n", + "# pipeline2 = Pipeline([('feat_select',ColumnExtractor()),('classifier', clf2)])\n", + "pipeline3 = Pipeline([('feat_select',ColumnExtractor()),('classifier', clf3)])\n", + "pipeline4 = Pipeline([('feat_select',ColumnExtractor()),('classifier', clf4)])\n", + "pipeline5 = Pipeline([('feat_select',ColumnExtractor()),('classifier', clf5)])\n", + "pipeline6 = Pipeline([('feat_select',ColumnExtractor()),('classifier', clf6)])\n", + "# pipeline7 = Pipeline([('feat_select',ColumnExtractor()),('classifier', clf7)])\n", + "pipeline8 = Pipeline([('feat_select',ColumnExtractor()),('classifier', clf8)])\n", + "pipeline9 = Pipeline([('feat_select',ColumnExtractor()),('classifier', clf9)])\n", + "# pipeline10 = Pipeline([('feat_select',ColumnExtractor()),('classifier', clf10)])\n" + ] + }, + { + "cell_type": "code", + "execution_count": 94, + "id": "5eef0bf1-1679-4fee-9e16-990691c3aa6b", + "metadata": {}, + "outputs": [], + "source": [ + "rootPath = \"./\"\n", + "X_train = pd.read_csv(rootPath + \"X_train_tenengrad.csv\")\n", + "X_test = pd.read_csv(rootPath + \"X_test_tenengrad.csv\")\n", + "y_train = pd.read_csv(rootPath + \"y_train_tenengrad.csv\").values.reshape(-1)\n", + "y_test = pd.read_csv(rootPath + \"y_test_tenengrad.csv\").values.reshape(-1)" + ] + }, + { + "cell_type": "code", + "execution_count": 95, + "id": "71d68ca3-e271-47e6-88e3-0d2ede7cae20", + "metadata": {}, + "outputs": [], + "source": [ + "indices = np.zeros(len(y_train) + len(y_test))\n", + "indices[:len(y_train)] = -1\n", + "Data_X = np.vstack([X_train,X_test])\n", + "Data_Y = np.hstack([y_train,y_test])\n", + "\n", + "ps = PredefinedSplit(indices)\n", + "score = { \"Accuracy\":\"balanced_accuracy\" ,\"Recall\":\"recall_weighted\",\"Precision\":\"precision_weighted\",\"F1_Score\":\"f1_weighted\"}" + ] + }, + { + "cell_type": "code", + "execution_count": 96, + "id": "f08c52e3-7708-4bad-a261-bbbdd2194ae8", + "metadata": {}, + "outputs": [], + "source": [ + "grid1 = GridSearchCV(pipeline1, n_jobs=-1, param_grid=[param1],scoring=score,refit=\"F1_Score\",cv=ps)\n", + "# grid2 = GridSearchCV(pipeline2, n_jobs=-1, param_grid=[param2],scoring=score,refit=\"F1_Score\",cv=ps)\n", + "grid3 = GridSearchCV(pipeline3, n_jobs=-1, param_grid=[param3],scoring=score,refit=\"F1_Score\",cv=ps)\n", + "grid4 = GridSearchCV(pipeline4, n_jobs=-1, param_grid=[param4],scoring=score,refit=\"F1_Score\",cv=ps)\n", + "grid5 = GridSearchCV(pipeline5, n_jobs=-1, param_grid=[param5],scoring=score,refit=\"F1_Score\",cv=ps)\n", + "grid6 = GridSearchCV(pipeline6, n_jobs=-1, param_grid=[param6],scoring=score,refit=\"F1_Score\",cv=ps)\n", + "# grid7 = GridSearchCV(pipeline7, n_jobs=-1, param_grid=[param7],scoring=score,refit=\"F1_Score\",cv=ps)\n", + "grid8 = GridSearchCV(pipeline8, n_jobs=-1, param_grid=[param8],scoring=score,refit=\"F1_Score\",cv=ps)\n", + "grid9 = GridSearchCV(pipeline9, n_jobs=-1, param_grid=[param2],scoring=score,refit=\"F1_Score\",cv=ps)\n", + "# grid10 = GridSearchCV(pipeline10, n_jobs=-1, param_grid=[param2],scoring=score,refit=\"F1_Score\",cv=ps)" + ] + }, + { + "cell_type": "code", + "execution_count": 97, + "id": "c0f85649-e85b-4410-8f74-403ad6a64727", + "metadata": {}, + "outputs": [], + "source": [ + "\n", + "grids = [grid1,grid3,grid4,grid5,grid6,grid8,grid9]" + ] + }, + { + "cell_type": "code", + "execution_count": 98, + "id": "1ce542b8-60ba-4d2f-a92b-a182f791e06e", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Yes Done\n", + "Yes Done\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "C:\\Users\\ronakdediya\\anaconda33\\lib\\site-packages\\sklearn\\model_selection\\_validation.py:372: FitFailedWarning: \n", + "150 fits failed out of a total of 300.\n", + "The score on these train-test partitions for these parameters will be set to nan.\n", + "If these failures are not expected, you can try to debug them by setting error_score='raise'.\n", + "\n", + "Below are more details about the failures:\n", + "--------------------------------------------------------------------------------\n", + "150 fits failed with the following error:\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\ronakdediya\\anaconda33\\lib\\site-packages\\sklearn\\model_selection\\_validation.py\", line 681, in _fit_and_score\n", + " estimator.fit(X_train, y_train, **fit_params)\n", + " File \"C:\\Users\\ronakdediya\\anaconda33\\lib\\site-packages\\sklearn\\pipeline.py\", line 394, in fit\n", + " self._final_estimator.fit(Xt, y, **fit_params_last_step)\n", + " File \"C:\\Users\\ronakdediya\\anaconda33\\lib\\site-packages\\sklearn\\linear_model\\_logistic.py\", line 1461, in fit\n", + " solver = _check_solver(self.solver, self.penalty, self.dual)\n", + " File \"C:\\Users\\ronakdediya\\anaconda33\\lib\\site-packages\\sklearn\\linear_model\\_logistic.py\", line 447, in _check_solver\n", + " raise ValueError(\n", + "ValueError: Solver lbfgs supports only 'l2' or 'none' penalties, got l1 penalty.\n", + "\n", + " warnings.warn(some_fits_failed_message, FitFailedWarning)\n", + "C:\\Users\\ronakdediya\\anaconda33\\lib\\site-packages\\sklearn\\model_selection\\_search.py:969: UserWarning: One or more of the test scores are non-finite: [ nan nan nan nan nan nan\n", + " nan nan nan nan nan nan\n", + " nan nan nan 0.31428571 0.42857143 0.4\n", + " 0.31428571 0.45714286 0.45714286 0.42857143 0.45714286 0.28571429\n", + " 0.37142857 0.22857143 0.2 0.22857143 0.34285714 0.2\n", + " nan nan nan nan nan nan\n", + " nan nan nan nan nan nan\n", + " nan nan nan 0.31428571 0.42857143 0.4\n", + " 0.31428571 0.45714286 0.45714286 0.42857143 0.45714286 0.28571429\n", + " 0.37142857 0.22857143 0.2 0.22857143 0.34285714 0.2\n", + " nan nan nan nan nan nan\n", + " nan nan nan nan nan nan\n", + " nan nan nan 0.31428571 0.42857143 0.4\n", + " 0.31428571 0.42857143 0.45714286 0.42857143 0.45714286 0.34285714\n", + " 0.4 0.22857143 0.2 0.2 0.25714286 0.2\n", + " nan nan nan nan nan nan\n", + " nan nan nan nan nan nan\n", + " nan nan nan 0.31428571 0.42857143 0.4\n", + " 0.31428571 0.42857143 0.45714286 0.42857143 0.45714286 0.34285714\n", + " 0.4 0.22857143 0.2 0.2 0.25714286 0.2\n", + " nan nan nan nan nan nan\n", + " nan nan nan nan nan nan\n", + " nan nan nan 0.31428571 0.42857143 0.4\n", + " 0.31428571 0.45714286 0.45714286 0.4 0.34285714 0.4\n", + " 0.42857143 0.2 0.25714286 0.2 0.28571429 0.2\n", + " nan nan nan nan nan nan\n", + " nan nan nan nan nan nan\n", + " nan nan nan 0.31428571 0.42857143 0.4\n", + " 0.31428571 0.45714286 0.45714286 0.4 0.34285714 0.4\n", + " 0.42857143 0.2 0.25714286 0.2 0.28571429 0.2\n", + " nan nan nan nan nan nan\n", + " nan nan nan nan nan nan\n", + " nan nan nan 0.31428571 0.42857143 0.4\n", + " 0.31428571 0.2 0.42857143 0.37142857 0.42857143 0.48571429\n", + " 0.31428571 0.2 0.17142857 0.22857143 0.28571429 0.2\n", + " nan nan nan nan nan nan\n", + " nan nan nan nan nan nan\n", + " nan nan nan 0.31428571 0.42857143 0.4\n", + " 0.31428571 0.2 0.42857143 0.37142857 0.42857143 0.48571429\n", + " 0.31428571 0.2 0.17142857 0.22857143 0.28571429 0.2\n", + " nan nan nan nan nan nan\n", + " nan nan nan nan nan nan\n", + " nan nan nan 0.31428571 0.42857143 0.4\n", + " 0.31428571 0.45714286 0.34285714 0.37142857 0.37142857 0.4\n", + " 0.42857143 0.2 0.25714286 0.2 0.25714286 0.2\n", + " nan nan nan nan nan nan\n", + " nan nan nan nan nan nan\n", + " nan nan nan 0.31428571 0.42857143 0.4\n", + " 0.31428571 0.45714286 0.34285714 0.37142857 0.37142857 0.4\n", + " 0.42857143 0.2 0.25714286 0.2 0.25714286 0.2 ]\n", + " warnings.warn(\n", + "C:\\Users\\ronakdediya\\anaconda33\\lib\\site-packages\\sklearn\\model_selection\\_search.py:969: UserWarning: One or more of the test scores are non-finite: [ nan nan nan nan nan nan\n", + " nan nan nan nan nan nan\n", + " nan nan nan 0.23611111 0.34935897 0.33909091\n", + " 0.28 0.45040293 0.45214286 0.54725275 0.55833333 0.36439394\n", + " 0.38692641 0.0816092 0.06837607 0.28761905 0.39929825 0.0780303\n", + " nan nan nan nan nan nan\n", + " nan nan nan nan nan nan\n", + " nan nan nan 0.23611111 0.34935897 0.33909091\n", + " 0.28 0.45040293 0.45214286 0.54725275 0.55833333 0.36439394\n", + " 0.38692641 0.0816092 0.06837607 0.28761905 0.39929825 0.0780303\n", + " nan nan nan nan nan nan\n", + " nan nan nan nan nan nan\n", + " nan nan nan 0.23611111 0.34935897 0.33909091\n", + " 0.28 0.35337662 0.45214286 0.41333333 0.54945055 0.27904762\n", + " 0.43222222 0.09059829 0.06818182 0.04516129 0.25873016 0.0780303\n", + " nan nan nan nan nan nan\n", + " nan nan nan nan nan nan\n", + " nan nan nan 0.23611111 0.34935897 0.33909091\n", + " 0.28 0.35337662 0.45214286 0.41333333 0.54945055 0.27904762\n", + " 0.43222222 0.09059829 0.06818182 0.04516129 0.25873016 0.0780303\n", + " nan nan nan nan nan nan\n", + " nan nan nan nan nan nan\n", + " nan nan nan 0.23611111 0.34935897 0.33909091\n", + " 0.28 0.54242424 0.45333333 0.32692308 0.28661616 0.43333333\n", + " 0.39980519 0.0780303 0.28933333 0.08550725 0.32596491 0.04375\n", + " nan nan nan nan nan nan\n", + " nan nan nan nan nan nan\n", + " nan nan nan 0.23611111 0.34935897 0.33909091\n", + " 0.28 0.54242424 0.45333333 0.32692308 0.28661616 0.43333333\n", + " 0.39980519 0.0780303 0.28933333 0.08550725 0.32596491 0.04375\n", + " nan nan nan nan nan nan\n", + " nan nan nan nan nan nan\n", + " nan nan nan 0.23611111 0.34935897 0.33909091\n", + " 0.28 0.04 0.38095238 0.37333333 0.44666667 0.48333333\n", + " 0.25050505 0.08 0.26333333 0.28311688 0.22333333 0.06944444\n", + " nan nan nan nan nan nan\n", + " nan nan nan nan nan nan\n", + " nan nan nan 0.23611111 0.34935897 0.33909091\n", + " 0.28 0.04 0.38095238 0.37333333 0.44666667 0.48333333\n", + " 0.25050505 0.08 0.26333333 0.28311688 0.22333333 0.06944444\n", + " nan nan nan nan nan nan\n", + " nan nan nan nan nan nan\n", + " nan nan nan 0.23611111 0.34935897 0.33909091\n", + " 0.28 0.46242424 0.41846154 0.37619048 0.35142857 0.375\n", + " 0.42444444 0.07142857 0.31494253 0.073 0.25929825 0.0780303\n", + " nan nan nan nan nan nan\n", + " nan nan nan nan nan nan\n", + " nan nan nan 0.23611111 0.34935897 0.33909091\n", + " 0.28 0.46242424 0.41846154 0.37619048 0.35142857 0.375\n", + " 0.42444444 0.07142857 0.31494253 0.073 0.25929825 0.0780303 ]\n", + " warnings.warn(\n", + "C:\\Users\\ronakdediya\\anaconda33\\lib\\site-packages\\sklearn\\model_selection\\_search.py:969: UserWarning: One or more of the test scores are non-finite: [ nan nan nan nan nan nan\n", + " nan nan nan nan nan nan\n", + " nan nan nan 0.25 0.36666667 0.36\n", + " 0.27986663 0.43142857 0.44335429 0.40608862 0.43526316 0.27944444\n", + " 0.35922587 0.10854701 0.09772727 0.16848739 0.32034188 0.10896057\n", + " nan nan nan nan nan nan\n", + " nan nan nan nan nan nan\n", + " nan nan nan 0.25 0.36666667 0.36\n", + " 0.27986663 0.43142857 0.44335429 0.40608862 0.43526316 0.27944444\n", + " 0.35922587 0.10854701 0.09772727 0.16848739 0.32034188 0.10896057\n", + " nan nan nan nan nan nan\n", + " nan nan nan nan nan nan\n", + " nan nan nan 0.25 0.36666667 0.36\n", + " 0.27986663 0.37744361 0.44335429 0.39469917 0.42611722 0.30630252\n", + " 0.36474028 0.12272727 0.09964158 0.07368421 0.20587302 0.10896057\n", + " nan nan nan nan nan nan\n", + " nan nan nan nan nan nan\n", + " nan nan nan 0.25 0.36666667 0.36\n", + " 0.27986663 0.37744361 0.44335429 0.39469917 0.42611722 0.30630252\n", + " 0.36474028 0.12272727 0.09964158 0.07368421 0.20587302 0.10896057\n", + " nan nan nan nan nan nan\n", + " nan nan nan nan nan nan\n", + " nan nan nan 0.25 0.36666667 0.36\n", + " 0.27986663 0.44069848 0.4427499 0.34365109 0.30525253 0.36947118\n", + " 0.40207792 0.10896057 0.16826923 0.11076923 0.24842634 0.07179487\n", + " nan nan nan nan nan nan\n", + " nan nan nan nan nan nan\n", + " nan nan nan 0.25 0.36666667 0.36\n", + " 0.27986663 0.44069848 0.4427499 0.34365109 0.30525253 0.36947118\n", + " 0.40207792 0.10896057 0.16826923 0.11076923 0.24842634 0.07179487\n", + " nan nan nan nan nan nan\n", + " nan nan nan nan nan nan\n", + " nan nan nan 0.25 0.36666667 0.36\n", + " 0.27986663 0.06666667 0.39657316 0.36699849 0.43110106 0.45601276\n", + " 0.26309942 0.10955882 0.13654971 0.16133005 0.23587001 0.0972549\n", + " nan nan nan nan nan nan\n", + " nan nan nan nan nan nan\n", + " nan nan nan 0.25 0.36666667 0.36\n", + " 0.27986663 0.06666667 0.39657316 0.36699849 0.43110106 0.45601276\n", + " 0.26309942 0.10955882 0.13654971 0.16133005 0.23587001 0.0972549\n", + " nan nan nan nan nan nan\n", + " nan nan nan nan nan nan\n", + " nan nan nan 0.25 0.36666667 0.36\n", + " 0.27986663 0.44259907 0.29666667 0.3717033 0.3385536 0.36939271\n", + " 0.40684492 0.09714286 0.16777778 0.10166667 0.20842634 0.10896057\n", + " nan nan nan nan nan nan\n", + " nan nan nan nan nan nan\n", + " nan nan nan 0.25 0.36666667 0.36\n", + " 0.27986663 0.44259907 0.29666667 0.3717033 0.3385536 0.36939271\n", + " 0.40684492 0.09714286 0.16777778 0.10166667 0.20842634 0.10896057]\n", + " warnings.warn(\n", + "C:\\Users\\ronakdediya\\anaconda33\\lib\\site-packages\\sklearn\\linear_model\\_logistic.py:814: ConvergenceWarning: lbfgs failed to converge (status=1):\n", + "STOP: TOTAL NO. of ITERATIONS REACHED LIMIT.\n", + "\n", + "Increase the number of iterations (max_iter) or scale the data as shown in:\n", + " https://scikit-learn.org/stable/modules/preprocessing.html\n", + "Please also refer to the documentation for alternative solver options:\n", + " https://scikit-learn.org/stable/modules/linear_model.html#logistic-regression\n", + " n_iter_i = _check_optimize_result(\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Yes Done\n", + "Yes Done\n", + "Yes Done\n", + "Yes Done\n", + "Yes Done\n" + ] + } + ], + "source": [ + "for pipe in grids:\n", + " print(\"Yes Done\")\n", + " pipe.fit(Data_X,Data_Y) " + ] + }, + { + "cell_type": "code", + "execution_count": 120, + "id": "7ccb5756-436b-4f6c-9c28-581d50dcaff4", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Pipeline(steps=[('feat_select',\n", + " <__main__.ColumnExtractor object at 0x000001AAD1CD82B0>),\n", + " ('classifier',\n", + " SVC(C=0.1, kernel='poly', probability=True, random_state=42))])\n" + ] + } + ], + "source": [ + "grid = grids[6]\n", + "print(grid.best_estimator_)\n", + "# print(pd.DataFrame(grid.cv_results_).iloc[grid.best_index_])" + ] + }, + { + "cell_type": "code", + "execution_count": 121, + "id": "9a9dddba-2d70-4703-9900-b86bd2665815", + "metadata": {}, + "outputs": [], + "source": [ + "df = pd.DataFrame(grid.cv_results_).drop(columns=[\"mean_fit_time\",\"std_fit_time\",\"mean_score_time\",\"std_score_time\",\"params\",\n", + " \"mean_test_Accuracy\",\"std_test_Accuracy\",\"rank_test_Accuracy\",\n", + " \"mean_test_Recall\",\"std_test_Recall\",\"rank_test_Recall\",\n", + " \"mean_test_Precision\",\"std_test_Precision\",\"rank_test_Precision\",\n", + " \"mean_test_F1_Score\",\"std_test_F1_Score\",\"rank_test_F1_Score\"])" + ] + }, + { + "cell_type": "code", + "execution_count": 114, + "id": "ac7ce343-61ec-404c-ad5e-7de603dd97ad", + "metadata": {}, + "outputs": [], + "source": [ + "df[\"sum\"] = df[\"split0_test_Accuracy\"] + df[\"split0_test_Recall\"] + df[\"split0_test_Precision\"] + df[\"split0_test_F1_Score\"]" + ] + }, + { + "cell_type": "code", + "execution_count": 122, + "id": "40f8c948-0199-47c1-8133-202b68885f1c", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
param_classifier__Cparam_classifier__class_weightparam_classifier__degreeparam_feat_select__colssplit0_test_Accuracysplit0_test_Recallsplit0_test_Precisionsplit0_test_F1_Score
1491None3(0, 1, 2, 3)0.4571430.4571430.4457140.418022
1781balanced3(1, 2, 3)0.4571430.4571430.4683330.416752
296100balanced3(0, 1, 3)0.4571430.4571430.4255560.409697
1150.1balanced3(0, 1, 2)0.4571430.4571430.4457140.418022
1791balanced3(0, 1, 2, 3)0.4571430.4571430.4457140.418022
850.1None3(0, 1, 2)0.4571430.4571430.4457140.418022
266100None3(0, 1, 3)0.4571430.4571430.4255560.409697
1481None3(1, 2, 3)0.4571430.4571430.4683330.416752
1000.1balanced2(0, 1, 2)0.4285710.4285710.4123810.387253
274100balanced2(0, 1)0.4285710.4285710.3912700.388394
\n", + "
" + ], + "text/plain": [ + " param_classifier__C param_classifier__class_weight \\\n", + "149 1 None \n", + "178 1 balanced \n", + "296 100 balanced \n", + "115 0.1 balanced \n", + "179 1 balanced \n", + "85 0.1 None \n", + "266 100 None \n", + "148 1 None \n", + "100 0.1 balanced \n", + "274 100 balanced \n", + "\n", + " param_classifier__degree param_feat_select__cols split0_test_Accuracy \\\n", + "149 3 (0, 1, 2, 3) 0.457143 \n", + "178 3 (1, 2, 3) 0.457143 \n", + "296 3 (0, 1, 3) 0.457143 \n", + "115 3 (0, 1, 2) 0.457143 \n", + "179 3 (0, 1, 2, 3) 0.457143 \n", + "85 3 (0, 1, 2) 0.457143 \n", + "266 3 (0, 1, 3) 0.457143 \n", + "148 3 (1, 2, 3) 0.457143 \n", + "100 2 (0, 1, 2) 0.428571 \n", + "274 2 (0, 1) 0.428571 \n", + "\n", + " split0_test_Recall split0_test_Precision split0_test_F1_Score \n", + "149 0.457143 0.445714 0.418022 \n", + "178 0.457143 0.468333 0.416752 \n", + "296 0.457143 0.425556 0.409697 \n", + "115 0.457143 0.445714 0.418022 \n", + "179 0.457143 0.445714 0.418022 \n", + "85 0.457143 0.445714 0.418022 \n", + "266 0.457143 0.425556 0.409697 \n", + "148 0.457143 0.468333 0.416752 \n", + "100 0.428571 0.412381 0.387253 \n", + "274 0.428571 0.391270 0.388394 " + ] + }, + "execution_count": 122, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df.sort_values(\"split0_test_Accuracy\")[-10:][::-1]" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "id": "b57f10a9-32dc-478b-b0f1-91876c3c187a", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "0 [92.95910811424255]\n", + "1 [82.2305908203125]\n", + "2 [82.43215727806091]\n", + "3 [80.79285311698914]\n", + "4 [80.9026141166687]\n", + " ... \n", + "85 [78.49931454658508]\n", + "86 [77.7010612487793]\n", + "87 [77.35790419578552]\n", + "88 [76.98056769371033]\n", + "89 [76.88145112991333]\n", + "Name: 0, Length: 90, dtype: object" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import pandas as pd\n", + "pd.read_csv(\"time_hwt.csv\").iloc[0]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3d4f1bed-a0a1-4792-92b3-ca561cb5aa78", + "metadata": {}, + "outputs": [], + "source": [ + "17" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "57b6a124-5cde-49b1-bf9a-c22abb78e09b", + "metadata": {}, + "outputs": [], + "source": [ + "95sec" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "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.9.7" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/Code/BlurDetection/X_test_fft.csv b/Code/BlurDetection/X_test_fft.csv new file mode 100644 index 0000000..ffcbdc0 --- /dev/null +++ b/Code/BlurDetection/X_test_fft.csv @@ -0,0 +1,36 @@ +min,mean,max,std +21.531595408108963,29.87376529645923,42.72090874686028,5.405600867532463 +20.216149873823372,28.52085480441143,40.797423325778674,5.290907239037773 +17.53616765221753,25.641657995349735,37.33319105176178,5.12691622858238 +7.576908239486671,17.06118480866069,28.16673518599857,5.089115009977336 +0.28515043720381156,11.142144835759,21.0435625001095,4.830618256980458 +18.23661682498695,23.08375286878893,26.972664018968,2.2187266586669665 +16.85561691694509,22.16919910436916,25.901382470237554,2.197147188051259 +13.984944839344722,19.129006902983175,22.540465915860814,2.0399442542523243 +0.33561288414842744,5.700151535710567,9.573730536676914,2.27232274175423 +-7.0257505659406485,-2.7941088144135615,1.2278464950005106,2.4568587729263744 +8.093192785299719,11.59515321263949,15.370265249534617,1.7930574102374117 +7.586794226107202,10.763776354578937,14.583341711027087,1.7421518715392885 +5.8476442957654395,8.476716267527207,12.096025765047614,1.5210739074837787 +-1.7471953597496326,1.459268203291185,4.99424444726533,1.5236263352566295 +-6.648174224134689,-3.241527707105753,0.5683998148175325,1.8587484216151304 +27.888672101338642,29.73830054523268,32.38587183594377,1.1141678744800267 +26.392637045327536,28.060238452786724,30.4106177174012,1.0796852856739803 +23.771691634977024,25.30158239878729,27.597210343826486,1.0283912762618037 +18.429276961782357,19.646612842671495,21.416080742111802,0.7537438063056228 +12.317762068216492,13.344216873461592,14.790275323768634,0.6029218952079135 +16.84112359917696,19.25996391422522,20.4255603604718,0.5464867583681107 +14.8003936404019,17.754029157284865,18.9735176265582,0.6499104850043943 +12.375904380340161,15.041386786244741,16.12084002380797,0.5815752687393929 +5.149097349108637,7.327109525991215,8.50258565845208,0.5043966284441849 +0.30616840008269997,2.2191973445015942,3.4476478799839603,0.5020600992984154 +43.22857067231837,43.86805005362926,44.767014053425925,0.3065330220942219 +40.40133278676875,41.33034070284039,41.97609344461869,0.282270448887174 +35.13539952719875,36.06461242930665,36.662602323720456,0.2533035321417649 +18.79724295756119,20.0542553265069,20.725178204254956,0.3098798697169552 +9.24936476321129,10.138940748830738,11.052379272269194,0.31806759169387117 +23.907367394625805,28.95797928803364,31.25996908107089,1.2777035412650282 +22.93199409300751,27.506559156629628,29.220325899402095,1.1273053504437482 +20.819927745387606,24.41663283738316,25.89036598360826,0.8865844502600543 +13.091272283296583,16.257149478664207,17.619004140572766,0.7056766628026977 +5.797163083686963,9.507233105828025,10.801375289829082,0.7927626013245344 diff --git a/Code/BlurDetection/X_test_hwt.csv b/Code/BlurDetection/X_test_hwt.csv new file mode 100644 index 0000000..711a74a --- /dev/null +++ b/Code/BlurDetection/X_test_hwt.csv @@ -0,0 +1,36 @@ +min,mean,max,std +0.2523364485981308,0.381390069083239,0.5863060989643268,0.09426973588795333 +0.44436997319034854,0.5746856892925973,0.7694859038142621,0.0769904956802218 +0.7480628272251308,0.8269907693649343,0.9295921924015337,0.03905321235598433 +0.9470642625982432,0.9888449985253123,1.0,0.015547730586564458 +0.9925531914893617,0.9998398799361516,1.0,0.0008682432432773699 +0.44980562542876745,0.5985801500238729,0.7142454160789845,0.061917449624178895 +0.5772281847876808,0.708088753182954,0.8147342244327013,0.052377164319260136 +0.9064386317907445,0.9431881903878493,0.9644910382144065,0.013701050372001936 +0.9992942836979535,0.9999900372454028,1.0,7.117387203921649e-05 +1.0,1.0,1.0,0.0 +0.8183118741058655,0.880857796240834,0.943657728231395,0.029243696084778385 +0.8385283597342872,0.9119534844877718,0.9479297365119197,0.03331747875200624 +0.922365988909427,0.9722194870223286,0.9925681255161024,0.01726593752323111 +0.9973753280839895,0.9999367141939498,1.0,0.0002767284103020225 +1.0,1.0,1.0,0.0 +0.322998046875,0.36873427651940793,0.4530838165524512,0.029356141272823547 +0.5311372926184179,0.6129399275026752,0.7278947368421053,0.04167211700430814 +0.8024263431542461,0.8592491217486281,0.9265428727471328,0.02441151935150512 +0.9860416117987885,0.9982055764497102,1.0,0.002650416892103494 +1.0,1.0,1.0,0.0 +0.7713815789473685,0.7858427929598795,0.8273894436519258,0.0067505854518527825 +0.8201438848920863,0.8328789168367005,0.8625198098256736,0.0054320045078997325 +0.9037945573016481,0.912390567935812,0.9252300613496932,0.0038087590427946074 +0.99856184084372,0.999529739368621,1.0,0.000263877554079976 +1.0,1.0,1.0,0.0 +0.22349304482225657,0.24897665672628733,0.26876550868486354,0.007876366907705828 +0.37870195337114054,0.4184709076915766,0.45419725502713054,0.012011845271911464 +0.8125701459034792,0.8271585028460103,0.8422093981863149,0.0043348362779286505 +0.9995958779551425,0.9999329552719354,1.0,0.0001092923180374663 +1.0,1.0,1.0,0.0 +0.7142259414225941,0.7827957507970398,0.886485280999108,0.04932752181720721 +0.8130472854640981,0.8586726816134653,0.9160470136723435,0.028555820796789595 +0.8827071290944123,0.9214351615794243,0.9666834931852599,0.024513414465524335 +0.9970544918998527,0.9993627902827135,1.0,0.00040186281913136935 +1.0,1.0,1.0,0.0 diff --git a/Code/BlurDetection/X_test_laplacian.csv b/Code/BlurDetection/X_test_laplacian.csv new file mode 100644 index 0000000..8943221 --- /dev/null +++ b/Code/BlurDetection/X_test_laplacian.csv @@ -0,0 +1,36 @@ +min,mean,max,std +126.85546995526975,273.65736353759866,624.6130348151539,76.92536665791837 +61.66331297983811,125.17546212807102,241.74280236928013,31.110750387231395 +19.797327345175177,35.099241730785735,71.26252309230851,7.920579181148632 +4.405994682182701,7.65123316935868,17.782856326189066,2.267894800339584 +3.128771192250938,5.250016165283263,9.105120898535871,1.1476129418268801 +123.43823965204304,183.2838837009207,261.66884107706386,30.967527941330346 +80.34622009426164,124.21221947346272,169.50606469625254,19.12963601369801 +25.86263035545028,41.586709625768165,54.73328399800512,5.617326797140299 +3.266040616188461,5.570037895209248,7.496269273419492,0.9306397119826756 +2.1567191173158697,3.3005072027718185,4.526001156201777,0.5295569835601894 +33.66024774177154,51.58628741000241,77.86852587909026,11.50192242989663 +20.67711044689585,26.938815540491326,34.28137095392987,2.398867235739986 +8.818846111430519,12.662986168830953,16.050594923882294,1.1630724290719117 +2.6254907705743364,4.251703704551549,5.830076077209577,0.6149221424857831 +1.8471855322734476,3.1393047093690476,4.384927017231916,0.5375630029000877 +191.3118108155186,314.239234598982,443.77945758224035,46.18316664140058 +55.936666287111855,97.83000423783278,135.75336002764075,17.16456072491156 +21.775603891600078,36.283524932721406,52.123240478440245,5.817428091746521 +9.264047016963254,12.156721087648354,17.559968608728624,1.374746025007754 +5.069195118426388,6.534562788102973,8.535008638350044,0.6188231113713837 +46.71924260819793,58.68025767687498,63.812674524243015,2.7916942273184353 +29.739388918772722,37.14868129815191,40.082367268710684,1.8373602013695172 +13.845235769727047,16.98243727162983,18.370606656922426,0.8651583354121101 +4.43395105138964,6.07416889069857,6.822735810807861,0.46942404651249525 +3.180717091975701,4.469882581997649,5.102544360875304,0.3834923294163784 +827.3568393349948,940.1879327255049,1137.4461897676103,44.37377429132447 +326.9390580762764,376.41168433215887,453.51170999388296,18.649906183215766 +77.25407693436229,89.10837669335702,101.48312374997846,3.6042060469784154 +8.964924285612156,11.04103654665313,12.526804875503347,0.7902967688784833 +4.909182569864323,6.569232995815579,7.940267063810087,0.7091724989358479 +35.989936780432394,76.82682734427233,143.81345630041875,24.669215816898664 +24.640171547059538,43.364395039927636,73.16926407982163,11.847281228810107 +13.19255159800454,21.583300559277237,32.52229207520289,4.747020575308702 +5.27721928845641,7.151166767342029,9.096365729278858,0.7636956618516039 +3.682985573246124,5.2943175540562555,6.436655084889013,0.5755092353204929 diff --git a/Code/BlurDetection/X_test_modified_laplacian.csv b/Code/BlurDetection/X_test_modified_laplacian.csv new file mode 100644 index 0000000..0b66be6 --- /dev/null +++ b/Code/BlurDetection/X_test_modified_laplacian.csv @@ -0,0 +1,36 @@ +min,mean,max,std +104.3248476080247,142.05026605950843,171.36216435185185,16.973212781577768 +102.36673948688272,139.81698798981532,169.66087577160494,16.956579686155774 +101.08081211419753,138.4568424615351,168.71221836419753,16.86286715697635 +100.0029157021605,137.2996443263325,167.77689911265432,16.820437655744506 +99.80216435185186,137.0917866996201,167.59176311728396,16.82793036537965 +159.63785590277777,167.28400017239346,173.50859423225307,4.765397679315337 +158.22883246527778,165.80766325949253,172.04561969521606,4.748533469142152 +156.06111255787036,163.62485640393646,169.98092447916667,4.878005587563826 +153.57404996141975,161.3533350813005,167.81948543595678,4.972737393161305 +153.19456163194445,161.01173493191422,167.51995081018518,4.986017011135635 +124.85830054012345,131.17805955457118,140.2505324074074,3.5547169219937924 +124.4836545138889,130.70727786717885,139.9839597800926,3.6105379484502915 +124.1136043595679,130.33374244576976,139.68429880401234,3.6283773496216924 +123.63015769675926,129.83868104421734,139.2018754822531,3.626272674952806 +123.42169994212964,129.63915387173927,139.00746238425927,3.6231810046537802 +111.91635030864198,120.89278855131172,124.00065827546297,3.3922351126644217 +110.55586275077161,119.46111435988942,122.43070505401235,3.4071963038315873 +109.38984471450617,118.38151255947787,121.40518566743827,3.489077413577215 +108.3273080632716,117.38171797678753,120.59027922453704,3.554299689336298 +107.99734567901234,117.04601057741769,120.27417148919753,3.5613023930100716 +43.18939525462963,47.945863929076644,50.56521701388889,2.0528776938040507 +42.67452256944444,47.42304284336419,50.066156925154324,2.046840174314805 +42.15017939814815,46.85978442644033,49.44483458719136,2.050411661124774 +41.467557388117285,46.16452661072531,48.699176311728394,2.050588712146288 +41.24582417052469,45.94672119341564,48.46303337191358,2.0508772336944476 +140.35530767746914,142.98126427308384,144.5023369984568,0.717602182929318 +136.63450569058642,139.3290533259388,140.6663570601852,0.7605602947429965 +132.2539125192901,134.39749224054782,135.52857011959875,0.6859903061800099 +129.23268277391975,130.90185361207563,131.93182629243827,0.6245773153517261 +128.779972029321,130.40035371013374,131.4641835455247,0.6233156942884039 +74.25796923225309,83.38847792434426,91.20889515817902,6.069762111911234 +74.47909770447531,83.75062350036914,91.62654562114197,6.160954923817771 +73.7647583912037,83.17791866937881,91.20764226466049,6.270528240100374 +72.75224006558642,82.34359865103717,90.62524016203703,6.439004982114112 +72.51615210262345,82.1302028523107,90.44446903935186,6.454469336145204 diff --git a/Code/BlurDetection/X_test_tenengrad.csv b/Code/BlurDetection/X_test_tenengrad.csv new file mode 100644 index 0000000..2232f47 --- /dev/null +++ b/Code/BlurDetection/X_test_tenengrad.csv @@ -0,0 +1,36 @@ +min,mean,max,std +335.41213723123496,506.4056953110869,765.9236420695989,84.43900506504964 +294.1957028354844,443.53593873312974,662.9084055836629,75.1141842713925 +239.88270013054273,358.45632028603313,553.2242707456087,67.78473449596359 +161.33831603320962,247.2543645534494,410.71273886680825,61.528595128923726 +123.7905785782718,194.37208724092554,325.3055582674049,53.07809012949872 +392.3479227206732,486.0094760215899,573.6788170561521,43.186204549516056 +349.9121690344738,445.7141469814325,519.7187799256324,37.931653596249305 +273.91131845161095,348.7581265489456,400.74530809099235,27.73691280728066 +125.43668852897108,162.0288228323433,193.23324110315335,18.305209644968517 +88.69058236114174,110.02216014920629,132.68556444587819,13.90743255416564 +174.07978671894193,217.8940849928395,266.3107924806651,24.577473238096523 +163.67847747620831,193.18627316590823,234.66382530724667,17.457949770287186 +128.45562167329004,158.15660398505239,188.4503002509131,10.2320478711555 +87.16694633159737,111.45420573800241,131.94179774443586,6.8993263487939815 +68.81005545169573,86.81271777230094,103.34169957869244,5.48244749008415 +488.9945327720535,554.639124724998,630.3984973115423,29.616231858025806 +413.5418650966413,464.83968326027525,520.2390337954691,25.575544946060663 +329.85533969500483,367.8069130437103,414.3772776963365,21.219982438143955 +243.2800362257311,264.9569731757772,297.1978194353307,14.193055351502128 +179.65014952252093,194.02770411038156,221.31942053291635,11.610604126307017 +290.2597438245646,330.5112457338679,345.40434480734285,8.307157505909881 +255.9703511942301,297.45323188779935,310.0964728256106,8.413306340627361 +222.36453170548754,254.0880376126295,263.27804928787833,6.376434561727781 +163.16493723803416,179.61973842484414,186.6463205622454,3.4319965321107233 +133.3440881915762,143.63508493616882,150.13146011734452,2.395955232598512 +983.8881947320142,1024.3956295444161,1054.7863527406616,11.364660198690615 +822.685665036312,875.426888267784,896.2858752096573,11.002045481861286 +596.1390687691666,637.0830191833749,651.0185534636596,8.017801521242427 +305.71370153485174,328.4565867346599,334.6478300176915,4.399591176263695 +206.88717396678288,217.58093008448859,221.6443536043312,2.302370131977221 +333.1982575042855,426.5466679919671,504.5443257957091,40.601395756373385 +318.7492207417121,390.54693212965947,444.57841626767976,31.166842256240347 +294.88256555938244,336.3514783981726,368.9491388379721,18.966750981859636 +224.0690412899053,244.11515129899576,261.4762498615521,6.669213284410634 +180.52364214607715,195.18791605985294,205.50373405989805,5.028097235406053 diff --git a/Code/BlurDetection/X_train_fft.csv b/Code/BlurDetection/X_train_fft.csv new file mode 100644 index 0000000..a7519b3 --- /dev/null +++ b/Code/BlurDetection/X_train_fft.csv @@ -0,0 +1,91 @@ +min,mean,max,std +40.40187535982148,41.2960364566954,42.51777613815489,0.5154163421458806 +38.189450519840435,39.024759304504734,40.17778645676754,0.5116999850272709 +33.23214024146941,34.081153117507874,35.21199066979788,0.5015834517887345 +22.45172059556596,23.322020819399878,24.343050088240798,0.47085831726165517 +16.017660011167,16.72954537574848,17.57059069649812,0.3720254610266965 +31.654062611420084,34.40380859184473,35.74919073821878,0.7357039592072817 +29.755655324391043,32.82245922150457,34.06567067761955,0.7582904964146266 +26.451323643459567,29.4718619499409,30.680863843504216,0.7367459150992408 +18.309016246796904,21.08474115642569,22.125423833302307,0.674678918643604 +12.64747650998431,15.116531032273931,16.32289814868002,0.6524330572343476 +34.4847382191056,37.19695670336788,38.67880177135768,0.7273091223822413 +32.925129396201136,35.08982366067516,36.28274953964791,0.6073564653462448 +29.834203809714534,31.461925517534667,32.31805445259141,0.47073082921069165 +20.060420463903455,21.2062761201744,22.102898214911086,0.36033846219809895 +13.073026106600414,14.288040187691433,15.341280389152656,0.3648363164820043 +25.084022335310785,28.210689964056623,31.834868087498545,1.5111024047915131 +23.660292279051735,26.624735034139132,30.07666654453469,1.527795869379724 +19.441723999813924,22.73095969764865,25.9795211613883,1.457881569142375 +5.888201496671476,10.82818788824733,14.226096402515989,1.6108642204581343 +-1.0252260141595149,3.718315184088015,6.924001402031182,1.5137432660975554 +23.03029439497809,33.734976113636435,38.137707877913854,4.279852973800912 +21.875267200988095,30.65943047187133,35.07039387109579,3.5054774929437196 +18.462611737169624,25.40649322753978,29.975096632398742,2.7507742278057026 +6.927099425604863,11.271337670347775,16.350875828090768,2.1059025557674658 +-0.4149320528264827,3.122360325767062,7.070117580262758,1.658709133994002 +39.0018825938379,40.10919594798644,41.53071812510394,0.5259837673706029 +37.444625636619215,38.48766628420384,39.944216295290076,0.48388167030009754 +33.574644939327726,34.64248565183118,36.12420529200402,0.44569828050085236 +24.899213502482876,26.373060134686067,28.006313155353446,0.4826820020385505 +19.34761539423653,21.134807525432258,22.849092071059722,0.5263583625238181 +32.538750414641,34.72235346994223,38.55828895440057,1.3130983478302969 +30.402449186709518,32.5257983135995,35.94176379896407,1.221434030015968 +26.75100898940073,28.81595318553307,32.164898982136144,1.1897250345077388 +17.66983150506992,19.739887722696054,22.862795610595747,1.0668192320718068 +10.871706709574754,13.255828404610037,15.722112307062039,1.035099938027414 +26.14096898381557,28.609322102137764,30.703082358719616,1.361303198789965 +23.881072321949727,26.685729540838718,28.75454150766884,1.4337030237025123 +20.9111478041833,23.319812872084675,25.33620518919052,1.4046524898117099 +11.754564306576185,14.052240216255532,16.065089263832792,1.322012504384731 +4.1333560795874345,6.419988279785895,8.470091330133883,1.086116972212852 +30.068341454844187,31.219739594011376,31.617319951139887,0.25466589544387824 +27.155330864984727,28.97006420333437,29.40510633007875,0.37966650464877816 +23.494112397627738,25.32124659327237,25.753854646021427,0.3805030597914013 +16.10139025135556,17.36951228753929,17.8116923056727,0.2952682773173713 +10.160533110786227,11.158251371930014,11.569006374697905,0.25319082938065 +27.824193700278617,29.20218030116584,30.01844624546323,0.39417525863515235 +26.05405970661003,27.680738820288536,28.52829436399821,0.406274086736325 +23.27158345265326,24.81836258285218,25.656076839131714,0.3862022173196665 +14.356777142671818,15.669791801619747,16.572411543345694,0.3672824434878224 +6.889410622310856,7.729820443146382,8.565166986777706,0.30580568188818047 +21.562540414501694,30.63078864970246,34.32979442866343,2.1124369456955407 +20.93921723747736,29.28966257475337,32.70582108961849,1.9850367467590384 +19.091230532711457,26.487971981370848,29.57197366972084,1.818635808809358 +11.647958680760734,18.977380776356107,22.06028059406124,1.7550149024449224 +5.398144209484158,12.964969637666576,15.597922393199529,1.5388673394820132 +34.48835797875193,37.614860621341364,41.20481860694096,1.3689861976035267 +32.53582887248832,35.49501830011209,38.89797976504337,1.2823380924553753 +28.609353335795166,31.264905441056808,34.221125503180275,1.2410575132548713 +16.401401833306863,18.58203674544296,20.70571615399172,0.9542875883347168 +7.822443644201458,9.686125835392131,11.549006246419042,0.797025989454443 +11.5350262100488,14.721134199029974,19.180698801638968,1.3205705687483658 +10.24207838205956,13.1947805158707,16.327101968532514,1.1608470377788642 +8.350732983577117,10.851512981227383,13.408223230007161,0.9839344569444753 +0.8718862746428128,2.918400377206089,5.198677585126928,0.8573754414802098 +-6.984466232424238,-4.265691227911021,-2.071858905438698,0.8759658588594561 +37.566460451893434,38.31807065546817,38.842405060192924,0.19803729971183917 +35.14712191083199,36.1741114490633,36.645660610149655,0.22844946954580284 +31.783146139947583,32.77644862749566,33.208221635101694,0.22022714241717706 +22.797632142406897,23.705445303178553,24.04298200561316,0.19494199104798687 +15.063831895775332,15.882625818951505,16.33799091837554,0.23184636281153337 +35.555954098541164,36.85651539084341,38.714819126715426,0.8797461532797658 +34.222177852160044,35.42667686366103,37.182000600310126,0.8611301523411756 +30.853634297129535,32.04839257770228,33.72647899865908,0.8158108376349642 +23.779134912741615,25.02949053551394,26.81453256485075,0.7808472851550249 +18.463366588314226,19.790851341321684,21.678449750842887,0.7402044028983424 +25.57218421255968,28.5624148608606,31.65898307539884,1.5136994039448959 +24.632194185468563,27.513721126910873,30.19054455527172,1.3849950205935166 +22.133744257116494,24.860547829931686,27.116946113248396,1.1975776869364454 +10.237310871769415,12.31143761881311,13.659632631257399,0.725223618093378 +0.36177392281332305,1.6853692130563143,3.5680709036930343,0.682480320774216 +31.240499875208076,31.97022281480195,32.50955831026551,0.22356156497308868 +29.050822538915043,30.23855247233275,30.698685150115015,0.28028682930941784 +25.280138843534743,26.528418960541796,26.939759101298197,0.2893353248989635 +15.219021957336668,16.167072174806357,16.702147040007212,0.2868873401579499 +9.296417567351115,10.183963568530912,10.810520663133858,0.3202325060010032 +34.58297786693582,35.9395961079883,39.15300565218216,0.6355311304264967 +33.16758129406672,34.38904367303894,36.948639778910845,0.5828401866849231 +30.015101048557305,31.16021848368194,33.388579769074816,0.5427802182985004 +19.925666104473063,20.942611847169548,22.421473491804676,0.4863609522423086 +10.066448878663286,11.409686580986712,13.51574062876193,0.7632006046349693 diff --git a/Code/BlurDetection/X_train_hwt.csv b/Code/BlurDetection/X_train_hwt.csv new file mode 100644 index 0000000..9218f32 --- /dev/null +++ b/Code/BlurDetection/X_train_hwt.csv @@ -0,0 +1,91 @@ +min,mean,max,std +0.22815884476534296,0.2616251255591495,0.28522460761320584,0.009572999636605059 +0.4992500937382827,0.5395970186317515,0.5639138240574506,0.01042784116060547 +0.79,0.8088554273212388,0.8221425877027537,0.006166628501040998 +0.9986270022883296,0.9993355528480832,0.9997855457859747,0.00023519996327696862 +1.0,1.0,1.0,0.0 +0.3862808145766345,0.43959827576774885,0.4751610891706506,0.018223029693960308 +0.5988563888277986,0.6333747981226154,0.6701940035273368,0.014012291634841648 +0.8287148156229543,0.8538916477404851,0.8793023255813953,0.008958269925732256 +0.9962154294032023,0.998998632632878,1.0,0.0005485735254854012 +0.9985190670122177,0.9999830733310714,1.0,0.00012558371839126658 +0.4680889207601291,0.5191989856109146,0.6454763220932375,0.028329097794709733 +0.5987437650101607,0.6475767525297103,0.7245587683064213,0.020178076785025277 +0.7812080536912752,0.8153452058115429,0.8592,0.012847275394681154 +0.9946284691136974,0.9969420191334372,0.9986434546687768,0.0005595110532965945 +1.0,1.0,1.0,0.0 +0.2330259849119866,0.33277804163351565,0.4751538097491718,0.04662188660361474 +0.3408207343412527,0.4789384094107031,0.6424757281553398,0.05721224364644207 +0.7263444520081688,0.818600919486791,0.862809019288237,0.0259246184438283 +0.9975633528265108,0.9996065874033988,1.0,0.00047674363681575937 +1.0,1.0,1.0,0.0 +0.34420121099208195,0.49977685190428395,0.9054749649040711,0.17657551149626907 +0.5189519206308827,0.6450639371643914,0.9553032133365548,0.13613966126030133 +0.8546486250545613,0.9027257666498577,0.9897619657025851,0.03875847956280894 +0.9983227104998322,0.9997914604048349,1.0,0.0003030307975969842 +1.0,1.0,1.0,0.0 +0.6399533488837055,0.6776273947369797,0.7155201626567266,0.011086404239978916 +0.7647461104462301,0.8006088072131758,0.8369304556354916,0.012628828407452986 +0.8907384451921374,0.9139304880677902,0.9298801973220577,0.007363032915017095 +0.990194116469882,0.9945816591193021,0.998800719568259,0.0018745046668334966 +0.9993249324932493,0.9999815781434211,1.0,7.338214686113336e-05 +0.435630689206762,0.4772316208041368,0.5470179290157337,0.01825881415991033 +0.6200631911532386,0.6457626362699622,0.6876145108098205,0.014094622912634532 +0.783080750961321,0.820190153796146,0.8431762884317628,0.010318462156410952 +0.9944738659912503,0.9968642601107214,0.9989865720800608,0.0007980283325655833 +1.0,1.0,1.0,0.0 +0.4711880483756225,0.5120534825770365,0.5537056928034372,0.01863735632562872 +0.6146811665842807,0.6472545098870268,0.6827109266943292,0.019354166872863447 +0.763915030922291,0.8029167408202333,0.8412647716384541,0.022003458367704273 +0.9935368043087971,0.9962904617147965,0.9986371379897785,0.0011056096727619493 +0.9995152690256908,0.9999983842300856,1.0,2.7939273656147494e-05 +0.5060606060606061,0.5191206208147348,0.548685911245153,0.005743843575777295 +0.7290135827209976,0.7354763901381444,0.7530616789133823,0.003298539704521584 +0.9097651421508035,0.9130660056468359,0.9166046165301563,0.0013629964049319747 +0.9720430107526882,0.9738995412143432,0.9769176136363636,0.0009444580850000162 +1.0,1.0,1.0,0.0 +0.4582953509571559,0.5007352884789038,0.5576611971342732,0.01457804251908378 +0.6336656619522374,0.6613765122951022,0.7073347857661583,0.01162755145188502 +0.7912200102092904,0.8172817912285975,0.8453661034306196,0.008588632645296426 +0.9942379717660617,0.9974096220861304,0.9981288425554664,0.0003886718418890675 +0.9996567112941984,0.9999988557043139,1.0,1.978672212586186e-05 +0.5290917691579943,0.6501100205543278,0.8653447765611127,0.07175011123118613 +0.6848077813802687,0.7917799274452436,0.9338723650014439,0.0421450790036643 +0.8027522935779816,0.8896454142035287,0.9886769964243146,0.029159818082196802 +0.9850785340314137,0.9957644992078706,1.0,0.0035159070325137772 +0.9996632996632997,0.9999829455067708,1.0,6.985655768005891e-05 +0.25153793574846206,0.33402698471714826,0.4146387474061498,0.025363483952474973 +0.429260182876143,0.4988102256645241,0.5743440233236151,0.023812209970338085 +0.7108635097493036,0.7386464349066554,0.7722321251733016,0.011529648251129097 +0.9971524721718872,0.9985648929203038,0.999529964747356,0.0005884687110418142 +1.0,1.0,1.0,0.0 +0.5334441213128376,0.644079315006173,0.7693817468105987,0.03835416277482808 +0.6147469458987783,0.7064385678764323,0.8186323092170465,0.033830073870420474 +0.7581818181818182,0.8265354922541347,0.9074257425742575,0.026212386027438684 +0.9951794322442421,0.9990668760265425,1.0,0.0006445172425967031 +1.0,1.0,1.0,0.0 +0.36866037075900665,0.4283173720245771,0.46900362631669834,0.016713317822139962 +0.569012056865215,0.5909564398421537,0.6123087621696801,0.007801998995316097 +0.7353281853281853,0.7492269144040519,0.7629260819609345,0.006128369149459716 +0.9737609329446064,0.9829745971997653,0.9889515219842164,0.0027223727642107978 +0.9980738362760835,0.9999195102135079,1.0,0.00027501459694151496 +0.6230551626591231,0.690549947586132,0.7498138495904692,0.02508485347424947 +0.843705035971223,0.8870917336579887,0.9188137164040778,0.015411597561483905 +0.9554794520547946,0.9680761241238135,0.977359208523592,0.005124257188604958 +0.998598037252153,0.9994755881454763,1.0,0.00023073149062734477 +1.0,1.0,1.0,0.0 +0.22604259094942325,0.38644062987088706,0.5074021012416428,0.05940296350457963 +0.35666368515205726,0.5029496227503182,0.6116646415552855,0.057847727742783905 +0.7232998885172798,0.7770095930815849,0.8184760956175299,0.015634267545156427 +0.9974182444061962,0.9991400160104228,1.0,0.0005738294090219953 +1.0,1.0,1.0,0.0 +0.4408839779005525,0.47544217575701747,0.502330743618202,0.011721294506734726 +0.6209658960860609,0.6547513390711533,0.6789413118527042,0.010678120629150223 +0.8377777777777777,0.8534918522455641,0.8691952346219305,0.005158536619389473 +0.9990963855421687,0.9998503114081695,1.0,0.00021224514118698098 +1.0,1.0,1.0,0.0 +0.503574115876599,0.5389038317075417,0.5776173285198556,0.014367737069704838 +0.6418530983963572,0.685209392082799,0.7395079594790159,0.01690632283688978 +0.8172535944988539,0.8412749047297859,0.8650758251561106,0.00937176000557261 +0.9930087390761548,0.9960155257756207,0.9974180222050091,0.00071044439657473 +0.9993670886075949,0.9999344038089126,1.0,0.0001323798871278912 diff --git a/Code/BlurDetection/X_train_laplacian.csv b/Code/BlurDetection/X_train_laplacian.csv new file mode 100644 index 0000000..6f62449 --- /dev/null +++ b/Code/BlurDetection/X_train_laplacian.csv @@ -0,0 +1,91 @@ +min,mean,max,std +511.1821983788236,610.7082452209437,735.4203606347521,29.196443340112236 +206.3157227951469,238.93557049822567,281.10823489602586,11.540947294471625 +53.90833658278117,58.67412999472846,69.42897656189628,2.053725808067656 +8.911844071456464,10.180573029164554,11.766648296024215,0.5379042070047312 +6.107674034522392,7.118981115495846,8.257753635978961,0.46838844726563955 +155.9647276724774,189.73052648173052,232.27854441430355,12.702986629813877 +82.41515963264735,100.40999802450337,117.12332025505363,5.950054121311415 +34.29060473129629,41.59460275221063,47.41493846160349,2.057003063038183 +8.366101459008151,10.67117940721915,12.524790702160495,0.7154172943123513 +5.21040122351534,6.923900031076751,8.142019669670782,0.5634238007226893 +184.04495409829514,300.7129361848721,381.2886027300937,36.998870606281436 +83.66881323729655,132.91432990205237,164.05601090070016,13.567578337647507 +34.51587185496732,49.798498044819986,57.3956915635681,4.008384792145725 +9.823330437759838,12.326995659974004,14.341318905206377,0.9802928507860571 +5.99044366096086,7.800596814745978,9.000908077398485,0.719405102953634 +316.8438364850126,481.90935845630986,729.2239909279825,71.85447104060746 +162.774773176167,264.59925767866565,381.1502782255584,44.19635510078773 +45.269350268987935,72.70610628952014,100.38076485339506,12.148127146077579 +5.261882228063723,7.656119724458334,9.606228290303552,0.9500746927919277 +3.172294519549966,4.786450111602807,6.0595230506535325,0.6420195884712776 +28.101608175349867,477.66132546343187,766.9801384713156,213.90805495990432 +16.930218272360133,166.04602022565007,270.588192491095,71.59180060723664 +9.593081702602518,47.217202005727486,71.52327959024349,17.728436335877454 +5.212142381701523,8.644952958105026,11.560062783926266,1.417366029518097 +3.3229185366030083,5.4805822291154955,7.0938338729423505,0.7920799417293956 +87.89537125931527,100.02548393444496,128.89881189932112,6.704748747852494 +49.21006409584093,57.09978684493352,76.66074132895548,4.317708126236905 +23.91606390933417,28.452151499930963,37.20685691514621,2.2863742017845583 +9.84116736629621,12.367242101466589,15.239763796605663,1.3013503709815695 +6.874764539259828,8.950538095026307,11.082497516580565,1.0918661356392831 +297.452634624409,353.14982305720514,450.5687046362156,28.43561283088167 +118.24429379359543,146.6010077427918,179.1041305844758,10.189507326644526 +42.48152271427646,49.61723573949139,58.8294079411229,3.5066651559308766 +7.505920566886416,9.869847630998214,14.14513834826099,1.3388263103908038 +5.11010869954427,6.9120813995380335,9.493161643360745,0.9614189761682796 +173.43595653657204,216.62929197537284,284.8497252459707,22.705739608882606 +79.55666803865782,99.79681017849703,123.30017832736395,11.76799841378428 +30.913076266338322,39.223736046606184,47.4400540010894,4.484814830135005 +6.709592236305569,8.135692856977396,9.32948459495262,0.6429535006339656 +4.040207325424385,5.095715946926685,6.028760915385337,0.45849150494031166 +332.2588291948761,371.89617620890857,392.8501154568625,9.019406357369604 +84.25738747903334,93.27212724083118,96.39085424809896,2.223184815713366 +27.34553034757554,29.66118000594785,31.049880278653557,0.6117894248688143 +8.75350067296609,9.042314548802683,9.717826476313784,0.17592572374638965 +4.807558348509563,5.017950318501949,5.560255104431006,0.12764420306470114 +207.87335122065085,253.84611574230541,316.6966692404395,15.177746219415232 +97.45511565645718,124.57555575672042,156.5435206549887,8.064996840387558 +35.99510319575182,45.25343119570982,51.01965663459686,2.4527581120316713 +6.172201477031947,8.097802358821781,9.380369875491397,0.6950339975915959 +4.1073890555341235,5.541422219525494,6.5938396795151,0.5852458016846975 +36.753200826762686,114.01101273778532,230.40911258650405,35.98544422014948 +20.297611373101564,50.91536514331569,103.96083912029508,13.766390244847218 +10.655135511665828,22.8045306652494,40.73156248974375,5.387303407995095 +6.05017201063159,8.280675888951489,11.649016193834438,1.1844141714856986 +4.555699251010908,6.081902280360001,7.754367764443399,0.753206790804672 +419.6727623446034,642.5708640823241,1035.9324357421867,101.02638308890238 +227.3441420690965,353.2614629947255,564.128061766655,54.764526583057815 +76.97538766010267,107.75917340041181,151.75943937422306,13.05754507944464 +8.668424464043932,10.829069475041543,12.860221732642321,1.0291545246716276 +4.885670814031812,6.281388356527627,7.56448413599424,0.611793969275771 +40.353252306594925,72.06272914407305,162.63182190955771,16.175281319273704 +19.11642409176207,37.332341890902995,69.65871768902439,7.701579786162443 +10.298415789767716,16.709599093794765,26.90191695425821,2.634954332395045 +3.842191807223117,4.963015634838781,6.244831693644697,0.4846892383553457 +2.8091931859627377,3.712921061897752,4.650982341577394,0.3808268887025316 +486.47394830727313,623.5270773564413,829.7268472007735,61.45583657300546 +155.87944419054614,185.3029501691429,217.56677246435143,10.605793956217637 +59.90404136302493,68.60340868996552,75.50686302293177,2.371652611802151 +11.58357225353518,12.826851090915559,15.268957425253745,0.5029248437350752 +6.657505298062731,7.633830116535781,8.662894694512527,0.4282722488834571 +72.8864215635365,90.64748595489259,116.66356528287912,8.063424907642279 +38.49152181632493,46.116797525183614,59.639691762311465,3.574781420558352 +19.216378224389345,23.22461532755234,28.916824362954998,1.8707180090650017 +9.276127923402345,12.022623103515906,14.439145389388852,1.2686255688774175 +6.416398533369194,8.921074877165557,10.94962577046536,1.1203033565225191 +228.4119550511984,335.2822751125962,549.1647899630127,69.00701609380354 +140.1624655884233,198.47364547641132,307.5552231984832,39.50299685428671 +55.373220477715414,73.81579760379346,101.24649352841264,12.259299274101213 +6.409143018162107,8.555537439957057,10.485567568680647,0.8883569361838007 +3.6346175405975876,4.900706040199717,5.891082149981567,0.4834685564323986 +246.50460417961506,303.14152968898514,370.968212234132,23.188704327597467 +91.11632865802272,117.01133177159682,152.83346616642748,11.243089142334476 +31.28956069328101,36.3838070709274,41.9285966375648,1.9404923820157305 +5.610186612250354,7.2809701815838865,8.397222337006408,0.5559736780675062 +4.039415901824576,5.12507451705444,6.227353316285355,0.5123475725890537 +147.93645765009595,169.90821072579357,213.8094143188306,8.95527575310472 +69.27144785588058,80.53410355268744,99.5350408941572,4.387987266325535 +31.67472448202796,37.893218004646165,46.28746375305212,2.2826947970529625 +8.274495952337233,10.391268677747656,12.796277483400361,0.9036516165694519 +5.033486689513405,6.507462031256604,7.872250154187025,0.6612205168314157 diff --git a/Code/BlurDetection/X_train_modified_laplacian.csv b/Code/BlurDetection/X_train_modified_laplacian.csv new file mode 100644 index 0000000..68adc7d --- /dev/null +++ b/Code/BlurDetection/X_train_modified_laplacian.csv @@ -0,0 +1,91 @@ +min,mean,max,std +124.59677372685185,125.77665630062859,127.2075496720679,0.6906565949816903 +122.96712046682099,124.23247329663722,125.58007908950617,0.6547485605002608 +120.06730661651234,121.36311184618658,122.76334008487655,0.6610977962872892 +118.07414496527778,119.34492288116257,120.76699845679012,0.6639839185318864 +117.7858130787037,119.04983286485889,120.49696518132716,0.6670246197775511 +81.46056327160494,90.99275397754654,100.06298852237654,4.38088238460886 +80.05325327932098,89.4137722829765,98.45555700231482,4.339448660836565 +78.94329475308642,88.33281481353308,97.43770302854938,4.363930446201189 +77.41661168981481,86.83432907220273,96.02233506944444,4.394169711232102 +77.09079668209877,86.50229028239204,95.70811149691357,4.399881939319064 +53.159363425925925,57.24244044735142,61.97585792824074,2.1238756820688005 +52.539693769290125,56.70080857981112,61.196453993055556,2.1789360795683663 +51.073433641975306,55.20145792478006,59.74687355324074,2.1769316928852933 +49.383028549382715,53.533191409934986,58.22093123070988,2.1792926860836186 +48.9768253279321,53.137646326160734,57.85663435570988,2.179942191934092 +134.10886815200618,141.48188924168667,153.1897125771605,5.35521247052886 +132.26901186342593,139.4545849931812,151.0694777199074,5.459362957443288 +128.724871720679,135.85561836221083,147.4739993248457,5.72777964587501 +125.6532672646605,132.85410417243446,144.23492042824074,5.9604684405429 +125.26389708719135,132.51354731431493,143.9030184220679,5.9582258422351915 +123.46109278549383,145.51900970530332,163.53252652391976,6.437577213592049 +119.99271122685185,142.67637198920266,160.7658063271605,6.055218872275898 +116.39769338348765,140.02775464404914,158.1917433449074,5.759624003944892 +113.85003231095679,137.99459963541025,156.2820558449074,5.663042322081189 +113.46279996141975,137.6605795881014,156.0144666280864,5.663068236909186 +95.18915702160494,100.57092528826239,120.46808352623457,3.948471779633929 +95.53694878472223,100.71695754859061,120.86777054398148,3.895556180025729 +94.97306423611111,100.1168195440994,120.2473861882716,3.882913283940228 +94.15135079089507,99.24705011394632,119.41078751929012,3.8646510918321515 +93.89938850308641,98.98984734046235,119.14675540123457,3.8609537466667443 +96.98351803626544,102.7106283869868,114.7284659529321,3.1673972558808625 +95.99986545138889,101.59652047989468,113.39573206018518,3.180524807553454 +94.23063319830247,99.80685048199673,111.75642119984568,3.2189496368569874 +92.49963445216049,98.06648913023973,110.18314718364198,3.2202665317051613 +92.25678819444444,97.80018564981441,109.85623070987654,3.200353165302224 +140.49930266203702,143.3356656716178,148.0720664544753,1.973388982770893 +139.06390914351852,141.90471032343106,146.54746238425926,1.9634093701435686 +137.4059702932099,140.5527192515432,145.27793788580246,2.0157610707577387 +135.77447627314814,139.06440878986623,143.89083140432098,2.0869795187330404 +135.4466936728395,138.7382060522762,143.58136477623458,2.0981195519273754 +109.65950713734568,110.53837718792295,110.74873649691358,0.17412422425155935 +107.51694396219136,108.44683308884224,108.67875771604939,0.1960279674061072 +106.37028694058642,106.96485712010633,107.15631606867284,0.1368341112210922 +105.58854456018518,105.81410105301002,105.97182291666667,0.09199947015893233 +105.3220703125,105.48975392595668,105.65758294753087,0.08881346964608625 +97.41538821373457,100.38177705761316,102.77608699845679,1.398761336041623 +96.28932098765432,99.28151149209106,101.42604456018519,1.3438623674185888 +95.1520630787037,97.9060770013503,100.08835985725308,1.3038355117959002 +94.01553915895062,96.42557231867285,98.56646701388888,1.2671011286632232 +93.75717158564815,96.17143370788324,98.313125,1.2639202571095818 +93.24844762731482,101.33818034374872,109.03850453317901,4.4202122551561445 +92.9922974537037,101.15820059196967,109.17303722993827,4.604257711158217 +92.42330150462963,100.5663950219946,108.62085358796297,4.619117306117996 +91.75748794367284,99.855166652888,107.98909963348765,4.641927967918442 +91.5503515625,99.65831346963311,107.82527391975309,4.648445957749339 +138.66812258873458,146.95909767723845,154.0082769097222,3.951002951263297 +136.7091261574074,144.9854019122857,151.30785783179013,3.8967147464071403 +132.6917110339506,141.088952487016,146.48571132330247,3.770755667797905 +129.1005922067901,137.36029578296112,142.97080439814815,3.717093284263348 +128.65375578703703,136.88327131013904,142.5605497685185,3.7206296582461467 +54.23913435570988,56.13661420201694,59.39746865354938,1.3648102385474474 +54.30285252700617,56.13262180655531,59.32220775462963,1.3599439333480843 +53.82991367669753,55.71180339583077,58.829104938271605,1.3593071774756604 +53.14554783950617,55.1228915302259,58.27802662037037,1.3531954833212068 +52.97815248842593,54.96159169473667,58.12668740354938,1.354783231402421 +107.55583188657407,110.38202070772323,112.52578414351852,1.3571407861685296 +105.86879967206791,108.53835360879116,110.5522617669753,1.3648319609049946 +104.3240446566358,106.8699871409858,108.9593465470679,1.3537170074774034 +102.34549864969136,104.86214304459672,106.98503858024691,1.366886955497343 +101.93129484953704,104.44173540455427,106.59016927083333,1.3675574157646562 +76.4389916087963,80.5400450209692,87.80126591435184,3.754281865359203 +77.63865113811728,81.72532168363685,88.96057243441358,3.8326108770896123 +77.06420138888889,81.11381665346478,88.25199459876544,3.818548527432955 +76.38424768518519,80.41959771921526,87.52460503472223,3.7975746153965684 +76.14611496913581,80.17276608033664,87.27148196373457,3.7903723574928976 +128.3391198881173,132.04768756930392,140.65523678626542,2.7482650614396547 +126.51923321759259,129.82348084688752,138.15273919753088,2.7549732824281183 +124.12359326774691,127.526707776347,135.9591473765432,2.9050366442763993 +120.79167148919753,124.76128730115843,133.64143566743826,3.130598141577878 +120.37536699459876,124.38783449840571,133.30104118441358,3.1568440618925657 +144.70661988811727,147.24043018257046,149.9857065007716,1.0142582702774572 +143.5614559220679,145.85162184436652,148.31638020833333,0.9463257476881676 +142.07087191358025,144.15949513869666,146.25218991126542,0.8947348960818308 +140.66144290123458,142.72227940365966,144.73602189429013,0.8870842479226104 +140.4531963734568,142.5020016867643,144.49895158179012,0.8816033434829312 +124.91737268518519,126.31616709265688,128.5140162037037,0.665723357628821 +124.59339602623457,125.94753780221193,128.08024064429011,0.6349417122385816 +123.60706211419753,124.97336128472222,127.09017168209877,0.6310362560770961 +122.27233217592592,123.5756189846965,125.61287905092593,0.6064691621283046 +121.90156491126544,123.22250788323045,125.2703443287037,0.6037146822261447 diff --git a/Code/BlurDetection/X_train_tenengrad.csv b/Code/BlurDetection/X_train_tenengrad.csv new file mode 100644 index 0000000..9ab0121 --- /dev/null +++ b/Code/BlurDetection/X_train_tenengrad.csv @@ -0,0 +1,91 @@ +min,mean,max,std +814.8926497307881,838.4384908893469,875.6856608065075,11.050583371801576 +687.6392342681779,706.567008587882,733.0204609653313,9.90275042856967 +515.6787018094507,533.1668968526508,553.7483290178053,8.490766422641705 +338.69670781090923,349.6906762250211,364.5827613637633,6.497821392151989 +271.3095461107095,279.05583930582435,291.09220708267634,5.379042493168068 +557.7213759777834,649.6193464711698,685.6651444061714,22.287440547676784 +468.89169561910586,563.5714777066512,596.5305941686973,21.394631176409803 +367.2602554569094,442.856923025406,469.7246159608695,17.028075765880235 +237.463083428542,284.42852048079527,304.27828953056223,11.739281254151024 +182.50848123679845,214.69622857278117,228.6219439171415,8.665732863186543 +600.9207723869935,732.5878329613697,792.3905219873346,31.256416777302665 +538.3882694627076,630.6949273568995,671.5318793528451,21.567406793699057 +451.22155028715684,502.40984721374167,528.0740987405277,12.26518238863626 +313.96545262658043,325.8284869726309,341.88999708944306,5.695587147584083 +234.39489371557053,243.8786121883595,257.7878874681933,4.48143198375328 +505.11799934043125,575.8835376800488,660.4576554696949,34.856798852669364 +448.90699040625867,507.0487800828563,579.1800282479347,31.565249712649813 +342.1960257845596,388.59863651122026,448.6856923180621,24.11119806886534 +159.2565458112275,200.23541855145686,236.5837733367067,16.247255474339983 +113.13626128287584,140.53856791874435,163.18298392099106,12.304260583204481 +326.25709111628254,639.176596962029,764.240609292806,139.2782045586008 +305.7169558733607,526.1249909800816,629.8361702281057,99.20784154745664 +265.9607046186575,389.54259374029726,469.63992039455906,56.71516536790631 +176.81049398717803,223.9237287255408,275.2377081956161,22.219038005568077 +126.92158905572695,161.57760163209585,201.33939947275894,16.446145240206842 +675.1294091562515,710.3793693979843,749.4939119112016,17.532498995150974 +599.7526375699066,629.0814557041257,664.8589087843245,14.261691280588117 +487.4139822053024,508.7421526917153,536.7847087710469,10.571896263350254 +347.1547616447699,361.8092036266674,383.915894818977,6.100963000720404 +276.5504482238976,288.14533075437566,307.1009945604104,4.373219691962488 +592.3485093003292,643.5742200524702,749.1053629281415,33.64060067297983 +510.3352130718097,552.7318794766281,636.5157446124696,27.136604662183863 +411.6749729963825,446.2294922042329,510.78140635303595,21.730177131089622 +289.70425948351425,308.8749878673457,342.28830249709983,12.8626987786468 +226.39445959234035,244.87921900061176,268.4110657183928,9.731560198636123 +471.7791352665077,526.5796855024546,576.066047542742,33.24941327530671 +399.9839640679612,455.7605467836192,498.4994712203675,31.136712398877172 +318.38014294110917,362.1309829810048,397.01056493639453,25.423298718334603 +200.79698024893088,228.5849997245239,251.62321566945738,15.670151140765606 +145.19886089364365,165.29943224471796,182.4859468406228,11.129530830631387 +476.90992162082875,515.4441325404119,522.4437419598069,6.790858291724448 +378.22598678116225,431.6596944033565,439.82007910248376,10.546819127927995 +296.64076557088504,337.4433218083013,343.75099300253464,8.112903814340243 +208.11907318382822,227.53161256387574,231.78379932437898,3.965394448605407 +162.4768249873822,172.89091186198897,176.81926387084724,2.2782201005945053 +460.45747119353945,497.038506925557,513.1541242011511,8.434019857844769 +403.7040282657559,444.063237308926,459.0120230718328,8.36648959270738 +337.79302922611697,370.3198892091931,383.2937205580556,6.740424924281273 +230.29507289105752,248.34113411171518,256.67804392784234,4.063577055429865 +176.90427385063245,188.16415982511904,194.13432800179973,2.7775928975020476 +297.35995972642445,455.3313732745667,555.3882309989347,51.084965170660695 +288.4559487698316,412.73310349668805,496.99405736069554,40.32630870323748 +269.104229104185,354.3146482667785,419.30377797110657,29.33195646574794 +216.13510100285296,269.3771839102803,317.41954833497795,20.78150357141065 +182.90219664512307,219.47152137822403,249.48490564252947,14.403656555698248 +728.3716433984031,833.5431425880715,941.2601711076073,40.383841265172684 +632.8941640608064,719.8447852286665,811.5001877668708,34.015700622083195 +497.31958679968596,558.2218064397964,624.7700723185911,27.09426188578579 +272.5655729198633,300.21191707248806,322.92458971814955,12.362110534591043 +192.43141062242645,209.15605147280982,221.1614831108002,6.52388199261572 +244.16649058785114,295.13708170717706,365.47893458108064,19.215864455710687 +231.88174936298196,271.63665235738426,302.2055861674069,13.549009114736931 +214.63031074040777,237.78375674559436,255.4715729926568,8.461609330611587 +168.91242102783949,179.91011377143658,189.6952606395304,4.4555111218140375 +135.16211078887662,142.9246560953623,150.05171330615948,2.9356562756450457 +683.631693570401,726.9677781286066,745.1703451230949,11.482008145803002 +570.053792783037,619.5663326829946,635.4479269910696,11.318712002043872 +466.72657974421105,503.6646793552272,516.3555301890918,8.472839806597337 +313.3508553812612,335.48904030552137,342.2146270592556,4.790186567127121 +230.61016280118722,246.06599374076734,249.87937983463843,3.184557634335938 +604.7227205441069,644.4237927757255,699.9926747369384,25.42748574004188 +546.3265602633346,580.5736278650002,627.8009179813862,22.901363388400537 +452.06481361827696,478.6924530866951,516.1378094089935,18.728334773099682 +333.20245974796364,352.5705152727262,379.99803711855867,14.432596670930796 +261.50090434212296,276.0548290794921,296.6803505442856,11.136979674661424 +498.79903146336966,606.866764055411,736.4033607948435,72.72933732012338 +456.827296741565,549.3332846990669,653.4370575112149,60.956604820440454 +383.39329993638376,453.59794720300164,524.9300596969435,43.548079724287064 +215.8372280605268,241.4521881803824,253.68415843706762,7.18936223640054 +149.60519725547962,162.59758424135444,177.57410774792913,6.835378188063582 +469.6363024451969,491.6086887929175,505.4958124710854,6.112850105852294 +395.70696263867137,430.1355283733187,441.81382544946246,7.413068589369048 +321.9653216251466,350.88752571148154,358.61332491012803,6.086922439843033 +220.85022899995064,238.44073635822724,243.29536497942445,4.059525061872091 +179.9331874696609,191.50469473848682,195.70152744163437,2.9907012481863933 +629.2581024336897,680.2117378787071,781.2661490898595,19.798077032528766 +555.605418111663,600.2280165835447,670.9967818550977,16.44814548591654 +446.657319835289,482.1156485633548,534.5642875843288,13.641414130907876 +288.37273532368846,305.40374246838604,326.1540528907917,7.675758891448528 +206.85250976872044,219.57831497830963,235.09789035813054,5.707616125140376 diff --git a/Code/BlurDetection/lap.sav b/Code/BlurDetection/lap.sav new file mode 100644 index 0000000..e69de29 diff --git a/Code/BlurDetection/test.xlsx b/Code/BlurDetection/test.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..6dff20c7e106604ada650dc7f23093297f13f906 GIT binary patch literal 5358 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 B2Z;ax literal 0 HcmV?d00001 diff --git a/Code/BlurDetection/y_test_fft.csv b/Code/BlurDetection/y_test_fft.csv new file mode 100644 index 0000000..f3e05ba --- /dev/null +++ b/Code/BlurDetection/y_test_fft.csv @@ -0,0 +1,36 @@ +label +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 diff --git a/Code/BlurDetection/y_test_hwt.csv b/Code/BlurDetection/y_test_hwt.csv new file mode 100644 index 0000000..f3e05ba --- /dev/null +++ b/Code/BlurDetection/y_test_hwt.csv @@ -0,0 +1,36 @@ +label +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 diff --git a/Code/BlurDetection/y_test_laplacian.csv b/Code/BlurDetection/y_test_laplacian.csv new file mode 100644 index 0000000..f3e05ba --- /dev/null +++ b/Code/BlurDetection/y_test_laplacian.csv @@ -0,0 +1,36 @@ +label +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 diff --git a/Code/BlurDetection/y_test_modified_laplacian.csv b/Code/BlurDetection/y_test_modified_laplacian.csv new file mode 100644 index 0000000..f3e05ba --- /dev/null +++ b/Code/BlurDetection/y_test_modified_laplacian.csv @@ -0,0 +1,36 @@ +label +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 diff --git a/Code/BlurDetection/y_test_tenengrad.csv b/Code/BlurDetection/y_test_tenengrad.csv new file mode 100644 index 0000000..f3e05ba --- /dev/null +++ b/Code/BlurDetection/y_test_tenengrad.csv @@ -0,0 +1,36 @@ +label +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 diff --git a/Code/BlurDetection/y_train_fft.csv b/Code/BlurDetection/y_train_fft.csv new file mode 100644 index 0000000..e73de9e --- /dev/null +++ b/Code/BlurDetection/y_train_fft.csv @@ -0,0 +1,91 @@ +label +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 diff --git a/Code/BlurDetection/y_train_hwt.csv b/Code/BlurDetection/y_train_hwt.csv new file mode 100644 index 0000000..e73de9e --- /dev/null +++ b/Code/BlurDetection/y_train_hwt.csv @@ -0,0 +1,91 @@ +label +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 diff --git a/Code/BlurDetection/y_train_laplacian.csv b/Code/BlurDetection/y_train_laplacian.csv new file mode 100644 index 0000000..e73de9e --- /dev/null +++ b/Code/BlurDetection/y_train_laplacian.csv @@ -0,0 +1,91 @@ +label +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 diff --git a/Code/BlurDetection/y_train_modified_laplacian.csv b/Code/BlurDetection/y_train_modified_laplacian.csv new file mode 100644 index 0000000..e73de9e --- /dev/null +++ b/Code/BlurDetection/y_train_modified_laplacian.csv @@ -0,0 +1,91 @@ +label +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 diff --git a/Code/BlurDetection/y_train_tenengrad.csv b/Code/BlurDetection/y_train_tenengrad.csv new file mode 100644 index 0000000..e73de9e --- /dev/null +++ b/Code/BlurDetection/y_train_tenengrad.csv @@ -0,0 +1,91 @@ +label +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0 +0.0 +1.0 +2.0 +3.0 +4.0