<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Picha Jetsadapattarakul on Medium]]></title>
        <description><![CDATA[Stories by Picha Jetsadapattarakul on Medium]]></description>
        <link>https://medium.com/@icepicha?source=rss-74926fed95de------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*DObvPOAHSjRrDz-Rrv4IGQ@2x.jpeg</url>
            <title>Stories by Picha Jetsadapattarakul on Medium</title>
            <link>https://medium.com/@icepicha?source=rss-74926fed95de------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 15:13:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@icepicha/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Diabetic Foot Ulcers Classification by using planter foot Thermogram]]></title>
            <link>https://medium.com/@icepicha/diabetic-foot-ulcers-classification-by-using-planter-foot-thermogram-3de9db31ad54?source=rss-74926fed95de------2</link>
            <guid isPermaLink="false">https://medium.com/p/3de9db31ad54</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[diabetes]]></category>
            <dc:creator><![CDATA[Picha Jetsadapattarakul]]></dc:creator>
            <pubDate>Mon, 12 Jun 2023 15:59:56 GMT</pubDate>
            <atom:updated>2025-12-07T21:33:46.509Z</atom:updated>
            <content:encoded><![CDATA[<h3>An Early Detection of Diabetic Foot Ulcers by using Planter Foot Thermogram with Vision Transformer Model (ViT)</h3><p>โดย นายพิชา เจษฎาภัทรกุล (Picha Jetsadapattarakul)</p><blockquote><strong>Diabetes</strong></blockquote><p>โรคเบาหวานเป็นหนึ่งในโรคไม่ติดต่อเรื้อรังที่รุนแรง และในทางสถิติพบว่าจํานวนผู้ป่วยโรคเบาหวาน นั้นมีอัตราการเพิ่มขึ้นในทุกปี โดยอ้างอิงข้อมูลจากในปี ค.ศ. 2021 พบผู้ป่วยเบาหวานในผู้ใหญ่มากถึง<strong> 537 ล้านคน</strong>ทั่วโลกหรือคิดเป็นร้อยละ 10.5 ของประชากรทั้งหมด ซึ่งเพิ่มขึ้นถึง 3 เท่าจากค.ศ.2000 โดยทางสมาพันธ์เบาหวานนานาชาติ คาดการณ์ไว้ว่าใน ค.ศ.2045 จํานวนผู้ป่วยโรคเบาหวานจะเพิ่มสูงถึง 784 ล้านคน</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8WOpPHiHKdFK2htjMxlCsQ.png" /><figcaption>จำนวนประชากรที่เป็นโรคเบาหวาน -<a href="https://diabetesatlas.org/">Source</a></figcaption></figure><blockquote><strong>What is Diabetic foot Ulcers?</strong></blockquote><p>การเป็นโรคเบาหวานก่อให้เกิดภาวะแทรกซ้อนมากมาย โดยร้อยละ 15–25 นั้น<strong>เกิดแผลที่เท้าจากโรคเบาหวาน</strong> ซึ่งส่งผลกระทบร้ายแรง โดยมีสาเหตุมาจาก ความผิดปกติของหลอดเลือดแดงส่วนปลาย และความผิดปกติของเส้นประสาทส่วนปลาย ส่งผลให้ผู้ป่วยเสียการรับรู้ความรู้สึกที่ป้องกันไม่ให้เกิดการบาดเจ็บต่อบริเวณฝ่าเท้า ร่วมถึงการรับน้ําหนักที่ไม่สมดุล และ เกิดการผิดรูปของเท้า จึงเกิดแผลบริเวณที่มีแรงกดทับจากน้ําหนักตัวได้ง่าย นอกจากนี้ยังเป็นการลดประสิทธิภาพการทํางานของเม็ดเลือดขาวในการกําจัดเชื้อโรค ที่ส่งผลให้แผลที่เกิดนั้นมีการติดเชื้อและลุกลามได้เร็วขึ้น</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*g-a8CpClIMhj4DRul6vGyQ.png" /><figcaption>แผลที่เท้าจากโรคเบาหวาน (DFU : Diabetic Foot Ulcers) -<a href="https://www.associatedpodiatristspc.com/blog/dealing-with-diabetic-foot-ulcers">Source</a></figcaption></figure><p>ซึ่งถ้าหากแผลที่เป็นนั้นการติดเชื้อ จะต้องรักษาด้วยการ<strong>ตัดขา </strong>เพื่อเป็นการป้องกันไม่ให้เชื้อลุกลามไปบริเวณอื่นในร่างกายหรือในผู้ป่วยบางรายที่มีการลุกลามอย่างรวดเร็วอาจส่งผลอันตรายถึงชีวิตได้ โดยการป้องกันนั้นสามารถทําได้ด้วยการควบคุมระดับน้ําตาลในเลือด ตรวจเท้าเป็นประจําทุกวัน แต่เนื่องจากผลกระทบของภาวะแทรกซ้อนอื่น ๆ เช่น ภาวะเบาหวานขึ้นตา ภาวะเสียการรับรู้ความรู้สึกที่บริเวณปลายมือและปลายเท้า ที่ทําให้การตรวจหาแผลที่เท้านั้นเป็นเรื่องยาก โดยในการวินิจฉัยการอักเสบตั้งแต่เริ่มต้นที่อาจจะยากในการมองเห็น ซึ่งถ้าหากเราสามารถรับรู้และตรวจหาในระยะนี้ได้ก็จะสามารถลดการเกิดแผลที่จะมีการติดเชื้อได้ ดังนั้นทางผู้จัดทำจึงได้ไปศึกษาถึงวิธีการต่าง ๆ ที่จะสามารถตรวจหาแผลที่เท้าจากโรคเบาหวานในระยะแรกได้ และจึงได้ค้นพบว่าเราสามารถใช้ภาพความร้อนหรือ Thermogram มาใช้ได้ เนื่องจากเวลาที่เกิดการอักเสบของแต่ละบริเวณในร่างกายนั้นจะทำให้บริเวณนั้นมีอุณหภูมิที่สูงกว่าบริเวณอื่นที่ปกติ โดยที่ภาพความร้อนจะเป็นการถ่ายภาพด้วยกล้องถ่ายภาพความร้อนแล้วแทนอุณภูมิของสิ่งที่ถ่ายด้วยสีแต่ละโทนเพื่อบ่งบอกถึงอุณหภูมิของแต่ละบริเวณ และเพื่อเป็นการเพิ่มประสิทธิภาพ เพิ่มความรวดเร็วและลดภาระของบุคคลากรทางการแพทย์ ในการตรวจหาแผลที่เท้าจากโรคเบาหวาน ทางผู้จัดทำจึงได้นำปัญญาประดิษฐ์ มาช่วยในการคัดแยก</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*64ofOrJQrm2TU4wkHYzAIQ.jpeg" /><figcaption>การเปลี่ยนแปลงของอุณหภูมิบริเวณฝ่าเท้าเมื่อเกิดการอักเสบ -<a href="https://www.magonlinelibrary.com/doi/abs/10.12968/jowc.2021.30.2.116">Source</a></figcaption></figure><blockquote><strong>Dataset Image</strong></blockquote><p>ในการพัฒนา model นี้ทางผู้จัดทำได้ใช้ <a href="https://ieee-dataport.org/open-access/plantar-thermogram-database-study-diabetic-foot-complications">PLANTAR THERMOGRAM DATABASE FOR THE STUDY OF DIABETIC FOOT COMPLICATIONS</a> จาก IEEE DataPort โดยใน dataset นี้จะเป็นการเก็บภาพความร้อนจากกลุ่มตัวอย่าง ของผู้ที่เป็นแผลที่เท้าจากโรคเบาหวาน (Diabetic Foot Ulcers) จำนวน 122 คน และผู้ที่ไม่เป็นแผลที่เท้าจากโรคเบาหวาน (Normal) จำนวน 45 คน และแบ่งภาพ ออกเป็นเท้าซ้ายและเท้าขวา ทำให้มีจำนวนรูปภาพใน dataset นี่ ทั้งหมด 334 ภาพ</p><p>โดยทางผู้จัดทำได้ใช้เทคนิคการทำ 5 fold cross validation เพื่อเป็นการลด bias ขณะสร้าง model แล้วจึงมาหาค่าเฉลี่ยของ metrics ในแต่ละfold</p><pre>all_folders = sorted((os.listdir(train_path))+(os.listdir(val_path)))<br>kfold = KFold(n_splits=5, shuffle=True)<br><br><br>for i, (train_indexes, val_indexes) in enumerate(kfold.split(all_folders)):<br><br>  for train_index in train_indexes:<br>    print(train_path + all_folders[train_index])<br>    print(&quot;train index = &quot;,train_index)<br><br>    if (all_folders[train_index] in os.listdir(train_path)):<br>        shutil.copyfile(train_path + all_folders[train_index], f&quot;fold{i}_train &quot; +all_folders[train_index]) <br>    else:<br>      shutil.copyfile(val_path + all_folders[train_index], f&quot;fold{i}_val &quot; +all_folders[train_index])<br><br>  for val_index in val_indexes:<br>    print(val_path + all_folders[val_index])<br><br>    print(&quot;val index = &quot;,val_index)<br>    if (all_folders[val_index] in os.listdir(val_path)):<br>      shutil.copyfile(val_path + all_folders[val_index], f&quot;fold{i}_val &quot; +all_folders[val_index])<br>    else:<br>      shutil.copyfile(train_path + all_folders[val_index], f&quot;fold{i}_train &quot; +all_folders[val_index]) </pre><blockquote>Modeling</blockquote><p>ในส่วนของ model ทางผู้จัดทำได้เลือกใช้ Pretrained model ตัว<a href="https://huggingface.co/google/vit-base-patch16-224"> google/vit-base-patch16–224</a> ที่ pretrained ด้วย ImageNet-21k (14ล้านรูป และ 21,843 class) และ fine-tuned ด้วย ImageNet 2012 (1 ล้านรูป และ 1,000 class) ที่ความละเอียด 224x224 และ <a href="https://huggingface.co/facebook/deit-base-patch16-224">facebook/deit-base-patch16–224</a> ที่ pre-trained และ fine-tuned ด้วยImageNet-1k (1ล้านรูป และ1,000 class)ที่ความละเอียด 224x224</p><p>เพื่อที่จะนำมาเปรียบเทียบกับ การที่ไม่ใช้ Pretrained model หรือ Train from scratch เนื่องจากทางผู้จัดทำคิดว่าในงานด้านที่จำเพาะแบบนี้ การไม่ใช้ Pretrained model จะมีประสิทธิภาพสูงกว่าการใช้ Pretrained Modelรึป่าว</p><h4>What is Vision Transformer (ViT) and Data-efficient Image Transformer (Deit) model?</h4><p>โดย Vision Transformer model นั้นคือการนำสถาปัตยกรรม Transformer ที่มักจะถูกนำไปใช้กับงานด้วย Natural Language Processing (NLP) มาประยุกต์ใช้ในงานด้าน Computer Vision (CV) โดยที่Vision Transformerได้ถูกนำเสนอขึ้นมาครั้งแรกโดย Google จาก paper อันนี้ <a href="https://arxiv.org/abs/2010.11929">An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale</a> ส่วนตัว Deit model นั้นมีสถาปัตยกรรมที่คล้ายกับ ViT</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*R58zM2PvG1AdXa0h7noboA.png" /><figcaption>Vision Transformer -<a href="https://arxiv.org/pdf/2010.11929.pdf">Source</a></figcaption></figure><p>โดยหลักการทำงานของVision Transformerคร่าวๆ จะมีดังนี้ คือจะรับinput มาเป็นภาพภาพนึง แล้วจึงนำภาพนั้นไปแบ่งเป็น patch แล้วทำการembedding แล้วไปผ่าน Transformer encoder และจึงไปผ่าน Multilayer Perceptron (MLP)เพื่อระบุว่า ภาพนี้เป็น class อะไร</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1kMP127oZXAy4QgB2E_Rgw.gif" /><figcaption>การทำงานของVision Transformer model -<a href="https://www.v7labs.com/blog/vision-transformer-guide">Source</a></figcaption></figure><p>หลังจากที่เราพอรู้ข้อมูลคร่าวๆกันมาแล้ว ก็มาเริ่มทำ model กันเลยยย</p><h3>Model : ViT (Pretrained : google/vit-base-patch16–224) and Deit (Pretrained : facebook/deit-base-patch16–224)</h3><p>โดย เราจะเริ่มจากการ import Library</p><pre>import numpy as np<br>import pandas as pd<br>from sklearn.model_selection import train_test_split<br>import glob<br>import matplotlib.pyplot as plt<br>from tqdm import tqdm<br>from tqdm import trange<br>import os<br>import gdown<br>from datasets import load_dataset</pre><p>สร้าง data frame สำหรับ train set และ test set</p><pre># create a dataframe for training data<br>img_name = []<br>img_label = []<br><br>for file in glob.glob(&#39;.../train/*/*.png&#39;): #path to train folder<br>        img_name.append(file)<br>        img_label.append(file.split(&quot;/&quot;)[-2])<br>        <br>df_train = pd.DataFrame({<br>    &#39;img_path&#39; : img_name,<br>    &#39;label&#39; : img_label<br>})<br>print(df_train)<br>#label 0 = Normal, 1 = Diabetic Foot Ulcers<br>label_counts = df_train[&#39;label&#39;].value_counts()<br>print(label_counts)<br>df_train.to_csv(&#39;df_train.csv&#39;, index=False)<br><br># create a dataframe for test data<br>img_name = []<br>img_label = []<br><br>for file in glob.glob(&#39;../test/*/*.png&#39;): #path to test folder<br>        img_name.append(file)<br>        img_label.append(file.split(&quot;/&quot;)[-2])<br>        <br>df_test = pd.DataFrame({<br>    &#39;img_path&#39; : img_name,<br>    &#39;label&#39; : img_label<br>})<br>print(df_test)<br>#label 0 = Normal, 1 = Diabetic Foot Ulcers<br>label_counts = df_test[&#39;label&#39;].value_counts()<br>print(label_counts)<br>df_test.to_csv(&#39;df_test.csv&#39;, index=False)</pre><p>load dataset และแบ่งเป็น train validation และ test set</p><pre>#load train data<br>train_data = load_dataset(&#39;csv&#39;, data_files=&#39;df_train.csv&#39;)<br><br># split to train and validation set<br>datasets = train_data[&quot;train&quot;].train_test_split(train_size=0.89, seed=None, shuffle=False)<br>datasets[&quot;validation&quot;] = datasets.pop(&quot;test&quot;)<br><br># load test data<br>test_data = load_dataset(&#39;csv&#39;, data_files=&#39;df_test.csv&#39;)<br>test_data[&quot;test&quot;] = test_data.pop(&quot;train&quot;)</pre><p>โดยเราจะแบ่ง train validation และ test set ได้ดังนี้ หรือคิดเป็น 80:10:10</p><pre>DatasetDict({<br>    train: Dataset({<br>        features: [&#39;img_path&#39;, &#39;label&#39;],<br>        num_rows: 267<br>    })<br>    validation: Dataset({<br>        features: [&#39;img_path&#39;, &#39;label&#39;],<br>        num_rows: 34<br>    })<br>})<br>DatasetDict({<br>    test: Dataset({<br>        features: [&#39;img_path&#39;, &#39;label&#39;],<br>        num_rows: 33<br>    })<br>})</pre><p>load model</p><pre>from transformers import ViTFeatureExtractor, ViTForImageClassification, ViTModel, DeiTImageProcessor<br><br>#change model here<br>model_checkpoint = &#39;google/vit-base-patch16-224&#39;<br># model_checkpoint = &quot;facebook/deit-base-patch16-224&quot;<br>feature_extractor = DeiTImageProcessor.from_pretrained(model_checkpoint, from_tf=True)   </pre><p>สร้าง id2label และ label2id</p><pre>id2label = {<br>    &#39;0&#39;:0,<br>    &#39;1&#39;:1,<br>  <br>}<br><br>label2id = {<br>    0:&#39;0&#39;,<br>    1:&#39;1&#39;,<br>    <br>}</pre><p>Configuration</p><pre># preparing configuration before put it into the model<br>model = ViTForImageClassification.from_pretrained(<br>    model_checkpoint,<br>    num_labels=2,<br>    id2label = id2label,<br>    label2id = label2id,<br>    ignore_mismatched_sizes=True<br>)<br># Initializing a model (with random weights) from the vit-base-patch16-224 style configuration</pre><p>Test feature extractor และ transform data</p><pre># test for feature extractor<br>inputs = feature_extractor(Image.open(train_data[&#39;train&#39;][1][&#39;img_path&#39;]), return_tensors=&#39;pt&#39;)<br>print(inputs)<br><br>def processed_example(example):<br>  inputs = feature_extractor(Image.open(example[&#39;img_path&#39;]), return_tensors=&#39;pt&#39;)<br>  inputs[&#39;labels&#39;] = example[&#39;label&#39;]<br>  return inputs<br><br>def transform(example_batch):<br>    # Take a list of PIL images and turn them to pixel values<br>    inputs = feature_extractor([Image.open(x) for x in example_batch[&#39;img_path&#39;]], return_tensors=&#39;pt&#39;)<br><br>    inputs[&#39;labels&#39;] = example_batch[&#39;label&#39;]<br><br>    return inputs<br><br>prepared_data = datasets.with_transform(transform)<br>tested_data = test_data.with_transform(transform)</pre><p>Train the model!!!</p><pre>import torch<br>from datasets import load_metric<br>from transformers import TrainingArguments<br>from transformers import Trainer<br><br>def collate_fn(examples):<br>    pixel_values = torch.stack([example[&quot;pixel_values&quot;] for example in examples])<br>    labels = torch.tensor([example[&quot;labels&quot;] for example in examples])<br>    return {&quot;pixel_values&quot;: pixel_values, &quot;labels&quot;: labels}<br><br><br>metric = load_metric(&quot;glue&quot;,&quot;mrpc&quot;)<br><br>def compute_metrics(p):<br>  logits, labels = p<br>  predictions = np.argmax(logits, axis = -1)<br>  return metric.compute(predictions= predictions, references = labels)<br><br>#Define Trainning arguments<br>training_args = TrainingArguments(<br>  output_dir=&quot;training_ViT_tune&quot;,<br>  per_device_train_batch_size =64,<br>  per_device_eval_batch_size =16,<br>  evaluation_strategy=&quot;epoch&quot;,<br>  save_strategy=&quot;epoch&quot;,<br>  num_train_epochs=20,<br>  logging_steps=10,<br>  learning_rate=2e-4,<br>  save_total_limit=2,<br>  warmup_ratio=0.1,<br>  fp16=True,<br>  remove_unused_columns=False,<br>  push_to_hub=False,<br>  metric_for_best_model=&quot;f1&quot;,<br>  report_to=&#39;tensorboard&#39;,<br>  load_best_model_at_end=True,<br>  auto_find_batch_size=True <br>)<br><br>#Define trainer<br>trainer = Trainer(<br>    model=model,<br>    args=training_args,<br>    data_collator=collate_fn,<br>    compute_metrics= compute_metrics,<br>    train_dataset= prepared_data[&#39;train&#39;],<br>    eval_dataset= prepared_data[&#39;validation&#39;],<br>    tokenizer=feature_extractor,<br>)<br><br># train the model<br>train_results = trainer.train()<br>trainer.save_model()<br>trainer.log_metrics(&quot;train&quot;, train_results.metrics)<br>trainer.save_metrics(&quot;train&quot;, train_results.metrics)<br>trainer.save_state()<br></pre><p>Evaluation</p><pre>metric = load_metric(&quot;glue&quot;,&quot;mrpc&quot;)<br>preds = np.argmax(predictions.predictions, axis = 1)<br>metric.compute(predictions = preds, references = predictions.label_ids)</pre><p>Plot Confusion matirx</p><pre>from sklearn.metrics import confusion_matrix<br>import matplotlib.pyplot as plt<br>import itertools<br><br># define True labels and Predicted labels for plot confusion matrix<br>predicted_labels = preds<br>true_labels = predictions.label_ids<br>print(f&quot;True Labels:       {true_labels}&quot;)<br>print(f&quot;Predicted Labels:  {predicted_labels}&quot;)<br><br>#Plot Confusion matirx<br>cm = confusion_matrix(true_labels, predicted_labels)<br>plt.imshow(cm, cmap=plt.cm.Blues)<br>plt.title(&#39;Confusion Matrix&#39;)<br>plt.colorbar()<br><br>tick_marks = np.arange(len(np.unique(true_labels)))<br>plt.xticks(tick_marks, np.unique(true_labels))<br>plt.yticks(tick_marks, np.unique(true_labels))<br>plt.xlabel(&#39;Predicted Label&#39;)<br>plt.ylabel(&#39;True Label&#39;)<br><br>thresh = cm.max() / 2<br>for i, j in itertools.product(range(cm.shape[0]), range(cm.shape[1])):<br>    plt.text(j, i, format(cm[i, j], &#39;d&#39;),<br>             horizontalalignment=&quot;center&quot;,<br>             color=&quot;white&quot; if cm[i, j] &gt; thresh else &quot;black&quot;)<br><br>plt.show()</pre><blockquote>Baseline Comparison</blockquote><p>ในส่วนของ Baseline Comparison ทางผู้จัดทำได้นำ metrics ของละ fold มาหาค่าเฉลี่ย และ Standard Deviation ได้ดังนี้</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hpZ4MpqjVbIQFw2jBHh-aw.png" /><figcaption>Project Report</figcaption></figure><p>โดยจะเห็นได้ว่าตัว google/vit-base-patch16–224 ที่ใช้ pretrained นั้นมี accuracy f1 score และ loss ดีที่สุด ตามมาด้วย ViT ที่ไม่ได้ใช้ pretrained หรือ train from scratch และ facebook/deit-base-patch16–224</p><blockquote>Deployment</blockquote><p>ในการdeploy ทางผู้จัดทำได้เลือกใช้ library stremlit เนื่องจากเป็น library ที่อำนวยความสะดวกในการ deploy model เป็นอย่างมาก แล้วจึงทำการ deploy ขึ้นบน huggingface space</p><p>โดยการใช้งานผู้ใช้สามารถ upload ภาพของตัวเองหรือจะเลือกจากตัวอย่างที่มีมาให้ก็ได้ <a href="https://huggingface.co/spaces/pichaaa1808/ViT-DFU-Thermogram-Classification">try it!!</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GXFPed054gh9gOSRsJWcZQ.png" /><figcaption>deployment</figcaption></figure><blockquote>Error Analysis</blockquote><p>โดยในการทำ error analysis ทางผู้จัดทำพบว่ามียังมีภาพหลายๆภาพที่ตัว model ยังทำนายผิดอยู่ ดังconfusion matrix ด้านล่าง</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/507/1*NH68w-91oHFR2Pb8HNxYxA.png" /><figcaption>ตัวอย่างของ confusion matrix</figcaption></figure><p>ดังนั้นทางผู้จัดทำจึงไปดูว่าภาพแบบไหนที่ model มักจะทำนายผิด โดยพบว่าเป็นภาพที่ไม่ค่อยเห็นความต่างกันชัดเจนหรือมีความใกล้เคียงกันมากๆ ที่อาจทำให้ model สับสนได้ เช่น</p><p>• ภาพนี้ที่จริงๆแล้ว เป็นภาพที่เป็นแผลที่เท้า (Diabetic foot ulcers) แต่ตัว model ทำนายว่าไม่เป็นแผลที่เท้า</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/62/1*dKeTXvFNwm1g-zvLjw5ycQ.png" /><figcaption>ตัวอย่างภาพของผู้ที่เป็นแผลที่เท้า</figcaption></figure><p>• หรือภาพนี้ที่จริงๆแล้ว เป็นภาพที่ไม่เป็นแผลที่เท้า (Normal) แต่ตัวmodel ทำนายว่าเป็น</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/70/1*S9faZs5vM9o92tJ0tw6vjA.png" /><figcaption>ตัวอย่างภาพของผู้ที่ไม่เป็นแผลที่เท้า</figcaption></figure><blockquote>Future Plan</blockquote><p>ในอนาคตทางผู้จัดทำจะไปทำ sub segment evaluation เพิ่ม เพื่อที่จะให้ตัว model สามารถบอกได้ด้วยว่าภาพที่ใส่เข้าไปนั้นเป็นภาพของเท้าซ้ายหรือเท้าขวา และจะไปแก้ไข้เรื่อง imbalance ของdataset ที่อาจทำตัวmodelนั้นยังมีการทำนายที่ผิดพลาด และเนื่องจากตัว model vision transformerนั้นมี self attention layer อยู่ทางผู้จัดทำจึงเห็นว่าเราอาจจะสามารถนำมาพัฒนาต่อเพื่อให้ model บอกได้ด้วยว่าทำไมถึงทำนายภาพนี้ เป็นอย่างงี้ เพราะอะไร หรือ ให้ model บอกว่าภาพนี้ที่ทำนายออกมาว่าเป็นแผลนี้ เกิดแผลบริเวณไหน</p><blockquote>Reference</blockquote><ul><li><a href="https://huggingface.co/google/vit-base-patch16-224">https://huggingface.co/google/vit-base-patch16-224</a></li><li><a href="https://huggingface.co/facebook/deit-base-patch16-224">https://huggingface.co/facebook/deit-base-patch16-224</a></li><li><a href="https://ieee-dataport.org/open-access/plantar-thermogram-database-study-diabetic-foot-complications">https://ieee-dataport.org/open-access/plantar-thermogram-database-study-diabetic-foot-complications</a></li><li><a href="https://keras.io/examples/vision/image_classification_with_vision_transformer/">https://keras.io/examples/vision/image_classification_with_vision_transformer/</a></li></ul><blockquote>Acknowledgment</blockquote><p>โครงการ <a href="https://ai-builders.github.io/">AI Builders</a></p><p>ที่ปรึกษาโปรเจกต์ :</p><p>Mentor: นาย ปัญญาวุธ ศรีอิสรานุสรณ์ (Panyawut Sri-iesaranusorn)</p><ul><li>Professional DataScientist at SCB</li><li>Ex-Algorithm Engineer at TikTok (Singapore)</li></ul><p>Teaching Assistant: นางสาว วรกาญจน์ ลาสุดี (Worakan Lasudee)</p><blockquote>Github</blockquote><p>Repo: <a href="https://github.com/picha-aaa/Explainable-DFU-ViT">https://github.com/picha-aaa/Explainable-DFU-ViT</a></p><p>Web App : <a href="https://huggingface.co/spaces/pichaaa1808/Explainable-DFU-ViT">https://huggingface.co/spaces/pichaaa1808/Explainable-DFU-ViT</a></p><p>AI Builders3 สังกัด Arcane Whales</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M2JHHBXpWtfyaTrYXUDJFA.png" /><figcaption>โครงการAI Builders</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3de9db31ad54" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>