--- license: apache-2.0 datasets: - Riksarkivet/goteborgs_poliskammare_fore_1900_lines - Riksarkivet/bergskollegium_relationer_och_skrivelser_lines - Riksarkivet/bergskollegium_advokatfiskalskontoret_seg - Riksarkivet/frihetstidens_utskottshandlingar - Riksarkivet/frihetstidens_utskottshandlingar_seg - Riksarkivet/gota_hovratt_seg - Riksarkivet/jonkopings_radhusratts_och_magistrat_seg - Riksarkivet/krigshovrattens_dombocker_seg - Riksarkivet/svea_hovratt_seg - Riksarkivet/trolldomskommissionen_seg pipeline_tag: image-segmentation tags: - text-line-detection - text-region-detection - document-analysis - historical-documents - handwritten-text - rf-detr - instance-segmentation --- # RF-DETR Seg-Preview: Historical Document Instance Segmentation This model is trained to detect and segment text lines and text regions from historical handwritten documents spanning from the 16th to the 20th century. ## Model Description RF-DETR Seg-Preview is an instance segmentation model based on the RF-DETR architecture. It is trained on Roboflow's [rfdetr-library](https://github.com/roboflow/rf-detr). More information about the architecture can be found via the link. It predicts: - Bounding boxes for text elements - Class labels (text_region or text_line) - Instance segmentation masks ### Classes The model detects two classes: - **text_region** (index: 1) - Larger regions of text content - **text_line** (index: 2) - Individual lines of text ## Training Data The model was trained on historical handwritten documents with the following data distribution: - **Training set**: 11,495 images - **Validation set**: 2,711 images - **Test set**: 2,340 images ## Performance Metrics ### Validation Set Performance | Class | mAP@50:95 | mAP@50 | Precision | Recall | |-------|-----------|--------|-----------|--------| | text_region | 0.822 | 0.963 | 0.949 | 0.940 | | text_line | 0.621 | 0.936 | 0.957 | 0.940 | | **Overall** | **0.721** | **0.950** | **0.953** | **0.940** | ### Test Set Performance | Class | mAP@50:95 | mAP@50 | Precision | Recall | |-------|-----------|--------|-----------|--------| | text_region | 0.822 | 0.959 | 0.949 | 0.940 | | text_line | 0.688 | 0.955 | 0.978 | 0.940 | | **Overall** | **0.755** | **0.957** | **0.964** | **0.940** | ## Training Metrics ![Training Metrics](metrics_plot.png) ## Use Cases This model is particularly suitable for: - Text line detection for OCR preprocessing - Document digitization projects involving historical manuscripts - Historical document understanding and analysis ## Limitations - The model is specifically trained on historical handwritten documents (16th-20th century) - Performance may vary on modern printed documents or documents outside the training distribution - Performance depends on image quality and document preservation state