LLaVA-Med === ###### tags: `LLM / LLaVA` ###### tags: `LLM`, `LLaVA`, `LLaVA-Med` :::warning :bulb: **相關 HackMD 隨手紀錄** - [LLaVA-Med](https://hackmd.io/aiQU5maSQKGQ6NVIGB3hnQ) - [LLaVA-Med / few_shot_example](https://hackmd.io/8RmlqpfgRkOOGqPsBhbjiA) - [LLaVA-Med / env](https://hackmd.io/N-s0nhmETbSPFg94QtSU3Q) - [LLaVA-Med / Training](https://hackmd.io/2SDurdu9QNqH_N3udJFFTQ) ::: [TOC] <br> ## Intro - LLaVA: Large Language and Vision Assistant https://llava-vl.github.io/ - [導讀] LLaVA-Med 醫學領域的文字-影像模型 https://medium.com/@rex19981002/88e978c3bb5c <br> ## GitHub - [haotian-liu / LLaVA](https://github.com/haotian-liu/LLaVA) - [microsoft / LLaVA-Med](https://github.com/microsoft/LLaVA-Med) <br> ## 醫學術語 - **Chest X-ray**, 胸部 X光 - **CT**, Computed Tomography, 電腦斷層掃描 - tomography [toˋmɑgrəfɪ] - **MRI**, Magnetic Resonance Imaging, 磁共振造影 - magnetic [mægˋnɛtɪk] 磁性的 - resonance [ˋrɛzənəns] 共振 - **Histopathological Slide Images**, 組織病理切片影像 - histopathology [͵hɪstopəˋθɑlədʒɪ] 組織病理學 - **Gross Pathology Specimen Slice**, 大體病理切片 - gross pathology 大體病理學 - pathology [pæˋθɑlədʒɪ] - specimen [ˋspɛsəmən] - **PMC** - https://www.ncbi.nlm.nih.gov/pmc/ - PubMed Central® (PMC) is a free full-text archive of biomedical and life sciences journal literature at the U.S. National Institutes of Health's National Library of Medicine (NIH/NLM) PubMed Central® (PMC) 是美國國家衛生研究院國家醫學圖書館(NIH/NLM)的生物醫學和生命科學期刊文獻的全文免費存取的檔案庫。 - #### PubMed vs PubMed Central (PMC) vs MEDLINE - [PubMed (https://pubmed.ncbi.nlm.nih.gov/)](https://pubmed.ncbi.nlm.nih.gov/) - PubMed® 包含超過3600萬條來自MEDLINE、生命科學期刊和線上書籍的生物醫學文獻引用。這些引用可能包括來自PubMed Central和出版商網站的全文內容連接。 - 小結: - PubMed 收錄來自 MEDLINE、PubMed Central、出版商網站等全文內容連接。 - MEDLINE 是 PubMed 最大的子集。 - PubMed Central 是 PubMed 最二大的子集。 - [MEDLINE, PubMed, and PMC (PubMed Central): How are they different?](https://www.nlm.nih.gov/bsd/difference.html) - PubMed 包含 MEDLINE & PMC - MEDLINE 是 PubMed 最大的子集。 - PMC 是 NLM 廣泛印刷期刊收藏的數位版本 - PMC (PubMed Central) 於 2000 年推出,作為全文生物醫學和生命科學期刊文章的免費檔案庫。 - PMC 是 PubMed 第二大的子集。 - [PubMed Overview](https://pubmed.ncbi.nlm.nih.gov/about/) Citations for PubMed Central (PMC) articles make up the second largest component of PubMed. PubMed Central(PMC) 文章的引用構成了 PubMed 的第二大組成部分。 <br> ### 醫學術語 Q&A - ### MRI vs CT [How to Easily Tell the Difference Between MRI and CT Scan](https://www.embodi3d.com/blogs/entry/373-how-to-easily-tell-the-difference-between-mri-and-ct-scan/) ![](https://hackmd.io/_uploads/B1d01Ehpp.png) A CT scan (left) and MRI (right) that show the patient table visible on the CT but not the MRI. - **CT 成像原理** 由於 CT 掃描是基於 X 射線,因此 CT 掃描上的骨骼是白色的,空氣是黑色的,就像 X 射線上的一樣,如下圖 1 所示。現代 CT 掃描儀速度非常快,通常掃描不到五分鐘即可完成。 - **CT**:骨骼:白色, 空氣:黑色, 混合物和脂肪:灰色陰影。 - 想像看 X 光照片那樣 - **MRI**:脂肪和水呈現白色 黑色或深灰色 - **判讀** | 部位 | 設備:顏色 | |-----|----------| | 桌子 | CT:白色弧線(C型) | | | MRI:無 | | 骨頭 | CT:白色 | | | MRI:白色 | | 脂肪 | CT:灰色陰影 | | | MRI:黑色或深灰色 | - ### 如何區分 CT 和 MRI? [ChatGPT4] CT(電腦斷層掃描)和MRI(磁振造影)掃描都是用來產生身體內部結構的詳細圖像,但它們使用不同的技術,有以下主要差異: 1. 成像技術: - CT掃描使用X射線通過身體並被不同組織以不同程度吸收,從而在X射線探測器上產生影像。CT掃描能夠快速完成,通常用於評估骨骼損傷、肺和胸部問題以及某些急性條件。 - MRI掃描則是使用強大的磁場和無線電波來撞擊體內的氫原子核,並捕捉其返回到原始狀態時釋放的信號,從而產生圖像。MRI更適合於軟組織如腦部、關節、肌肉和韌帶的成像。 2. 影像特性: - CT掃描產生的影像是高對比度的,尤其是當顯示骨骼與周圍軟組織時。圖像往往具有較硬的邊界和清晰的細節。 - MRI掃描則提供不同類型軟組織間更好的對比度,可以區分不同軟組織的微妙差異。 3. 外觀: - CT圖像呈現出骨骼的白色高亮,而軟組織則以不同的灰階呈現,而空氣區域則通常呈黑色。 - MRI圖像的亮度取決於成像序列和軟組織的類型。T1加權圖像中的脂肪通常呈高信號(亮白色),而T2加權圖像中的水和水分較多的組織則顯示為亮白色。 4. 使用輻射: - CT掃描使用離子輻射(X射線),所以病人會暴露在一定量的輻射下。 - MRI掃描不使用離子輻射,而是利用磁場和無線電波,對病人來說輻射暴露的風險很低。 醫生會根據診斷的需要選擇最合適的掃描類型。例如,對於需要高細節的骨骼成像,可能會選擇CT掃描;對於腦部或軟組織的細節評估,則可能傾向於選擇MRI掃描。 - ### 組織病理切片 和 大體病理切片 有何差異? 組織病理切片(Histopathological Slide)和大體病理切片(Gross Pathology Specimen Slice)在病理學中是兩種不同類型的切片,主要差異在於它們所處理和觀察的尺度和目的: - #### 組織病理切片: - 組織病理切片是指在顯微鏡下觀察的極薄的組織或細胞切片。 - 它們通常用於研究細胞、細胞間的關係以及細胞與其周圍微環境之間的相互作用。 - 組織病理切片需要通過特殊的染色技術進行染色,以便更清楚地觀察細胞結構和組織形態。 - 這類切片對於診斷各種疾病(如癌症)非常重要,因為它們可以揭示細胞水平上的異常。 - #### 大體病理切片: - 大體病理切片涉及到從人體器官或組織中切取的相對較大的切片,並且是在肉眼下進行觀察和分析。 - 它們主要用於評估疾病對整個器官或大塊組織的影響,如腫瘤的大小、位置以及是否侵犯周圍組織。 - 大體病理切片不需要染色,因為分析是在肉眼觀察的基礎上進行的。 - 這種類型的切片對於了解疾病的宏觀特徵、手術切除邊緣評估以及某些病理學研究非常有價值。 總的來說,組織病理切片偏重於細胞和微觀結構的分析,而大體病理切片則集中於疾病在宏觀層面上的影響。兩者都是病理學診斷和研究中不可或缺的工具,但應用的焦點和方法有所不同。 ### 備註: - #### 組織病理切片範例: - #### PMC4174271/12967_2014_246_Fig3_HTML.jpg ![](https://hackmd.io/_uploads/B1RQbPuT6.png) - #### PMC5562478/gr2.jpg ![](https://hackmd.io/_uploads/SkVQBvOap.png) - llava_med_instruct_60k.json ```json { "id": "28855840_f0010", "image": "28855840_f0010.jpg", "domain": { "chest_xray": false, "mri": false, "ct_scan": false, "histology": true, "gross": false }, ``` - llava_med_image_urls.jsonl: `{"pmc_tar_url": "https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/b0/4e/PMC5562478.tar.gz", "image_file_path": "PMC5562478/gr2.jpg", "pair_id": "28855840_f0010"}` - #### 大體病理切片範例: - #### PMC4974669/13019_2016_524_Fig4_HTML.jpg ![](https://hackmd.io/_uploads/HJ17gDO6p.png) - #### PMC6556353/CRIOR2019-6840693.008.jpg ![](https://hackmd.io/_uploads/HyLlmvdTa.png) - llava_med_instruct_60k.json ```json { "id": "31263612_fig8", "image": "31263612_fig8.jpg", "domain": { "chest_xray": false, "mri": false, "ct_scan": false, "histology": true, <--- 資料是不是有標錯? "gross": true <--- }, ``` - llava_med_image_urls.jsonl `{"pmc_tar_url": "https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/65/ad/PMC6556353.tar.gz", "image_file_path": "PMC6556353/CRIOR2019-6840693.008.jpg", "pair_id": "31263612_fig8"}` - ### X光片上有 portable 字,是指什麼? 在X光片上標注有“portable”字樣,通常是指這張X光片是使用可攜式X光機拍攝的。可攜式X光機是一種輕便、可以移動的X光成像設備,使得醫療人員能夠在病人床邊或在無法輕易移動病人到標準X光室的情況下進行拍攝。這對於重症監護室(ICU)的病人、急診病人或是任何因健康狀況而難以移動的病人來說非常有用。 “Portable”標記在X光片上有幾個目的: 1. 提供成像條件的信息,指出該影像是在非標準X光室條件下獲得的。 2. 幫助醫生了解拍攝條件,因為可攜式X光機拍攝的影像可能與標準X光室內拍攝的影像在質量和角度上有所不同,這可能會影響影像的解讀。 總之,X光片上的“portable”字樣是告訴查看影像的醫療人員這是一張在特定情況下,使用可攜式設備拍攝的X光片。 <br> ## 導讀 - ### [[新聞] MedTech醫療科技雙周報第22期:圖文通吃!微軟打造生醫領域專用的生成式AI Chatbot](https://www.ithome.com.tw/news/157543) - ### [[導讀] LLaVA-Med 醫學領域的文字-影像模型](https://medium.com/@rex19981002/88e978c3bb5c) - **第一階段**:訓練 projector - 資料集: 醫學圖片-說明 (figure-caption) 數據集 - **第二階段**:拿多回合對話來訓練 --> 有提到是關鍵步驟 - 資料集: 使用 GPT-4 建立自我指導的開放式 instruction-following 數據 - ### [[授權條款] LLaVA: Large Language and Vision Assistant](https://llava.hliu.cc/) - ==**License**== The service is a research preview intended for non-commercial use only, subject to the model [License](https://github.com/facebookresearch/llama/blob/main/MODEL_CARD.md) of LLaMA, [Terms of Use](https://openai.com/policies/terms-of-use) of the data generated by OpenAI, and [Privacy Practices](https://chrome.google.com/webstore/detail/sharegpt-share-your-chatg/daiacboceoaocpibfodeljbdfacokfjb) of ShareGPT. Please contact us if you find any potential violation. 關於内容的所有權。在您和OpenAI之間,並在適用法律允許的範圍內,您保留對輸入(Input)的所有權,並擁有輸出(Output)的所有權。我們在此將我們在輸出内容中可能擁有的所有權利、所有權和利益轉讓給您。 <br> ## 論文 ### PDF - https://arxiv.org/abs/2306.00890 - [[PDF] LLaVA-Med: Training a Large Language-and-Vision Assistant for Biomedicine in One Day](https://arxiv.org/pdf/2306.00890.pdf) ### 生物醫學視覺指導範例 ![](https://hackmd.io/_uploads/HkeK2bEpT.png) - ### 圖說: 圖4:病患#1的增強對比CT胸部掃描。在右上葉發現了一個大型空洞性病灶,涉及胸膜並可能延伸至胸壁。此外,還懷疑有右側肺門淋巴結腫大。這是該病患的主要惡性病灶。 - ### 包含圖片提及的句子: - 獲取了胸部的電腦斷層掃描(CT)圖像(圖4)。 - (圖4)顯示了右上葉後方一個大型空洞性病灶,很可能涉及胸膜,這可能代表主要病灶。 - ### 對話 - 原始英文: - User: Where is the lesion located? - Assistant: The lesion is located in the posterior aspect of the right upper lobe of the lung. - User: Is it extending into the chest wall? - Assistant: Yes, the CT scan suggests that the large cavitating lesion in the right upper lobe is likely extending into the chest wall. - User: Can you explain more about the cavitating lesion? - Assistant: Certainly. A cavitating lesion refers to an abnormal mass or growth within the lung tissue that has a cavity or hollow space inside it. This cavity can be formed due to the necrosis (death) of the tissue inside the lesion, leading to the breakdown and disintegration of the affected tissue. Cavitating lesions can be caused by various factors, such as infections (like tuberculosis or fungal infections), autoimmune diseases, or malignancies (cancer). In the context of the CT scan provided, the large cavitating lesion in the right upper lobe of the lung is suggestive of a malignant (cancerous) growth. The cavity within the lesion may be a result of the rapid and uncontrolled growth of cancer cells, which can lead to the destruction of surrounding healthy tissue. It’s important to note that further diagnostic tests, such as a biopsy, would be required to confirm the malignancy and determine the specific type of cancer involved. - 中文翻譯(by ChatGPT4): - 用戶:病灶在哪裡? - 助理:病灶位於肺的右上葉後部。 - 用戶:它有延伸到胸壁嗎? - 助理:是的,CT掃描顯示,右上葉的大型空洞病灶很可能延伸到胸壁。 - 用戶:能否解釋更多關於空洞病灶的資訊? - 助理:當然。空洞病灶指的是肺組織內有空腔或空洞的異常質塊或生長。這個空洞可能是由於病灶內組織的壞死(死亡)導致的,導致受影響組織的分解和崩解。空洞病灶可以由多種因素引起,如感染(如結核或真菌感染)、自身免疫性疾病或惡性腫瘤(癌症)。在提供的CT掃描的背景下,肺右上葉的大型空洞病灶暗示為惡性(癌性)生長。病灶內的空洞可能是由於癌細胞的快速和不受控制的生長導致的,這可能會導致周圍健康組織的破壞。重要的是要注意,還需要進一步的診斷測試,如活檢,以確認惡性腫瘤並確定涉及的特定癌症類型。 - 中文翻譯(by Claude): - 用户:病變位於哪裡? - A:病變位於右肺上葉後側部位。 - 用户:它是否延伸至胸膜? - A:是的,CT掃描顯示右上葉的大型空洞性病變可能已延伸至胸膜。 - 用户:你能解釋一下關於空洞性病變的更多資訊嗎? - A:當然可以。空洞性病變是指肺組織內的一種異常腫塊或生長物,其內部有一個空腔或空洞。這個空腔可能是由於病變內部組織的壞死(死亡)導致組織崩解和分解而形成的。引起空洞性病變的因素有感染(如結核病或真菌感染)、自身免疫性疾病或惡性腫瘤(癌症)等。根據所提供的CT掃描結果,右肺上葉的大型空洞性病變暗示是惡性(癌症)生長物。病變內的空腔可能是由於癌細胞快速及失控生長,導致周圍健康組織破壞的結果。重要的是,需要進一步的診斷測試,如活檢,以確認是否為惡性腫瘤,並確定具體的癌症類型。 ### 原始資料來源 - ### llava_med_instruct_fig_captions.json ```json= { "ct_scan": [ ... { "fig_caption": "Contrast-enhanced CT scan of the chest for patient #1. A large cavitating lesion was identified in the right upper lobe with pleural involvement and likely extension into the chest wall. In addition, right hilar lymphadenopathy was suspected. This was the primary malignant lesion in this patient.", "fig_id": "F4", "fig_label": "Figure 4", "graphic_ref": "71/f3/PMC1488857/1746-1340-14-8-4.jpg", "pair_id": "16734899_F4", "pmid": "16734899", "in_text_mention": [ { "tokens": "Computerized tomography ( CT ) scans of the chest ( Figure 4 ) were obtained .", "entities": [ { "type": "figure", "entity_id": "4", "start_tok": 10, "end_tok": 12 } ] }, { "tokens": "( Figure 4 ) and demonstrated a large cavitating lesion in the posterior aspect of the right upper lobe with probable pleural involvement likely representing the primary lesion .", "entities": [ { "type": "figure", "entity_id": "4", "start_tok": 1, "end_tok": 3 } ] } ], "domain": { "chest_xray": false, "mri": false, "ct_scan": true, "histology": false, "gross": false } }, ... ], ... } ``` ### 其他圖片 - ![](https://hackmd.io/_uploads/Symc1Suaa.png) - https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7398722/ - 頁面下方有堤供 Fig.3 - 從 llava_med_image_urls.jsonl 檔案亦可找到相關 tar.gz 下載點 `$ grep 'PMC7398722' 4_image_urls/llava_med_image_urls.jsonl` `{"pmc_tar_url": "https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/7d/af/PMC7398722.tar.gz", "image_file_path": "PMC7398722/cureus-0012-00000008970-i01.jpg", "pair_id": "32766012_FIG1"}` - pmc_tar_url: https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/7d/af/PMC7398722.tar.gz - image_file_path - PMC7398722/cureus-0012-00000008970-i01.jpg - PMC7398722/cureus-0012-00000008970-i02.jpg - PMC7398722/cureus-0012-00000008970-i04.jpg - PMC7398722/cureus-0012-00000008970-i06.jpg LLamMA-Med 無使用 i03.jpg 圖片檔 - **實際找到的圖片** PMC7398722/cureus-0012-00000008970-i03.jpg [![](https://hackmd.io/_uploads/ByJgkM_p6.png)](https://hackmd.io/_uploads/ByJgkM_p6.png) <br> ## 論文 Q&A > 由 TJ 提問,ChatGPT4 回答 <hr> ### 這篇論文是怎麼訓練出能回答醫學領域知識的模型? 這篇論文提出了一種成本高效的方法,用於訓練一個能夠回答生物醫學圖像開放式研究問題的視覺語言會話助手。核心思想是利用從PubMed Central提取的大規模廣覆蓋的生物醫學圖片-說明數據集,使用GPT-4從這些說明中自學開放式指令跟隨數據,然後使用一種新穎的課程學習方法對一個大型通用領域視覺語言模型進行微調。具體來說,模型首先學習使用圖片-說明對齊生物醫學詞匯,然後使用GPT-4生成的指令跟隨數據學習開放式會話語義,模仿一個外行人逐漸獲取生物醫學知識的過程。這使得我們能夠在不到15小時內(使用八個A100s)訓練出一個大型語言和視覺助手用於生物醫學(LLaVA-Med),LLaVA-Med展現出優秀的多模態會話能力,能夠跟隨開放式指令協助查詢生物醫學圖像。在三個標準的生物醫學視覺問答數據集上,微調LLaVA-Med在某些指標上超過了之前的監督學習最先進性能。為了促進生物醫學多模態研究,我們將公開我們的指令跟隨數據和LLaVA-Med模型。 <hr> ### 這篇論文提到的訓練步驟有哪些? 這篇論文採用了兩階段的訓練方法來訓練生物醫學領域的大型語言和視覺助手(LLaVA-Med): - ### 第一階段:生物醫學概念特徵對齊 在這一階段,目標是在保持訓練效率的同時,涵蓋廣泛的生物醫學概念。選擇了來自PMC-15M數據集的600K圖文對,將這些圖文對轉換為指令跟隨數據,使用一種簡單的擴展方法:指令僅僅是要求描述圖片。對於每個樣本,給定語言指令和圖片輸入,模型預測原始標題。在訓練過程中,保持視覺編碼器和語言模型(LM)的權重固定,只更新投影矩陣。這一階段可以理解為將對齊的圖像-文本標記的詞彙擴展到生物醫學領域。 - ### 第二階段:端到端指令調整 在這一階段,只保持視覺編碼器的權重固定,並繼續更新預訓練的投影層和LM的權重。為了訓練模型跟隨各種指令並以會話方式完成任務,通過在第三節收集的生物醫學語言-圖像指令跟隨數據上對模型進行微調,開發了一個生物醫學聊天機器人。如後續實驗所示,此階段的LLaVA-Med模型不僅能夠作為生物醫學視覺助手與用戶互動,還在評估時實現了良好的零樣本任務轉移性能。 綜合兩個階段,LLaVA-Med首先學習使用圖片-標題對齊生物醫學詞匯,然後利用GPT-4生成的指令跟隨數據學習開放式會話語義,模仿一個外行人逐漸獲取生物醫學知識的過程。這使得能夠在不到15小時內(使用八個A100s)訓練出一個具有優秀多模態會話能力的大型語言和視覺助手用於生物醫學(LLaVA-Med),並在三個標準的生物醫學視覺問答數據集上,微調LLaVA-Med在某些指標上超過了之前的監督學習最先進性能。为了促進生物醫學多模态研究,将公開指令跟隨數據和LLaVA-Med模型。 <hr> ### 第一階段:生物醫學概念特徵對齊,是怎麼準備資料的?請具體描述每一個步驟。 第一階段的資料準備是“生物醫學概念特徵對齊”,其步驟如下: 1. **選擇資料集**:從PubMed Central的PMC-15M資料集中篩選出600K圖文對。PMC-15M是一個涵蓋廣泛的生物醫學圖像-文本配對資料集,包含了1500萬個生物醫學圖像與對應的說明文本。 2. **生成指令跟隨數據**:將這些圖文對轉換成指令跟隨數據,使用一種簡單的擴展方法,即指令僅僅是要求描述圖片。對於每個樣本,給定語言指令和圖片輸入,模型預測原始標題。 3. **問題採樣**:對於一個生物醫學圖像X~v~和其相關說明文本X~c~ ,採樣一個問題X~q~,該問題要求描述該生物醫學圖像。根據說明文本的長度,採樣的問題可能要求簡潔或詳細地描述圖像。在實踐中,如果說明文本的長度少於30個單詞,則使用30個單詞作為截止點來決定選擇哪個問題列表。 4. **創建單回合指令跟隨示例:根據 X~v~、X~c~和X~q~,創建單回合指令跟隨示例。格式為: `Human : Xq Xv<STOP>\n Assistant : Xc<STOP>\n` 這些步驟將PMC-15M資料集中的圖文對轉換成為訓練模型所需的指令跟隨數據,專注於擴展對齊的圖像-文本標記的詞彙到生物醫學領域。這一階段的訓練過程中,保持視覺編碼器和語言模型(LM)的權重固定,只更新投影矩陣,目的是為了讓模型學習如何將生物醫學概念與其文本詞嵌入對齊。 - **備註**: ![](https://hackmd.io/_uploads/rJj7QL_ap.png) X~q~ 表示問題,X~v~ 表示影像,X~c~ 表示影像的 caption。 <hr> ### 第二階段:端到端指令調整,是怎麼準備資料的?請具體描述每一個步驟。 第二階段的資料準備過程,即"端到端指令調整",涉及以下步驟: 1. **保持視覺編碼器權重固定**:在這一階段中,只有視覺編碼器的權重是固定不變的,而預訓練的投影層和語言模型(LM)的權重則繼續更新。 2. **開發生物醫學聊天機器人**:通過對模型在第三節收集的生物醫學語言-圖像指令跟隨數據上進行微調,開發一個生物醫學聊天機器人。這些數據是用來訓練模型跟隨各種指令並以會話方式完成任務。 3. **生物醫學指令-跟隨數據的準備**:給定一個圖像說明,設計提示(prompt)中的指令,要求GPT-4生成多輪問答,好像它能看到圖像一樣(即使它只能訪問文本)。如果圖像說明太短,無法讓GPT-4生成有意義的問答,則在提示中加入不僅包含圖像說明,還包含原始PubMed論文中提及圖像的句子,以提供更多關於圖像的上下文。此外,還手動策劃提示中的少數示例,以示範如何基於提供的說明和上下文生成高質量的會話。 4. **選擇圖像和上下文**:從PMC-15M中篩選出只包含單一情節的圖像,從五種最常見的成像模式中抽樣60K圖文對,這些模式包括胸部X光(CXR)、電腦斷層掃描(CT)、磁共振成像(MRI)、組織病理學和大體(即宏觀)病理學。然後,從原始PubMed論文中提取提及圖像的句子,作為說明的額外上下文。 這個過程的目的是使模型能夠跟隨多樣化的指令,並在與用戶互動時表現出生物醫學視覺助手的能力,同時也在標準的生物醫學視覺問答數據集上達到良好的零樣本任務轉移性能。 <hr> ### 第二階段:端到端指令調整,要求 GPT-4 生成多輪問答的 prompt 格式為何? 第二階段的端到端指令調整中,要求GPT-4生成多輪問答的prompt格式包含以下幾個關鍵元素: 1. **引入語句**:提示以引入語句開始,設定情境,例如:“假設你能看到下面描述的圖像。” 2. **圖像說明**:接著提供圖像的詳細說明。這可能是從PubMed Central提取的原始圖片說明,或者是較短的描述,如果圖片說明太短,無法讓GPT-4生成有意義的問答,則加入原始PubMed論文中提及圖像的句子,作為提供更多關於圖像的上下文。 3. **指令**:隨後是一個或多個具體的指令,引導GPT-4圍繞圖像的內容生成問答。這些指令可能會要求模型解釋圖像顯示的情況、識別圖像中的特定元素、或對圖像背後的生物醫學問題提出假設。 4. **問答結構**:提示以問答形式結構化,每個問題後面都跟著一個由模型生成的回答。這個結構鼓勵生成連貫且相關的多輪對話。 5. **結束語**:在一系列問答後,提示可能包含一個結束語,總結對話或提供下一步指引。 以下是一個簡化的例子: ```css 假設你能看到下面描述的圖像:一張顯示右上葉有大型空洞性病灶的胸部X光片,該病灶可能涉及胸膜並延伸到胸壁。 問題1:請解釋空洞性病灶可能指示什麼類型的醫學問題? 回答1:[模型生成的回答] 問題2:該病灶延伸到胸壁意味著什麼? 回答2:[模型生成的回答] ... ``` 這種格式旨在模擬一個外行人逐漸獲取生物醫學知識的過程,使模型能夠以會話方式協助查詢生物醫學圖像,並對開放式指令做出反應。 <hr> ### 根據這篇論文的描述, LLaVA-Med 效果如何?效能如何? 根據論文的描述,LLaVA-Med模型展現出優秀的多模態會話能力,能夠跟隨開放式指令協助查詢生物醫學圖像。在進行微調後,LLaVA-Med在三個標準的生物醫學視覺問答數據集上的某些指標上超過了先前的最先進性能,顯示了其出色的效能。此外,這個模型不僅能夠作為生物醫學視覺助手與用戶進行互動,還在評估時實現了良好的零樣本任務轉移性能。這些結果表明LLaVA-Med在生物醫學圖像分析和問答領域具有強大的應用潛力。为了促進生物醫學多模态研究,將公開指令跟隨數據和LLaVA-Med模型。 <hr> ### LLaVA-Med 所用到的 input data , model, output data,其版權為何? > keywords: 版權聲明, 使用條款 由於我無法直接訪問互聯網以確認特定的版權信息,我將根據通常情況下的標準做法提供一個一般性的回答: 1. **Input Data(輸入數據)**:LLaVA-Med使用的輸入數據主要來自PubMed Central的PMC-15M資料集,這是美國國家衛生研究院國家醫學圖書館(NIH/NLM)提供的一個公開存取資料庫。此資料庫中的內容通常允許在遵守特定條款和條件下被重新使用,包括學術研究和教育目的。 2. **Model(模型)**:模型開發過程中產生的知識產權(如訓練好的模型參數和架構設計)通常歸開發者或其所屬機構所有。如果LLaVA-Med模型是由學術研究機構開發,其可能會在遵守一定條件的情況下公開分享,以促進科學研究和開發。 3. **Output Data(輸出數據)**:模型產生的輸出數據(如視覺問答結果或分析報告)的版權取決於具體的使用情況和目的。一般而言,這些輸出數據的使用應遵守相關數據和模型的版權政策。 在實際應用和分享LLaVA-Med模型及其數據時,重要的是要參考相關的版權聲明和使用條款,並尊重原始數據提供者、模型開發者和其他相關方的知識產權。如需獲得具體的版權信息,建議直接訪問數據和模型的官方發布源或聯繫相關負責人。 <hr> ### 請根據這篇論文提出10個問題與答案,答案必須能在論文中找到,並請用英文描述問題與答案,同時提供對應的繁體中文。 基於您提供的論文討論和內容摘要,以下是根據論文提出的問題與答案,用英文描述問題與答案,並提供對應的繁體中文翻譯: 1. #### What is the main objective of the LLaVA-Med model? - The main objective of the LLaVA-Med model is to answer open research questions in biomedical images through a visual-language conversational assistant. - 主要目標是什麼? - LLaVA-Med模型的主要目標是通過視覺語言會話助手回答生物醫學圖像中的開放式研究問題。 2. #### How does LLaVA-Med model learn to follow open instructions? - LLaVA-Med model learns to follow open instructions by self-learning from image-caption data extracted from PubMed Central, using GPT-4. 如何學習遵循開放式指令? LLaVA-Med模型通過使用GPT-4從PubMed Central提取的圖像-說明數據自學來學習遵循開放式指令。 3. #### What novel training approach is applied to LLaVA-Med? - A novel curriculum learning approach is applied to fine-tune a large general-domain visual-language model. - 採用了哪種新穎的訓練方法? - 採用了一種新穎的課程學習方法來對大型通用領域視覺語言模型進行微調。 4. #### How long does it take to train the LLaVA-Med model? - It takes less than 15 hours to train the LLaVA-Med model using eight A100 GPUs. - 訓練LLaVA-Med模型需要多長時間? - 使用八個A100 GPU,訓練LLaVA-Med模型需要不到15小時。 5. #### What datasets are used for training LLaVA-Med? - The PMC-15M dataset is used, which includes 15 million biomedical image-caption pairs. - 使用了哪些數據集來訓練LLaVA-Med? - 使用了PMC-15M數據集,其中包括1500萬個生物醫學圖像-說明對。 6. #### What kind of medical devices does LLaVA-Med identify in chest X-rays? - LLaVA-Med can identify devices such as endotracheal tubes, central venous catheters, and pulmonary artery catheters in chest X-rays. - LLaVA-Med能識別哪些類型的醫療裝置? - LLaVA-Med能在胸部X光中識別如氣管內管、中央靜脈導管和肺動脈導管等裝置。 7. #### What is the primary source of training data for LLaVA-Med? - The primary source of training data for LLaVA-Med is the large-scale, broad-coverage biomedical image-caption dataset extracted from PubMed Central. - 訓練LLaVA-Med的主要數據來源是什麼? - LLaVA-Med的訓練數據主要來源於從PubMed Central提取的大規模、廣覆蓋的生物醫學圖像-說明數據集。 8. #### What are the applications of LLaVA-Med? - LLaVA-Med is used as a biomedical visual assistant for querying biomedical images and engaging in open-ended conversations. - LLaVA-Med有哪些應用? - LLaVA-Med用作生物醫學視覺助手,用於查詢生物醫學圖像和參與開放式對話。 9. #### How does LLaVA-Med perform on standard biomedical visual question answering datasets? - Fine-tuned LLaVA-Med surpasses previous state-of-the-art performance on some metrics across three standard biomedical visual question answering datasets. - LLaVA-Med在標準生物醫學視覺問答數據集上的表現如何? - 微調後的LLaVA-Med在三個標準生物醫學視覺問答數據集的某些指標上超越了先前的最先進性能。 10. #### Will the data and model of LLaVA-Med be made available to the public? - The instruction-following data and LLaVA-Med model will be made publicly available to facilitate biomedical multimodal research. - LLaVA-Med的數據和模型會公開給大眾嗎? - 指令跟隨數據和LLaVA-Med模型將公開提供,以促進生物醫學多模態研究。 <hr> ### 根據這篇論文,做出五點重要的總結。 根據這篇論文的討論和內容,以下是五點重要的總結: 1. **創新的訓練方法**:LLaVA-Med通過使用來自PubMed Central的大規模生物醫學圖像-說明數據集,結合GPT-4生成的指令跟隨數據,採用了一種創新的課程學習方法,成功地訓練了一個大型的通用領域視覺語言模型。 2. **強大的多模態會話能力**:經過特定的訓練後,LLaVA-Med模型展現出優秀的多模態會話能力,能夠根據開放式指令協助查詢生物醫學圖像,並與用戶進行互動。 3. **高效的訓練過程**:使用八個A100 GPU,LLaVA-Med模型的訓練過程非常高效,僅需不到15小時即可完成,顯示了其在實際應用中的可行性和效率。 4. **優秀的性能表現**:微調後的LLaVA-Med在三個標準的生物醫學視覺問答數據集上的某些指標上超越了先前的最先進性能,證明了其在處理生物醫學圖像分析和問答任務上的出色能力。 5. **促進生物醫學多模態研究**:為了推動生物醫學多模態研究的發展,研究團隊將公開LLaVA-Med模型和相關的指令跟隨數據,以供學術界和研究人員使用,這將有助於提高生物醫學圖像分析的準確性和效率。 這篇論文提出的LLaVA-Med模型在生物醫學視覺語言會話助手領域中是一個重要的進步,它不僅提高了處理生物醫學圖像的能力,也為未來的相關研究開拓了新的方向。 <hr> <br> ## Datasets ### 訓練資料的產生方式 > - https://arxiv.org/abs/2306.00890 > - [[PDF] LLaVA-Med: Training a Large Language-and-Vision Assistant for Biomedicine in One Day](https://arxiv.org/pdf/2306.00890.pdf) - The list of instructions for brief image description. Instructions for brief image description. The list of instructions used to briefly describe the image content are shown in Table 7. They present the same meaning with natural language variance. • "Describe the image concisely." • "Provide a brief description of the given image." • "Offer a succinct explanation of the picture presented." • "Summarize the visual content of the image." • "Give a short and clear explanation of the subsequent image." • "Share a concise interpretation of the image provided." • "Present a compact description of the photo’s key features." • "Relay a brief, clear account of the picture shown." • "Render a clear and concise summary of the photo." • "Write a terse but informative summary of the picture." • "Create a compact narrative representing the image presented." - The list of instructions for detailed image description. Instructions for detailed image description. The list of instructions used to describe the image content in detail are shown in Table 8. They present the same meaning with natural language variance. • "Describe the following image in detail" • "Provide a detailed description of the given image" • "Give an elaborate explanation of the image you see" • "Share a comprehensive rundown of the presented image" • "Offer a thorough analysis of the image" • "Explain the various aspects of the image before you" • "Clarify the contents of the displayed image with great detail" • "Characterize the image using a well-detailed description" • "Break down the elements of the image in a detailed manner" • "Walk through the important details of the image" • "Portray the image with a rich, descriptive narrative" • "Narrate the contents of the image with precision" • "Analyze the image in a comprehensive and detailed manner" • "Illustrate the image through a descriptive explanation" • "Examine the image closely and share its details" • "Write an exhaustive depiction of the given image" 詳細描述以下圖片 提供該圖片的詳細描述 給出您看到的圖片的詳細解釋 分享呈現圖片的全面概述 提供對圖片的徹底分析 解釋您面前圖片的各個方面 以詳細的方式說明顯示的圖片內容 使用詳細描述來刻畫圖片 詳細剖析圖片的各個元素 步驟式介紹圖片的重要細節 用豐富的敘述描繪圖片 精準敘述圖片的內容 全面且詳細地分析圖片 透過描述性說明來闡述圖片 仔細檢視圖片並分享其細節 撰寫該圖片的完整描繪 ### 1. 醫學概念的特徵對齊 > - biomedical concept feature alignment > - 用途: > - 第一階段讓模型去預測原始影像的 caption。 > - 在這個階段的訓練上,影像 encoder 跟語言模型會固定 weights 不會參與訓練,只會更新 encoder 後的投影矩陣,希望可以將 vision concept 與 word embedding 對齊。 - ### download | Alignment data files | Size | |----------------------|------| | [llava_med_alignment_500k.json](https://hanoverprod.z21.web.core.windows.net/med_llava/alignment/llava_med_alignment_500k.json) | 341.52 MiB | - status - 2024/05/07 | CASE | VALUE | |----------------------|--------| | size( raw-records ) | 467710 | | size( xxx.tar.gz )=0 | 128 | | size( xxx.tar.gz )>0<br>& mapping-file error | 169 | | size( .jpg ) | 50.21GB | | size( available-records ) | 467385 | ``` 467385 + (128+169) 467385 + 297 467682 < 467710 ``` ``` 467710 - 467385 = 325 > 297 ``` - 中間的 28 筆紀錄跑去哪裡? - 有問題的 128+169 個 pmc.tar.gz 之中,其中 28 個 pmc.tar.gz 有被其他 image 共同參考 - 換言之,部份 image 共用相同的 pmc.tar.gz ``` 2 https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/04/ab/PMC7612601.tar.gz 2 https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/04/ef/PMC8245047.tar.gz 2 https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/08/48/PMC7150735.tar.gz 2 https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/09/39/PMC8777548.tar.gz 2 https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/0a/4b/PMC9111580.tar.gz 2 https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/14/b1/PMC8245035.tar.gz 2 https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/28/c8/PMC8763396.tar.gz 2 https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/2a/8f/PMC8057238.tar.gz 2 https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/33/4e/PMC3421444.tar.gz 2 https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/3e/8d/PMC9115539.tar.gz 2 https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/65/1f/PMC3817399.tar.gz 2 https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/67/10/PMC9163025.tar.gz 2 https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/6d/76/PMC8923104.tar.gz 2 https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/84/f3/PMC8245044.tar.gz 2 https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/8e/7e/PMC9111368.tar.gz 2 https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/a2/86/PMC8739500.tar.gz 2 https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/af/90/PMC3737733.tar.gz 2 https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/b9/d0/PMC8936121.tar.gz 2 https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/c3/6e/PMC8285668.tar.gz 2 https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/ca/e9/PMC7532547.tar.gz 2 https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/cc/f5/PMC3296357.tar.gz 2 https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/ce/2d/PMC2913393.tar.gz 2 https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/dc/3d/PMC5776473.tar.gz 2 https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/e1/a7/PMC8979492.tar.gz 2 https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/fc/24/PMC4383940.tar.gz 2 https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/fe/73/PMC9060714.tar.gz 3 https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/6b/c6/PMC3102043.tar.gz ``` [![](https://hackmd.io/_uploads/B1kMkXkmA.png)](https://hackmd.io/_uploads/B1kMkXkmA.png) - ### llava_med_alignment_500k.json 樣本資料 ```json= [ { "id": "32357477_ijms-21-03049-f006", "image": "32357477_ijms-21-03049-f006.jpg", "conversatons": [ { "from": "human", "value": "Illustrate the image through a descriptive explanation\n<image>" }, { "from": "gpt", "value": "Determination of metaphase II entry in oocytes pre-exposed to ferrocenyl 4-(alkylamino)-1,4-dihydroquinolines. After incubation or not with compounds 9, 6, 10, 7, 11, 8 for 24 h, oocytes were rinsed four times in ND96 for 30 min, before progesterone stimulation. White spot appearance was scored after 15 h. N refers to the number of females and n to the number of oocytes (N = 2 and n = 60)." } ] }, { "id": "17096591_pcbi-0020151-g003", "image": "17096591_pcbi-0020151-g003.jpg", "conversatons": [ { "from": "human", "value": "Illustrate the image through a descriptive explanation\n<image>" }, { "from": "gpt", "value": "Polar Localization of Lipid Clusters Elastic energy parameters are fixed (\u03ba = 25 k = 0.25 k/nm4, \u03b3 = 0.4 nm\u22121), with varying short-range attraction (A) \u025b = 1 k (B) \u025b = 1.5 k and (C) \u025b = 2.5 k. The rectangles on the left and right represent the cell poles and have slightly enhanced cell-wall curvature, \u03b3 pole = 0.04 nm\u22121. The three-dimensional figure in (D) represents the lipid position and the membrane height in (C) mapped onto the surface of a capped cylinder. The color scheme and fraction of lipid A (\u03d5 = 0.075) are the same as in Figure 2." } ] }, ... ] ``` - ### Case1: 32357477_ijms-21-03049-f006.jpg - **從 `llava_med_image_urls.jsonl` 找圖片來源:** `$ grep -r "32357477_ijms-21-03049-f006" llava_med_image_urls.jsonl` `{"pmc_tar_url": "https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/c7/e2/PMC7246863.tar.gz", "image_file_path": "PMC7246863/ijms-21-03049-g006.jpg", "pair_id": "32357477_ijms-21-03049-f006"}` - pmc_tar_url: https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/c7/e2/PMC7246863.tar.gz - image_file_path: PMC7246863/ijms-21-03049-g006.jpg - pair_id: ==32357477_ijms-21-03049-f006== - **解壓縮後:** ``` $ tree PMC7246863 PMC7246863 ├── ijms-21-03049-g001.gif ├── ijms-21-03049-g001.jpg ├── ijms-21-03049-g002.gif ├── ijms-21-03049-g002.jpg ├── ijms-21-03049-g003.gif ├── ijms-21-03049-g003.jpg ├── ijms-21-03049-g004.gif ├── ijms-21-03049-g004.jpg ├── ijms-21-03049-g005.gif ├── ijms-21-03049-g005.jpg ├── ijms-21-03049-g006.gif ├── ijms-21-03049-g006.jpg <--- 檔案所在 ├── ijms-21-03049-g007.gif ├── ijms-21-03049-g007.jpg ├── ijms-21-03049-g008.gif ├── ijms-21-03049-g008.jpg ├── ijms-21-03049.nxml ├── ijms-21-03049.pdf └── ijms-21-03049-s001.pdf 0 directories, 19 files ``` - **ijms-21-03049-g006.jpg** ![](https://hackmd.io/_uploads/SyvlbuVaT.png) - **Determination of metaphase II entry in oocytes pre-exposed to ferrocenyl 4-(alkylamino)-1,4-dihydroquinolines. After incubation or not with compounds 9, 6, 10, 7, 11, 8 for 24 h, oocytes were rinsed four times in ND96 for 30 min, before progesterone stimulation. White spot appearance was scored after 15 h. N refers to the number of females and n to the number of oocytes (N = 2 and n = 60).** 決定先前暴露於鐵鋰基4-(烷基氨基)-1,4-二氫喹啉的卵母細胞是否進入第二階段減數分裂。經過與化合物9、6、10、7、11、8孵育24小時後(不論是否孵育),卵母細胞接著在ND96溶液中沖洗四次,每次30分鐘,之後再進行孕酮刺激。15小時後觀察並記錄白點出現的情況。N指的是雌性的數量,n指的是卵母細胞的數量(N=2,n=60)。 - ### Case2: 17096591_pcbi-0020151-g003.jpg - **從 `llava_med_image_urls.jsonl` 找圖片來源:** `$ grep -r "17096591_pcbi-0020151-g003" llava_med_image_urls.jsonl` `{"pmc_tar_url": "https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/a1/30/PMC1635540.tar.gz", "image_file_path": "PMC1635540/pcbi.0020151.g003.jpg", "pair_id": "17096591_pcbi-0020151-g003"}` - pmc_tar_url: https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/a1/30/PMC1635540.tar.gz - image_file_path: PMC1635540/pcbi.0020151.g003.jpg - pair_id: ==17096591_pcbi-0020151-g003== - **解壓縮後:** ``` $ tree PMC1635540/ PMC1635540/ ├── pcbi.0020151.e001.jpg ├── pcbi.0020151.e002.jpg ├── pcbi.0020151.e003.jpg ├── pcbi.0020151.ex001.jpg ├── pcbi.0020151.ex002.jpg ├── pcbi.0020151.ex003.jpg ├── pcbi.0020151.g001.gif ├── pcbi.0020151.g001.jpg ├── pcbi.0020151.g002.gif ├── pcbi.0020151.g002.jpg ├── pcbi.0020151.g003.gif ├── pcbi.0020151.g003.jpg <--- 檔案所在 ├── pcbi.0020151.g004.gif ├── pcbi.0020151.g004.jpg ├── pcbi.0020151.g005.gif ├── pcbi.0020151.g005.jpg ├── pcbi.0020151.g006.gif ├── pcbi.0020151.g006.jpg ├── pcbi.0020151.nxml └── pcbi.0020151.pdf 0 directories, 20 files ``` - **pcbi.0020151.g003.jpg** ![](https://hackmd.io/_uploads/Bkq9zuV6a.png) - **Polar Localization of Lipid Clusters Elastic energy parameters are fixed (\u03ba = 25 k = 0.25 k/nm4, \u03b3 = 0.4 nm\u22121), with varying short-range attraction (A) \u025b = 1 k (B) \u025b = 1.5 k and (C) \u025b = 2.5 k. The rectangles on the left and right represent the cell poles and have slightly enhanced cell-wall curvature, \u03b3 pole = 0.04 nm\u22121. The three-dimensional figure in (D) represents the lipid position and the membrane height in (C) mapped onto the surface of a capped cylinder. The color scheme and fraction of lipid A (\u03d5 = 0.075) are the same as in Figure 2.** 極地定位的脂質團簇 彈性能量參數固定(κ = 25 k = 0.25 k/nm^4,γ = 0.4 nm^-1),短程吸引力變化(A)ε = 1 k(B)ε = 1.5 k及(C)ε = 2.5 k。左右的矩形代表細胞極端,並具有略為增強的細胞壁曲率,γ極 = 0.04 nm^-1。三維圖形(D)代表脂質位置以及(C)中的膜高度映射到帶蓋圓柱體的表面上。顏色方案和脂質A的比例(φ = 0.075)與圖2中的相同。 - human question list ``` $ egrep "human\",$" -A1 llava_med_alignment_500k.json | egrep "value\": \"(.*)\"" | sort | uniq -c 19249 "Analyze the image in a comprehensive and detailed manner\n<image>" 19299 "Break down the elements of the image in a detailed manner\n<image>" 19213 "Characterize the image using a well-detailed description\n<image>" 18898 "Clarify the contents of the displayed image with great detail\n<image>" 14732 "Create a compact narrative representing the image presented.\n<image>" 18876 "Describe the following image in detail\n<image>" 14780 "Describe the image concisely.\n<image>" 19340 "Examine the image closely and share its details\n<image>" 19135 "Explain the various aspects of the image before you\n<image>" 19074 "Give an elaborate explanation of the image you see\n<image>" 14438 "Give a short and clear explanation of the subsequent image.\n<image>" 19088 "Illustrate the image through a descriptive explanation\n<image>" 19068 "Narrate the contents of the image with precision\n<image>" 14680 "Offer a succinct explanation of the picture presented.\n<image>" 19055 "Offer a thorough analysis of the image\n<image>" 18959 "Portray the image with a rich, descriptive narrative\n<image>" 14640 "Present a compact description of the photo\u2019s key features.\n<image>" 14562 "Provide a brief description of the given image.\n<image>" 19337 "Provide a detailed description of the given image\n<image>" 14623 "Relay a brief, clear account of the picture shown.\n<image>" 14766 "Render a clear and concise summary of the photo.\n<image>" 19308 "Share a comprehensive rundown of the presented image\n<image>" 14611 "Share a concise interpretation of the image provided.\n<image>" 14923 "Summarize the visual content of the image.\n<image>" 19081 "Walk through the important details of the image\n<image>" 19369 "Write an exhaustive depiction of the given image\n<image>" 14606 "Write a terse but informative summary of the picture.\n<image>" ``` <br> ### 2. end-to-end 指示微調 > - end-to-end instruction-tuning > - 第二階段則是會讓語言模型的部分開始參與訓練,透過GPT-4 生成的多回合對話來訓練。 - ### llava_med_instruct_10k.json ```json= [ { "id": "17506892_F1", "image": "17506892_F1.jpg", "conversatons": [ { "from": "human", "value": "Can you describe the image for me?\n<image>" }, { "from": "gpt", "value": "The image consists of maps of significant voxels representing regions of hypoperfusion in FTLD patients according to their clinical diagnosis. These maps are superimposed onto a reference T1-weighted MRI image. There are five rows, each representing a different patient subgroup: bvFTD, SD, PNFA, PSP, and CBD. The neurological convention is followed, with the left side of the brain on the left side of the image." }, { "from": "human", "value": "What is the modality of this image?" }, { "from": "gpt", "value": "The modality of this image is a T1-weighted MRI, which is a type of magnetic resonance imaging used to visualize the brain's anatomy." }, { "from": "human", "value": "What stands out or draws attention in this image?" }, { "from": "gpt", "value": "What stands out in this image are the regions of hypoperfusion, which are represented by significant voxels. These regions are color-coded and overlaid on the T1-weighted MRI image, highlighting the differences in blood flow between the various patient subgroups." }, { "from": "human", "value": "Can you tell me more about the first row representing bvFTD?" }, { "from": "gpt", "value": "The first row represents the behavioral variant of Frontotemporal Dementia (bvFTD) patient subgroup. In this row, you can see the regions of hypoperfusion specific to bvFTD patients, which are highlighted by significant voxels on the T1-weighted MRI image." }, { "from": "human", "value": "What about the second row for Semantic Dementia (SD)?" }, { "from": "gpt", "value": "The second row represents the Semantic Dementia (SD) patient subgroup. In this row, the regions of hypoperfusion specific to SD patients are highlighted by significant voxels on the T1-weighted MRI image, showing the areas of the brain affected by this type of dementia." }, { "from": "human", "value": "Can you describe the third row for Progressive Non-Fluent Aphasia (PNFA)?" }, { "from": "gpt", "value": "The third row represents the Progressive Non-Fluent Aphasia (PNFA) patient subgroup. In this row, the regions of hypoperfusion specific to PNFA patients are highlighted by significant voxels on the T1-weighted MRI image. This helps to visualize the brain areas affected by this particular type of aphasia." }, { "from": "human", "value": "What about the fourth row for Progressive Supranuclear Palsy (PSP)?" }, { "from": "gpt", "value": "The fourth row represents the Progressive Supranuclear Palsy (PSP) patient subgroup. In this row, the regions of hypoperfusion specific to PSP patients are highlighted by significant voxels on the T1-weighted MRI image. This provides insight into the brain areas impacted by this neurodegenerative disorder." }, { "from": "human", "value": "Finally, can you describe the fifth row for Corticobasal Degeneration (CBD)?" }, { "from": "gpt", "value": "The fifth row represents the Corticobasal Degeneration (CBD) patient subgroup. In this row, the regions of hypoperfusion specific to CBD patients are highlighted by significant voxels on the T1-weighted MRI image. This helps to visualize the brain areas affected by this rare neurodegenerative disease." } ] }, ... ] ``` - 17506892_F1.jpg - 對應資訊:`{"pmc_tar_url": "https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/d5/0a/PMC1884173.tar.gz", "image_file_path": "PMC1884173/1471-2377-7-9-1.jpg", "pair_id": "17506892_F1"}` - pmc_tar_url: https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/d5/0a/PMC1884173.tar.gz - PMC1884173/1471-2377-7-9-1.jpg [![](https://hackmd.io/_uploads/H1RJwvrpp.png)](https://hackmd.io/_uploads/H1RJwvrpp.png) - 對話內容 - **人類**:你能為我描述這張圖片嗎?\n\<image\> - **GPT**:這張圖片由代表額顳葉性痴呆(FTLD)患者臨床診斷中低灌注區域的顯著體素地圖組成。這些地圖被疊加在一張參考T1加權MRI影像上。共有五行,每行代表不同的患者亞組:行為變異型額顳葉痴呆(bvFTD)、語義性失智症(SD)、進展性非流暢性失語症(PNFA)、進展性核上性麻痺(PSP)和額基底性退化症(CBD)。遵循神經學慣例,圖像左側為大腦的左側。 - **人類**:這張圖片的模式是什麼? - **GPT**:這張圖片的模式是T1加權MRI,這是一種用於可視化大腦解剖結構的磁共振成像類型。 - **人類**:這張圖片中有什麼突出或引人注目的地方? - **GPT**:這張圖片中突出的是低灌注區域,這些區域由顯著的體素表示。這些區域被上色並覆蓋在T1加權MRI影像上,突顯了各患者亞組之間血流差異。 - **人類**:你能告訴我第一列代表的bvFTD的更多信息嗎? - **GPT**:第一列代表的是行為變異型額顳葉痴呆(bvFTD)患者亞組。在這一行中,你可以看到特定於bvFTD患者的低灌注區域,這些區域通過在T1加權MRI影像上的顯著體素突出顯示。 - **人類**:那第二列代表語義性失智症(SD)呢? - **GPT**:第二列代表語義性失智症(SD)患者亞組。在這一行中,特定於SD患者的低灌注區域通過在T1加權MRI影像上的顯著體素突出顯示,顯示了受到這種失智症影響的大腦區域。 - **人類**:你能描述第三列代表進展性非流暢性失語症(PNFA)的情況嗎? - **GPT**:第三列代表進展性非流暢性失語症(PNFA)患者亞組。在這一行中,特定於PNFA患者的低灌注區域通過在T1加權MRI影像上的顯著體素突出顯示。這有助於可視化受到這種特定失語症影響的大腦區域。 - **人類**:那第四列代表進展性核上性麻痺(PSP)呢? - **GPT**:第四列代表進展性核上性麻痺(PSP)患者亞組。在這一行中,特定於PSP患者的低灌注區域通過在T1加權MRI影像上的顯著體素突出顯示。這提供了對這種神經退行性疾病影響的大腦區域的洞察。 - **人類**:最後,你能描述第五列代表額基底性退化症(CBD)的情況嗎? - **GPT**:第五列代表額基底性退化症(CBD)患者亞組。在這一行中,特定於CBD患者的低灌注區域通過在T1加權MRI影像上的顯著體素突出顯示。這有助於可視化受到這種罕見神經退行性疾病影響的大腦區域。 - ### llava_med_instruct_60k.json ```json= [ { "id": "27374136_fig01", "image": "27374136_fig01.jpg", "domain": { "chest_xray": true, "mri": false, "ct_scan": true, "histology": false, "gross": false }, "conversations": [ { "from": "human", "value": "<image>\nWhat is the purpose of the flow diagram?" }, { "from": "gpt", "value": "The purpose of the flow diagram is to illustrate the lung cancer screening process implemented by the local government of Yokohama City. It shows the steps involved in the screening, from the primary examination to the follow-up examinations for participants with positive results." }, { "from": "human", "value": "What is the primary screening method?" }, { "from": "gpt", "value": "The primary screening method involves chest X-ray examinations, which can be either indirect or direct radiographs. In some cases, an additional sputum cytology test may also be performed." }, { "from": "human", "value": "What happens if a participant has positive results in the primary screening?" }, { "from": "gpt", "value": "If a participant has positive results in the primary screening, they are asked to undergo work-up examinations. These may include a chest X-ray with direct radiograph, chest computed tomography(CT), and bronchoscopy to further investigate the findings and determine if lung cancer is present." } ] }, ... ``` - 27374136_fig01.jpg - 對應資訊:`{"pmc_tar_url": "https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/40/0f/PMC5121433.tar.gz", "image_file_path": "PMC5121433/je-26-646-g001.jpg", "pair_id": "27374136_fig01"}` - pmc_tar_url: https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/40/0f/PMC5121433.tar.gz - PMC5121433/je-26-646-g001.jpg [![](https://hackmd.io/_uploads/HJHwzcrTT.png)](https://hackmd.io/_uploads/HJHwzcrTT.png) - 對話內容 - **人類**:\<image\>\n這個流程圖的目的是什麼? - **GPT**:這個流程圖的目的是為了說明橫濱市地方政府實施的肺癌篩查過程。它展示了篩查過程中的各個步驟,從初步檢查到對結果呈陽性的參與者進行後續檢查。 - **人類**:主要的篩查方法是什麼? - **GPT**:主要的篩查方法包括胸部X光檢查,可以是間接或直接的放射線照片。在某些情況下,還可能進行額外的痰液細胞學測試。 - **人類**:如果參與者在初篩中結果呈陽性會發生什麼? - **GPT**:如果參與者在初篩中結果呈陽性,他們將被要求進行進一步檢查。這可能包括直接放射線的胸部X光、胸部電腦斷層掃描(CT)和支氣管鏡檢查,以進一步調查發現並確定是否存在肺癌。 - ### llava_med_instruct_60k_inline_mention.json ```json= [ { "id": "31270284_fig_002", "image": "31270284_fig_002.jpg", "domain": { "chest_xray": false, "mri": false, "ct_scan": false, "histology": true, "gross": false }, "conversations": [ { "from": "human", "value": "<image>\nWhat type of tissue is shown in the image?" }, { "from": "gpt", "value": "The image shows a histopathological section of an endonasal mass, which is a tissue sample taken from inside the nasal cavity." }, { "from": "human", "value": "What is the magnification level?" }, { "from": "gpt", "value": "The magnification level of the image is 200x." }, { "from": "human", "value": "What is the diagnosis based on the histopathological features?" }, { "from": "gpt", "value": "The diagnosis is a b-cell lymphoma. b-cell lymphomas are a type of cancer that originates from b lymphocytes, which are a type of white blood cell. the image shows solid sheets of large round cells diffusely obscuring the lamina propria underlying the respiratory epithelium. this finding, along with other clinical and laboratory data, led to the diagnosis of b-cell lymphoma." } ] }, ... ``` - 31270284_fig_002.jpg - 對應資訊 - `{"pmc_tar_url": "https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/ed/12/PMC6715927.tar.gz", "image_file_path": "PMC6715927/jvms-81-1219-g002.jpg", "pair_id": "31270284_fig_002"}` - pmc_tar_url: https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/ed/12/PMC6715927.tar.gz - PMC6715927/jvms-81-1219-g002.jpg [![](https://hackmd.io/_uploads/r1b2aFHa6.png)](https://hackmd.io/_uploads/r1b2aFHa6.png) - 對話內容 - **人類**:\<image\>\n圖中顯示的是什麼類型的組織? - **GPT**:圖片顯示的是一個鼻內腫塊的組織病理切片,這是從鼻腔內部取出的組織樣本。 - **人類**:放大倍數是多少? - **GPT**:圖片的放大倍數是200倍。 - **人類**:根據組織病理特徵的診斷是什麼? - **GPT**:診斷為B細胞淋巴瘤。B細胞淋巴瘤是一種起源於B淋巴細胞的癌症,B淋巴細胞是一種白血球。圖片顯示大量的圓形細胞以實體片狀分布,使得位於呼吸上皮下的基底膜變得模糊不清。這一發現,加上其他臨床和實驗室數據,導致了B細胞淋巴瘤的診斷。 - ### llava_med_instruct_fig_captions.json ```json= { "chest_xray": [ { "fig_caption": "Flow diagram of the lung cancer screening process implemented by the local government of Yokohama City. In the primary screening, participants were examined by chest X-ray (indirect or direct radiograph), with or without additional sputum cytology test. There were two lung cancer screening systems: one was performed in the 18 Public Health and Welfare Centers (PHWC), and the other was in the Cancer Center of Yokohama Municipal Citizen\u2019s Hospital (CC-YMCH). If participants had positive results (e1, e2, and d) in the primary screening, they were asked to undergo work-up examinations, such as chest X-ray (direct radiograph), chest computed tomography (CT), and bronchoscopy.", "fig_id": "fig01", "fig_label": "Figure 1. ", "graphic_ref": "40/0f/PMC5121433/je-26-646-g001.jpg", "pair_id": "27374136_fig01", "pmid": "27374136", "in_text_mention": [ { "tokens": "The flow of the lung cancer screening process in Yokohama City is shown in Figure 1 .", "entities": [ { "type": "figure", "entity_id": "1", "start_tok": 14, "end_tok": 16 } ] } ], "domain": { "chest_xray": true, "mri": false, "ct_scan": true, "histology": false, "gross": false } }, ... "gross": [ { "fig_caption": "Gross appearance: a jelly-like mass with hemorrhagic areas are seen", "fig_id": "Fig6", "fig_label": "Fig. 6", "graphic_ref": "ee/dd/PMC5368922/13019_2017_584_Fig6_HTML.jpg", "pair_id": "28347347_Fig6", "pmid": "28347347", "in_text_mention": [ { "tokens": "The combined size of all tumors approached approximately 6.5 cm \u00d7 4.5 cm \u00d7 3.0 cm ; the gross appearance was that of a jelly like mass with hemorrhagic areas ( Fig. 6 ) .", "entities": [ { "type": "figure", "entity_id": "6", "start_tok": 31, "end_tok": 33 } ] } ], "domain": { "chest_xray": false, "mri": false, "ct_scan": false, "histology": false, "gross": true } }, ... ``` - pair_id: 27374136_fig01 - 對應資訊:`{"pmc_tar_url": "https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/40/0f/PMC5121433.tar.gz", "image_file_path": "PMC5121433/je-26-646-g001.jpg", "pair_id": "27374136_fig01"}` - pmc_tar_url: https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/40/0f/PMC5121433.tar.gz - PMC5121433/je-26-646-g001.jpg [![](https://hackmd.io/_uploads/HJHwzcrTT.png)](https://hackmd.io/_uploads/HJHwzcrTT.png) - fig_caption 橫濱市地方政府實施的肺癌篩查過程流程圖。在初級篩查中,參與者接受胸部X光檢查(間接或直接放射照片),並可選擇是否進行額外的痰液細胞學測試。有兩套肺癌篩查系統:一套在18個公共衛生及福利中心(PHWC)執行,另一套在橫濱市立市民醫院的癌症中心(CC-YMCH)進行。如果參與者在初級篩查中結果呈陽性(e1、e2和d),則被要求進行後續檢查,如直接放射照片的胸部X光、胸部電腦斷層掃描(CT)和支氣管鏡檢查。 - in_text_mention - tokens 橫濱市肺癌篩查過程的流程顯示於圖1中。 <br> ### 3. 當前資料集的大小狀況 - ### PMC7467501.tar.gz, ==3.6G== - 資料夾路徑:`data/pmc_articles/PMC7467501.tar.gz` - URL: https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/19/8b/PMC7467501.tar.gz - 內容物除了圖片,還有影片 [![](https://hackmd.io/_uploads/HytxDUM1A.png)](https://hackmd.io/_uploads/HytxDUM1A.png) - 論文來源: - 標題:XEN Gel Stent Open Conjunctiva Technique: A Practical Approach Paper #眼睛 #手術 - PubMed: https://pubmed.ncbi.nlm.nih.gov/32200534/ - PMC: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7467501/ - ### PMC6149940.tar.gz, 125MB https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/28/26/PMC6149940.tar.gz ![](https://hackmd.io/_uploads/BkPlFXrRa.png) - 論文有提供影片 - 論文來源:https://pubmed.ncbi.nlm.nih.gov/30271169/ - 論文名稱:Evaluation of supportive and barrier-protective skin care products in the daily prevention and treatment of cutaneous toxicity during systemic chemotherapy - PMCID: [PMC6149940](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6149940/) - https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6149940/ - [Download video file.(50M, avi)](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6149940/bin/ott-11-5865-s.avi) - ### PMC6153305.tar.gz, 79MB https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/90/0b/PMC6153305.tar.gz ![](https://hackmd.io/_uploads/ByDKY7SR6.png) - 論文有提供影片 - ### PMC6153119.tar.gz, 41MB https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/00/b5/PMC6153119.tar.gz ![](https://hackmd.io/_uploads/rkVQ9QSCp.png) - #### mmc4.mp4 ![](https://hackmd.io/_uploads/SJ9ucXHA6.png) - #### mmc5.mp4 ![](https://hackmd.io/_uploads/HkjrcQSCT.png) - ### PMC6155148.tar.gz, 20MB https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/43/2b/PMC6155148.tar.gz ![](https://hackmd.io/_uploads/ryf2oQSCT.png) - #### 41419_2018_1018_MOESM2_ESM.tif, 18M ![](https://hackmd.io/_uploads/rk6l2mrRa.png) scale: 20% <br> ### 4. 當前資料集的重疊狀況(overlap) | type | dataset | #(image) | self-overlap<br>#(image_id) | |------|----------|---------:|------------:| | mapping | `llava_med_image_urls.jsonl` | 721154 | 83880 | || | pretrain | `llava_med_alignment_500k.json` | 467710 | 0 | | finetune-1 | `llava_med_instruct_10k.json` | 9888 | 0 | | finetune-2 | `llava_med_instruct_60k.json` | 56702 | 0 | | finetune-3 | `llava_med_instruct_60k_inline_mention.json`| 56708 | 0 | || | **overlap** | pretrain(500k) vs finetune-1(10k) | 349 | | | pretrain(500k) vs finetune-2(60k) | 1945 | | | pretrain(500k) vs finetune-3(60k-im) | 1946 | | | finetune-1(10k) vs finetune-2(60k) | 5216 | | | finetune-2(60k) vs finetune-3(60k-im) | 56309<br>(約400張<br>不重疊) | - **overlap**:定義為使用相同圖片ID - 範例:底下是使用相同圖片 `23241278_F4.jpg` 的範例 - `23241278_F4.jpg` -> `pmc_articles/PMC3608000/1749-8090-7-130-4.jpg` ![](https://hackmd.io/_uploads/r1Ci825RT.png) - #### `alignment/llava_med_alignment_500k.json` ```json= [ ... { "id": "23241278_F4", "image": "23241278_F4.jpg", "conversatons": [ { "from": "human", "value": "Share a concise interpretation of the image provided.\n<image>" }, { "from": "gpt", "value": "Angio CT Scan shows that all stent grafts were opened and not kinked. No sidearm graft occlusion was found." } ] }, ... ] ``` - #### `instruct/llava_med_instruct_10k.json` ```json= [ ... { "id": "23241278_F4", "image": "23241278_F4.jpg", "conversatons": [ { "from": "human", "value": "Can you describe the image for me?\n<image>" }, { "from": "gpt", "value": "The image is an Angio CT Scan showing multiple stent grafts. All of the stent grafts appear to be open and not kinked. Additionally, there are no signs of sidearm graft occlusion." }, { "from": "human", "value": "What is the modality of this image?" }, { "from": "gpt", "value": "The modality of this image is an Angio CT Scan, which is a type of computed tomography scan that uses contrast agents to visualize blood vessels and stent grafts." }, { "from": "human", "value": "What are the most important or significant parts of this image?" }, { "from": "gpt", "value": "The most significant parts of this image are the stent grafts, which are shown to be open and not kinked. This is important because it indicates that the stent grafts are functioning properly. Additionally, the absence of sidearm graft occlusion is another important aspect of this image, as it suggests that blood flow is not being obstructed." } ] }, ... ] ``` - #### `llava_med_image_urls.jsonl` ```json= ... { "pmc_tar_url": "https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/12/1a/PMC3608000.tar.gz", "image_file_path": "PMC3608000/1749-8090-7-130-4.jpg", "pair_id": "23241278_F4" } ... ``` - `llava_med_image_urls.jsonl` 有相同 ID 的分佈狀況 ``` ... 600 "_f0005"} 629 "_f2"} 687 "_f0040"} 701 "_fig3"} 726 "_Fig11"} 760 "_f0035"} 825 "_fig0005"} 844 "_f1"} 873 "_Fig10"} 904 "_F3"} 911 "_fig2"} 939 "_f0030"} 1067 "_f0025"} 1089 "_Fig9"} 1243 "_uro1"} 1344 "_f0020"} 1380 "_Fig8"} 1582 "_f0015"} 1763 "_Fig7"} 1971 "_f0010"} 1992 "_fig1"} 2292 "_Fig6"} 2468 "_F2"} 2936 "_Fig5"} 3685 "_Fig4"} 4690 "_Fig3"} 6076 "_Fig2"} 6201 "_F1"} 7845 "_Fig1"} ``` <br> ### 5. tar.gz 壓縮檔不存在 - ### 32432162_F1.jpg 需要 PMC7236913.tar.gz - finetune 跑到一半掛了,發現檔案不存在 ``` FileNotFoundError: [Errno 2] No such file or directory: '.../LLaVA-Med/data/images-finetune-10k/32432162_F1.jpg' 13%|████████████████████▉ | 936/7416 [5:56:27<41:07:46, 22.85s/it] ``` ![](https://hackmd.io/_uploads/SkrGVfb1A.png) - `data/llava_med_image_urls.jsonl` `{"pmc_tar_url": "https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/3f/46/PMC7236913.tar.gz", "image_file_path": "PMC7236913/nihms-1587931-f0001.jpg", "pair_id": "32432162_F1"}` - #### 開 issue - https://github.com/microsoft/LLaVA-Med/issues/58 - #### PMC7236913 - https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7236913/ - Article with this PMCID is not available Reason: You have requested a manuscript that was deposited in PubMed Central (PMC) in error and subsequently removed because it does not fall under the public access policy of NIH or another PMC participating funder. 說遭誤植,因為不屬於 NIH 或 PMC 範圍 - https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8272944/ ![](https://hackmd.io/_uploads/Bks_TbWkR.png) 16. Pharmaco-invasive therapy for STEMI in a patient with COVID-19: a case report. Kariyanna PT, Hossain N, Jayarangaiah A, et al. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7236913/ Am J Med Case Rep. 2020;8:192–196. - Pharmaco-invasive Therapy for STEMI in a Patient with COVID-19: A Case Report > https://pubs.sciepub.com/ajmcr/8/7/9/index.html - ### 33585675_F1.jpg 需要 PMC7877808.tar.gz - ### 33585675_F2.jpg 需要 PMC7877808.tar.gz - `data/llava_med_image_urls.jsonl` `{"pmc_tar_url": "https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/ff/6a/PMC7877808.tar.gz", "image_file_path": "PMC7877808/nihms-1661770-f0001.jpg", "pair_id": "33585675_F1"}` `{"pmc_tar_url": "https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/ff/6a/PMC7877808.tar.gz", "image_file_path": "PMC7877808/nihms-1661770-f0002.jpg", "pair_id": "33585675_F2"}` - #### PMC7877808 - https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7877808/ - #### HIV-associated Hodgkin Lymphoma with a Granulomatous Bone Marrow Biopsy: A Case Report > https://www.sciepub.com/AJMCR/abstract/12566 > - Fig1 > ![](https://hackmd.io/_uploads/S176E3bJA.png) > - Fig2 > ![](https://hackmd.io/_uploads/SytwqnZJC.png) <br> ### 6. xxx.jpg 對應的影像不存在 - ### `34476397_F1` -> `PMC8405846/ojab029f0001.jpg`,但實際檔案是 `ojab029_fig1.jpg` ``` $ grep '34476397_F1' data/llava_med_image_urls.jsonl {"pmc_tar_url": "https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/0e/50/PMC8405846.tar.gz", "image_file_path": "PMC8405846/ojab029f0001.jpg", "pair_id": "34476397_F1"} ``` ``` $ ll data/pmc_articles/PMC8405846 drwxr-xr-x 2 4096 Mar 2 18:59 ./ drwxr-xr-x 7384 2973696 Mar 28 14:53 ../ -rw-r--r-- 1 12175 Mar 2 18:59 ojab029_fig1.gif -rw-r--r-- 1 98673 Mar 2 18:59 ojab029_fig1.jpg <--- -rw-r--r-- 1 6778 Mar 2 18:59 ojab029_fig2.gif -rw-r--r-- 1 74570 Mar 2 18:59 ojab029_fig2.jpg -rw-r--r-- 1 4605 Mar 2 18:59 ojab029_fig3.gif -rw-r--r-- 1 59302 Mar 2 18:59 ojab029_fig3.jpg -rw-r--r-- 1 9175 Mar 2 18:59 ojab029_fig4.gif -rw-r--r-- 1 54355 Mar 2 18:59 ojab029_fig4.jpg -rw-r--r-- 1 68881 Mar 2 18:59 ojab029.nxml -rw-r--r-- 1 2538982 Mar 2 18:59 ojab029.pdf ``` - ### `35043100_fig1` -> `PMC8757369/gr1_lrg.jpg`,但實際檔案是 `gr1.jpg` ``` $ grep PMC8757369 llava_med_image_urls.jsonl {"pmc_tar_url": "https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/f0/cb/PMC8757369.tar.gz", "image_file_path": "PMC8757369/gr1_lrg.jpg", "pair_id": "35043100_fig1"} {"pmc_tar_url": "https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/f0/cb/PMC8757369.tar.gz", "image_file_path": "PMC8757369/gr2_lrg.jpg", "pair_id": "35043100_fig2"} ``` ``` -rw-r--r-- 1 17983 Sep 16 2023 gr1.gif -rw-r--r-- 1 129943 Sep 16 2023 gr1.jpg <--- -rw-r--r-- 1 19424 Sep 16 2023 gr2.gif -rw-r--r-- 1 124897 Sep 16 2023 gr2.jpg <--- -rw-r--r-- 1 36264 Sep 16 2023 main.nxml -rw-r--r-- 1 533930 Sep 16 2023 main.pdf ``` - ### `35039808_fig4` -> `PMC8755556/gr4_lrg.jpg`,但實際檔案是 `gr4.jpg` ``` $ grep 35039808_fig4 llava_med_image_urls.jsonl {"pmc_tar_url": "https://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/3c/ad/PMC8755556.tar.gz", "image_file_path": "PMC8755556/gr4_lrg.jpg", "pair_id": "35039808_fig4"} ``` ``` $ ll pmc_articles/PMC8755556/ total 5316 drwxr-xr-x 2 4096 Sep 16 2023 ./ drwxr-xr-x 7384 2973696 Mar 28 14:53 ../ -rw-r--r-- 1 19087 Sep 16 2023 gr1.gif -rw-r--r-- 1 363598 Sep 16 2023 gr1.jpg -rw-r--r-- 1 14331 Sep 16 2023 gr2.gif -rw-r--r-- 1 235345 Sep 16 2023 gr2.jpg -rw-r--r-- 1 16485 Sep 16 2023 gr3.gif -rw-r--r-- 1 288977 Sep 16 2023 gr3.jpg -rw-r--r-- 1 17368 Sep 16 2023 gr4.gif -rw-r--r-- 1 309103 Sep 16 2023 gr4.jpg <--- -rw-r--r-- 1 30585 Sep 16 2023 main.nxml -rw-r--r-- 1 1145496 Sep 16 2023 main.pdf ``` ## License 問題 - [Does LLaVA 1.6 have the same commercial usage conditions as 1.5? #1336](https://github.com/haotian-liu/LLaVA/issues/1336) <br> <hr> <br> ## 資料產生方式,為什麼要這樣設計, 這麼做的目的是什麼? - ### 產生方式 - **stage 1**: 由人類定義「簡易/詳細」多種不同問法來套入 - **stage 2**: 由 GPT4 產生 - ### 目的 - **stage 1**: - 由實際情境產生,用於訓練 VLM 理解圖像特徵所對應的專業領域術語 - **context (上下文知識)**:由論文所提及該影像的句子,作為引用該圖片的背景知識 - **caption (圖文說明) (as Answer)**:論文針對該影像進行說明,作為 answer (比如:這張影像是描述 Chest X-ray 玻璃狀毛樣) - **Question**: 由人類定義 簡易/詳細多種不同問法來套入 (比如:請簡易描述該圖片) - **stage2**: - stage 1 的缺失在於沒有能力對話,需要透過 stage2 來補足 - 所以透過 GPT4,根據 context, caption 和 8個對話範本,來生出多輪對話 <br> <hr> <br> ## 之後面對特定領域,我們要怎麼樣產生需要的 dataset? ### 車牌辨識 - 以車牌辨識來說,即使收集到那麼多車牌(幾萬張),仍覺得不夠... - 透過 Image augmentation 去生出 光線反射、下雪、起霧、傾斜、過曝、模糊等場景,才能生出更多影像 - 但實際的專業領域圖像,似乎無法透過 augment 去生出「類車牌」訓練資料 ### 基本電學 - ### 電子零件 如果要訓練認識電子零件知識,可能要個別準備單張影像的訓練資料,例如: [![](https://hackmd.io/_uploads/SyPo0Aw1R.png)](https://hackmd.io/_uploads/SyPo0Aw1R.png) > [教你怎么看电路图,各种电路图形符号大全](https://murata.eetrend.com/article/2018-06/1001691.html) 這是電阻,然後說明用途: ![](https://hackmd.io/_uploads/HkNJ1J_1R.png) - ### 電阻 - 單輪對話1 ![](https://hackmd.io/_uploads/SygHq6RDJ0.png) > #電路中的電阻 > https://yamol.tw/item-713392.htm - **USER**:標示5W的電子零件是什麼? - **ASSISTANT**: 標示5W的電子零件是一個電阻器,阻值為20歐姆(20Ω)。 這裡的5W指的是電阻器可以承受的最大功率,即5瓦特。 電阻器的功率等級是衡量其能承受多大電流通過而不會過熱或損壞的一個重要參數。 在此電路中,這個電阻器必須能夠在不超過5瓦特的功率下正常運作。 - ### 電阻 - 單輪對話2 ![](https://hackmd.io/_uploads/SygHq6RDJ0.png) > #電路中的電阻 > https://yamol.tw/item-713392.htm - **USER**:圖中的電阻器在哪? - **ASSISTANT**: 在圖中,有三個標有其電阻值和功率容量的電阻器。最左邊的電阻器標記為1歐姆,功率為1瓦特;中間的電阻器標記為20歐姆,功率為5瓦特;最右邊的電阻器標記為12歐姆,功率為3瓦特。這三個電阻器連接成混合連接方式,1歐姆的電阻器和其它兩個串聯,而20歐姆和12歐姆的電阻器並聯在一起。 - ### 電阻 - 單輪對話3 ![](https://hackmd.io/_uploads/SygHq6RDJ0.png) > #電路中的電阻 > https://yamol.tw/item-713392.htm - **USER**:與1Ω連接的電子零件有哪些? - **ASSISTANT**: 在圖中,與1Ω電阻器直接連接的電子零件是兩個其他的電阻器,它們的阻值分別是20Ω和12Ω。 這兩個電阻器是並聯連接的,它們的一端與1Ω電阻器的一端相連,而另一端則共同連接在一個節點上,並回到電壓源 `V_s`。 此外,這些電阻器也直接與電壓源 `V_s` 相連,因為1Ω電阻的另一端接回電壓源的負極,形成一個閉合迴路。 這樣的連接配置允許電流從電壓源通過1Ω電阻器流入,並在分支點分流到20Ω和12Ω的電阻器,最後再流回電壓源,完成電路。 - ### 電阻 - 兩輪對話 ![](https://hackmd.io/_uploads/SygHq6RDJ0.png) > #電路中的電阻 > https://yamol.tw/item-713392.htm - **USER**:這張電路圖的電阻扮演什麼角色? - **ASSISTANT**: 這張電路圖展示了一個含有三個電阻的簡單電路。電阻器分別標有它們的阻值(以歐姆Ω表示)和它們能夠承受的最大功率(以瓦特W表示)。 - 1歐姆的電阻器標有 `1W`,這意味著它最大可以承受1瓦特的功率。 - 20歐姆的電阻器標有 `5W`,這意味著它最大可以承受5瓦特的功率。 - 12歐姆的電阻器標有 `3W`,這意味著它最大可以承受3瓦特的功率。 電阻在電路中的角色是限制電流的流動,並且在電流通過時消耗能量,通常以熱能的形式釋放。阻值越大,流過電阻的電流越小,給定電壓下消耗的功率也越大。功率等於電流平方乘以電阻(`P = I^2R`),或者等於電壓平方除以電阻(`P = V^2/R`)。 在這個特定的電路中,電阻還可以扮演分壓器的角色,這取決於電源 `V_s` 的電壓大小。通過電阻的電流會在電阻之間分配電壓,而電阻上的電壓降將取決於它的阻值。 在這個電路中,由於20歐姆和12歐姆的電阻並聯,它們共同決定了流經1歐姆電阻的電流大小。這個並聯組合也會決定整體電路的總功耗和1歐姆電阻上的電壓降。由於這些電阻被賦予了最大功率額定值,這提供了關於設計這個電路時電源電壓應該在什麼範圍內的重要信息。如果電源電壓太高,電流可能會超過這些電阻所能安全處理的限度,導致它們過熱甚至燒壞。 - **USER**:電阻器 功用為何? - **ASSISTANT**: 電阻器的主要功能是限製或調整電路中的電流,它可以完成以下幾個功能: - **限流**:防止電流過大而損害電路中的元件。 - **分壓**:在分壓電路中,電阻器可以用來將電壓分配到不同的部分。 - **電阻性負載**:提供所需的電阻性負載,以確保某些電路元件如電晶體能在正確的操作條件下運作。 - **熱敏電阻和光敏電阻**:特殊類型的電阻器(如熱敏電阻和光敏電阻)可以用來檢測溫度變化或光線強度的變化,並根據這些變化來調整電路中的電流。 - **時間延遲**:與電容器結合使用時,電阻器可以創造出延時或濾波電路。 - **電路定值**:在類比電路中,電阻器用於設定電路的工作點。 在電路設計中,電阻器是基本且不可或缺的組成部分,因為幾乎所有的電子設備都需要對電流進行某種形式的控制。 <br> ## 參考資料 - [LLaVA: Large Language and Vision Assistant](https://llava-vl.github.io/) - [[論文] LLaVA-Med: Training a Large Language-and-Vision Assistant for Biomedicine in One Day](https://arxiv.org/pdf/2306.00890.pdf) - [[新聞] MedTech醫療科技雙周報第22期:圖文通吃!微軟打造生醫領域專用的生成式AI Chatbot](https://www.ithome.com.tw/news/157543) - [[導讀] LLaVA-Med 醫學領域的文字-影像模型](https://medium.com/@rex19981002/88e978c3bb5c) - [[授權條款] LLaVA: Large Language and Vision Assistant](https://llava.hliu.cc/) - [使用视觉和语言模型增强胸部 X 射线分析中的人机交互](https://arxivtools.blob.core.windows.net/xueshuxiangzipaperhtml/2024_4_4/2404.02370.pdf)