IP Library Granted Patent US 12,367,697
Granted Patent B2
US 12,367,697 · App. 18/129,155 · Granted Jul 22, 2025

Method and system for generating a data model for text extraction from documents

Inventors: Nupur Sumeet (Thane West, IN); Manoj Karunakaran Nambiar (Thane West, IN); Karan Rawat (New Delhi, IN)
Assignee: TATA CONSULTANCY SERVICES LIMITED
G06V30/1916G06N3/082G06V10/82G06V10/94G06V30/19147
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,367,697
App. No.
18/129,155
Granted
Jul 22, 2025
Kind
B2
Abstract

State of the art techniques used for document processing and particularly for handling processing of images for data extraction have the disadvantage that they have large computational load and memory footprint. The disclosure herein generally relates to text processing, and, more particularly, to a method and system for generating a data model for text extraction from documents. The system prunes a pretrained base model using a Lottery Ticket Hypothesis (LTH) algorithm, to generate a LTH pruned data model. The system further trims the LTH pruned data model to obtain a structured pruned data model, which involves discarding filters that have filter sparsity exceeding a threshold of filter sparsity. The structured pruned data model is then trained from a teacher model in a Knowledge Distillation algorithm, wherein a resultant data model obtained after training the structured pruned data model forms the data model for text detection.

Claims (74)

1. A processor implemented method of obtaining a data model for text detection, comprising:

obtaining, via one or more hardware processors, a) a training dataset, b) a test dataset, c) a pre-trained base model, d) a plurality of pre-trained weights, and e) an acceptable drop in accuracy with respect to the baseline model, as input;

pruning, via the one or more hardware processors, the pre-trained base model using a Lottery Ticket Hypothesis (LTH) algorithm to generate a LTH pruned data model;

trimming, via the one or more hardware processors, the LTH pruned data model to obtain a structured pruned data model, comprising iteratively performing till an accuracy drop of the structured pruned data model is below the acceptable drop in accuracy:

determining a filter sparsity of every filter of each of a plurality of layers of the LTH pruned data model;

comparing the determined filter sparsity with a threshold of filter sparsity;

discarding all filters for which the determined filter sparsity exceeds the threshold of filter sparsity, wherein discarding the filters causes structured pruning and a resulting data model after discarding the filters form the structured pruned data model;

fine-tuning the plurality of pre-trained weights by training the structured pruned data model for a pre-defined number of iterations;

determining the accuracy drop of the structured pruned data model based on the fine-tuned plurality of pre-trained weights; and

increasing a pruning rate affecting rate of the preliminary pruning of the LTH pruned data model, by a pre-defined percentage; and

training, via the one or more hardware processors, the structured pruned data model from a teacher model in a Knowledge Distillation algorithm, wherein a resultant data model obtained after training the structured pruned data model forms the data model for text detection.

2. The method of claim 1 , wherein discarding the filters comprises:

determining number of zeros in every layer of the LTH pruned data model;

determining zero percentage in every layer of the LTH pruned data model;

determining number of zeros in all layers having the determined zero percentage exceeding a threshold of zero percentage;

determining zero percentage of all filters in all the layers for which the determined number of zeros exceeds a threshold of zeros; and

discarding all filters for which the determined zero percentage exceeds the threshold of zero percentage, wherein the filters are discarded by setting corresponding non-zero weights to zero.

3. The method of claim 1 , wherein fine-tuning the plurality of pre-trained weights and determining the accuracy drop comprises;

initializing the structured pruned data model as a model to be trained;

fine-tuning the structured pruned data model in a plurality of iterations, based on a calculated training loss, to obtain a plurality of trained data models;

determining accuracy in terms of precision and recall, for each of the plurality of trained models, for a test data fed as input;

retraining a data model that has been identified as having highest accuracy from among the plurality of trained models;

determining accuracy drop of the retrained data model, for the test data fed as input; and

retraining the data model if the accuracy drop is exceeding a threshold of accuracy drop, in iterations, fill the accuracy drop is below the threshold of accuracy drop.

4. A system for obtaining a data model for text detection, comprising:

one or more hardware processors;

a communication interface; and

a memory storing a plurality of instructions, wherein the plurality of instructions when executed, cause the one or more hardware processors to:

obtain a) a training dataset, b) a test dataset, c) a pre-trained base model, d) a plurality of pre-trained weights, and e) an acceptable drop in accuracy with respect to the baseline model, as input;

prune the pre-trained base model using a Lottery Ticket Hypothesis (LTH) algorithm to generate a LTH pruned data model;

trim the LTH pruned data model to obtain a structured pruned data model, comprising iteratively performing till an accuracy drop of the structured pruned data model is below the acceptable drop in accuracy:

determining a filter sparsity of every filter of each of a plurality of layers of the LTH pruned data model;

comparing the determined filter sparsity with a threshold of filter sparsity;

discarding all filters for which the determined filter sparsity exceeds the threshold of filter sparsity, wherein discarding the filters causes structured pruning and a resulting data model after discarding the filters forms the structured pruned data model; fine-tuning the plurality of pre-trained weights by training the structured pruned data model for a pre-defined number of iterations;

determining the accuracy drop of the structured pruned data model based on the fine-tuned plurality of pre-trained weights; and

increasing a pruning rate affecting rate of the preliminary pruning of the LTH pruned data model, by a pre-defined percentage; and

train the structured pruned data model from a teacher model in a Knowledge Distillation algorithm, wherein a resultant data model obtained after training the structured pruned data model forms the data model for text detection.

5. The system as claimed in claim 4 , wherein the one or more hardware processors are configured to discard the filters by:

determining number of zeros in every layer of the structured pruned data model;

determining zero percentage in every layer of the structured pruned data model;

determining number of zeros in all layers having the determined zero percentage exceeding a threshold of zero percentage;

determining zero percentage of all filters in all the layers for which the determined number of zeros exceeds a threshold of zeros; and

discarding all filters for which the determined zero percentage exceeds the threshold of zero percentage, wherein the filters are discarded by setting corresponding non-zero weights to zero.

6. The system as claimed in claim 4 , wherein the one or more hardware processors are configured to fine-tune the plurality of pre-trained weights and determining the accuracy drop by:

initializing the structured pruned data model as a model to be trained;

fine-tuning the structured pruned data model in a plurality of iterations, based on a calculated training loss, to obtain a plurality of trained data models;

determining accuracy in terms of precision and recall, for each of the plurality of trained models, for a test data fed as input;

retraining a data model that has been identified as having highest accuracy from among the plurality of trained models;

determining accuracy drop of the retrained data model, for the test data fed as input; and

retraining the data model if the accuracy drop is exceeding a threshold of accuracy drop, in iterations, till the accuracy drop is below the threshold of accuracy drop.

7. One or more non-transitory machine-readable information storage mediums comprising one or more instructions which when executed by one or more hardware processors cause:

obtaining a) a training dataset, b) a test dataset, c) a pre-trained base model, d) a plurality of pre-trained weights, and e) an acceptable drop in accuracy with respect to the baseline model, as input;

pruning the pre-trained base model using a Lottery Ticket Hypothesis (LTH) algorithm to generate a LTH pruned data model;

trimming the LTH pruned data model to obtain a structured pruned data model, comprising iteratively performing till an accuracy drop of the structured pruned data model is below the acceptable drop in accuracy:

determining a filter sparsity of every filter of each of a plurality of layers of the LTH pruned data model;

comparing the determined filter sparsity with a threshold of filter sparsity;

discarding all filters for which the determined filter sparsity exceeds the threshold of filter sparsity, wherein discarding the filters causes structured pruning and a resulting data model after discarding the filters form the structured pruned data model;

fine-tuning the plurality of pre-trained weights by training the structured pruned data model for a pre-defined number of iterations;

determining the accuracy drop of the structured pruned data model based on the fine-tuned plurality of pre-trained weights; and

increasing a pruning rate affecting rate of the preliminary pruning of the LTH pruned data model, by a pre-defined percentage; and

training the structured pruned data model from a teacher model in a Knowledge Distillation algorithm, wherein a resultant data model obtained after training the structured pruned data model forms the data model for text detection.

8. The one or more non-transitory machine-readable information storage mediums of claim 7 , wherein discarding the filters comprises:

determining number of zeros in every layer of the LTH pruned data model;

determining zero percentage in every layer of the LTH pruned data model;

determining number of zeros in all layers having the determined zero percentage exceeding a threshold of zero percentage;

determining zero percentage of all filters in all the layers for which the determined number of zeros exceeds a threshold of zeros; and

discarding all filters for which the determined zero percentage exceeds the threshold of zero percentage, wherein the filters are discarded by setting corresponding nonzero weights to zero.

9. The one or more non-transitory machine-readable information storage mediums of claim 7 , wherein fine-tuning the plurality of pre-trained weights and determining the accuracy drop comprises:

initializing the structured pruned data model as a model to be trained;

fine-tuning the structured pruned data model in a plurality of iterations, based on a calculated training loss, to obtain a plurality of trained data models;

determining accuracy in terms of precision and recall, for each of the plurality of trained models, for a test data fed as input;

retraining a data model that has been identified as having highest accuracy from among the plurality of trained models;

determining accuracy drop of the retrained data model, for the test data fed as input; and

retraining the data model if the accuracy drop is exceeding a threshold of accuracy drop, in iterations, till the accuracy drop is below the threshold of accuracy drop.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 31, 2023
From: SUMEET, NUPUR; NAMBIAR, MANOJ KARUNAKARAN; RAWAT, KARAN
To: TATA CONSULTANCY SERVICES LIMITED
Reel/Frame 063183/0438 →
Priority Claims (1)
IN 202221028692 · May 18, 2022 · national
Continuity (1)
Related Publication 20240005686A1 · Jan 4, 2024
References Cited (6)
US 11200497B1 · Yan · 2021 [cited by examiner]
Iterative Structured Pruning, Zhao et al, Jan. 2022 (Year: 2022). [cited by examiner]
Chen et al., “Coarsening the Granularity: Towards Structurally Sparse Lottery Tickets,” (2022). [cited by applicant]
Ghimire et al., “A Survey on Efficient Convolutional Neural Networks and Hardware Acceleration,” Electronics, 11(945) (2022). [cited by applicant]
Pan et al., “Fine-tuning Pruned Networks with Linear Over-parameterization,” (2022). [cited by applicant]
Xia et al., “Structured Pruning Learns Compact and Accurate Models,” (2022). [cited by applicant]