# Data augmentation FUNSD dataset & LayoutLMv3

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdata-augmentation-funsd-dataset-layoutlmv3%2F59519%3E%5C
**Category:** Beginners\
**Created:** [October 23, 2023, 7:20am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdata-augmentation-funsd-dataset-layoutlmv3%2F59519 "2023-10-23T07:20:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aghenghiu](https://avatars.discourse-cdn.com/v4/letter/a/5f9b8f/32.png) [@aghenghiu](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Faghenghiu)%5C
**Post date:** [October 23, 2023, 7:20am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdata-augmentation-funsd-dataset-layoutlmv3%2F59519%2F1 "2023-10-23T07:20:42Z")

</div>

Hi all,  
So, I just created my first LayoutLMv3 model for token classification over the FUNSD dataset. Now, I would like to fine tune it with my own version of FUNSD dataset. But, since the amout of documents is not big enough, data augmentation comes to mind.

I need some guidance on this topic. Sice text extraction from documents is a big part of this problem, I don’t think any kind of transformation over the original image is valid to obtain a new one (resizing, blurring, changing background colors, to name a few, could negatively impact on text extraction).

Is there any data augmentation technique that I could implement safely to get new valid data?

Greetings

---

<div class="post-metadata">

**Author:** ![aghenghiu](https://avatars.discourse-cdn.com/v4/letter/a/5f9b8f/32.png) [@aghenghiu](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Faghenghiu)%5C
**Post date:** [October 31, 2023, 12:31pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdata-augmentation-funsd-dataset-layoutlmv3%2F59519%2F2 "2023-10-31T12:31:19Z")

</div>

@nielsr is your answer [here](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdata-augmentation-for-image-vit-using-hugging-face%2F9750) aplicable in this specific scenario?

---

<div class="post-metadata">

**Author:** ![nielsr](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/nielsr/32/39617_2.png) [@nielsr](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fnielsr)%5C
**Post date:** [November 13, 2023, 10:44am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdata-augmentation-funsd-dataset-layoutlmv3%2F59519%2F3 "2023-11-13T10:44:56Z")

</div>

Hi,

No since the text to be extracted will change if you use things like random cropping or flipping.

For document AI, one typically applies augmentation like here: [https://github.com/facebookresearch/nougat/blob/f5d2cd525979e24c01c72fe223feff2eda555a0c/nougat/transforms.py](https://github.com/facebookresearch/nougat/blob/f5d2cd525979e24c01c72fe223feff2eda555a0c/nougat/transforms.py). Things like erosion, dilation, bitmap transformations (which preserve the content of the images).
