Automatic paper marking method based on computer vision
Through the automatic marking method based on computer vision, the problems of subjectivity and inefficiency in manual marking are solved, and high-precision and low-cost scoring is achieved, which is suitable for large-scale examination environments.
Patent Information
- Application Number
- CN202510702671.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-28
- Publication Date
- 2025-09-09
AI Technical Summary
The existing manual marking technology has problems of subjectivity, misjudgment and low efficiency, and it is difficult to meet the needs of large-scale and high-precision scoring.
This automated grading method, based on computer vision, includes image acquisition and preprocessing, region identification and segmentation, semantic scoring of subjective questions, and a dual-scoring mechanism. Image acquisition involves grayscale conversion, binarization, and fuzzy detection. Region identification utilizes template parameters. Semantic scoring of subjective questions uses the BERT deep semantic encoding network to calculate semantic similarity. The dual-scoring mechanism combines algorithmic review and manual verification.
It improves the accuracy and efficiency of marking, reduces manual intervention, ensures the fairness and consistency of scoring results, and adapts to different exam types and question types.
Smart Images

Figure BDA0005424944650000041 
Figure BDA0005424944650000111 
Figure BDA0005424944650000133
Abstract
Description
Technical Field
[0001] The present invention relates to the field of teaching technology, and in particular to an automatic examination paper marking method based on computer vision. Background Art
[0002] In order to further tap the value of Zhongce Hi-Tech's existing data assets, promote the development of new quality productivity in the human resources service industry, and solve the problems of traditional marking methods due to low efficiency, high cost and strong subjectivity, which have been unable to meet the needs of large-scale and high-precision scoring, Zhongce Hi-Tech, relying on its profound industry experience and technical talent advantages, innovatively launched the Zhongce Zhiyuexing-AI marking system.
[0003] The existing manual marking is subject to subjectivity, misjudgment and low efficiency, the difficulty of the test questions is uneven, and the marking quality is uneven. These problems make the marking process less intuitive and convenient, and greatly increase the workload of the markers. Summary of the Invention
[0004] The purpose of the present invention is to solve the problems of subjectivity, misjudgment and low efficiency in manual marking in the prior art.
[0005] To achieve the above object, the present invention provides the following technical solutions:
[0006] The present invention provides an automatic marking method based on computer vision, comprising the following steps: S1, image acquisition and preprocessing: acquiring answer sheet images, performing image blur detection and correction identification through grayscale and binarization processing, and eliminating unclear images.
[0007] S2. Region identification and segmentation: Use template parameters to extract the answer area and accurately identify the location of different question types.
[0008] S3. Semantic scoring of subjective questions: Semantic recognition technology is used to calculate the semantic similarity between the answer sheet and the reference answer to judge the logic and rationality of the candidate's answer.
[0009] S4. Double scoring mechanism: After the initial automatic scoring, the algorithm will be reviewed again, and manual verification and scoring can be used to correct errors.
[0010] Furthermore, in step S1, image acquisition and preprocessing: the answer sheet image is acquired, and image blur detection and correction recognition and unclear image removal are performed through grayscale and binarization processing. The method is as follows: using an image acquisition device, a cursor reading device, a high-definition scanner or a mobile terminal device with a shooting function, the answer sheet filled in by the examinee is imaged to obtain the original image data.
[0011] Convert the collected original image into a grayscale image. The grayscale calculation formula is: L GRAY=0.299·R+0.587·G+B, where R, G, and B are the red, green, and blue channel pixels of the original color image, and L GRAY is the pixel value of the output grayscale image,
[0012] The grayscale image is further binarized to obtain a binary image. The binarization calculation formula is: Where T(x,y) is the local adaptive threshold, which is dynamically calculated by Gaussian weighted average based on the neighborhood image information around the pixel, and L binary (x, y) is the grayscale value of the original grayscale image at the pixel (x, y), 255 and 0 represent L binary (x, y) The final output binary image has two possible pixel values in (x, y), 255 represents white and 0 represents black.
[0013] The formula for blur detection on a binary image is: Among them, E sharp is the edge image obtained after the original image is binarized and edge extracted, E blurred The edge image is obtained by Gaussian blurring the original image and then extracting the edge. 1 is the sum of the absolute values of all elements in the matrix.
[0014] After blur detection, the angle deviation during scanning is corrected. The tilt angle correction formula is: where x i is the coordinate of the edge pixel point, θ is the tilt angle to be solved relative to the horizontal axis, ρ is the distance from the straight line to the image origin, δ is the impulse function,
[0015] The perspective correction formula is: Where (x, y) is the pixel coordinate in the original image, (x'y') is the pixel coordinate after correction, and a ij The affine transformation matrix parameters after solving the reference points.
[0016] 3. Furthermore, in step S2, the template parameters are used to extract the answer area and accurately identify the locations of different question types.
[0017] According to the template parameters pre-set by the system and matching the answer sheet format, the answer sheet styles of different test types are configured and switched. The template parameters are mapped to the actual image, and the coordinate frame is mapped to the corresponding area of the corrected actual image. The displacement elimination positioning formula is: region =T·C corrected , where T is the template matrix, specifically the pre-set template parameters, used to describe the standard position and size information of the question block area. The system completes image acquisition and preprocessing.
[0018] The image correction results are used to keep the answer sheet image and the template in spatial alignment. According to the coordinate and size information in the template parameters, the system automatically extracts the designated answer area in the image. The system identifies the overall question area framework and further divides the answer area according to the question type structure. The division formula is: Row i =y shart +i·Δ y , Col j =x start +j·Δ x , where Δ y is the spacing between rows in the question type area, Δ x The spacing between columns in the question type area, i and y represent the question number index, and the area is divided according to the row and column rules to adapt to batch question positioning.
[0019] The composite area determination is used to distinguish text and non-text areas, adapting to complex question types and identifying different question types. The area determination formula is:
[0020]
[0021] Among them, OCR (R SUB ) is the sub-region R Sub The text recognition confidence is , EdgeDensity is the ratio of edge pixels, and τ and β are the set empirical thresholds.
[0022] 4. Further, in step S3, the semantic scoring process for subjective questions uses semantic recognition technology to calculate the semantic similarity between the answer sheet and the reference answer to judge the logic and rationality of the candidate's answer. The method is:
[0023] The system establishes a standard answer corpus and uses the BERT deep semantic encoding network to semantically embed the candidate's answers with the standard answers, calculate the semantic similarity score between the two, and use the CLs tag output of the BERT model as the semantic vector of the text to compress answers of any length into a fixed dimension. The semantic vectorization calculation formula is: V answer =BERT CLS (T answer ), where T answer Represents the original text of the answer text input to BERT, BERT CLS Represents the processing of the input text by the BERT model, extracting the output vector corresponding to its cls tag, V answer Represented as the output fixed-length semantic vector,
[0024] The system performs handwriting recognition on subjective questions, using OCR technology to accurately convert images of examinees' handwritten answers into parseable text information. During the recognition process, the system uses a character training model to identify sloppy or non-standard handwriting, and uses the CTCLoss formula to handle characters with inconsistent input and output lengths:
[0025] Among them, x represents the input image feature sequence, y represents the target output label sequence, π represents the sum of all paths, B -1 (y) represents the set of all paths that can be mapped to the target sequence y, p(π|x) represents the probability of the model predicting the path π, and log p(y|x) represents the logarithm of the probability that the target text y appears in the image x, which is used for the recognition of unaligned character and image feature sequences.
[0026] The semantic similarity score between the candidate's answer vector and the standard answer vector is calculated using cosine similarity and other measurement methods. The calculation formula is: V1 and v2 are the semantic vectors of the candidate's answer and the standard answer respectively. The similarity score is used to measure the semantic closeness between the candidate's answer and the standard answer.
[0027] Logical judgment, the formula for determining the logical rationality of the similarity threshold is: Similarity represents the semantic similarity score between the candidate's answer and the standard answer, which is generally calculated by methods such as cosine similarity and ranges from [0,1]. high represents a high threshold, representing the standard of high semantic matching, θ low It represents the low threshold, which indicates the lower limit of the large semantic difference. KeywordScore represents the keyword score, which is used to further evaluate whether the answer covers the key concepts when the similarity is in the medium range.
[0028] 5. Further, in step S3, a dual scoring mechanism is implemented, where an algorithm review is conducted after the initial automatic scoring, with optional manual verification and score comparison. The error correction method is as follows: the system generates a preliminary scoring result for each subjective question of the examinee based on the semantic similarity score and question type characteristics, and the system starts the algorithm review process.
[0029] Generate a preliminary score through the fusion model, the fusion formula is: S p=W1·BERT_Similarity+w2·Keyphrase_Match+W3·Logic_Score, where w1, w2, and w3 represent dynamic weights, which are adjusted according to the question type. BERT_Similarity represents the cosine similarity of the semantic vectors between the candidate's answer and the standard answer. Keyphrase_Match represents the coverage of professional terms. Logic_Score represents the score of the logical structure of the answer based on the dependency syntax tree.
[0030] Through the scoring model strategy, the candidate's answers are analyzed and scored again. The formula for the review trigger condition is: Among them, s1 represents the predicted score given by the system or machine, s2 represents the manual score or reference score, δ represents the threshold of the relative score difference, and Trigger_Human indicates whether to trigger manual review.
[0031] Final score synthesis formula: Among them, s1 represents the system's automatic scoring, s2 represents the initial manual scoring, and s h Indicates manual review and scoring, Trigger_Human indicates whether manual review is triggered, S final Represents the final score value,
[0032] The system presents the examinee's answers, standard answers, initial scores, and review scores to the examiner, and also provides a summary of the AI scoring rationale or key analysis points for manual judgment and correction. The correction formula is: Among them, μ represents the learning rate, which controls the parameter update amplitude, s h -s p is the prediction error, Represents the model output parameter w i The gradient of the error guides the model learning, and the weight distribution on specific question types or scoring dimensions is close to the manual scoring standard.
[0033] Beneficial effects
[0034] Compared with the known public technology, the technical solution provided by the present invention has the following advantages:
[0035] Beneficial effects:
[0036] This invention significantly improves the ability to assess the clarity and correct the posture of answer sheet images through image preprocessing processes such as image grayscale conversion, local adaptive binarization, blur detection, and perspective correction. In particular, the introduction of calculation formulas for blurred edge detection and tilt angle correction allows the system to automatically correct and accurately extract image information even when faced with common issues such as inconsistent shooting angles and blurred images, ensuring the stable operation of subsequent recognition and scoring modules.
[0037] By incorporating the BERT deep semantic encoding model, this paper can perform high-dimensional semantic vectorization of test-takers' subjective answers and standard answers, and evaluate the logical rationality of the answers using a dual metric of cosine similarity and keyword coverage. This scoring mechanism, based on natural language semantic understanding, breaks through the limitations of traditional scoring based on keyword matching, more accurately identifying answers that are flexible in expression but correct in content, thereby improving the fairness and scientific nature of automatic scoring.
[0038] This invention incorporates a dual scoring and manual review mechanism. After the initial scoring process, the system automatically invokes multiple models for review based on scoring sensitivity intervals, and optionally initiates a manual verification process. The three-way scoring results are weighted and integrated according to pre-set weights. This mechanism ensures that even in cases of uncertainty or dispute regarding the accuracy of the automatic scoring, a more robust basis for judgment can be introduced, minimizing scoring bias and improving the credibility and consistency of the overall system scoring results. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 This is a flow chart of an automatic examination paper marking method based on computer vision according to the present invention. DETAILED DESCRIPTION
[0040] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0041] It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the numbers used in this manner are interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to these processes, methods, products, or apparatuses.
[0042] The present invention is described in further detail below with reference to the accompanying drawings:
[0043] Example:
[0044] like Figure 1As shown, a method for automatic examination paper marking based on computer vision is characterized by comprising:
[0045] S1. Image acquisition and preprocessing: Collect answer sheet images, perform image blur detection and correction through grayscale and binarization processing, and eliminate unclear images:
[0046] Furthermore, in step S1, image acquisition and preprocessing: the answer sheet image is acquired, and image blur detection and correction recognition and unclear image removal are performed through grayscale and binarization processing. The method is as follows: using an image acquisition device, a cursor reading device, a high-definition scanner or a mobile terminal device with a shooting function, the answer sheet filled in by the examinee is imaged to obtain the original image data.
[0047] Convert the collected original image into a grayscale image. The grayscale calculation formula is: L GRAY =0.299·R+0.587·G+B, where R, G, and B are the red, green, and blue channel pixels of the original color image, and L GRAY is the pixel value of the output grayscale image,
[0048] The grayscale image is further binarized to obtain a binary image. The binarization calculation formula is: Where T(x,y) is the local adaptive threshold, which is dynamically calculated by Gaussian weighted average based on the neighborhood image information around the pixel, and L binary (x, y) is the grayscale value of the original grayscale image at the pixel (x, y), 255 and 0 represent L binary (x, y) The final output binary image has two possible pixel values in (x, y), 255 represents white and 0 represents black.
[0049] The formula for blur detection on a binary image is: Among them, E sharp is the edge image obtained after the original image is binarized and edge extracted, E blurred The edge image is obtained by Gaussian blurring the original image and then extracting the edge. 1 is the sum of the absolute values of all elements in the matrix.
[0050] After blur detection, the angle deviation during scanning is corrected. The tilt angle correction formula is: where x i is the coordinate of the edge pixel point, θ is the tilt angle to be solved relative to the horizontal axis, ρ is the distance from the straight line to the image origin, δ is the impulse function,
[0051] The perspective correction formula is: Where (x, y) is the pixel coordinate in the original image, (x'y') is the pixel coordinate after correction, and a ijThe affine transformation matrix parameters after solving the reference points.
[0052] In this embodiment, an image acquisition device is used to capture the answer sheet and obtain the original image data. The original image is generally a color image or a grayscale image. The captured original image is then converted into a grayscale image for subsequent processing. On this basis, the grayscale image is further binarized to obtain a binary image containing only black and white pixels, which is convenient for image analysis operations such as edge extraction and region recognition. In order to ensure that the image quality meets the requirements of automatic recognition and scoring, blur detection is performed on the above-mentioned binary image. The system analyzes the image edge before and after blurring, calculates the change value of its foreground ratio, and compares this value with the preset blur threshold. If the detection result shows that the image is If the blurriness is greater than the set threshold, the image is judged as an unclear image and the system will automatically reject it, mark it as "image rejection", and prompt manual review and manual marking to ensure the accuracy of the marking results. After the blur detection is completed, the system also performs correction operations on the image, mainly including rotation correction, tilt correction and scale correction, to ensure that the answer sheet image can be accurately aligned with the template position in the subsequent area segmentation and question type recognition process, thereby improving the recognition accuracy and the overall scoring efficiency of the system. Through the above-mentioned image acquisition and preprocessing steps, the system can effectively improve image quality, reduce recognition errors caused by image blur or offset, and lay an accurate and reliable foundation for subsequent answer area recognition and scoring processing.
[0053] S2. Region Identification and Segmentation: Using template parameters, extract the answer area and accurately identify the location of different question types:
[0054] Furthermore, the method of using template parameters to extract the answer area and accurately identify the location of different question types is as follows:
[0055] According to the template parameters pre-set by the system and matching the answer sheet format, the answer sheet styles of different test types are configured and switched. The template parameters are mapped to the actual image, and the coordinate frame is mapped to the corresponding area of the corrected actual image. The displacement elimination positioning formula is: region =T·C corrected , where T is the template matrix, specifically the pre-set template parameters, used to describe the standard position and size information of the question block area. The system completes image acquisition and preprocessing.
[0056] The image correction results are used to keep the answer sheet image and the template in spatial alignment. According to the coordinate and size information in the template parameters, the system automatically extracts the designated answer area in the image. The system identifies the overall question area framework and further divides the answer area according to the question type structure. The division formula is: Row i =y shart +i·Δy , Col j =x start +j·Δ x , where Δ y is the spacing between rows in the question type area, Δ x The spacing between columns in the question type area, i and y represent the question number index, and the area is divided according to the row and column rules to adapt to batch question positioning.
[0057] The composite area determination is used to distinguish text and non-text areas, adapting to complex question types and identifying different question types. The area determination formula is:
[0058]
[0059] Among them, OCR (R SUB ) is the sub-region R Sub The text recognition confidence is , EdgeDensity is the ratio of edge pixels, and τ and β are the set empirical thresholds.
[0060] In this embodiment, the system pre-sets template parameters that match the answer sheet format. The template parameters include but are not limited to the overall size of the answer sheet, page margins, question block area coordinates, the starting position of each question, question type identification, row and column arrangement information, and size information of each question area. These template parameters can be configured and switched according to different test types or answer sheet styles, and are highly adaptable and extensible. After the system completes image acquisition and preprocessing, it uses the image correction results to maintain spatial alignment between the answer sheet image and the template, and then automatically extracts the specified answer area from the image based on the coordinates and size information in the template parameters. During the extraction process, the system first identifies the overall question area framework, and further divides the answer area into multiple-choice question area, fill-in-the-blank question area, and subjective question area according to the question type structure. For each type of question, the system locates the image area of each question in turn based on the question number index and area identification, thereby completing the regional segmentation of all answer content.
[0061] S3. Semantic scoring of subjective questions: Semantic recognition technology is used to calculate the semantic similarity between the answer sheet and the reference answer to judge the logic and rationality of the candidate's answer:
[0062] Furthermore, in step S3, the semantic scoring process of the subjective questions uses semantic recognition technology to calculate the semantic similarity between the answer sheet and the reference answer to judge the logic and rationality of the candidate's answer.
[0063] The system establishes a standard answer corpus and uses the BERT deep semantic encoding network to semantically embed the candidate's answers with the standard answers, calculate the semantic similarity score between the two, and use the CLs tag output of the BERT model as the semantic vector of the text to compress answers of any length into a fixed dimension. The semantic vectorization calculation formula is: V answer =BERT CLS (T answer ), where T answer Represents the original text of the answer text input to BERT, BERT CLS Represents the processing of the input text by the BERT model, extracting the output vector corresponding to its cls tag, V answer Represented as the output fixed-length semantic vector,
[0064] The system performs handwriting recognition on subjective questions, using OCR technology to accurately convert images of examinees' handwritten answers into parseable text information. During the recognition process, the system uses a character training model to identify sloppy or non-standard handwriting, and uses the CTCLoss formula to handle characters with inconsistent input and output lengths:
[0065] Among them, x represents the input image feature sequence, y represents the target output label sequence, π represents the sum of all paths, B -1 (y) represents the set of all paths that can be mapped to the target sequence y, p(π|x) represents the probability of the model predicting the path π, and log p(y|x) represents the logarithm of the probability that the target text y appears in the image x, which is used for the recognition of unaligned character and image feature sequences.
[0066] The semantic similarity score between the candidate's answer vector and the standard answer vector is calculated using cosine similarity and other measurement methods. The calculation formula is: V1 and v2 are the semantic vectors of the candidate's answer and the standard answer respectively. The similarity score is used to measure the semantic closeness between the candidate's answer and the standard answer.
[0067] Logical judgment, similarity threshold judgment logic rationality formula:
[0068] Similarity represents the semantic similarity score between the candidate's answer and the standard answer, which is generally calculated by methods such as cosine similarity and ranges from [0,1]. high represents a high threshold, representing the standard of high semantic matching, θ lowIt represents the low threshold, which indicates the lower limit of the large semantic difference. KeywordScore represents the keyword score, which is used to further evaluate whether the answer covers the key concepts when the similarity is in the medium range.
[0069] In this embodiment, by introducing the BERT deep semantic coding model, semantic vectorization processing of subjective question answers and standard answers is realized, and combined with cosine similarity calculation and keyword coverage judgment, a multi-dimensional scoring system is constructed, which not only improves the system's ability to understand complex language expressions, but also enhances the rationality and fault tolerance of scoring. It has the advantages of high accuracy, strong adaptability, and good scalability. It is suitable for various scenarios such as educational assessment and intelligent marking, and has significant practical value.
[0070] S4. Double scoring mechanism: After the initial automatic scoring, the algorithm will be reviewed again, and manual verification and scoring can be used to correct errors.
[0071] Furthermore, in S4, a double scoring mechanism is implemented, where an algorithm review is conducted after the initial automatic scoring, with optional manual verification and score comparison. The error correction method is as follows: the system generates a preliminary scoring result for each subjective question of the examinee based on the semantic similarity score and question type characteristics, and the system starts the algorithm review process.
[0072] The preliminary score is generated by the fusion model. The fusion formula is:
[0073] S p =W1·BERT_Similarity+w2·Keyphrase_Match+W3·Logic_Score, where w1, w2, and w3 represent dynamic weights, which are adjusted according to the question type. BERT_Similarity represents the cosine similarity of the semantic vectors between the candidate's answer and the standard answer. Keyphrase_Match represents the coverage of professional terms. Logic_Score represents the score of the logical structure of the answer based on the dependency syntax tree.
[0074] Through the scoring model strategy, the candidate's answers are analyzed and scored again. The formula for the review trigger condition is: Among them, s1 represents the predicted score given by the system or machine, s2 represents the manual score or reference score, δ represents the threshold of the relative score difference, and Trigger_Human indicates whether to trigger manual review.
[0075] Final score synthesis formula: Among them, s1 represents the system's automatic scoring, s2 represents the initial manual scoring, and s h Indicates manual review and scoring, Trigger_Human indicates whether manual review is triggered, S final Represents the final score value,
[0076] The system presents the examinee's answers, standard answers, initial scores, and review scores to the examiner, and also provides a summary of the AI scoring rationale or key analysis points for manual judgment and correction. The correction formula is: Among them, μ represents the learning rate, which controls the parameter update amplitude, s h -s p is the prediction error, Represents the model output parameter w i The gradient of the error guides the model learning, and the weight distribution on specific question types or scoring dimensions is close to the manual scoring standard.
[0077] In this embodiment, intelligent evaluation of subjective questions is achieved by integrating a multi-dimensional scoring model. First, the candidates' answers are preliminarily scored based on semantic similarity, keyword coverage, and logical structure, and the weights of each scoring dimension are dynamically adjusted according to the question type. The system then starts the review process. When the relative difference between the initial score and the re-score exceeds the set threshold, manual review is automatically triggered. The final score uses the model mean or manual score based on whether manual review is triggered. The system also presents the scoring results and AI analysis basis to the examiners, and supports manual verification and correction. The model parameters are optimized through error backpropagation to achieve continuous iteration and accuracy improvement of the scoring criteria. This mechanism not only significantly improves the accuracy and efficiency of scoring, reduces the rate of manual intervention, but also has high interpretability and scoring fairness, and is suitable for large-scale standardized examination environments.
[0078] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements will not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A method for automatic marking of examination papers based on computer vision, characterized in that: The following steps are involved: S1. Image acquisition and preprocessing: Collect answer sheet images, perform image blur detection and correction through grayscale and binarization processing, and eliminate unclear images; S2. Region identification and segmentation: Use template parameters to extract the answer area and accurately identify the location of different question types. S3. Semantic scoring of subjective questions: semantic recognition technology is used to calculate the semantic similarity between the answer sheet and the reference answer to judge the logic and rationality of the candidate's answer; S4. Double scoring mechanism: After the initial automatic scoring, the algorithm will be reviewed again, and manual verification and scoring can be used to correct errors.
2. The automatic examination paper marking method based on computer vision according to claim 1, characterized in that: In step S1, image acquisition and preprocessing: the answer sheet image is acquired, and the image blur detection and correction recognition and the unclear image are eliminated by grayscale and binarization processing. The method is as follows: Use the image acquisition device to acquire the original image data of the answer sheet filled in by the examinee through the cursor reading device, and convert the acquired original image into a grayscale image. The grayscale calculation formula is: L GRAY =0.299·R+0.587·G+B, where R, G, and B are the red, green, and blue channel pixels of the original color image, and L GRAY is the pixel value of the output grayscale image, The grayscale image is further binarized to obtain a binary image. The binarization calculation formula is: Where T(x,y) is the adaptive threshold, which is dynamically calculated by Gaussian weighted average based on the neighborhood image information around the pixel, and L binary (x, y) is the grayscale value of the original grayscale image at the pixel (x, y), 255 and 0 represent L binary (x, y) The final output binary image has two possible pixel values at (x, y), 255 represents white and 0 represents black. The formula for blur detection on a binary image is: Among them, E sharp is the edge image obtained after the original image is binarized and edge extracted, E blurred The edge image is obtained by Gaussian blurring the original image and then extracting the edge. 1 is the sum of the absolute values of all elements in the matrix. After blur detection, the angle deviation during scanning is corrected. The tilt angle correction formula is: where x i is the coordinate of the edge pixel point, θ is the tilt angle to be solved relative to the horizontal axis, ρ is the distance from the straight line to the image origin, δ is the impulse function, The perspective correction formula is: Where (x, y) is the pixel coordinate in the original image, (x'y') is the pixel coordinate after correction, and a ij The affine transformation matrix parameters after solving the reference points.
3. The automatic examination paper marking method based on computer vision according to claim 2, characterized in that: In step S2, the template parameters are used to extract the answer area and accurately identify the locations of different question types. According to the template parameters pre-set by the system and matching the answer sheet format, the answer sheet styles of different test types are configured and switched. The template parameters are mapped to the actual image, and the coordinate frame is mapped to the corresponding area of the corrected actual image. The displacement elimination positioning formula is: region =T·C corrected , where T is the template matrix, specifically the pre-set template parameters, used to describe the standard position and size information of the question block area. The system completes image acquisition and preprocessing. The image correction results are used to keep the answer sheet image and the template in spatial alignment. According to the coordinate and size information in the template parameters, the system automatically extracts the designated answer area in the image. The system identifies the overall question area framework and further divides the answer area according to the question type structure. The segmentation formula is: Row i =y shart +i·Δ y , Col j =x start +j·Δ x , where Δ y is the spacing between rows in the question type area, Δ x The spacing between columns in the question type area, i and y represent the question number index, and the area is divided according to the row and column rules to adapt to batch question positioning. The composite area determination is used to distinguish text and non-text areas, adapting to complex question types and identifying different question types. The area determination formula is: Among them, OCR (R SUB ) is the sub-region R Sub The text recognition confidence is , EdgeDensity is the ratio of edge pixels, and τ and β are the set empirical thresholds.
4. The automatic examination paper marking method based on computer vision according to claim 3, characterized in that: In step S3, the semantic scoring process of the subjective questions is to use semantic recognition technology to calculate the semantic similarity between the answer sheet and the reference answer to judge the logic and rationality of the candidate's answer. The system establishes a standard answer corpus and uses the BERT deep semantic encoding network to semantically embed the candidate's answers with the standard answers, calculate the semantic similarity score between the two, and use the CLs tag output of the BERT model as the semantic vector of the text to compress answers of any length into a fixed dimension. The semantic vectorization calculation formula is: V answer =BERT CLS (T answer ), where T answer Represents the original text of the answer text input to BERT, BERT CLS Represents the processing of the input text by the BERT model, extracting the output vector corresponding to its cls tag, V answer Represented as the output fixed-length semantic vector, The system performs handwriting recognition on subjective questions, using OCR technology to accurately convert images of examinees' handwritten answers into parseable text information. During the recognition process, the system uses a character training model to identify sloppy or non-standard handwriting, and uses the CTCLoss formula to handle characters with inconsistent input and output lengths: Among them, x represents the input image feature sequence, y represents the target output label sequence, π represents the sum of all paths, B -1 (y) represents the set of all paths that can be mapped to the target sequence y, p(π|x) represents the probability of the model predicting the path π, and log p(y|x) represents the logarithm of the probability that the target text y appears in the image x, which is used for the recognition of unaligned character and image feature sequences. The semantic similarity score between the candidate's answer vector and the standard answer vector is calculated using cosine similarity and other measurement methods. The calculation formula is: V1 and v2 are the semantic vectors of the candidate's answer and the standard answer respectively. The similarity score is used to measure the semantic closeness between the candidate's answer and the standard answer. Logical judgment, the formula for determining the logical rationality of the similarity threshold is: Similarity represents the semantic similarity score between the candidate's answer and the standard answer, which is calculated by methods such as cosine similarity and ranges from [0,1]. high represents a high threshold, representing the standard of high semantic matching, θ low It represents the low threshold, which indicates the lower limit of the large semantic difference. KeywordScore represents the keyword score, which is used to further evaluate whether the answer covers the key concepts when the similarity is in the medium range.
5. The automatic examination paper marking method based on computer vision according to claim 4, characterized in that: In step S4, the double scoring mechanism is used. After the initial automatic scoring, the algorithm is reviewed again. Manual verification and score comparison are optional. The error correction method is as follows: the system generates the preliminary scoring results of the examinee's subjective questions based on the semantic similarity score and question type characteristics, and the system starts the algorithm review process. The preliminary score is generated by the fusion model. The fusion formula is: S p =W1·BERT_Similarity+w2·Keyphrase_Match+W3·Logic_Score, where w1, w2, and w3 represent dynamic weights, which are adjusted according to the question type. BERT_Similarity represents the cosine similarity of the semantic vectors between the candidate's answer and the standard answer. Keyphrase_Match represents the coverage of professional terms. Logic_Score represents the score of the logical structure of the answer based on the dependency syntax tree. Through the scoring model strategy, the candidate's answers are analyzed and scored again. The formula for the review trigger condition is: Among them, s1 represents the predicted score given by the system or machine, s2 represents the manual score or reference score, δ represents the threshold of the relative score difference, and Trigger_Human indicates whether to trigger manual review. Final score synthesis formula: Among them, s1 represents the system's automatic scoring, s2 represents the initial manual scoring, and s h Indicates manual review and scoring, Trigger_Human indicates whether manual review is triggered, S final Represents the final score value, The system presents the examinee's answers, standard answers, initial scores, and review scores to the examiner, and also provides a summary of the AI scoring rationale or key analysis points for manual judgment and correction. The correction formula is: Among them, μ represents the learning rate, which controls the parameter update amplitude, s h -s p is the prediction error, Represents the model output parameter w i The gradient of the problem is used to guide the model learning through errors, and the weight distribution of the question types is close to the manual scoring standard.