MikkoLipsanen
commited on
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model:
|
3 |
+
- Ultralytics/YOLOv8
|
4 |
+
pipeline_tag: object-detection
|
5 |
+
---
|
6 |
+
|
7 |
+
## Text column and row line intersection detection from Finnish death records from the 1930s
|
8 |
+
|
9 |
+
The model is trained to find the intersection points of table column and cell lines from digitized death record documents
|
10 |
+
from the 1930s. The model has been trained using yolov8x by Ultralytics as the base model.
|
11 |
+
|
12 |
+
|
13 |
+
## Intended uses & limitations
|
14 |
+
|
15 |
+
<img src='death_record_intersection_example.jpg' width='500'>
|
16 |
+
|
17 |
+
The model has been trained to detect intersection points from specific kinds of tables, and probably generalizes badly to other,
|
18 |
+
very different table types.
|
19 |
+
|
20 |
+
## Training data
|
21 |
+
|
22 |
+
Training dataset consisted of 244 digitized and annotated documents containing tables, while validation
|
23 |
+
dataset contained 31 annotated document images.
|
24 |
+
|
25 |
+
## Training procedure
|
26 |
+
|
27 |
+
This model was trained using 2 NVIDIA RTX A6000 GPUs with the following hyperparameters:
|
28 |
+
|
29 |
+
- image size: 2560
|
30 |
+
- train batch size: 4
|
31 |
+
- epochs: 100
|
32 |
+
- patience: 10 epochs
|
33 |
+
- optimizer: SGD
|
34 |
+
- workers: 4
|
35 |
+
- learning rate (lr0): 0.01
|
36 |
+
|
37 |
+
Default settings were used for other training hyperparameters (find more information [here](https://docs.ultralytics.com/modes/train/#train-settings)).
|
38 |
+
|
39 |
+
Model training was performed using the following code:
|
40 |
+
|
41 |
+
```
|
42 |
+
from ultralytics import YOLO
|
43 |
+
|
44 |
+
# Use pretrained Yolo segmentation model
|
45 |
+
model = YOLO('yolov8x.pt')
|
46 |
+
|
47 |
+
# Path to .yaml file where data location and object classes are defined
|
48 |
+
yaml_path = 'intersections.yaml'
|
49 |
+
|
50 |
+
# Start model training with the defined parameters
|
51 |
+
model.train(data=yaml_path, name='model_name', epochs=100, imgsz=640, workers=4, optimizer='SGD',
|
52 |
+
lr0=0.01, seed=42, val=True, cos_lr=False, patience=10, batch=32, device='0,1')
|
53 |
+
```
|
54 |
+
|
55 |
+
## Evaluation results
|
56 |
+
|
57 |
+
Evaluation results using the validation dataset are listed below:
|
58 |
+
|Class|Images|Class instances|Box precision|Box recall|Box mAP50|Box mAP50-95
|
59 |
+
-|-|-|-|-|-|-
|
60 |
+
Intersection|31|6769|0.927|0.946|0.939|0.426
|
61 |
+
|
62 |
+
More information on the performance metrics can be found [here](https://docs.ultralytics.com/guides/yolo-performance-metrics/).
|
63 |
+
|
64 |
+
## Inference
|
65 |
+
|
66 |
+
If the model file `yolo_kuolleet_09022024.pt` is downloaded to a folder `\models\yolo_kuolleet_09022024.pt`
|
67 |
+
and the input image path is `\data\image.jpg', inference can be perfomed using the following code:
|
68 |
+
|
69 |
+
```
|
70 |
+
from ultralytics import YOLO
|
71 |
+
|
72 |
+
# Initialize model
|
73 |
+
model = YOLO(`\models\yolo_kuolleet_09022024.pt`)
|
74 |
+
prediction_results = model.predict(source=`\data\image.jpg', save=True)
|
75 |
+
```
|
76 |
+
More information for available inference arguments can be found [here](https://docs.ultralytics.com/modes/predict/#inference-arguments).
|