{
  "fetched_at": "2026-10-18T13:42:44Z",
  "source_url": "https://www.kaggle.com/competitions/dlsprint2/data",
  "pages": [
    {
      "name": "data-description",
      "content": "# BaDLAD\nThe Dataset paper is available at: https://arxiv.org/abs/2303.05325.\n\n# About the Dataset\nThe dataset for this competition comprises about 34,000 Bengali documents annotated using polygon boundaries and rectangular bounding boxes. These documents range from newspaper articles, official documents, notices, and government gadgets to novels, comics, magazines, and even liberation war records.\n\n\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F10747121%2F5174eee762e639cc95d3947559af144f%2FIMG_0052.png?generation=1687142796077441&alt=media\"  width=\"90%\" height=\"30%\">\n\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F10747121%2F326a661f994df5d01e0a697a1eeded42%2FIMG_0053.png?generation=1687142841349263&alt=media\"  width=\"90%\" height=\"30%\">\n\n\nThe annotations specify the regions in these documents that fall into 4 classes - \n- Paragraph\n- Text Box\n- Image\n- Table\n\nYour task is to design a deep learning pipeline that takes in a document image (`.png`) and predicts bounding polygon segments (masks) for each occurrence of the classes mentioned above in the input image. \n\n# Data Details\nThere are 20,365 training and 13,000 test images. The `train` and `test` images can be found in in `badlad/images/` directory, whereas the labels for the `train` dataset can be found in `badlad/labels/` directory. \n\n## Train\n\nTraining set images are in `badlad/images/train`. \n\nThe `train` images have `labels` corresponding to them. For your convenience, we provide 2 forms of labels:\n1. **COCO Format**: `badlad/labels/coco_format/train` \n    The COCO format labels are in `badlad-train-coco.json` file. This `JSON` file has some notable fields:\n   1. `categories`: Maps instance categories to their assigned IDs. \n   2. `images`: Maps image IDs (`id`) to their hashed name, height, and width. \n    For example,\n\n        | ImageId | Width | Height | ImageFile | FilePath |\n        | ------- | ----- | ------ | --------- | -------- |\n        | 0 | 720 | 995 | `846df66a-610e-4356-b369-6788885a0dc5.png` | `badlad/images/train/846df66a-610e-4356-b369-6788885a0dc5.png` |\n    \n   3. `annotations`: This is a list of the polygon bounding segments for each instance of the categories occurring in each image. The contents of this category are the crux of the problem:\n      - `segmentation`: Polygon `(x, y)` coordinate pairs of it's vertices. \nFor example, the first annotation has its first vertex at `(86.328, 179.007)`. The following pairs complete the polygon region of the annotation. \n      - `image_id`: The image this annotation is for. \n      - `category_id`: The category this annotation is bounding. It may be a paragraph, text box, image, or table. \n      - `id`: Annotation ID, identifies each annotation. \n      - `bbox`: The rectangular bounding box that best estimates the annotated region. \n    \n    This list holds all the annotations for each instance of the categories for all images. \n\n2. **YOLOv8 Format**: `badlad/labels/yolov8_format/train`\n    Each training image has its label as a text file of the same name in the mentioned directory. \n    For example,\n\n    | Image | Label |\n    | ----- | ----- |\n    | `badlad/images/train/846df66a-610e-4356-b369-6788885a0dc5.png` | `badlad/labels/yolov8_format/train/846df66a-610e-4356-b369-6788885a0dc5.txt` |\n\n    You can read more about the expected YOLOv8 data format [here](https://docs.ultralytics.com/datasets/segment/).\n\n## Test\n\nTest set images are in `badlad/images/test`. \n\nThe test set has no provided annotations. Your task is to learn the bounding polygon from the train set and predict it for the test set images. \n\nHowever, the test set does have metadata associated with each image. That metadata can be found in `badlad/test-metadata.json`. This `JSON` file consists of all the fields of the training labels *except the annotations*. \n\n# Predictions\n\nYour model should predict the masks for bounding polygons in each image. A mask is a 2D matrix corresponding to each input image pixel. The contents of each pixel position can be `0` or `1`. If the pixel position is marked `0`, then that position corresponds to the background category, no paragraph, text box, image, or table exists at that pixel. This mask is called a **binary mask** because of its content. Each prediction category (paragraph, text box, image, table) has a binary mask for each image. For example, image `846df66a-610e-4356-b369-6788885a0dc5.png` has 4 binary masks, for each existing category - that predict where in the image, that specific category occurs. \n\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F10747121%2F54232aef9b0ceab41a33f8113cd0600e%2F__results___71_0.png?generation=1687185171344197&alt=media\" height=\"80%\" width=\"80%\"/>\n\n# Cite the Paper\n\n```\n@article{shihab2023badlad,\n  title={BaDLAD: A Large Multi-Domain Bengali Document Layout Analysis Dataset},\n  author={Shihab, Md Istiak Hossain and Hasan, Md Rakibul and Emon, Mahfuzur Rahman and Hossen, Syed Mobassir and Ansary, Md Nazmuddoha and Ahmed, Intesur and Rakib, Fazle Rabbi and Dhruvo, Shahriar Elahi and Dip, Souhardya Saha and Pavel, Akib Hasan and others},\n  journal={arXiv preprint arXiv:2303.05325},\n  year={2023}\n}\n```",
      "isPublished": false,
      "hasIsPublished": false,
      "postTitle": "",
      "hasPostTitle": false,
      "mimeType": "",
      "hasMimeType": false
    },
    {
      "name": "Description",
      "content": "Bengali is the fifth most spoken of all native languages worldwide. After completing the month-long signature Deep Learning competition on Bengali Automatic Speech Recognition (ASR) last year, we at the **Department of Computer Science and Engineering, BUET** now focus on another computational challenge. This year again, in partnership with **Bengali.AI**, we welcome participants to attend the **DL Sprint 2.0** and play around with the first multi-domain large **Bengali Document Layout Analysis Dataset: BaDLAD**, as a part of **BUET CSE Fest 2023.**\n\nFor training the model, we will use a subset of the BaDLAD dataset contributed by our co-host, Bengali.AI. The details of the dataset can be found [in this paper](https://arxiv.org/abs/2303.05325)\n\n***This competition is open to all, not only for undergraduates. Anyone from any institution can participate.***\n***However, in the spirit of fairness, all students from BUET CSE18 (the organizing batch) are disallowed from participating.***\n\n## How to Participate\n\nRegistration link: https://forms.gle/FffwUxn3huKYBjhZ8. **Anyone can join this competition. However, registration is mandatory to be eligible for prizes.**\n\nFacebook event link: [DL Sprint 2.0](https://www.facebook.com/events/1882607365439555)\n\n## Competition Schedule\nPhase 1: Will be held in Kaggle from 18th June to 5th August (11:59 PM GMT+6). Participants are expected to build and train their models during this phase. The top 15 teams from this round will be selected for Phase 2.\nPhase 2: Will be held onsite at the Department of CSE, BUET, on 11th August (tentative). Only invited participants can participate. Participants will present their methods live in front of the judges’ panel.\n\n**Important**\nAll teams will submit working Kaggle notebooks for Train and Test with appropriate instructions and documentation for reproducibility after Phase 1. **Test(/Inference) notebook must run on Kaggle Notebooks (with any accelerator).**\n\n## Scoring\n**50% Weight on Phase-1**\n<ul>\n<li>15% public DICE</li>\n<li>35% private DICE</li>\n</ul>\n\n**50% Weight on Phase-2**\n<ul>\n<li>25% mAP </li>\n<li>20% Judge and Presentation (Explainability, Reproducibility)</li>\n<li>5% Inference Speed</li>\n</ul>\n\n\n## Acknowledgements\nWe thank BJIT for sponsoring BUET CSE Fest 2023 and Bengali.AI for co-hosting the DL Sprint 2.0 event with technical support.",
      "isPublished": false,
      "hasIsPublished": false,
      "postTitle": "",
      "hasPostTitle": false,
      "mimeType": "",
      "hasMimeType": false
    },
    {
      "name": "Evaluation",
      "content": "# Prediction\n\nYour model should predict the masks for **segmentation** bounding polygons in each image. \n\nA mask is a 2D matrix corresponding to each pixel of the input image. The contents of each pixel position can be `0` or `1`. If the pixel position is marked `0`, then that position corresponds to the background category, no paragraph, text box, image, or table exists at that pixel. This mask is called a **binary mask** because of its content. \n\nEach prediction category (paragraph, text box, image, table) has a binary mask for each image. For example, image `846df66a-610e-4356-b369-6788885a0dc5.png` has 4 binary masks for each existing category - that predict where that specific category occurs in the image. \n\n*Bounding boxes play no role in the evaluation for this competition.*\n\n# Run Length Encoding (RLE) of Masks\n\nThe mask matrices become too big, considering the number of images you must predict. To compress the masks, we use RLE encoding. The function used for RLE conversion is the following:\n\n```python\ndef rle_encode(mask: np.ndarray) -> str:\n    # flatten the mask column wise\n    pixels = mask.T.flatten()\n\n    # pad the list of pixels to ensure they have leading and trailing 0\n    use_padding = False\n    if pixels[0] or pixels[-1]:\n        use_padding = True\n        pixel_padded = np.zeros([len(pixels) + 2], dtype=pixels.dtype)\n        pixel_padded[1:-1] = pixels\n        pixels = pixel_padded\n\n    # get the pixel indices where consecutive pixels don't match => binary masks begin or end\n    # +1 to convert to inclusive start indices, exclusive end indices of masks\n    # +1 to convert to 1-indexed pixel ordering\n    rle = np.where(pixels[1:] != pixels[:-1])[0] + 2\n    if use_padding:\n        rle = rle - 1  # remove the extra offset introduced by padding\n\n    # end pixel indices of masks - start pixel indices of masks = length of RLE runs\n    # store the RLE run lengths replacing the end pixel indices \n    rle[1::2] = rle[1::2] - rle[:-1:2]\n    \n    return ' '.join(str(x) for x in rle)\n```\n\nYou can read about the RLE encoding format [here](https://www.kaggle.com/code/leahscherschel/run-length-encoding). *(NB: The explanation in the link uses RLE encoding in a 0-indexed grid, but the function above uses a 1-indexed grid. You are advised to use the 1-indexed implementation above to match the ground truth.)*\n\n# Submission Format\n\nYou will submit a `CSV` file for each image, and each category. Your `submission.csv` will contain 2 columns: `Id` and `Predicted`. \n1. `Id`: This column will be composed of each `image_id`, and each `category_id` for that image. They will be concatenated in the form `<image_id>_<category_id>`. \n2. `Predicted`: This will contain the RLE encoded mask for each image category. \n\nYou have a sample submission (`sample_subimssion.csv`) available in the dataset. \n\n**All teams will submit working Kaggle notebooks for Train and Test with appropriate instructions and documentation for reproducibility to verify the authenticity of the solution.**\n\n# Evaluation Metric: Dice Score\n ![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F10747121%2F93d164345ff828b16e609c96f64d6791%2Fdice.png?generation=1687102960736961&alt=media)",
      "isPublished": false,
      "hasIsPublished": false,
      "postTitle": "",
      "hasPostTitle": false,
      "mimeType": "",
      "hasMimeType": false
    },
    {
      "name": "rules",
      "content": "**Registration link:** https://forms.gle/FffwUxn3huKYBjhZ8. Registration is mandatory to participate in all the phases of the contest.\n\n- **Only one account per participant in Kaggle will be allowed.**\n- **All teams will submit working Kaggle notebooks for Train and Test with appropriate instructions and documentation for reproducibility after Phase 1. Test Notebook must run on Kaggle Notebooks (with any accelerator)**\n- Publicly available pre-trained models are allowed, and the participants must disclose the data used to pre-train the models.\n**Team guidelines:**\nTeams must follow these guidelines to qualify for Phase 2.\n\n- The maximum team size is 4.\n- In a team, there can be a maximum of 2 people who have completed their undergrad.\n- For overseas participants, a minimum of 1 person should be present in Bangladesh during the Phase 2 round.\n- A majority of team members must belong to the 19/20/21 batch from BUET to qualify for the BUET Rising Team prize.\n- Teams can merge only in Phase 1.\n- No private code sharing outside teams.\n\n**Evaluation:**\nRefer to the Overview Section.\n\n**Competition Data:**\n- **DATA ACCESS AND USE:** Competition Use, Academic Use, and Non-Commercial Use.\n\n**General Rules**\n- The participants must only use open source code licensed under an Open Source Initiative-approved license (see www.opensource.org) that in no event limits commercial use of such code or model containing or depending on such code.\n- Winner license: The winners will grant the competition hosts and sponsors the following license:\nYou hereby license and will license your winning submission and the source code used to generate the submission under an Open Source Initiative-approved license (see www.opensource.org) that in no event limits commercial use of such code or model containing or depending on such code. For generally commercially available software that you used to generate the submission that is not owned by you but that can be procured by the Competition Sponsor without undue expense, you do not need to grant the license in the preceding sentence for that software. You must also make your solution public.\n- The Competition hosts and sponsors and its affiliates may use your name and likeness for advertising and promotional purposes without additional compensation unless prohibited by law.\n- You warrant that your submission is your own original work and, as such, you are the sole and exclusive owner and rights holder of the submission, and you have the right to make the submission and grant all required licenses. To the maximum extent permitted by law, you indemnify and agree to keep indemnified Competition Entities at all times from and against any liability, claims, demands, losses, damages, costs, and expenses resulting from any of your acts, defaults or omissions and/or a breach of any warranty set forth herein.\n- The DL Sprint Organizing Committee reserves the right to cancel or postpone the event for any reason.\nThe organizers serve the right to disqualify any team.\n- Winners will be selected at the sole discretion of the DL Sprint Organizing Committee. All participants must conform to the terms and conditions. The DL Sprint Organizing Committee’s decisions in this regard will be final, and no queries or appeals thereof will be entertained.",
      "isPublished": false,
      "hasIsPublished": false,
      "postTitle": "",
      "hasPostTitle": false,
      "mimeType": "",
      "hasMimeType": false
    }
  ]
}