Skip to content

Commit 84658f8

Browse files
caitlinwheelesscaitlinwheeless
and
caitlinwheeless
authored
docs: DOC-273: Medical Image Classification template (#6908)
Co-authored-by: caitlinwheeless <[email protected]>
1 parent d7f69d9 commit 84658f8

File tree

3 files changed

+93
-1
lines changed

3 files changed

+93
-1
lines changed

docs/source/templates/gallery_cv.ejs

+6-1
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,10 @@ cards:
6565
- Image Classification
6666
image: "/images/templates-misc/multi-image-classification.png"
6767
url: "/templates/multi-image_classification.html"
68-
68+
- title: Medical Image Classification and Segmentation
69+
categories:
70+
- Image Classification
71+
- object detection
72+
image: "/images/templates/medical-image-classification.png"
73+
url: "/templates/medical_imaging_classification.html"
6974
---
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
title: Medical Image Classification with Bounding Boxes
3+
type: templates
4+
category: Computer Vision
5+
cat: computer-vision
6+
order: 155
7+
meta_title: Medical Image Classification with Bounding Boxes Template
8+
meta_description: Template for classifying medical images and using bounding boxes for image segmentation.
9+
---
10+
11+
12+
<img src="/images/templates/medical-image-classification.png" alt="" class="gif-border" width="552px" height="408px" />
13+
14+
This template interface allows annotators to:
15+
- Draw bounding boxes around areas identified as tumors in the image using the "Tumor" label.
16+
- Classify the entire image by selecting one of "Benign", "Malignant", or "Normal".
17+
18+
This setup is useful in medical imaging tasks where you need to localize tumors and also provide an overall assessment of the image.
19+
20+
## Labeling configuration
21+
22+
```xml
23+
<View>
24+
<Image name="image" value="$image"/>
25+
<RectangleLabels name="label" toName="image">
26+
<Label value="Tumor" background="green"/>
27+
</RectangleLabels>
28+
<Choices name="classification" toName="image">
29+
<Choice value="Benign"/>
30+
<Choice value="Malignant"/>
31+
<Choice value="Normal"/>
32+
</Choices>
33+
</View>
34+
```
35+
36+
## About the labeling configuration
37+
38+
#### Image
39+
40+
```xml
41+
<Image name="image" value="$image"/>
42+
```
43+
44+
This displays the image. The `value="$image"` means it will use the image field from your task data.
45+
46+
!!! info Tip
47+
For example images, you can use a sample dataset available from [kaggle](https://www.kaggle.com/datasets/aryashah2k/breast-ultrasound-images-dataset?resource=download).
48+
49+
50+
#### Bounding boxes
51+
52+
```xml
53+
<RectangleLabels name="label" toName="image">
54+
<Label value="Tumor" background="green"/>
55+
</RectangleLabels>
56+
```
57+
This defines the image segmentation you can use. In this template, you're drawing rectangles (bounding boxes).
58+
59+
- The `RectangleLabels` tag creates a tool for drawing bounding boxes, and `toName="image"` means that the boxes will be associated with the tag named `image` (which in this example is the name assigned to the `<Image>` tag).
60+
- The `Label` tag specifies that the bounding boxes represent "Tumor" regions, displayed with a green background.
61+
62+
For more information about working with bounding boxes, see [Object Detection with Bounding Boxes](image_bbox).
63+
64+
#### Classification
65+
66+
```xml
67+
<Choices name="classification" toName="image">
68+
<Choice value="Benign"/>
69+
<Choice value="Malignant"/>
70+
<Choice value="Normal"/>
71+
</Choices>
72+
```
73+
74+
This adds image-level classification choices.
75+
76+
- The `<Choices>` tag provides a set of options for annotators to select.
77+
- `toName="image"` applies these choices to the entire image.
78+
- Annotators can classify the image as "Benign", "Malignant", or "Normal".
79+
80+
You can change these classification options by editing them, adding more, or deleting them. If your needs are more complex, you can also use [nested choices](image_classification#Enhance-classification-templates-with-nested-choices).
81+
82+
83+
## Related tags
84+
85+
- [Image](/tags/image.html)
86+
- [RectangleLabels](/tags/rectanglelabels.html)
87+
- [Choices](/tags/choices.html)
Loading

0 commit comments

Comments
 (0)