A Method and System for Image Analysis of Error-Collecting Questions Based on Document Scanners

By acquiring images with a high-speed document scanner and performing segmentation and semantic association, a clean question stem image is generated, which solves the problem that existing technologies cannot automatically distinguish between printed question stems and handwritten answers, and achieves high-precision error judgment and knowledge point mapping.

CN122049930BActive Publication Date: 2026-06-30SHENZHEN ELOAM TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN ELOAM TECH CO LTD
Filing Date
2026-04-16
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Existing technologies cannot accurately distinguish between printed questions and handwritten answers. Error identification relies on manual marking, and they are inaccurate in handling complex question types and mathematical formulas. They lack automated identification capabilities and are not stable or accurate enough under different lighting conditions and writing habits.

Method used

Images are captured using a high-speed document scanner, and the acquisition quality is assessed and standardized. The system segments students' handwritten answers, printed question stems, and mathematical structure masks, detects marking symbols and establishes semantic associations, generates risk maps and clean question stem maps, and achieves automatic error judgment and knowledge point mapping.

Benefits of technology

It achieves precise differentiation between question stems and answers, protects the integrity of mathematical structures, automatically identifies incorrect questions and completes knowledge point mapping, thus improving the accuracy and stability of incorrect question identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122049930B_ABST
    Figure CN122049930B_ABST
Patent Text Reader

Abstract

This invention discloses a method and system for analyzing images of incorrect answers based on a document scanner, belonging to the field of image recognition technology. The method includes the following steps: generating student handwritten answers, printed question stems, and protective masks for mathematical structures through image acquisition, three-layer segmentation, and structural line detection; simultaneously detecting correction symbols and performing semantic association; generating a risk map and cleaning the question stem image; and storing various images and indicators in layers to achieve automatic analysis and precise management of incorrect answers. This invention, through three-layer segmentation and structural line detection, achieves accurate identification of student answer areas, distinguishes between question stems, handwritten answers, and correction symbols, protects the question stem and mathematical formula structure, and supports automatic error judgment for complex question types. It solves the problems of existing technologies that only identify the overall answer area, cannot distinguish between question stems, handwritten answers, and correction symbols, have insufficient protection for question stems, rely on manual marking for error judgment, and are inaccurate in handling complex question types and mathematical formulas.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image recognition technology, and in particular to a method and system for analyzing images of incorrect questions collected using a document scanner. Background Technology

[0002] With the continuous advancement of educational informatization, the demand for digital management and intelligent analysis of student assignments and exam papers is growing, especially in error management and personalized review, which places higher demands on the accurate acquisition and intelligent analysis of exam paper information. Traditional manual error compilation is not only time-consuming and labor-intensive but also easily affected by subjective factors, making it difficult to achieve real-time monitoring and quantitative analysis of students' knowledge mastery. To meet this need, image acquisition technology and OCR (Optical Character Recognition) technology are increasingly being applied in educational scenarios to automatically acquire images of student exam papers, recognize printed questions and handwritten answers, and combine algorithms for error statistics, error step location, and knowledge point mapping analysis. Through these technologies, educational management systems can quickly generate structured error databases, automatically extract students' weak knowledge points, provide teachers and students with personalized review suggestions and practice strategies, and provide data support for educational evaluation, teaching improvement, and learning outcome tracking. The development of error collection and analysis not only improves the efficiency and accuracy of assignment processing but also provides fundamental technical support for intelligent educational services.

[0003] Existing systems provide basic data support for student error management and personalized review by acquiring test paper images, recognizing questions and answers, identifying incorrect answers, and annotating knowledge points. However, existing solutions still have significant limitations in key areas. While some solutions can categorize questions and knowledge points through intelligent image acquisition and deep learning, their core flaw lies in their complete reliance on users manually marking incorrect answers; the system itself lacks the ability to automatically determine the correctness of answers, resulting in insufficient intelligence. Other solutions, while using natural language processing to analyze the question meaning to generate standard answers and performing image-to-image matching for automatic judgment, face serious challenges in the reliability of standard answer generation, the accuracy of comparing complex handwritten answers, and the generalization ability of the technology. This makes it difficult to guarantee the accuracy and stability of the core automatic error judgment function in practical applications. Therefore, in the evolution of current systems from basic data support to high-reliability automated processing, a reliable technical solution is still lacking that can stably and accurately complete intelligent error judgment and deep structured analysis without manual pre-marking.

[0004] For example, Chinese invention patent CN111753616B discloses a method for collecting incorrect questions. The method includes: collecting image information of a test paper answered by a user; identifying the test questions included in the image information and analyzing the meaning of the test questions to determine the corresponding standard answers; identifying target test questions as incorrect questions from the test questions; wherein the user's answer to the target test question does not match the standard answer of the identified target test question; and storing the collected incorrect questions in a cache for the user to review.

[0005] For example, Chinese invention patent CN111753617B discloses a method for organizing incorrect question information, an electronic device, and a storage medium, including: when the electronic device is in the incorrect question information collection mode, adjusting the shooting angle of the image acquisition module of the electronic device so that the shooting area of ​​the image acquisition module includes the answer page; capturing a target image containing the answer page through the image acquisition module in a preset incorrect question recognition mode; analyzing the target image to obtain the incorrect question information contained in the target image, the incorrect question information including the incorrect question question and the knowledge point information corresponding to the incorrect question question; obtaining the category identifier corresponding to the knowledge point information from a pre-constructed incorrect question set; and associating the incorrect question information with the category identifier and storing it in the incorrect question set.

[0006] The above-mentioned technology has at least the following technical problems:

[0007] The above findings reveal that existing technologies still suffer from several limitations. They can only identify the entire area of ​​a student's answer, failing to distinguish between printed question stems, handwritten answers, and correction symbols. Question stem protection is insufficient, and error detection is imprecise, relying on manual user marking of incorrect answers and lacking automatic accuracy. Furthermore, for complex content processing, they only mention OCR and deep learning analysis, without addressing the challenges of mixing handwritten and printed text, or mathematical structures. Error detection accuracy is low, relying on NLP-generated answers or image-to-image matching, which fails with complex question types and handwritten text. Image-to-image matching is almost ineffective with complex handwriting and mathematical formulas. Moreover, the device lacks protection mechanisms for mathematical formulas, table lines, and structural elements, making it prone to accidental deletion of question stems and formulas during handwriting removal or image processing. In addition, existing technologies, in their evolution from basic data collection to high-accuracy, automated error detection, lack a feedback mechanism for real-time adjustment of data collection quality parameters, failing to guarantee the stability and accuracy of error detection results under different lighting, resolution, and writing habits. Summary of the Invention

[0008] To address the shortcomings of existing technologies, such as only recognizing the entire answer area, failing to distinguish between the question stem, handwritten answers, and correction symbols, insufficient protection of the question stem, reliance on manual marking for incorrect answer identification, and inaccurate handling of complex question types and mathematical formulas, this invention provides a method and system for analyzing incorrect question images based on a document scanner. The technical solution is as follows:

[0009] On the one hand, a method for analyzing error-collected images based on a document scanner is provided. This method is implemented using a document scanner and includes: acquiring original images using a document scanner, evaluating the acquisition quality of the original images to obtain acquisition quality indicators, standardizing the original images based on the evaluation results to obtain standardized images; performing pixel-level segmentation on the standardized images to obtain student handwritten answer masks, printed question stem masks, and mathematical structure masks; detecting correction symbols in the standardized images, and determining the semantic association between correction symbols and question stem or answer regions based on the overlap relationship between correction symbols and printed question stem masks and student handwritten answer masks; generating a risk map based on the detection results of student handwritten answer masks, printed question stem masks, mathematical structure protection masks, and correction symbols, and generating a clean question stem image that retains the question stem and mathematical structure based on the risk map; identifying and analyzing the question regions based on the clean question stem image to obtain question judgment results, and locating and mapping error-collected questions to knowledge points based on the question judgment results.

[0010] On the other hand, a system for analyzing images of incorrect answers based on a document scanner is provided. This system includes: an image acquisition module, a three-layer segmentation module, a grading symbol detection and semantic association module, a risk map and clean question stem image generation module, and an incorrect answer identification and location module. The image acquisition module is used to acquire original images using a document scanner, evaluate the acquisition quality of the original images to obtain acquisition quality indicators, and standardize the original images based on the evaluation results to obtain standardized images. The three-layer segmentation module is used to perform pixel-level segmentation on the standardized images to obtain student handwritten answer masks, printed question stem masks, and mathematical structure masks. The grading symbol detection and semantic association module... The module is divided into four parts: a linking module, which detects correction symbols in standardized images and determines the semantic association between correction symbols and the question stem or answer area based on the overlap between correction symbols and printed question stem masks and student handwritten answer masks; a risk map and clean question stem image generation module, which generates risk maps based on student handwritten answer masks, printed question stem masks, mathematical structure protection masks, and correction symbol detection results, and generates clean question stem images that retain the question stem and mathematical structure based on the risk maps; and a wrong question identification and location module, which identifies and analyzes question areas based on clean question stem images, obtains question judgment results, and locates wrong questions and maps knowledge points based on the question judgment results.

[0011] The beneficial effects of the technical solutions provided in the embodiments of the present invention include at least the following:

[0012] 1. The error-collecting image analysis method based on a document scanner provided by this invention obtains collection quality indicators by evaluating the collection quality of the original image and then performs standardization processing. It segments the student's handwritten answers, printed question stems, and mathematical structures at the pixel level, detects correction symbols and establishes their semantic association with the question stems and answers, generates a clean question stem image that retains the question stems and mathematical structures, and then identifies and analyzes the question area. This achieves accurate differentiation between question stems and answers, protects the integrity of question stems and mathematical structures, automatically identifies errors and completes knowledge point mapping. It thus overcomes the problems of inaccurate error identification, insufficient protection of question stems, difficulty in recognizing complex content, and low automation in existing technologies. It effectively solves the problems of reliance on manual annotation, inability to automatically recognize mixed handwritten and printed content, and low accuracy in error identification caused by interference from complex mathematical formulas and correction symbols in existing technologies.

[0013] 2. By detecting candidate line segments in standardized images and combining line width stability, edge smoothness, grayscale consistency, and alignment with printed text or table structures, candidate line segments are classified into mathematical formula lines, fraction lines, graphic structure lines, superscript / subscript connecting lines, or table lines. Their pixel areas are then incorporated into a mathematical structure protection mask. This preserves key mathematical structures and table areas during the generation of risk maps and clean question images, thereby achieving complete protection and high-precision recognition of complex mathematical formulas and table structures in image processing.

[0014] 3. After identifying and analyzing the question area based on the clean question stem image, a set of verification indicators is generated for the processing results, including question stem integrity, structural integrity, excessive erasure indicators, and color residue indicators. When potential risks exist, feedback is executed from both the acquisition end and the processing end in conjunction with the acquisition quality assessment results. At the same time, the question judgment results are corrected by combining the degree of overlap between the correction symbols and the student's handwritten answer mask. After the correction is completed, the wrong questions are located and knowledge points are mapped. The original image, standardized image, clean question stem image, student's handwritten answer mask, printed question stem mask, mathematical structure protection mask, acquisition quality assessment results, and verification indicator set are stored together to achieve multi-level risk control and precise correction of the question processing results, ensuring the integrity and accuracy of the question stem, mathematical structure, and answer content. This achieves highly stable and highly accurate automatic wrong question identification and knowledge point mapping. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0016] Figure 1 Flowchart of the error-collecting image analysis method based on a document scanner provided in this application embodiment;

[0017] Figure 2 This is a structural diagram of the error-collecting image analysis system based on a document scanner provided in an embodiment of this application.

[0018] Figure 3 An overall flowchart provided for embodiments of this application;

[0019] Figure 4 This is a schematic diagram of image processing provided for an embodiment of this application. Detailed Implementation

[0020] This application provides a method and system for analyzing images of incorrect questions based on a document scanner. It solves the problems in the prior art where only the answer area is identified as a whole, and the question stem, handwritten answer, and correction symbols cannot be distinguished. The question stem is not adequately protected, the judgment of incorrect questions relies on manual marking, and the handling of complex question types and mathematical formulas is inaccurate. Through image processing, it achieves the technical effects of accurately distinguishing the question stem, handwritten answer, and correction symbols, protecting the integrity of the question stem and mathematical structure, automatically judging incorrect questions, and realizing knowledge point mapping and high-precision error management.

[0021] The technical solution in this application aims to address the problems mentioned above, such as only recognizing the entire answer area, failing to distinguish between the question stem, handwritten answers, and correction symbols, insufficient protection of the question stem, reliance on manual marking for incorrect answer judgment, and inaccurate handling of complex question types and mathematical formulas. The overall approach is as follows:

[0022] This system generates handwritten student answers, printed question stems, and a protective mask for the mathematical structure through image acquisition, three-layer segmentation, and structural line detection. Simultaneously, it detects grading symbols and performs semantic association to generate risk maps and clean question stem maps. Various images and indicators are stored hierarchically, enabling automatic analysis and precise management of incorrect answers. This achieves the technical effects of accurately distinguishing question stems, handwritten answers, and grading symbols, protecting the integrity of question stems and mathematical structures, automatically identifying incorrect answers, and realizing knowledge point mapping and high-precision incorrect answer management. To better understand the above technical solution, a detailed explanation will be provided below with reference to the accompanying drawings and specific implementation methods.

[0023] like Figure 1 The diagram shown is a flowchart of a method for analyzing images of incorrect questions based on a document scanner, provided in an embodiment of this application. The method includes the following steps:

[0024] Embodiment 1 of this invention: Original exam paper images are acquired using a high-speed document scanner, and the acquisition quality is assessed. Based on the assessment results, the original images are standardized to obtain standardized images. Pixel-level segmentation is performed on the standardized images to generate student handwritten answer masks, printed question stem masks, and mathematical structure protection masks. The pixel confidence scores of each mask are output to achieve accurate differentiation between the question stem and answer areas. Grading symbols in the standardized images are detected, generating grading symbol masks and symbol category information. The degree of symbol association is calculated based on the overlap between the masks and the question stem or answer areas. This system enables automatic understanding of teacher marking marks; it generates a risk map based on student handwritten answer masks, printed question stem masks, mathematical structure protection masks, and marking symbol masks, dividing the exam paper into low-risk, medium-risk, and high-risk areas to identify error-prone areas; it performs fade-out and repair processing on the exam paper image based on the risk map to generate a clean question stem image, ensuring the integrity of the question stem and mathematical structure for reuse; based on the clean question stem image, it identifies and analyzes the question areas to obtain question judgment results, and uses this to locate incorrect questions and map knowledge points, achieving automated error analysis.

[0025] The above solution enables automated and high-precision collection and analysis of incorrect answers, ensuring the integrity of the question stem, handwritten answers, and mathematical structure. It automatically identifies teacher markings, identifies error-prone areas, generates a reusable, clean question bank image, and performs error location, knowledge point mapping, and data statistics. This system solves the problems of low efficiency, poor accuracy, scattered errors, and difficulty in reviewing traditional manual error compilation, providing technical support for students to focus on review, systematically master knowledge points, and improve learning efficiency.

[0026] like Figure 3 The diagram shown is an overall flowchart provided in an embodiment of this application. It describes how, after image acquisition, a quality assessment determines whether a retake is needed, followed by standardized preprocessing and three-layer segmentation to generate a clean image, and then error analysis and personalized review are conducted. Figure 4 The diagram shown is an image processing illustration provided in an embodiment of this application. It describes how, after image standardization preprocessing, a risk map is constructed through multi-feature classification and segmentation, a cleanliness map is generated, and the indicators are verified. Once the indicators are met, new parameters are generated. The processing flow of this method may include the following steps:

[0027] S1: The high-speed document scanner uses its built-in sensor to capture images of student exam papers, obtain information about the exam paper layout, and perform quantitative evaluation of the captured images to reflect the shooting quality of the exam papers, including sharpness, illumination uniformity, noise, moiré patterns, exposure level, and white balance deviation, providing a reliable input basis for subsequent image standardization, segmentation, and cleaning processes.

[0028] In this embodiment, to make the embodiment easier to understand, the overall system data is defined as follows:

[0029]

[0030] Among them, I raw These are the original images, and the data is collected by a document scanner and permanently stored. For standardized images; M w Masks for students' handwritten answers; M p For printing the title mask; M s A protective mask for mathematical structures; M m To correct symbol masks and symbol categories; I c To clean up the question stem diagram, so as to remove handwriting but retain structure and semantics; Q c To collect quality indicators; R map This is a risk diagram.

[0031] The test paper to be scanned is captured by the high-speed scanner sensor to generate the original image I. raw And record the acquisition quality index Q for each image. c The acquisition quality parameters included are: resolution index q c Light uniformity index q s Noise q n Moiré index q m Exposure index q e White balance offset index q w The calculation of the collected quality index parameters follows these steps:

[0032] The system denotes the original image as I. raw The system will display image I. raw The image is normalized to a fixed size H×W, where H represents the height of the original image and W represents the width of the original image, resulting in a normalized image I1. The system then converts I1 into a grayscale image I. g , where I g (p) represents the grayscale value of pixel p. The system will convert the grayscale image I... g Divide the block into a set of non-overlapping smaller blocks of a fixed block size bxb. Where b represents the side length of a single block when dividing the blocks, and each block B i It is a set of pixels, containing the grayscale values ​​of all pixels within a block; the total number of blocks N satisfies:

[0033] ,

[0034] The system denotes the total number of pixels in the entire image as A = H × W. In subsequent calculations, all metrics employing block-based statistics are treated with the same... The calculations are performed on the object; for all metrics that use global pixel statistics, the system uses the entire image. The calculation is performed on an object using pixels as the unit. The system-defined truncation function is as follows:

[0035] ,

[0036] Where x1 is the original value to be truncated.

[0037] Calculate the resolution index q c When using a gradient method based on the entire image pixels, in one embodiment, the system applies a gradient to the grayscale image I. g The system calculates the sharpness index for all pixels in the grayscale image I. g Applying the Laplacian operator yields the response map L, where L(p) represents the second-order gradient response value of pixel p. The system responds to all pixel values ​​{L(p) | p∈I} in the response map L. g Calculate the variance to obtain:

[0038] ,

[0039] Where Var() represents the variance calculated over all pixel values ​​in the entire image. When the image is sharper, the edges are more angular, causing a larger overall fluctuation in L(p), thus increasing q. c Larger; when the image is more blurred, the edges are smoothed, making q c Smaller.

[0040] Calculate the uniformity index of illumination Time based on {B i The system employs a block-based brightness statistics method to analyze the block set. The illumination uniformity is calculated for each pixel block. For each small block B... i The system processes the set of pixel grayscale values ​​{I} within this block. g (p)|p∈B i Calculate the block mean Standard deviation of the block And calculate the relative undulation r of the block. i :

[0041] ,

[0042] Where ε is a very small constant, usually taken as [1e] -6 ,1e -8 [, to prevent the denominator from being 0.]

[0043] The system calculates the average of the relative fluctuations of all N small blocks to obtain the global non-uniformity R:

[0044] ,

[0045] The system defines the illumination uniformity index as:

[0046] ,

[0047] A larger R value indicates greater grayscale fluctuation within the block, and more pronounced shadows or localized overexposure. The smaller; conversely The closer to 1, the more uniform the illumination.

[0048] Calculate noise index The system uses a smoothing front-to-back difference method based on the entire image pixels. The system processes the grayscale image I... g The system calculates noise metrics for all pixels in the grayscale image I. g (p) Applying Gaussian smoothing filter yields smoothed image I. s (p). The system calculates the difference ∆I(p) for each pixel p:

[0049] ,

[0050] And all pixel values ​​of the difference image ∆I {∆I(p)|p∈I g Calculate the standard deviation Std to obtain the noise amplitude η:

[0051] ,

[0052] The system defines the noise index as:

[0053] ,

[0054] Where a larger η is, the greater the difference fluctuation before and after smoothing, and the more obvious the noise, and thus q n Small; conversely, q n The closer the value is to 1, the weaker the noise. Calculate the moiré ripple index q. m The system uses the frequency domain high-frequency energy ratio method based on the spectral amplitude to analyze the grayscale image I. g The frequency domain representation is used to calculate the moiré index. The system calculates the moiré index for grayscale image I. g A two-dimensional discrete Fourier transform is performed to obtain the spectrum F(u, v), and the amplitude spectrum M(u, v) = |F(u, v)| is calculated. Here, u and v represent frequency coordinates, u represents the spatial frequency in the horizontal direction, and v represents the spatial frequency in the vertical direction. The system constructs a fixed high-frequency band region Ω in the frequency domain. h (This region is determined by the frequency radius range), and respectively for Ω h Summing the amplitude spectrum within the inner frequency domain and the full frequency domain yields the high-frequency proportion ρ:

[0055] ,

[0056] The system defines the moiré index as:

[0057] ,

[0058] The larger the value of ρ, the higher the proportion of high-frequency repetitive texture energy and the more obvious the moiré pattern, and thus q m The smaller q is; conversely, q m A value closer to 1 indicates a lower risk of moiré patterns. Calculate the exposure index q. e The system uses an extreme pixel ratio method based on the entire image's pixels. The system processes grayscale image I... g The system calculates the exposure index for all A pixels. Using fixed thresholds t1 and t2, the system statistically analyzes the proportions of underexposed and overexposed pixels. Both t1 and t2 are pre-set empirical grayscale thresholds based on the image's visual characteristics and are calculated adaptively without relying on the current image content. These thresholds are used to quickly calculate the proportion of pixels with extreme brightness, thereby generating the underexposed pixel proportion r1 and the overexposed pixel proportion r2.

[0059] ,

[0060] The system defines the exposure quality index as:

[0061] ,

[0062] The larger r1+r2 is, the more extremely dark or extremely bright pixels there are, and the more unreasonable the exposure is, thus q e The smaller q is; conversely, q e A value closer to 1 indicates a more reasonable exposure. Calculate the white balance shift index q. w The system uses a channel mean deviation method based on the pixels of the entire color image. The system calculates the white balance shift for all pixels in the normalized image I1. I1 is separated into three channels: R, G, and B, and the mean μ is calculated for all pixel values ​​in each channel. R μ G μ B The system calculates the relative deviation d of the channel mean:

[0063]

[0064] The white balance shift index is defined as:

[0065]

[0066] The larger the value of d, the greater the difference in the mean values ​​of the three channels and the more obvious the white balance shift, and thus q w The smaller q is; conversely, q w The closer to 1, the more stable the white balance.

[0067] S2: The threshold parameters for the acquired quality indicators include sharpness threshold, illumination uniformity threshold, noise threshold, moiré threshold, exposure threshold, and white balance shift threshold. Threshold settings follow these steps: First, acquire calibration samples under fixed acquisition conditions, including the document scanner model, resolution, depth of field, lens focal length, aperture, exposure time, gain, light source type and location, and installation angle, acquiring at least 500 images covering both normal and abnormal samples. Perform statistical analysis on the sample data, calculate the indicator distribution, initially determine the thresholds, and validate them on new samples. The classification accuracy should reach at least 93%.

[0068] Secondly, for each image, calculate the sharpness index, illumination uniformity index, noise index, moiré index, exposure index, and white balance shift index to ensure consistent calculation methods. Images with different bit depths need to be normalized to a uniform grayscale range. When resolution differences may affect the sharpness index, resolution must be unified or normalized. The moiré index adopts a fixed window and frequency sampling method, and the exposure category adopts a uniform definition of brightness, darkness, saturation, and pixel ratio to ensure that the thresholds are universal and do not drift.

[0069] The third step is to determine the threshold direction and gradient for each indicator. Sharpness and illumination uniformity are positive indicators; higher values ​​indicate better performance, while values ​​below the threshold indicate blurry images or uneven illumination. Noise and moiré are negative indicators; lower values ​​indicate better performance, while values ​​above the threshold indicate excessive noise or moiré. Exposure is maintained within a predetermined range to ensure adequate brightness. White balance shift is a negative indicator; lower values ​​indicate less color deviation, while values ​​exceeding the threshold indicate color cast.

[0070] The fourth step involves calculating candidate thresholds using data. The system extracts indicator values ​​from the samples or extracts candidate thresholds based on quantiles, and tests each one, statistically analyzing three scenarios: usable images being mistakenly identified as unusable, unusable images being mistakenly identified as usable, and unsupervised cases with unlabeled samples. The false interception rate of usable images must not exceed the business tolerance limit to ensure a lenient threshold; the false release rate of unusable images must not exceed the business tolerance limit to ensure a strict threshold. In the unsupervised case, positive indicators are selected with the lower percentile of the sample (10th to 20th) as the threshold, and negative indicators are selected with the upper percentile of the sample (80th to 90th). Finally, the threshold with the lowest overall false positive rate is selected as the final threshold.

[0071] The fifth step involves creating a multi-level threshold table, including acceptable, critical, and unacceptable thresholds. If the indicator reaches the acceptable threshold, the image is directly released. When the indicator is at the critical threshold, lightweight adjustment processing is triggered, including increasing or decreasing exposure by 5% to 10%, prompting the operator to check the light source when the light source brightness is below 10%, performing noise reduction when the noise indicator exceeds the threshold by 1 to 2 units, and performing frequency domain filtering when the moiré indicator exceeds the threshold by 1 to 2 units. The critical threshold is defined as an indicator deviating from the acceptable threshold by no more than 10% or an absolute change within the allowable range. Below the unacceptable threshold, the image is deemed unusable, triggering re-acquisition or forced parameter adjustment, including refocusing, adjusting exposure or gain by 15% to 30%, and replacing or rearranging the light source. After the initial threshold is completed, the false positive rate and re-acquisition rate are statistically analyzed using independent verification samples, and iterative adjustments are made until the business indicators are met. The final threshold table is bound to the document scanner parameters and light source configuration, and is only effective when the document scanner parameters and light source conditions are consistent. During actual data acquisition, the system automatically categorizes data based on the relationship between indicators and thresholds: acceptable levels are allowed, borderline levels trigger lightweight adjustments, and unacceptable levels trigger re-acquisition or forced adjustments. The final resolution indicator threshold T is then obtained. c Light uniformity index threshold T s Noise threshold T n Moiré index threshold T m Exposure index threshold T e White balance offset index threshold T w .

[0072] Example A: If q c >T c At this point, the original image has generally clear boundaries, but some areas exhibit low levels of blur. The system sharpens the image or enhances illumination, and re-acquires the image if necessary. Sharpening first applies inverse masking sharpening or Laplacian high-frequency enhancement to the original image to increase high-frequency edge features while maintaining low-frequency brightness. The sharpening amplitude is quantized as a 5% to 10% normalized image pixel gradient enhancement, matched to the image size and resolution to prevent excessive noise amplification. When the noise index exceeds a threshold of 1 to 2 units, non-local mean denoising, bilateral filtering, or guided filtering are performed first, reducing noise by 10% to 20% before sharpening. After processing, the sharpness index is recalculated. If q c ≈T c If this happens, the user will be prompted to stabilize the acquisition device or reacquire the image, and the image will be marked as critical. If q c <T cAt times, the image is blurry overall, and the handwriting and edges of the question cannot be clearly identified. The system prompts the user to stabilize the paper and the document camera, increase lighting, increase shutter speed, or enable image stabilization. At the same time, it performs pixel gradient enhancement of 5% to 10% sharpening and contrast enhancement of 5% to 15%. When multi-frame acquisition is supported, 3 to 5 images can be captured continuously, aligned and superimposed, and the image with the highest clarity can be selected for output.

[0073] Example B: If q s >T s At this point, the overall brightness of the paper is uniform without localized shadows, and it can directly proceed to standardized processing, including perspective correction, cropping, size standardization, and contrast normalization, with adjustments ranging from 5% to 10%. If q s ≈T s When the local brightness deviation is 1% to 5%, the system performs local illumination correction or background illumination field estimation, applies wide-kernel Gaussian filtering or large-kernel mean filtering to the grayscale image to smooth small-scale textures, preserves the illumination change trend, and then performs contrast normalization adjustment of 5% to 10%. If q s <T s If the local brightness deviation is greater than 5%, the system will perform strong light correction and local contrast enhancement by 15% to 25%, while prompting the user to adjust the light source direction, increase the uniformity of the light source, and flatten the test paper.

[0074] Example C: If q n <T n If the ISO value is too high, it indicates that the original image contains high noise, and the ISO causes severe graininess on the paper surface, affecting handwriting segmentation. The document scanner should prompt you to lower the ISO or enable strong noise reduction filtering during the standardization process of the original image to reduce noise by more than 30%. If q n ≈T n If the original image shows noise and slightly grainy paper texture, noise reduction filtering can be enabled during the standardization stage to reduce noise by 10% to 20%, using an edge-preserving noise reduction method. If q n >T n If the original image has low noise, a clean paper surface, and clear paper texture, it can be directly processed into standardization.

[0075] If q m <T m At that time, moiré interference was obvious. The algorithm performed strong filtering and prompted the user to adjust the shooting distance by no more than 5% of the image height, the shooting angle by no more than 3 degrees, the focus by no more than 0.5 mm, and the light source uniformity to preserve the details of the problem. If q m ≈T m If the original image shows moiré patterns, or if the printed lines on the roll show wavy lines, this can be addressed by wavelet filtering or frequency domain Notch filtering, or by downsampling to reduce moiré interference by 10% to 20%. If qm >T m If the original image has no moiré pattern, the roll surface is clearly photographed, and the printing texture does not interfere, the original image can be directly processed into standardization.

[0076] Example D: If q e <T e If abnormal exposure causes handwriting or the text to be lost, the system will first correct the exposure by 10% to 15%, then perform contrast normalization by 5% to 10% to ensure the text is clear and legible. If q e ≈T e If the original image is slightly underexposed, with some areas of the image slightly darker or brighter, this indicates that the original image can be adjusted during the illumination correction stage, with an increase or decrease of ±10%. If q e >T e If the original image is properly exposed, the brightness of the roll surface is moderate, and the printed text is clear in contrast to the paper surface, then the original image can be directly processed into standardization.

[0077] Example E: If q w <T w At that time, the color deviation of the paper surface was significant. The algorithm enhanced the white balance and combined it with illumination correction, while prompting the user to adjust the light source or re-acquire the image. If q w ≈T w When the color deviation of the paper surface is within 3%, the system selects the background area of ​​the paper, calculates the average value of the red, green, and blue channels, adjusts the gain to make the background close to neutral gray, and simultaneously performs local illumination correction to ensure that the brightness deviation is increased or decreased by 10%. If q w >T w At this time, the image colors are normal and can be directly standardized.

[0078] In summary, through the judgment and processing strategies of various indicator thresholds, I... raw Geometric correction, illumination correction, color correction, sharpening, denoising, multi-frame fusion, and moiré suppression are performed. The adjustments to all acquisition quality parameters are based on industrial experience and visual effect experiments. After all processing is complete, a standardized image I is generated. n This is used for subsequent symbol recognition and error analysis tasks.

[0079] The examples above clearly demonstrate that the quality of the captured test paper directly impacts the accuracy of subsequent image processing and error analysis. After calculating and comparing various image quality indicators with thresholds, the system determines any abnormalities in the original image. When any indicator exceeds a preset threshold, the image is marked as abnormal. In case of an anomaly, a processing level and parameter configuration template (Profile) is generated. This Profile controls the intensity and strategy of subsequent image processing, executes processing based on image quality levels, and enables automated and quantitative decision-making. Simultaneously, shooting suggestions or capture hints are generated to guide on-site operations. When all indicators are normal, the Profile uses the default values ​​and has no capture hints.

[0080] As the examples illustrate, threshold judgment allows for the grading of acquired images based on different quality issues. Images with low-risk or good quality indicators directly enter the image standardization process. Standardization parameters are adjusted at boundary conditions, such as enhancing sharpness, adjusting illumination, or denoising. If the quality indicators exceed the threshold, a re-shoot or optimization of the acquisition environment is prompted. Therefore, this method not only quantifies the acquisition quality indicators but also provides a feedforward adjustment mechanism, ensuring the system can stably and efficiently generate processable images (I) even with low-cost hardware. n This provides reliable input for triple segmentation, symbol recognition, and error analysis. For each frame I... raw Calculate all acquisition quality metrics. This method quantifies the quality of each acquired image frame, automatically determines processing strategies, and provides on-site prompts, ensuring standardized image quality. n It can generate stably while reducing the probability of retakes or misprocessing.

[0081] S3: Based on the standardized image I in S2 n Perform three-class segmentation: handwritten text, question stem, and mathematical structure. First, standardize the image I. n Feature extraction is performed.

[0082] Where x and y represent the horizontal and vertical coordinates of the pixel in the image; fc(x, y) is the feature vector of the image at the pixel position (x, y), used to represent the color and brightness information of that pixel; R(x, y), G(x, y), and B(x, y) are the red, green, and blue channel values ​​of the pixel in the RGB color space, respectively; L(x, y), a(x, y), and b(x, y) are the brightness (L) and color composition (a represents green to red, b represents blue to yellow) of the pixel in the Lab color space, respectively. For the standardized image I... n Each pixel is defined by the formula:

[0083] ,

[0084] A 6-dimensional feature vector is obtained by combining the RGB and Lab information of a pixel. Then, RGB+Lab is used to enhance color discrimination and extract color features, resulting in a 2D feature vector f that combines the gradient intensity and local feature information of a pixel. g (x, y):

[0085] ,

[0086] This allows for the extraction of texture and gradient features, where |∇I(x,y)| represents the Sobel and Scharr gradient intensities, and G1(x,y) is a local gradient direction histogram (HOG-like feature) used to enhance stroke direction information. Furthermore, f... s (x, y) = P s The (x, y) formula extracts prior structural features, where f s (x, y) is the feature vector of the image at pixel position (x, y), used to describe the structural information of that pixel; P s (x, y) represents the structural feature value of the pixel, such as local structural indicators like texture mode, edge direction, and corner intensity.

[0087] For the printed layer, regions with high prior probability are the question stem, tables, and formula rows. For grading symbols, during image analysis, specific color and brightness feature regions surrounding the answer area are defined as candidate regions with high prior probability. Specifically, these regions include blank areas with pixel brightness greater than 90% located around the answer area, and areas with pixel red or blue channel saturation exceeding 80%. These thresholds are set based on engineering experience and calibration sample analysis. Statistical analysis of actual exam paper images shows that when pixel brightness exceeds 90% or color channel saturation exceeds 80%, the area is usually the background of the answer area or a highly saturated color marker, which helps the algorithm accurately locate the answer area. By using these quantitative indicators as prior conditions, the accuracy of answer area detection can be improved, and the processing process can be reproducible and verifiable. Based on the above feature extraction steps, the total feature vector F(x, y) is obtained:

[0088] ,

[0089] This allows for the fusion of multiple prior features (color, gradient, and structure) on a pixel, resulting in a probability output rather than hard classification. This supports subsequent risk region processing. Furthermore, by combining prior constraints unique to educational scenarios (formatting rules, marking symbol positions), the probability of a pixel belonging to handwriting / question stem / mathematical structure is predicted for three-class probability estimation, yielding a three-dimensional feature vector P(x, y) composed of the handwriting / question stem / mathematical structure features of a single pixel.

[0090] ,

[0091] Where p p p represents the probability of printing the question stem, i.e., the pixel confidence level corresponding to the printed question stem mask; w p represents the probability of a student writing their answer by hand, i.e., the confidence level of the pixel corresponding to the student's handwritten answer mask; s0 This represents the probability of the mathematical structure, i.e., the pixel confidence level corresponding to the mathematical structure mask. The three confidence levels are first extracted from the pixel using multi-class visual features, then processed by a multi-feature perceptual classifier and a Softmax model to calculate the raw scores for the three classes. These scores are then uniformly converted into probability values ​​that sum to 1, resulting in p. p p w p s0 Three confidence levels.

[0092] Continue using the multi-feature perceptual classifier:

[0093] ,

[0094] Where W is the weight matrix, b is the bias, and σ uses softmax. Softmax is a commonly used activation function, primarily used in multi-class classification problems to transform the model's output vector into a probability distribution. Specifically, softmax maps each element of a real-valued vector through an exponential function and normalizes it to a value between 0 and 1, such that the sum of all elements is 1, thus representing the predicted probability for each class.

[0095] ,

[0096] Since handwriting and printing may overlap locally, gradient-guided smoothing avoids misidentifying printed lines as handwriting, thus introducing spatial consistency smoothing. This applies local smoothing and structural consistency constraints to the multi-feature perceptual classifier. Similar to the above operation, the classification probabilities p(i,j) of a pixel's neighboring pixels are obtained, and then a weighted average is used to obtain the smoothed classification probability.

[0097] ,

[0098] in This represents the smoothed or weighted classification probability of an image at pixel location (x, y), used to improve classification results by incorporating local information within the pixel's neighborhood; i is the row coordinate of a pixel in the neighborhood; j is the column coordinate of a pixel in the neighborhood; (i, j) ∈ N(x, y) represents the set of neighboring pixels of pixel (x, y), such as a 3×3 or 5×5 neighborhood; w i,jThe weighted coefficient representing the classification probability of neighboring pixel (i, j) to (x, y) is calculated based on distance, similarity, or a Gaussian kernel; p(i, j) represents the classification probability of neighboring pixel (i, j); according to the above formula, this is further used for noise reduction or enhancing local consistency, suitable for handwritten answers, printed questions, or other pixel classification tasks. Simultaneously, utilizing this smoothing operation, the probability vector P(x, y) = [p...] output from the original classifier can be obtained. p p w p s0 The smoothed classification probabilities were obtained respectively: The smoothed printing probability. This represents the smoothed handwritten probability. The probability is the smoothed mathematical structure. Finally, a mask M for the student's handwritten answer is generated. w ; Printing title mask M p Mathematical structure mask M s0 :

[0099] ,

[0100] ,

[0101] ,

[0102] in The probability threshold for printing. The probability threshold for handwritten input. This is the probability threshold for the mathematical structure. When... > When , pixel (x, y) is considered to belong to the printed area; when > When , pixel (x, y) is considered to belong to the handwritten area; when > At that time, the pixel (x, y) is considered to belong to the mathematical structure region.

[0103] S4: Because fraction bars, square roots, superscript / subscript lines, and table lines in math problems are easily mistakenly deleted during handwriting removal, the semantic meaning of the question stem may be lost, leading to errors in subsequent optical character recognition and knowledge point mapping. Therefore, it is necessary to mask the mathematical structures M. s0 As a hard protective layer, it is preserved. Given the complex symbol systems in mathematical scenarios, OCR handwriting removal algorithms are prone to interfering with fraction lines, square roots, and subscript / superscript structures. To prevent false positives, a refined mathematical structure protection mask needs to be generated to ensure these critical structures remain intact during the handwriting removal process. According to I... n and M pAfter obtaining the pixel confidence scores corresponding to the printed question stem mask, the student's handwritten answer mask, and the mathematical structure mask, the generation of the mathematical structure protection mask adopts a posterior refinement process of adaptive thresholding and line segment-level constraints to simultaneously control structural line breaks and noise misjudgments. First, a candidate structure region is constructed through grayscale consistency. This region consists of the intersection of the set of pixels whose pixel confidence scores corresponding to the mathematical structure mask are not less than 0.60 and the neighborhood buffer of the printed question stem mask. The buffer radius is calculated by multiplying the shorter side length of the image by 0.006 and rounding, limiting it to a range of 5 to 15 pixels. Then, quantile statistics are performed on the distribution of the mathematical structure probability map within the candidate structure region. The structure threshold is set to the 85th percentile of the mathematical structure probability map within this region, and the initial structure mask is obtained accordingly. Pixels in the initial structure mask must simultaneously satisfy the conditions of being located in the candidate structure region and having a mathematical structure probability map value not less than the threshold. The specific values ​​are derived from engineering experience.

[0104] By combining edge smoothing, topology repair and noise suppression are performed on the initial structural mask to improve connectivity and geometric consistency. Specifically, the connected component skeleton of the mask is broken and connected, with the connection condition limited to the Euclidean distance between the endpoints not exceeding 2 pixels. At the same time, connected components with a skeleton length of less than 5 pixels are deleted, and the remaining skeleton is backfilled according to the backfill radius to restore the coverage of the structural lines. The backfill radius is the image short side length multiplied by 0.0008 and rounded to the nearest whole number, and is limited to the range of 1 to 2 pixels.

[0105] After topology refinement, segment-level consistency verification is performed on structural lines to distinguish them from handwritten lines and constrain the mathematical structure morphology. Based on the alignment with printed text or table structures, segment extraction employs a segment detector or Hough line transform. Retained segments must simultaneously meet the following conditions: the line fitting residual does not exceed 2 pixels; the horizontal deviation of suspected fraction lines or table horizontal lines does not exceed 5 degrees; the vertical deviation of suspected table vertical lines does not exceed 5 degrees; the alignment offset with printed text lines or table grids does not exceed 3 pixels; and the length constraints are: candidate fraction line segments are no less than 20 pixels long, and candidate table boundary line segments are no less than 30 pixels long.

[0106] For the square root structure, additional constraints are required: the tilt direction of the square root segment is limited to between 35 and 55 degrees, and its horizontal extension length is no less than 15 pixels. Pixels corresponding to line segments that do not satisfy any of the above constraints are removed from the final mathematical structure protective mask, while pixels of line segments that satisfy all constraints are retained to generate M. s It is used for the protection of high-risk areas and the generation of clean question stem diagrams in subsequent handwritten removal processing.

[0107] This step makes M sThis technology elevates the protective mask to a high-precision, structurally intact, and noise-controllable state. Through topology repair and break connection, it ensures the continuity of structural lines, reducing breaks caused by image noise, weak local lines, or acquisition jitter. Specifically, based on linewidth stability, backfilling the linewidth maintains the coverage of the original structural lines, ensuring the integrity of mathematical symbols, thus improving the integrity of the structural lines. Adaptive thresholds are set according to the probability distribution of structural candidate regions, preventing weak lines from being misjudged as handwriting and reducing the probability of noisy pixels being included in structural lines. Segment-level geometric constraints ensure that only genuine printed or mathematical structural lines are retained, eliminating handwritten marks or noise interference, thereby reducing the risk of misjudgment. Segment-level verification and combination constraints ensure that the spatial relationships of mathematical formulas, fraction lines, square roots, and table lines conform to the expected layout rules, reducing damage to key structures during handwriting or symbol removal and ensuring the accuracy of downstream OCR and knowledge point mapping, thus maintaining geometric and topological consistency. Quantifiable parameters such as pixel length, angle deviation, and offset range make the mask generation process repeatable and adjustable, enabling adaptive processing of original images with different resolutions and qualities. Finally, improve mask accuracy and controllability.

[0108] S5: Correction symbols are identified through a separate object detection module. Object detection models such as YOLOv8, the accelerated region-based convolutional neural network Faster-RCNN, or the lightweight mobile network with single-shot multi-border object detection model MobileNet-SSD automatically identify the symbol's category, location, and confidence level, generating symbol M. m and symbol category information; subsequently, in the step of associating symbols with the question stem and answer, for each symbol s i Calculate the pixel overlap index O(S) between the image and the question stem and the answer mask. i (X):

[0109] ,

[0110] s i Represents the i-th pixel sub-region or the segmented candidate region; |s i | Represents region s i The total number of pixels; X is the target mask, where if there are manually annotated handwritten or printed areas, X is a known target mask used to evaluate the algorithm's performance; if there are no manually annotated areas, the binary mask output by the model is used as X, so X is the target mask generated by the algorithm, used for candidate region selection or further processing.

[0111] At this time, when O(s) i M w When O(s) > θ, the marking symbol is associated with the answer area, and the symbol marks the student's answer for determining whether a question is wrong or correct; when O(s) > θ, the marking symbol is associated with the answer area, and the symbol marks the student's answer for determining whether a question is wrong or correct. i Mp When the value of the correction symbol is greater than θ, it is determined that the symbol is associated with the question stem. The symbol may circle the question stem, indicate the key points, or provide a hint, thus transforming the symbol from pure pixel information into usable semantics, providing a basis for subsequent error analysis and cleanup. Here, θ is a decimal between [0, 1], representing the overlap ratio threshold between the symbol mask and the target mask. For example, when θ = 0.5, the symbol is considered valid when the overlap area exceeds 50%; when θ = 0.3, the symbol is considered valid when the overlap area exceeds 30%. The adjustment of θ is determined based on quantitative indicators, such as the image sharpness index q. c When the value is greater than 0.8, increase θ by 0.05 to 0.1 from the base value of 0.5; when the symbol mask area is less than 100 pixels, decrease θ by 0.05 to 0.1 from the base value of 0.5; further optimize θ on a large number of samples to maximize recognition accuracy and recall. After setting θ, construct the risk map R. map (x, y).

[0112] ,

[0113] Where w1, w2, and w3 are weighting coefficients for different masks or overlapping regions, w1 corresponds to the weight of the handwritten and printed overlapping region, w2 corresponds to the weight of the marking and printed overlapping region, and w3 corresponds to the weight of the structure or other candidate regions. The first term in the formula reflects the risk of accidental deletion when handwritten text covers the question stem, the second term reflects the high protection priority when correction symbols cover the question stem, and the third term ensures the complete protection of important structures such as mathematical structure lines and table lines. Based on this risk map, the system divides the page pixels into three regions during the generation of the clean question stem image: a low-risk area (also called the faded processing area), a high-risk area (also called the image restoration area), and a structural protection area. This effectively handles the overlap between handwritten and printed content and avoids the loss of edge information caused by hard mask intersections. Finally, a clean question stem image I is generated based on the three layers of masks. c According to the formula:

[0114] ,

[0115] Among them, I c To clean up the question stem image, it removes interference from student handwriting or correction symbols, while preserving the question stem and structure; α is the fading coefficient, used to control the fading intensity of low-risk handwriting areas, and is generally taken in the range of [0.3, 0.7]. A mask for low-risk students' handwritten answers, indicating that students' handwritten or correction marks cover low-risk areas on the question stem, such as not overlapping with printed question stems and structural lines; This is a mask for handwritten answers from high-risk students, covering areas containing handwriting, correction symbols, or other marks that may be accidentally deleted. `inpaint` is an image restoration function used to reconstruct the background information of the covered high-risk areas, preventing accidental deletion of the answer key or structure.

[0116] The formula is divided into low-risk fade-out areas and high-risk image restoration areas. For the fade-out areas, the process is directly applied to the original image I. n The contrast of the handwriting is reduced without complete erasure, where α determines the intensity of the fade. For example, α=0.5 means that the brightness of the covered handwriting is reduced by half. This processing method is fast and avoids destroying the structure of the text, and is a commonly used low-risk method for removing handwritten handwriting in existing educational scanning systems. For image restoration areas, the text cannot be directly erased. Instead, existing image inpainting algorithms are used to reconstruct the covered background. For example, the Telea algorithm is suitable for fast restoration of small areas, or the Navier-Stokes algorithm, which maintains texture continuity and is suitable for areas with lines, graphics, or mathematical formulas, combined with M... p and M s This ensures that the question stem text and structural lines are not mistakenly repaired. The repaired results can be further combined with the question stem characters obtained from OCR. Text rewriting is only performed when it is ensured that the rewriting will not destroy the integrity of the original question stem information, nor introduce typos or formatting errors, to guarantee I c The integrity of the text is crucial. If characters overlap, recognition confidence is low, or the question stem contains complex structures such as formulas, tables, or special symbols, rewriting should be avoided to prevent information loss or error propagation. If rewriting fails, the location of the failure should be recorded, and the original image or text should be retained for manual verification or secondary processing. Simultaneously, multi-model fusion, confidence threshold filtering, or local redrawing strategies can be considered to improve the success rate.

[0117] S6: I generated based on S5 c For each question region M p Perform AI-powered automatic question answering (OCR + question parsing + model prediction) to obtain AI judgment result A. i Among them, A i Output A for the three-class classification of this problem. i ={correct, wrong, partial}. This can be represented as label A. i ∈{correct, wrong, partial}, or represented as a probability vector A i =[p1, p2, p3], where p1 is the probability that the model judges the question correctly, p2 is the probability that the model judges the question incorrectly, and p3 is the probability that the model judges the question partially correctly. The system then maps each incorrect question to a knowledge point, establishing a knowledge point base K. j :

[0118] ,

[0119] M for each question area p With A i By combining the weights of incorrect answers (e.g., 1 for an incorrect answer, 0.5 for a partially correct answer, and 0 for a completely correct answer), and summarizing the weights of students' incorrect answers for each knowledge point, a knowledge point statistical database K is obtained. j This corresponds to outputting the Top 10 most frequently missed knowledge points for each student, enabling personalized review. The data is then stored in a database for traceability, with the student ID, exam paper ID, page number, and question number linked to the data.

[0120] In summary, this embodiment provides an image processing method for a document scanner system for identifying incorrect answers. The system uses a built-in camera sensor to capture images of student exam papers, obtains paper information, and performs a quantitative assessment of the acquisition quality. Subsequently, it performs image standardization preprocessing, print and handwriting segmentation, mathematical structure protection, and identification and semantic association of correction symbols. A risk map is then constructed, and a clean question stem image is generated. Finally, it completes the identification of incorrect answers, knowledge point mapping, and process-based error analysis, and stores the relevant data in a database for retrieval and personalized question bank generation.

[0121] Example 2: Building upon Example 1, the paper image processing system adds feedback adjustment parameters. These are primarily applicable when closed-loop verification indicators fail to meet standards or when processing results pose potential risks. This ensures that question stems, mathematical formulas, table lines, and correction symbols are not mistakenly deleted or left behind during handwriting removal, symbol utilization, and cleaning processes. Simultaneously, correction symbols further assist in verifying the correctness of the AI's problem-solving, providing feedback to the AI. Using correction symbols as true labels, supervised fine-tuning + LoRA is used to correct pixel classification and problem-solving models; SAM fine-tuning is used to improve the accuracy of mathematical structure protection for the segmentation mask; and closed-loop iteration is achieved through knowledge distillation compression optimization. Regarding the image quality acquisition part, the system first verifies the processing results during the processing result verification stage... , , and Quantifiable indicators are calculated, and a set of verification indicators is added and generated. To detect whether the question stem has been corrupted, the system performs a weighted score on the integrity of the question stem, defining the question stem integrity score formula q0 as follows:

[0122] ,

[0123] in This represents the mean confidence score of the characters or words in the printed question stem OCR within the question stem mask. (Example: cropping outliers to...) To ensure stability, c k Let c be the confidence score of the k-th character or word. kBy applying an OCR tool, such as Tesseract, PaddleOCR, Baidu, or Tencent OCRAPI, to the printed question stem mask, a confidence score c is returned when recognizing each character or word. k ∈[0,1] indicates the probability or confidence level of the character being correctly recognized. The total number of characters in the question stem; The hit rate is the number of questions. The number of questions successfully identified, m, is obtained by combining OCR output with reproducible rules: The system first performs OCR on the question stem area or each line of text to obtain the character sequence and position. Then, it uses regular expressions or pattern matching rules, such as "1.", "(1)", etc., to identify the question numbers. It further checks whether the order of the identified question numbers conforms to the consecutive numbering rule. Only the question numbers that conform to the format and order are counted in m, which represents the number of question numbers that OCR actually successfully identified. The number of question numbers that should appear, M, is automatically estimated through image analysis. No question bank information is required. Common methods include taking the largest number among the question numbers identified by OCR as M, or counting the number of all candidates that conform to the question number pattern detected in the question stem area as M, which is used to represent the total number of question numbers that should appear in the current question stem or page. β∈[0,1] is the weight coefficient, which is used to adjust the relative influence of the average confidence and the hit rate of question numbers in different scenarios. The specific settings follow these guidelines: Based on empirical reference values, when the layout is fixed and the OCR confidence score for the question number is greater than or equal to 0.85, β is set to 0.2 to 0.4 to enhance the impact of question number constraints on scoring. When question numbers are prone to being missing or there is multi-column layout, β is set to 0.6 to 0.8 to enhance the impact of OCR confidence score on scoring. The specific value of β can be optimized on a manually annotated validation set by maximizing the F1 score or minimizing the false positive rate, and then fixed in the model or scoring system to ensure that the scoring results are reproducible and verifiable.

[0124] Structural integrity q s In M s The region is used to assess the continuity of mathematical formulas and table lines: for M s Perform binarization and skeletonization, then use Hough transform or line segment tracking algorithm to obtain the line segment set L, and define the breakage rate b1:

[0125] ,

[0126] Where gap_len represents the length of the gap caused by the discontinuity of consecutive pixels on a line segment in the same direction, total_len is the total length of the corresponding line segment, and let q s =1-clip(b, 0, 1), the clip function restricts the value to between zero and one. Values ​​outside the range will be automatically clipped, thereby ensuring the stability of the indicator and improving the reproducibility of the results.

[0127] Over-erasing index q e1 To determine whether a key area in the question stem has been mistakenly deleted: Count the number of connected components C before and after processing within the printed text mask of the question stem. b C a Define the false deletion rate e1:

[0128] ,

[0129] Let q again e1 =1-e1, In image processing, the index reflecting the integrity of connected components is defined as the value obtained by subtracting the connected component coverage after image processing from the connected component coverage of the original image. When the number of connected components after processing is reduced by 20% or more relative to the original image, it is considered that the number of connected components has been significantly reduced. This threshold is derived from engineering experience and calibration sample statistics. In actual experiments, it has been found that a connected component loss of more than 20% usually leads to the deletion of the question stem or key symbols. If the number of connected components is significantly reduced, a rollback or secondary processing operation is triggered, including restoring key regions in the initial image and re-segmenting connected components, while combining a region preservation strategy to ensure that the question stem and key symbols are not deleted. By using a 20% threshold for triggering, the processing process can be guaranteed to be reproducible, and the threshold can be further optimized on a manually labeled validation set to adapt to different image characteristics. This avoids deleting the question stem.

[0130] Color retention index q r In areas outside the question stem, calculate the proportion of high-chroma retention: Convert pixels to HSV (Hue, Saturation, Lightness) or Lab (Luminance, Red / Green, Blue / Yellow) color space, and calculate the retention proportion r:

[0131] ,

[0132] Where p is a pixel, τ c and τ v For fixed thresholds, these two thresholds are set through experience or statistical analysis. The chroma(p) chromaticity function represents the color intensity or saturation of a pixel, used to measure the purity of a color and reflect the degree to which a color deviates from grayscale. The value(p) luminance function represents the brightness or lightness of a pixel, used to distinguish the lightness and darkness of pixels in an image and reflect the characteristics of light intensity distribution. Let q be the total number of pixels in the region not specified in the question. r =1-clip(r, 0, 1) is used to measure whether red pen or highlighter has been completely removed. It is clearly calculable and verifiable.

[0133] The above indicators are based on OCR confidence, regularized question number matching, skeletonization + Hough line detection, connected component statistics, and color space threshold analysis, respectively, under the same input and parameter set (β, τ). c , τv The output is a unique mass vector Q. v = (q0, q s q e q r In the closed-loop adaptive feedback stage, the deviation ∆Q is calculated. v This is mapped to specific operable parameter adjustments or secondary processing strategies, such as enhancing or weakening the intensity of handwriting removal, adjusting the handwriting separation threshold, enabling structural line repair, or restoring the original image for manual review, thereby optimizing image processing accuracy and protecting critical structures. Simultaneously, new parameter indicators are updated based on the above adjustments, resulting in the adaptive adjustment formula:

[0134] ,

[0135] Among them, Profile new For the new processing level and parameter configuration template, this feedback adjustment mechanism achieves precise protection of question stems, mathematical formulas, tables and correction marks under low-cost high-speed document scanner shooting conditions through closed-loop iteration of index detection, parameter mapping, secondary processing and re-verification, thereby ensuring the readability of optical character recognition, structural integrity and the reliability of symbol recognition and error analysis.

[0136] Regarding the verification function aided by correction symbols, after symbol recognition and layered mask generation are completed in the paper image processing, the system converts the pixel information of the correction symbols into usable value information for error analysis, personalized review, and accuracy assessment. The error judgment method incorporates handwritten correction symbols from teachers: for each symbol s... j ∈M m , where s j This refers to independent correction symbols, with a confidence level of C. m θ1 is a set threshold used to determine the degree of overlap between the student's handwriting and the correction symbols, thereby calculating the overlap rate between sj and the student's answer mask:

[0137] ,

[0138] If O1(S) j M w )>θ1 and C m =× indicates that the step was incorrect. If O1(S j M w )>θ1 and C m =√ indicates that the step was corrected.

[0139] When there is low overlap or missing symbols, AI-based determination is used. This leads to a comprehensive determination formula:

[0140] ,

[0141] If E i If E = 1, then the question is incorrect. i If the value is 0, the question is considered correct.

[0142] Where f at For a weighted fusion function, the contributions of AI and grading symbols can be adjusted according to empirical weights, for example:

[0143] ,

[0144] Where θ high Representing a high threshold, θ indicates a high overlap between students' handwritten answers and correction symbols. low This represents a low threshold, indicating a low overlap between student symbols and correction symbols. Based on the above formula, the logical interpretation of the rule is as follows:

[0145] When the question itself is judged as incorrect (A) i =wrong and the symbol highly overlaps with the answer area O1(S) j M w )>θ high , indicates a complete error, E i =1, directly judged as an incorrect question. When question A is judged as incorrect... i =wrong and the symbol partially overlaps with the answer area O1(S) j M w )∈[θ low, θ high The symbol θ represents a vague area; instead of directly classifying it as an incorrect answer, it increases the AI's weight. This indicates that the symbol might indicate an error, but the overlap is insufficient for complete confirmation, requiring the AI ​​model to pay more attention to this area and increase its prediction weight. When the question is correct, or the overlap between the symbol and the answer area is less than θ, the AI ​​model will focus on this area and increase its prediction weight. low At that time, E i =0 indicates that the question is not considered wrong and represents other situations.

[0146] Finally, based on the weighted fusion function, through A i The determination result is the discrete label or probability vector and the correction symbol determination, which is achieved through E. i The final determination of whether student symbols match the grading annotations is obtained after merging, i.e., the updated version. Calculate the weight w for each incorrect question. i Furthermore, this is mapped to a knowledge point base, thereby generating a new knowledge point base. In this way, both grading symbols and AI judgments are taken into account, the knowledge point weights are more accurate, and a new knowledge point base is ultimately obtained. This enables closed-loop feedback regulation.

[0147] Finally, the system compiles the top 10 most frequently missed knowledge points for each student, providing a quantitative basis for personalized learning. Based on the combination of symbols and the location of handwritten answers, the system generates process-oriented error analysis, outputting the reason for the error, the incorrect steps, and the corresponding knowledge points for each question. This information is then compiled into a personalized question bank for students to use for targeted review. Ultimately, in the database storage and traceable archiving stage, the system establishes associations between the processing results and student identifiers, exam paper identifiers, page number identifiers, and question number identifiers. For example, it binds student ID, exam paper ID, page number, and question number. Simultaneously, failed or frequently missed samples are placed in a difficult example sample library for iterative training and model optimization, achieving a closed-loop learning mechanism where system accuracy continuously improves with training. This enables the entire process to achieve a closed-loop processing chain from symbol recognition to error analysis, knowledge point mapping, personalized question bank generation, and traceable archiving.

[0148] Therefore, this method relies on a document scanner-based image analysis system for collecting and analyzing incorrect questions to achieve closed-loop processing, such as... Figure 2 The diagram shows the structure of a document camera-based error-collecting and image analysis system. This system comprises five core modules: an image acquisition module, a three-layer segmentation module, a marking symbol detection and semantic association module, a risk map and clean question stem image generation module, and an error identification and location module. The image acquisition module completes image acquisition, quality assessment, and standardized preprocessing; the three-layer segmentation module generates student handwritten answer masks, printed question stem masks, and mathematical structure masks; the marking symbol detection module establishes semantic associations between marking symbols and regions; the risk map module outputs clean question stem images that retain key information; and the error identification module completes question judgment, error location, and knowledge point mapping. This system combines AI-generated problem-solving results with marking symbols to improve judgment accuracy and collects deviation data into a difficult example sample library for model iteration and optimization.

Claims

1. A method for analyzing images of incorrectly collected questions based on a document scanner, characterized in that: Includes the following steps: Original images are acquired using a high-speed document scanner, and the acquisition quality of the original images is evaluated to obtain acquisition quality indicators. Based on the evaluation results, the original images are standardized to obtain standardized images. The standardized image is segmented at the pixel level. Color features, gradient features, and structural prior features are extracted from the pixels in the standardized image. Based on the classification probability of each pixel belonging to the student's handwritten answer, the printed question stem, and the mathematical structure, and combined with local smoothness constraints and structural consistency constraints, student handwritten answer masks, printed question stem masks, and mathematical structure masks are generated. The correction symbols in the standardized image are detected, and the semantic association between the correction symbols and the printed question stem mask and the student's handwritten answer mask is determined based on the overlap relationship between the correction symbols and the question stem area or the answer area. Candidate line segments in the standardized image are detected, and the candidate line segments are classified as structural lines or handwritten lines by combining line width stability, edge smoothness, grayscale consistency, and alignment relationship between the candidate line segments and printed text or table structure. Pixel regions categorized as mathematical formula lines, fraction lines, graphic structure lines, superscript / subscript connecting lines, or table lines are included in the mathematical structure protection mask to preserve key structural regions during subsequent risk diagram generation and clean question stem diagram generation. A risk map is generated by detecting the results of student handwritten answer masks, printed question stem masks, mathematical structure protection masks, and correction symbols. Based on the risk map, a clean question stem map that retains the question stem and mathematical structure is generated. Based on the clean question stem diagram, the question area is identified and analyzed to obtain the question judgment result, and the wrong question is located and knowledge point is mapped according to the question judgment result.

2. The method for analyzing error-collected images based on a document scanner as described in claim 1, characterized in that, The quality assessment includes at least sharpness, illumination uniformity, noise, moiré, exposure level, and white balance deviation. Based on the acquisition quality assessment results, the original image is subjected to standardization processing, which includes at least one or more of geometric correction, illumination correction, color normalization, white balance correction, noise reduction, and moiré removal to obtain the standardized image.

3. The method for analyzing incorrect question images based on a document scanner as described in claim 2, characterized in that, Based on the comparison results between the acquired quality indicators and the corresponding thresholds, the original images are divided into qualified, critical, and unqualified categories. Specifically, the standardization process is directly performed on qualified images, the standardization process after parameter compensation is performed on critical images, and the standardization process is performed after triggering re-acquisition or adjusting the acquisition parameters for unqualified images. The parameter compensation includes at least one or more of the following: exposure adjustment, local illumination compensation, refocusing, white balance adjustment, and noise reduction intensity adjustment.

4. The method for analyzing error-collected images based on a document scanner as described in claim 2, characterized in that, When detecting correction symbols in the standardized image, the location, category, and confidence level of the correction symbols are generated, and the correction symbol detection results are generated. By calculating the degree of overlap between the area corresponding to the correction symbol and the printed question stem mask and the student's handwritten answer mask, the semantic association between the correction symbol and the question stem area or the answer area is determined. When the degree of overlap between the area corresponding to the correction symbol and the student's handwritten answer mask is greater than a preset threshold, it is determined that the correction symbol is associated with the answer area. When the overlap between the area corresponding to the correction symbol and the printed question mask is greater than a preset threshold, it is determined that the correction symbol is associated with the question area.

5. The method for analyzing incorrect question images based on a document scanner as described in claim 4, characterized in that, When generating the risk map, the potential risk of the printed question stem or mathematical structure being covered by handwritten handwriting or correction symbols in the paper area is assessed based on the student's handwritten answer mask, the printed question stem mask, the mathematical structure protection mask, and the correction symbol detection results. The faded processing area, image restoration area, and structure protection area are determined according to the assessment results. The structure protection area is determined by the area corresponding to the mathematical structure protection mask.

6. The method for analyzing incorrect question images based on a document scanner as described in claim 5, characterized in that, When generating a clean question image that retains the question stem and mathematical structure based on the risk map, handwritten marks or correction marks in the faded area are faded, and the area covering the printed question stem or mathematical structure in the image restoration area is image restored. The restoration boundary is constrained by the printed question stem mask and the mathematical structure protection mask. When the character recognition confidence level meets the preset threshold, the question stem characters are rewritten in the repaired local area.

7. The method for analyzing incorrect question images based on a document scanner as described in claim 6, characterized in that, After identifying and analyzing the question area based on the clean question stem image, the processing results are verified to generate a set of verification indicators. The set of verification indicators includes at least the question stem integrity, structural integrity, excessive erasure indicators, and color residue indicators. When the set of verification indicators indicates that there is a potential risk in the processing result, the collection end feedback and the processing end feedback are executed based on the collection quality assessment result and the set of verification indicators. The collection end feedback is used to trigger re-acquisition, refocusing, exposure adjustment, light source adjustment or white balance adjustment. The processing end feedback is used to adjust the fade intensity, segmentation threshold, repair parameters or risk map generation parameters and trigger secondary processing. Furthermore, after obtaining the question judgment result, the question judgment result is corrected by combining the degree of overlap between the correction symbol and the student's handwritten answer mask. Based on the corrected question judgment result, the wrong question is located and knowledge point is mapped. The original image, standardized image, clean question stem image, student's handwritten answer mask, printed question stem mask, mathematical structure protection mask, collection quality assessment results, and verification index set are stored together.

8. A system for analyzing images of incorrect questions collected using a document scanner, used to implement the method for analyzing images of incorrect questions collected using a document scanner as described in any one of claims 1-7, characterized in that, include: The module includes an image acquisition module, a three-layer segmentation module, a correction symbol detection and semantic association module, a risk map and clean question stem image generation module, and a wrong question identification and location module. The image acquisition module is used to acquire the original image using a high-speed scanner, evaluate the acquisition quality of the original image to obtain an acquisition quality index, and perform standardization processing on the original image based on the evaluation result to obtain a standardized image. The three-layer segmentation module is used to perform pixel-level segmentation on the standardized image to obtain a student handwritten answer mask, a printed question stem mask, and a mathematical structure mask. The correction symbol detection and semantic association module is used to detect correction symbols in the standardized image and determine the semantic association between the correction symbols and the question stem area or answer area based on the overlap relationship between the correction symbols and the printed question stem mask and the student's handwritten answer mask. The risk diagram and clean question stem diagram generation module is used to generate a risk diagram based on the student handwritten answer mask, printed question stem mask, mathematical structure protection mask and grading symbol detection results, and generate a clean question stem diagram that retains the question stem and mathematical structure based on the risk diagram; The error identification and location module is used to identify and analyze the question area based on the clean question stem image, obtain the question judgment result, and locate the error and map the knowledge point according to the question judgment result.