← All articles

document analysisobject detectioneducationdataset

Teaching computers to see the structure of an exam paper

A printed exam paper is full of structure that a person takes in at a glance: questions, answer choices, instructions. A computer looking at a scan sees only pixels. We built HiLEx, a collection of 1,965 exam-paper pages in which six kinds of region are marked by hand. Then we tested ten object detection models on it, to see how well they can find those regions.

The problem

Question papers often exist only in hard copy, and well-organised digital question banks are scarce. That makes it hard to pull the questions out automatically. The layouts vary. A page can have one column or several, with instructions and descriptions sitting inside it. On multi-column pages these are often a single line of text squeezed between other sections.

The field that studies this is called document layout analysis: finding the parts of a page and working out what role each one plays. Datasets such as PubLayNet, DocBank, DocLayNet and M6Doc have pushed it forward, but none of them annotates the question and answer structure of an exam page. Even M6Doc, which includes images of test papers, labels standard layout elements instead.

What is in HiLEx

We took pages from eight exams: GMAT, SAT, GRE, GATE, UGC-NET, BANK, JEE and UPSC. Most questions are multiple-choice, though some papers, such as UGC-NET and UPSC, also have descriptive and analytical questions. We used official previous-year papers and free mock exams that are publicly available online, and turned the relevant pages into images. GATE contributes the most pages, 668, and UPSC the fewest, 36 (Table 1).

Each page is labelled with boxes of six kinds. The whole printed area is the Question_Paper_Area. Inside it sit Question_Answer_Blocks, each holding a Question_Block, which is the problem statement, and an Answer_Block, which holds the answer choices or a pre-filled solution. Instruction boxes carry guidelines for the exam or for a set of questions. Description boxes carry explanatory text about an answer.

Two schematic pages, one single-column and one two-column, with coloured boxes nested inside each other and arrows naming the six region types.
The labels are nested like boxes inside boxes, for a single-column page on the left and a two-column page on the right.Source: Fig. 1 of the paper.

Three expert annotators did the labelling in Roboflow, over two months. They first practised on 10 sample papers. Each also labelled the same 100 shared pages, so that we could measure how well they agreed, using a score called Cohen's kappa. We set the bar at 0.90. The annotations come in two common formats, YOLO and COCO, and the dataset is public on GitHub.

Two annotated exam pages, a single-column page with explanations and a two-column UGC NET page, with coloured rectangles around each region and a colour legend.
Hand-made labels on a single-column page and on a crowded two-column page. Notice how small and tightly packed the answer boxes get.Source: Fig. 2 of the paper.

How we tested it

We trained ten models from four families. The one-stage detectors, YOLOv8 to YOLOv12, predict all the boxes in a single pass through the network. DETR and RT-DETR are transformer-based. They use self-attention, which lets every part of the image be weighed against every other part. Detectron2 is a two-stage model that first proposes candidate regions and then refines them. Florence-2 and PaLI-Gemma 2 are vision-language models, pretrained on images together with text.

Each model trained for 25 epochs with a batch size of 16, on an NVIDIA A100 GPU. We kept 10% of the pages for testing and split the rest 80:20 into training and validation. The test set has 199 pages with 1,918 labelled regions (Table 3). The main score is mAP50. Roughly, a predicted box counts as a hit if it overlaps the true box enough, and the score averages over the classes. The stricter mAP50-95 averages over overlap thresholds from 0.50 to 0.95.

What we found

Large regions are easy. YOLOv8 finds the Question_Paper_Area with an mAP50 of 0.984 (Table 3). Small, rare regions are hard. The test pages hold only 56 Description regions, and the YOLO models reach 0.478 at best on them, with YOLOv12 as low as 0.104 (Table 3). DETR managed 0.071 (Table 4).

Bar chart of mAP50 for five YOLO versions across the six region classes. All versions score high on large regions and low on Description.
Every YOLO version does well on big blocks and badly on Description. YOLOv12 has the lowest bars on Description and Instruction.Source: Fig. 4(b) of the paper.

Over all classes, Detectron2 is the best model in our study, with an mAP50 of 0.940 and an mAP50-95 of 0.673 (Table 5). We attribute this to its region proposal network, and we conclude that two-stage models remain the most effective for fine-grained layout understanding. Among the YOLO versions, YOLOv8 has the highest mAP50, 0.848, with YOLOv11 second at 0.822, and YOLOv11 has the highest mAP50-95, 0.689 (Table 3). The vision-language models score 0.835 for PaLI-Gemma 2 and 0.810 for Florence-2 (Table 6). The transformer-based detectors score 0.606 for RT-DETR and 0.502 for DETR (Table 4), and we found them to perform worst overall.

Detectron2 reached an mAP50 of 0.940 (Table 5). In our conclusion, Detectron2 performs best, followed by YOLOv11 and PaLI-Gemma 2.

Looking at the mistakes, we saw two patterns. Some models, among them DETR, Detectron2 and YOLOv12, draw redundant, overlapping boxes. Others, among them YOLOv9 and YOLOv11, miss Instruction and Description regions altogether.

Results in more detail

The paper gives one big table for each family of models. Here are the ones that show the most. Table 3 gives the mAP50 of each YOLO version for every region type. Each row is one kind of region and each column is one model. The row called All is the score over all six region types.

mAP50 of the five YOLO versions on the HiLEx test set, by region type
ClassYOLOv8YOLOv9YOLOv10YOLOv11YOLOv12
All0.8480.8180.7430.8220.685
Answer_Block0.9220.9150.8560.9150.847
Description0.4780.3750.2430.4240.104
Instruction0.8560.7900.6660.8180.537
Question_Answer_Block0.9470.9400.9030.9270.873
Question_Block0.9030.9090.8330.8860.771
Question_Paper_Area0.9840.9790.9560.9640.978
Higher is better. The test set has 199 pages. The Image, Instance, Precision, Recall and mAP50-95 columns of Table 3 are left out here. Source: Table 3 of the paper.

Large regions score high for every version: Question_Paper_Area is at 0.956 or higher, while Description ranges from 0.104 to 0.478 (Table 3). In the All row YOLOv8 has the highest mAP50. The other metrics tell a slightly different story. YOLOv11 has the highest precision in that row, 0.866 against 0.766 for YOLOv8, which means fewer false alarms. YOLOv8 has the higher recall, 0.840 against 0.752, which means it finds more of the true regions (Table 3). We suggest that YOLOv11's refinements explain its precision, and that YOLOv8's features are more sensitive to subtle patterns, at the price of more false detections.

The two transformer-based detectors are compared in Table 4. RT-DETR has the higher mAP50 over all classes, 0.606 against 0.502, and it does better on Instruction regions. DETR does better at fine localisation of Question_Answer_Block regions, with an mAP50-95 of 0.557 against 0.526. Both do poorly on Description, with a precision of 0.157 for DETR and 0.270 for RT-DETR (Table 4). We link the differences to how each model is built: DETR matches boxes one-to-one, which struggles with the dense structure of documents.

DETR and RT-DETR on the HiLEx test set, by region type
ClassDETR precisionDETR mAP50DETR mAP50-95RT-DETR precisionRT-DETR mAP50RT-DETR mAP50-95
All0.4070.5020.3500.6780.6060.448
Answer_Block0.3760.5680.3190.5650.6250.386
Description0.1570.0710.0440.2700.1180.073
Instruction0.3340.3680.2830.5750.6130.471
Question_Answer_Block0.6140.7630.5570.9250.6990.526
Question_Block0.3440.3940.1670.7970.6570.468
Question_Paper_Area0.6180.8500.7310.9330.9230.761
Higher is better. The Image, Instance and Recall columns of Table 4 are left out here. Source: Table 4 of the paper.

Detectron2, the two-stage model, reached an mAP50 of 0.94 and an mAP50-95 of 0.673 over all classes, with a precision of 0.741 and a recall of 0.837 (Table 5). Its precision was highest on Question_Paper_Area, at 0.819, and lowest on Description, at 0.250. We blame the weak Description result on the region proposal network, which struggles with regions that lack clear boundaries, on how much Descriptions vary in position and format, and on the few examples.

Table 6 compares the two vision-language models. PaLI-Gemma 2 is ahead of Florence-2 across the main numbers in the All row: precision 0.790 against 0.740, recall 0.800 against 0.755 and mAP50 0.835 against 0.810. Both are weakest on Description (Table 6).

Florence-2 and PaLI-Gemma 2 on the HiLEx test set, by region type
ClassFlorence-2 precisionFlorence-2 recallFlorence-2 mAP50PaLI-Gemma2 precisionPaLI-Gemma2 recallPaLI-Gemma2 mAP50
All0.7400.7550.8100.7900.8000.835
Answer_Block0.7850.8200.8000.8250.8400.855
Description0.3500.1800.1500.4200.2500.220
Instruction0.6500.6700.6400.7100.7300.710
Question_Answer_Block0.8200.8500.8500.8500.8700.875
Question_Block0.7800.8000.7900.8000.8200.820
Question_Paper_Area0.8800.9000.9100.9000.9100.920
Higher is better. The Image, Instance and mAP50-95 columns of Table 6 are left out here. Source: Table 6 of the paper.

Discussion

We conclude that two-stage models remain the most effective for fine-grained layout understanding. Detectron2 had the highest mAP, which we credit to its region proposal network and its iterative refinement of boxes. In the paper's figures it is 0.092 above the best one-stage model, YOLOv8, and 0.105 above the best vision-language model, PaLI-Gemma 2. Among the YOLO versions, YOLOv8 is 0.163 mAP ahead of YOLOv12, which we attribute to its feature pyramid network and deeper backbone. PaLI-Gemma 2 detects layouts better than earlier YOLO versions, but its mAP is 0.013 lower than YOLOv8's, so it lacks the spatial precision that fine-grained work needs. DETR and RT-DETR trail, which we put down to their direct set prediction and its poor localisation of small objects.

Over-detection may come from overfitting or ambiguous features, and missed Instruction and Description regions lower recall. Layout variability and inconsistent annotation also make detection harder. Better model calibration, more training data and post-processing could raise accuracy.

HiLEx has limits that we state. We removed pages in other languages, so it is English only, and the questions come mostly from Indian national exams, plus GMAT, GRE and SAT. The dataset is unbalanced, as the page counts per exam show (Table 1), and Instruction and Description regions are rare. It holds page images and boxes, but not yet the text of the questions.

Next we plan to add OCR-based text annotations, so that models that read words and layout together, such as LayoutLMv3, TILT and DocFormer, can be tested. We also plan to add non-English and non-Indian exams, including East Asian, African and European ones, to explore hierarchical and diffusion-based approaches to layout segmentation, and to try vision-language pretraining that helps across layouts and languages. The longer-term aim is a pipeline ready for real use in education and assessment, supporting automated grading, question retrieval and exam digitisation.

Sources

The figures and tables listed here are taken from the paper cited at the top of this page; the numbers quoted in the text come from it too.

  • Figures: Fig. 1, Fig. 2, Fig. 4(b)
  • Tables: Table 1: number of question-paper pages from each exam; Table 3: results of the five YOLO versions, per class; Table 4: results of DETR and RT-DETR, per class; Table 5: results of Detectron2, per class; Table 6: results of Florence-2 and PaLI-Gemma 2, per class

Cite the paper

U Aich, S Chakraborty, D Sadhukhan, Swarnendu Ghosh, T Saha (2025). HiLEx: Image-Based Hierarchical Layout Extraction from Question Papers. Document Analysis and Recognition – ICDAR 2025, pp. 485–505 · Springer (LNCS).

BibTeX
@inproceedings{aich2025hilex,
  author    = {Aich, U and Chakraborty, S and Sadhukhan, D and Ghosh, Swarnendu and Saha, T},
  title     = {{HiLEx:} {Image-Based} Hierarchical Layout Extraction from Question Papers},
  booktitle = {Document Analysis and Recognition -- ICDAR 2025},
  pages     = {485--505},
  publisher = {Springer (LNCS)},
  year      = {2025},
  url       = {https://link.springer.com/chapter/10.1007/978-3-032-04627-7_28}
}