169 lines
442 KiB
Plaintext
169 lines
442 KiB
Plaintext
|
{
|
||
|
"cells": [
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 3,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABW4AAAPdCAYAAAAauvH/AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8fJSN1AAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd3gU1frA8e/upvfeSKVJ74TelBJBFL0oigKhiIKK/LCAlSYiYAFUuBaqYNfrtSAYFEQuSGhBIKhgEkJJCKQS0ja78/tjkiWbTUgC6byf55mH3bNnZs4cUmbfvPsejaIoCkIIIYQQQgghhBBCCCHqDW1dD0AIIYQQQgghhBBCCCGEOQncCiGEEEIIIYQQQgghRD0jgVshhBBCCCGEEEIIIYSoZyRwK4QQQgghhBBCCCGEEPWMBG6FEEIIIYQQQgghhBCinpHArRBCCCGEEEIIIYQQQtQzErgVQgghhBBCCCGEEEKIekYCt0IIIYQQQgghhBBCCFHPSOBWCCGEEEIIIYQQQggh6hkJ3AohGrzLly/z7LPPMnToULy9vdFoNMybN6/S+8fExDBixAiCg4Oxt7fHw8ODXr16sWnTpkrtv3PnTjQaTZnb77//fp1XZS40NJQ77rijWo4FcP78eebNm0dMTEy1HbOxGjhwIAMHDqzrYQghhBA3tfXr16PRaEhISKjyvsX3al9++WW1jaf4mDt37qy2Y9aVefPmodFo6noYogLV+TU3cOBA2rVrd+ODKpKTk8O8efMaxfeDEPWNVV0PQAghblRqairvv/8+HTt2ZNSoUXz44YdV2j8jI4OgoCAeeOABmjRpwpUrV9i8eTPjxo0jISGBF198sVLHefXVVxk0aJBZW3XeEFWn8+fPM3/+fEJDQ+nUqVNdD0cIIYQQ4ppGjBjB3r178ff3r+uhCCFKycnJYf78+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0aRORkZFcuHCBZ599li5durBu3TomTpzIiy++yIgRIwAIDAys0njKotfrufPOO5k8eTJPPfUUu3btYuHChbi6uvLyyy8D6pumQYMG8c8//zB//nw6dOjAb7/9xuLFi4mJibG4yf3mm2/47bffePnll/Hz88PHx4f9+/cDMGXKFO655x4+/fRTDh8+zPPPP09hYSF//fUX99xzD1OnTmX79u0sWbKEgIAAZs2aZTpuQkICjzzyCMHBwQD8/vvvPPHEE5w7d840ViGEEELUb8nJyTz44IM89dRTzJ07l//85z8899xzBAQEMH78eLO+zz//PF26dOHDDz8kMzOTefPmMXDgQA4fPkzTpk0B9f7glltu4f7778fDw4OkpCRWr15N9+7diY2NxcvLq9yxVHXfKVOmMGLECD7++GPOnDnDM888w0MPPcQvv/xi6vPyyy+zcOFC7rnnHp566ilcXV05duyYWTB406ZNjB8/nrvuuosNGzZgbW3Ne++9x7Bhw9i2bRu33XYbAD///DN33XUXvXr14tNPPzXd7124cOGG/x/Kc733atVxvxgbG0vv3r0JDg7mjTfewM/Pj23btjFjxgwuXbrE3Llzyx230Whk5MiRHDhwgHnz5tGlSxf27t1LRESERd9ff/2VIUOG0KFDB9asWYOtrS2rVq1i5MiRfPLJJ4wZMwao3H06wIULFxgwYADW1tasWrUKX19fNm/ezOOPP16pOR83bhyHDh1i0aJFtGzZkoyMDA4dOkRqaqpZv8p871y8eJHevXtTUFDAwoULCQ0N5fvvv+fpp5/mn3/+YdWqVfj7+7N161YiIiKYPHkyU6ZMATAFcys7HiFEORQhhGhELl68qADK3Llzq7zvI488ogAKoNjY2CirVq2q1H6HDh1SnnzySeU///mPsmvXLmXt2rVK69atFZ1Op2zduvWa+166dEkBlOXLl1+zX0hIiGJnZ6ecPn3a1Jabm6t4eHgojzzyiKnt/vvvV2xtbZXExESz/W+//XbFwcFBycjIUBRFUfbv368Ayrp1665rPGWZMGGCAiiff/65Wfvw4cOVW265xfT83//+d5n9lixZogDKTz/9ZGoDFFdXVyUtLc2s77p16xRAeeKJJ8zaR40apQDKm2++adbeqVMnpUuXLuWO3WAwKHq9XlmwYIHi6empGI1G02sDBgxQBgwYcO2LF0IIIUSNKv7dHx8fb2obMGCAAij79u0z69umTRtl2LBhpuc7duxQAKVLly5mv+MTEhIUa2trZcqUKeWet7CwUMnOzlYcHR2VFStWWBxzx44dVd63+FqmT59u1n/p0qUKoCQlJSmKoihxcXGKTqdTHnzwwXLPceXKFcXDw0MZOXKkWbvBYFA6duyohIeHm9p69OihBAQEKLm5uaa2rKwsxcPDQ6nu0MCN3qtVx/3isGHDlMDAQCUzM9Os/fHHH1fs7Ows+pf0ww8/KICyevVqs/bFixdbvNfo2bOn4uPjo1y+fNnUVlhYqLRr104JDAw0fc1V9j599uzZikajUWJiYsz6DRkypMKvOUVRFCcnJ2XmzJnX7FPZ7505c+aU2W/atGmKRqNR/vrrL0VRrv0erDLjEUKUT0olCCFEkeeff579+/fzww8/MGnSJB5//PFKfXysc+fOLF++nFGjRtGvXz8mTpzInj178Pf3N/3lvDweHh40a9aMZcuW8eabb3L48OEyP9oH0KlTJ1N2KICdnR0tW7Y0y7j45ZdfuO222wgKCjLbNzIykpycHPbu3Vtt4ymLRqNh5MiRZm0dOnSwGKOjoyOjR4+2GCNg8bG+W2+9FXd39zLPd8cdd5g9b926NYApi7hke+mPKf7yyy8MHjwYV1dXdDod1tbWvPzyy6SmppKSklLBlQohhBCiPvDz8yM8PNysrfS9R7GxY8ealdcKCQmhd+/e7Nixw9SWnZ3N7Nmzad68OVZWVlhZWeHk5MSVK1c4ceLENcdS1X3vvPNOi3EDprFHRUVhMBh47LHHyj3nnj1
|
||
|
"text/plain": [
|
||
|
"<Figure size 1400x1000 with 6 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"import matplotlib.pyplot as plt\n",
|
||
|
"\n",
|
||
|
"# Define data\n",
|
||
|
"bottle_data = {\n",
|
||
|
" \"ResNet50\": {\n",
|
||
|
" \"1,3,5 shots normal\": [0.5892857142857143, 0.7321428571428571, 0.75],\n",
|
||
|
" \"inbalanced - more good shots\": [0.75, 0.732, 0.696, 0.696],\n",
|
||
|
" \"2 ways only detect if faulty or not\": [0.8395, 0.8315, 0.8031],\n",
|
||
|
" \"inbalance 2 way\": [0.8031, 0.81893, 0.8336, 0.8031],\n",
|
||
|
" \"only faulty class detect\": [0.7638, 0.7428, 0.787]\n",
|
||
|
" },\n",
|
||
|
" \"P>M>F\": {\n",
|
||
|
" \"1,3,5 shots normal\": [0.67910401, 0.71710526, 0.78860294],\n",
|
||
|
" \"inbalanced - more good shots\": [0.78768382, 0.78860294, 0.75827206, 0.74356618],\n",
|
||
|
" \"2 ways only detect if faulty or not\": [0.86422306, 0.93201754, 0.93933824],\n",
|
||
|
" \"inbalance 2 way\": [0.92371324, 0.87867647, 0.86397059, 0.87775735],\n",
|
||
|
" \"only faulty class detect\": [0.57380952, 0.76705653, 0.84191176]\n",
|
||
|
" },\n",
|
||
|
" \"CAML\": {\n",
|
||
|
" \"1,3,5 shots normal\": [0.40740741, 0.39726027, 0.30769231],\n",
|
||
|
" \"2 ways only detect if faulty or not\": [0.79012346, 0.84415584, 0.87671233],\n",
|
||
|
" \"only faulty class detect\": [0.58064516, 0.51785714, 0.52]\n",
|
||
|
" }\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
"cable_data = {\n",
|
||
|
" \"ResNet50\": {\n",
|
||
|
" \"1,3,5 shots normal\": [0.21808, 0.43815, 0.4321478],\n",
|
||
|
" \"inbalanced - more good shots\": [0.4321478, 0.432986, 0.42340, 0.4464635],\n",
|
||
|
" \"2 ways only detect if faulty or not\": [0.8592, 0.8772, 0.8495],\n",
|
||
|
" \"inbalance 2 way\": [0.8495, 0.8180, 0.7460, 0.6846],\n",
|
||
|
" \"only faulty class detect\": [0.240, 0.4740, 0.4805]\n",
|
||
|
" },\n",
|
||
|
" \"P>M>F\": {\n",
|
||
|
" \"1,3,5 shots normal\": [0.25199021, 0.44388328, 0.46975059],\n",
|
||
|
" \"inbalanced - more good shots\": [0.50425859, 0.48023277, 0.43118282, 0.41842534],\n",
|
||
|
" \"2 ways only detect if faulty or not\": [0.79263485, 0.8707712, 0.86756514],\n",
|
||
|
" \"inbalance 2 way\": [0.86966158, 0.80142425, 0.80961366, 0.66028834],\n",
|
||
|
" \"only faulty class detect\": [0.24383256, 0.43800505, 0.51304563]\n",
|
||
|
" },\n",
|
||
|
" \"CAML\": {\n",
|
||
|
" \"1,3,5 shots normal\": [0.24031008, 0.19834711, 0.15929204],\n",
|
||
|
" \"2 ways only detect if faulty or not\": [0.57364341, 0.54545455, 0.59292035],\n",
|
||
|
" \"only faulty class detect\": [0.12962963, 0.36363636, 0.58823529]\n",
|
||
|
" }\n",
|
||
|
"}\n",
|
||
|
"# Prepare the data\n",
|
||
|
"measurement_types = [\n",
|
||
|
" \"1,3,5 shots normal\",\n",
|
||
|
" \"inbalanced - more good shots\",\n",
|
||
|
" \"2 ways only detect if faulty or not\",\n",
|
||
|
" \"inbalance 2 way\",\n",
|
||
|
" \"only faulty class detect\"\n",
|
||
|
"]\n",
|
||
|
"\n",
|
||
|
"models = [\"ResNet50\", \"P>M>F\", \"CAML\"]\n",
|
||
|
"\n",
|
||
|
"# Create subplots\n",
|
||
|
"fig, axes = plt.subplots(3, 2, figsize=(14, 10))\n",
|
||
|
"axes = axes.flatten()\n",
|
||
|
"\n",
|
||
|
"# Loop through each measurement type\n",
|
||
|
"for i, measurement in enumerate(measurement_types):\n",
|
||
|
" ax = axes[i]\n",
|
||
|
" for model in models:\n",
|
||
|
" # Get the bottle and cable data for the current measurement and model\n",
|
||
|
" bottle_accuracy = bottle_data[model].get(measurement, [])\n",
|
||
|
" cable_accuracy = cable_data[model].get(measurement, [])\n",
|
||
|
" \n",
|
||
|
" # Plot both bottle and cable data\n",
|
||
|
" ax.plot(bottle_accuracy, marker='o', label=f'{model} - Bottle', linestyle='-')\n",
|
||
|
" \n",
|
||
|
" ax.set_title(measurement)\n",
|
||
|
" ax.set_xlabel(\"Shots / Samples\")\n",
|
||
|
" ax.set_ylabel(\"Accuracy\")\n",
|
||
|
" ax.legend()\n",
|
||
|
" ax.grid(True)\n",
|
||
|
"\n",
|
||
|
"# Adjust layout\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.show()\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 2,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABW0AAAPdCAYAAADxjUr8AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8fJSN1AAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd3gUVd/H4c/uplcICUloSegl9Bp670h5UZoCAoIiIAJSFIQAgoBUJYhKEUFFRVTKAwQhdAQEFAi9l9AhBRKy2Z33jyEry24aqSS/22su2bMzZ86cbDaz3z1zRqMoioIQQgghhBBCCCGEEEKIHEGb3Q0QQgghhBBCCCGEEEII8R8JbYUQQgghhBBCCCGEECIHkdBWCCGEEEIIIYQQQgghchAJbYUQQgghhBBCCCGEECIHkdBWCCGEEEIIIYQQQgghchAJbYUQQgghhBBCCCGEECIHkdBWCCGEEEIIIYQQQgghchAJbYUQQgghhBBCCCGEECIHkdBWCCGEEEIIIYQQQgghchAJbYUQL4Xo6GhGjx5Ny5Yt8fLyQqPRMGnSpFRvf/ToUdq1a0exYsVwdHTEw8ODoKAgVq5cmartw8LC0Gg0Vpf9+/e/4FGZ8/f3p3379hlSF8CNGzeYNGkSR48ezbA6c6vGjRvTuHHj7G6GEEIIIZ6zfPlyNBoNly5dSvO2iedvv/zyS4a1J7HOsLCwDKszu0yaNAmNRpPdzRApyMjXXOPGjQkMDEx/o556/PgxkyZNyhW/D0LkRDbZ3QAhhE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 1400x1000 with 6 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"# Create subplots\n",
|
||
|
"fig, axes = plt.subplots(3, 2, figsize=(14, 10))\n",
|
||
|
"axes = axes.flatten()\n",
|
||
|
"\n",
|
||
|
"# Loop through each measurement type\n",
|
||
|
"for i, measurement in enumerate(measurement_types):\n",
|
||
|
" ax = axes[i]\n",
|
||
|
" for model in models:\n",
|
||
|
" # Get the bottle and cable data for the current measurement and model\n",
|
||
|
" bottle_accuracy = bottle_data[model].get(measurement, [])\n",
|
||
|
" cable_accuracy = cable_data[model].get(measurement, [])\n",
|
||
|
" \n",
|
||
|
" # Plot both bottle and cable data\n",
|
||
|
" ax.plot(cable_accuracy, marker='o', label=f'{model} - Cable', linestyle='-')\n",
|
||
|
" \n",
|
||
|
" ax.set_title(measurement)\n",
|
||
|
" ax.set_xlabel(\"Shots / Samples\")\n",
|
||
|
" ax.set_ylabel(\"Accuracy\")\n",
|
||
|
" ax.legend()\n",
|
||
|
" ax.grid(True)\n",
|
||
|
"\n",
|
||
|
"# Adjust layout\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"metadata": {
|
||
|
"kernelspec": {
|
||
|
"display_name": "Python 3",
|
||
|
"language": "python",
|
||
|
"name": "python3"
|
||
|
},
|
||
|
"language_info": {
|
||
|
"codemirror_mode": {
|
||
|
"name": "ipython",
|
||
|
"version": 3
|
||
|
},
|
||
|
"file_extension": ".py",
|
||
|
"mimetype": "text/x-python",
|
||
|
"name": "python",
|
||
|
"nbconvert_exporter": "python",
|
||
|
"pygments_lexer": "ipython3",
|
||
|
"version": "3.10.14"
|
||
|
}
|
||
|
},
|
||
|
"nbformat": 4,
|
||
|
"nbformat_minor": 2
|
||
|
}
|