|
| 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) |
0 commit comments