Intelligent anomaly detection method and device for answer sheet images based on visual recognition
Through visual recognition technology, the completeness and abnormality of the answer sheet was detected, and the problem of inaccurate scanning results of the answer sheet in the prior art was solved, and the reliability and accuracy of the marking were improved.
Patent Information
- Application Number
- CN202411266823.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-11
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-09-11
AI Technical Summary
The prior art is difficult to effectively detect and handle abnormalities in the answer sheet, resulting in inaccurate scanning results and affecting the reliability of marking papers.
Using intelligent abnormality detection method based on visual recognition, by obtaining the answer sheet image, detecting its integrity and blank page situation, using the proportion of white pixels and the number of matches to calculate the blank page score, identifying subject categories, detecting corners, scratches and black edges Defects and other abnormalities.
It improves the reliability and accuracy of the answer sheet marking, can effectively detect and correct abnormalities in the answer sheet, and ensures the accuracy of the scan results.
Smart Images

Figure CN118781619B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence, and in particular to an intelligent anomaly detection method and device for answer sheet images based on visual recognition. Background Art
[0002] In order to reduce the intensity of grading, it is becoming more and more common to use answer sheet scanner scanning technology to grade the test paper. In complex actual situations, various anomalies will appear on the answer sheet, which will seriously affect the scanning results of the answer sheet scanner and further affect the grading of the answer sheet.
[0003] Therefore, how to detect the anomalies in the answer sheet has become an urgent problem to be solved. Summary of the invention
[0004] In view of this, the purpose of this application is to provide an intelligent anomaly detection method and device for answer sheet images based on visual recognition, which can detect anomalies such as the integrity of the answer sheet and blank pages, thereby improving the reliability of answer sheet grading.
[0005] In a first aspect, an embodiment of the present application provides an intelligent anomaly detection method for answer sheet images based on visual recognition, the method comprising:
[0006] Get the answer sheet images in the current scanning group;
[0007] If the number of answer sheet images in the current scan group is equal to the number of answer sheets of a single student, then the answer sheet integrity check is performed on the answer sheet images in the current scan group according to the number of matches between corresponding positions of every two answer sheet images in the current scan group;
[0008] And according to the proportion of the window in which the proportion of white pixels in the currently scanned answer sheet image exceeds the preset proportion, the blank page score of the currently scanned answer sheet image is calculated; the size of the window is determined based on the size of the currently scanned answer sheet;
[0009] If the blank page score is greater than the preset score, the currently scanned answer sheet image is a blank page.
[0010] In a possible implementation, answer sheet integrity detection is performed on answer sheet images in the current scan group according to the number of matches between corresponding positions of every two answer sheet images in the current scan group, including:
[0011] For every two answer sheet images in the current scan group, count the number of matches between the corresponding positions in all positions of the two answer sheet images;
[0012] If the number of matching corresponding positions in all positions of the two answer sheet images is greater than the first preset number, then the answer sheet images in the current scanning group have a single student answer sheet duplicate missing page exception;
[0013] If the number of matches of corresponding positions in all positions of the two answer sheet images is less than or equal to a first preset number, then counting the number of matches of corresponding positions in preset key positions of the two answer sheet images;
[0014] If the number of matches of corresponding positions in the preset key positions of the two answer sheet images is greater than the second preset number, then there is an abnormality in the answer sheet images in the current scanning group that a single student's answer sheet is missing a page or the answer sheets of different students are in disarray.
[0015] In a possible implementation, the window includes a horizontal window and a vertical window; the size of the window is determined by the following steps:
[0016] The width of the currently scanned answer sheet image is determined as the width of the horizontal window, and the preset height is determined as the height of the horizontal window;
[0017] The height of the currently scanned answer sheet image is determined as the height of the vertical window, and the preset width is determined as the width of the vertical window.
[0018] In a possible implementation, the window proportion includes a horizontal window proportion and a vertical window proportion, and the preset proportion includes a preset horizontal proportion and a preset vertical proportion; the window proportion in which the proportion of white pixels in the currently scanned answer sheet image exceeds the preset proportion is determined by the following steps:
[0019] Determine the proportion of the horizontal window in which the proportion of white pixels in the currently scanned answer sheet image exceeds a preset horizontal proportion; the preset horizontal proportion is determined based on the width of the currently scanned answer sheet;
[0020] Determine the ratio of white pixels in the currently scanned answer sheet image that exceeds the preset vertical ratio and the ratio of the vertical window; the preset vertical ratio is determined based on the height of the currently scanned answer sheet.
[0021] In a possible implementation, determining the proportion of the horizontal window in which the proportion of white pixels in the currently scanned answer sheet image exceeds the preset horizontal proportion includes:
[0022] Starting from the top or bottom of the currently scanned answer sheet image, slide the horizontal window downward or upward;
[0023] Count the number of horizontal windows in which the proportion of white pixels in the currently scanned answer sheet image exceeds the preset horizontal proportion, and obtain the target number of horizontal windows;
[0024] The ratio of the target number of horizontal windows to the total number of horizontal windows sliding in the currently scanned answer sheet image is determined as the horizontal window ratio.
[0025] In a possible implementation, determining that the proportion of white pixels in the currently scanned answer sheet image exceeds the proportion of the preset vertical proportion to the proportion of the vertical window includes:
[0026] Starting from the left or right end of the currently scanned answer sheet image, slide the vertical window to the right or left;
[0027] Count the number of vertical windows in which the proportion of white pixels in the currently scanned answer sheet image exceeds the preset vertical proportion, and obtain the target number of vertical windows;
[0028] The ratio of the target number of vertical windows to the total number of vertical windows sliding in the currently scanned answer sheet image is determined as the vertical window ratio.
[0029] In a possible implementation, according to the proportion of windows in which the proportion of white pixels in the currently scanned answer sheet image exceeds a preset proportion, calculating the blank page score of the currently scanned answer sheet image includes:
[0030] Substitute the window ratio of the white pixels in the currently scanned answer sheet image that exceeds the preset ratio into the following formula to calculate the blank page score of the currently scanned answer sheet image;
[0031] ;
[0032] in, The blank page fraction of the currently scanned answer sheet image. is the horizontal window ratio, is the vertical window ratio, is the proportion of white pixels in the currently scanned answer sheet image, is the preset weight of the horizontal window ratio, is the preset weight of the vertical window ratio, The preset weight for the proportion of white pixels in the currently scanned answer sheet image.
[0033] In a possible implementation, the method further includes:
[0034] Get the current scanning subject category;
[0035] Inputting the currently scanned answer sheet image into the subject recognition model to obtain the subject category corresponding to the currently scanned answer sheet image;
[0036] If the subject category corresponding to the currently scanned answer sheet image is different from the currently scanned subject category, then there is a subject anomaly in the currently scanned answer sheet image.
[0037] In a second aspect, the embodiment of the present application further provides an intelligent anomaly detection device for answer sheet images based on visual recognition, the device comprising:
[0038] An acquisition module is used to acquire the answer sheet images in the current scanning group;
[0039] A detection module, for performing an answer sheet integrity detection on the answer sheet images in the current scanning group according to the number of matches between corresponding positions of every two answer sheet images in the current scanning group if the number of answer sheet images in the current scanning group is equal to the number of answer sheets of a single student;
[0040] A calculation module, used to calculate the blank page score of the currently scanned answer sheet image according to the proportion of the window in which the proportion of white pixels in the currently scanned answer sheet image exceeds the preset proportion; the size of the window is determined based on the size of the currently scanned answer sheet;
[0041] The determination module is used to determine that if the blank page score is greater than a preset score, the currently scanned answer sheet image is a blank page.
[0042] In the third aspect, an embodiment of the present application also provides an electronic device, comprising: a processor, a storage medium and a bus, the storage medium storing machine-readable instructions executable by the processor, when the electronic device is running, the processor and the storage medium communicate through the bus, and the processor executes the machine-readable instructions to perform the steps of any of the intelligent anomaly detection methods for answer sheet images based on visual recognition in the first aspect.
[0043] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the intelligent anomaly detection method for answer sheet images based on visual recognition as described in any one of the first aspects are executed.
[0044] The embodiment of the present application provides an intelligent anomaly detection method and device for answer sheet images based on visual recognition, the method comprising: if the number of answer sheet images in the current scanning group is equal to the number of answer sheets of a single student, then the answer sheet images in the current scanning group are checked for integrity based on the number of matches at corresponding positions between every two answer sheet images in the current scanning group; and the blank page score of the answer sheet image currently scanned is calculated based on the proportion of windows in which the proportion of white pixels in the answer sheet image currently scanned exceeds a preset proportion; the size of the window is determined based on the size of the answer sheet currently scanned; if the blank page score is greater than the preset score, the answer sheet image currently scanned is a blank page. The present application can perform integrity detection on the answer sheet by the number of matches at corresponding positions between every two answer sheet images in the current scanning group, and detect whether the answer sheet is a blank page by the proportion of windows in which the proportion of white pixels in the answer sheet image currently scanned exceeds a preset proportion, thereby improving the reliability of answer sheet grading. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0046] Figure 1 A flow chart of an intelligent anomaly detection method for answer sheet images based on visual recognition provided in an embodiment of the present application is shown;
[0047] Figure 2 A flowchart of another intelligent anomaly detection method for answer sheet images based on visual recognition provided in an embodiment of the present application is shown;
[0048] Figure 3 A schematic flow chart of another intelligent anomaly detection method for answer sheet images based on visual recognition provided in an embodiment of the present application is shown;
[0049] Figure 4 A schematic diagram showing images of four corner areas in an answer sheet image provided in an embodiment of the present application is shown;
[0050] Figure 5 A schematic flow chart of another intelligent anomaly detection method for answer sheet images based on visual recognition provided in an embodiment of the present application is shown;
[0051] Figure 6 A schematic diagram of the structure of an intelligent anomaly detection device for answer sheet images based on visual recognition provided by an embodiment of the present application is shown;
[0052] Figure 7 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0053] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.
[0054] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0055] In order to enable those skilled in the art to use the content of this application, the following implementation is provided in conjunction with the specific application scenario "artificial intelligence field". For those skilled in the art, the general principles defined herein can be applied to other embodiments and application scenarios without departing from the spirit and scope of this application. Although this application is mainly described around the "artificial intelligence field", it should be understood that this is only an exemplary embodiment.
[0056] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.
[0057] The following is a detailed description of an intelligent anomaly detection method for answer sheet images based on visual recognition provided in an embodiment of the present application.
[0058] Reference Figure 1 As shown, it is a flowchart of an intelligent anomaly detection method of answer sheet images based on visual recognition provided by an embodiment of the present application. The exemplary steps of the embodiment of the present application are described below:
[0059] S101, obtaining the answer sheet images in the current scanning group.
[0060] In the implementation manner of the present application, a single student answer sheet may have multiple answer sheets, and all answer sheets of the same student are taken as answer sheets of a scanning group, and all answer sheets of a certain student are scanned in sequence by an answer sheet scanner to obtain answer sheet images;
[0061] S102: If the number of answer sheet images in the current scan group is equal to the number of answer sheets of a single student, then answer sheet integrity detection is performed on the answer sheet images in the current scan group according to the number of matches between corresponding positions of every two answer sheet images in the current scan group.
[0062] In the implementation manner of the present application, the number of answer sheets for a single student refers to the total number of answer sheets for a student. If the number of answer sheet images in the current scanning group is equal to the number of single answer sheets, it means that all the answer sheets of a certain student have been scanned. However, due to some human factors, the current scanning group may contain answer sheet images of multiple students, or a student's answer sheet may be missing pages. Therefore, when the number of answer sheet images in the current scanning group is equal to the number of single student answer sheets, the answer sheet integrity check is performed on the answer sheet images in the current scanning group.
[0063] Among them, the answer sheet integrity detection refers to detecting whether there are repeated missing pages of a single student's answer sheet, missing pages of a single student's answer sheet, and confusion of answer sheets between students in the answer sheet images in the current scanning group. Here, repeated missing pages of a single student's answer sheet refers to the repeated scanning of a student's answer sheet resulting in the lack of an image of a certain answer sheet of the student; missing pages of a single student's answer sheet refers to the lack of an image of a certain answer sheet of the student; confusion of answer sheets between students refers to the existence of multiple students' answer sheet images in the current scanning group.
[0064] Specifically, according to the number of matches between corresponding positions of every two answer sheet images in the current scan group, the answer sheet integrity detection is performed on the answer sheet images in the current scan group, including:
[0065] Step 1: For every two answer sheet images in the current scan group, count the number of matches between corresponding positions in all positions of the two answer sheet images.
[0066] In the implementation mode of the present application, each pixel point is used as a detection position, and the SIFT algorithm is used to count the number of matches of the corresponding positions in all positions of the two answer sheet images. For example, the answer sheet image includes only two positions, a and b, and it is determined whether position a in the first answer sheet image matches position a in the second answer sheet image, and whether position b in the first answer sheet image matches position b in the second answer sheet image, and the number of successful matches is counted to obtain the number of matches of the corresponding positions in all positions of the two answer sheet images.
[0067] Step 2: If the number of matches of corresponding positions in all positions of the two answer sheet images is greater than a first preset number, then the answer sheet images in the current scanning group have a single student answer sheet duplicate missing page anomaly.
[0068] In the implementation manner of the present application, the greater the number of matches, the greater the similarity of the two answer sheet images. If the number of matches of the corresponding positions in all positions of the two answer sheet images is greater than the first preset number, it means that the two answer sheet images are exactly the same, and therefore it means that there are duplicated answer sheets in the answer sheet images in the current scan group, resulting in a single student's answer sheet missing page, that is, there is a single student's answer sheet duplicate missing page anomaly in the answer sheet images in the current scan group.
[0069] Among them, the ratio of the first preset number to the total number of answer sheet image positions needs to be very large, so as to accurately indicate whether the two answer sheet images are images of the same answer sheet of the same student, and whether there is a single student's answer sheet duplicate missing page anomaly.
[0070] Step 3: If the number of matches of corresponding positions in all positions of the two answer sheet images is less than or equal to a first preset number, the number of matches of corresponding positions in preset key positions of the two answer sheet images is counted.
[0071] In an implementation manner of the present application, if the number of matches of corresponding positions in all positions of two answer sheet images is less than or equal to a first preset number, it means that the two answer sheet images are not images of the same answer sheet of the same student, then the number of matches of corresponding positions in the preset key positions of the two answer sheet images will continue to be counted.
[0072] Among them, the preset key position can be a title, page number, etc.
[0073] Step 4: If the number of matches of corresponding positions in the preset key positions of the two answer sheet images is greater than the second preset number, then there is an abnormality in the answer sheet images of a single student with a missing page or an abnormality in the disorder of answer sheets between students in the answer sheet images in the current scanning group.
[0074] In the implementation manner of the present application, the greater the number of matches of corresponding positions in the preset key positions of the two answer sheet images, the higher the similarity of the two answer sheet images. On the premise that the two answer sheet images are not images of the same answer sheet of the same student, if the number of matches of corresponding positions in the preset key positions of the two answer sheet images is greater than the second preset number, it means that the two answer sheet images are images of the same page of answer sheets of different students, so there are anomalies of missing pages of answer sheets of a single student and disordered answer sheets between students in the answer sheet images in the current scanning group.
[0075] In addition, the present application can also determine missing page numbers and duplicate page numbers based on the page numbers of the answer sheet images in the current scan group.
[0076] S103, and calculating the blank page score of the currently scanned answer sheet image according to the window proportion of white pixels in the currently scanned answer sheet image exceeding the preset proportion.
[0077] In the implementation manner of the present application, the larger the blank page score is, the greater the possibility that the currently scanned answer sheet image is a blank page. The white pixel ratio refers to the ratio of the number of white pixels in the window to the total number of pixels in the window. The window ratio refers to the ratio of the number of windows whose white pixel ratio exceeds the preset ratio to the total number of windows. Among them, the window ratio includes the horizontal window ratio and the vertical window ratio, and the preset ratio includes the preset horizontal ratio and the preset vertical ratio.
[0078] Here, the window includes a horizontal window and a vertical window, and the size of the window is determined based on the size of the currently scanned answer sheet image; specifically, the width of the currently scanned answer sheet image is determined as the width of the horizontal window, and the preset height (generally 5) is determined as the height of the horizontal window; the height of the currently scanned answer sheet image is determined as the height of the vertical window, and the preset width (generally 5) is determined as the width of the vertical window.
[0079] Furthermore, the proportion of windows in which the proportion of white pixels in the currently scanned answer sheet image exceeds a preset proportion is determined by the following steps:
[0080] Step 1: determine the proportion of the horizontal window in which the proportion of white pixels in the currently scanned answer sheet image exceeds the preset horizontal proportion; the preset horizontal proportion is determined based on the width of the currently scanned answer sheet.
[0081] In the implementation manner of the present application, the proportion of horizontal windows refers to the ratio of the number of horizontal windows whose white pixel proportion exceeds the preset horizontal proportion to the total number of horizontal windows. The preset horizontal proportion = X * the width of the currently scanned answer sheet, where X is a preset multiple, generally 0.8.
[0082] Specifically, starting from the upper or lower end of the currently scanned answer sheet image, slide the horizontal window downward or upward; count the number of horizontal windows in which the proportion of white pixels in the currently scanned answer sheet image exceeds the preset horizontal proportion, and obtain the target number of horizontal windows; determine the ratio of the target number of horizontal windows to the total number of horizontal windows sliding in the currently scanned answer sheet image as the horizontal window proportion.
[0083] For example, starting from the top or bottom of the currently scanned answer sheet image, slide the horizontal window downward or upward, and slide a total of 10 horizontal windows, of which 8 horizontal windows have a white pixel ratio that exceeds the preset horizontal ratio. Therefore, the target number of horizontal windows is 8, the total number of horizontal windows is 10, and the horizontal window ratio is 8 / 10.
[0084] Step 2: Determine the ratio of white pixels in the currently scanned answer sheet image to the vertical window, which exceeds the preset vertical ratio; the preset vertical ratio is determined based on the height of the currently scanned answer sheet.
[0085] In the implementation manner of the present application, the proportion of vertical windows refers to the ratio of the number of vertical windows whose white pixel proportion exceeds the preset vertical proportion to the total number of vertical windows. The preset vertical proportion = Y*the height of the currently scanned answer sheet, where Y is a preset multiple, generally 0.8.
[0086] Specifically, starting from the left or right end of the currently scanned answer sheet image, slide the vertical window to the right or left; count the number of vertical windows in which the proportion of white pixels in the currently scanned answer sheet image exceeds the preset vertical proportion, and obtain the target number of vertical windows; determine the ratio of the target number of vertical windows to the total number of vertical windows sliding in the currently scanned answer sheet image as the vertical window proportion.
[0087] For example, starting from the left or right end of the currently scanned answer sheet image, slide the vertical window to the right or left, and slide a total of 10 vertical windows, of which 8 vertical windows have a white pixel ratio that exceeds the preset vertical ratio. Therefore, the target number of vertical windows is 8, the total number of vertical windows is 10, and the vertical window ratio is 8 / 10.
[0088] Further, the proportion of windows in which the proportion of white pixels in the currently scanned answer sheet image exceeds the preset proportion is substituted into the following formula to calculate the blank page score of the currently scanned answer sheet image;
[0089] ;
[0090] in, The blank page fraction of the currently scanned answer sheet image. is the horizontal window ratio, is the vertical window ratio, is the proportion of white pixels in the currently scanned answer sheet image, is the preset weight of the horizontal window ratio, is the preset weight of the vertical window ratio, The preset weight for the proportion of white pixels in the currently scanned answer sheet image. Generally, a and b are 0.25, and c is 0.5.
[0091] Here, the proportion of white pixels in the currently scanned answer sheet image refers to the ratio of the number of white pixels in the currently scanned answer sheet image to the total number of white pixels in the currently scanned answer sheet image.
[0092] S104: If the blank page score is greater than the preset score, the currently scanned answer sheet image is a blank page.
[0093] The embodiment of the present application provides an intelligent anomaly detection method for answer sheet images based on visual recognition, the method comprising: if the number of answer sheet images in the current scanning group is equal to the number of answer sheets of a single student, then the answer sheet images in the current scanning group are checked for integrity based on the number of matches between corresponding positions of every two answer sheet images in the current scanning group; and the blank page score of the currently scanned answer sheet image is calculated based on the window proportion of white pixels in the currently scanned answer sheet image exceeding a preset proportion; the size of the window is determined based on the size of the currently scanned answer sheet; if the blank page score is greater than the preset score, the currently scanned answer sheet image is a blank page. The present application can detect anomalies such as the integrity of the answer sheet and blank pages, thereby improving the reliability of answer sheet grading.
[0094] Reference Figure 2 As shown, it is a flow chart of another intelligent anomaly detection method of answer sheet images based on visual recognition provided by an embodiment of the present application. The exemplary steps of the embodiment of the present application are described below:
[0095] S201, obtaining the category of the subject currently being scanned.
[0096] In the implementation manner of the present application, the currently scanned subject category refers to the subject category of the answer sheet currently required to be scanned (such as mathematics, Chinese, etc.).
[0097] S202: Input the currently scanned answer sheet image into the subject recognition model to obtain the subject category corresponding to the currently scanned answer sheet image.
[0098] In the implementation mode of the present application, the subject recognition model is trained based on the sample image of the answer sheet and the corresponding subject category annotation. The subject category of the answer sheet image is recognized in real time by the trained subject recognition model, and the recognition result is compared with the specified current scan subject category. If the recognized subject category is inconsistent with the current scan subject category, a prompt message is returned to report the subject abnormality.
[0099] Here, the subject recognition model uses the LabelImg tool to annotate the answer sheet sample images and generate XML format data files. Then, these annotated answer sheet sample images are input into the YOLOv5 model that introduces the Multi-Head Self-Attention mechanism for training, and finally a subject recognition model that can identify different subject categories is obtained.
[0100] Among them, the multi-head self-attention mechanism processes the input features through multiple attention heads in parallel, calculates the attention score in each attention head, and then forms a global feature representation by weighted summation of these scores. Finally, these global features are combined with the original features and input into the subsequent network layers for further processing. This method ensures the reliability of subject recognition during the scanning process, helps to timely discover and correct subject errors that may occur during the scanning process, and improves the overall reliability of answer sheet scanning. After introducing the multi-head self-attention mechanism, the model can better capture important information in the answer sheet image, reduce misjudgments and missed judgments, and thus improve the overall performance of subject recognition.
[0101] Specifically, first, the input answer sheet image is adjusted to a fixed size and then enters the model. The backbone network (Backbone) extracts multi-scale features through CSPDarknet53, and then these features are processed by the multi-head self-attention mechanism to obtain attention scores. The self-attention mechanism weights and sums these scores to form a global feature map, which enhances the ability to capture details and global information. Then, these global feature maps are multi-scale feature fused through the multi-head self-attention mechanism to further improve the feature representation ability. Then, the fused feature map enters the head network (Head) to generate bounding boxes, predict output confidence and categories. Finally, the overlapping prediction boxes are filtered by the NMS algorithm to output the exact location and subject category marked on the answer sheet. This structure that combines YOLO-v5 and the multi-head self-attention mechanism improves the reliability and robustness of answer sheet object detection.
[0102] S203. If the subject category corresponding to the currently scanned answer sheet image is different from the currently scanned subject category, then there is a subject anomaly in the currently scanned answer sheet image.
[0103] The embodiment of the present application also provides another intelligent anomaly detection method for answer sheet images based on visual recognition, which can detect the subjects of the answer sheet images and improve the overall performance of subject detection.
[0104] Further, refer to Figure 3 As shown, another flow chart of an intelligent anomaly detection method for answer sheet images based on visual recognition is provided in the embodiment of the present application to detect and eliminate anomalies such as corner defects, scratch defects and black edge defects, specifically including:
[0105] S301, obtaining the corner area image, background color, and target straight line whose length exceeds a preset length in the currently scanned answer sheet image.
[0106] In the implementation manner of the present application, the corner area image refers to the image at the corner position of the currently scanned answer sheet image. The currently scanned answer sheet image may include one or more corner area images; refer to Figure 4 As shown, it is a schematic diagram of the images of the four corner areas in the answer sheet image provided in the embodiment of the present application. The background color refers to the color of the area other than the text area and the symbol area in the currently scanned answer sheet (generally white). The target straight line includes a target horizontal straight line and a target vertical straight line; the preset length is determined based on the size of the currently scanned answer sheet, including a preset horizontal length and a preset vertical length; specifically, the preset horizontal length = A*the width of the currently scanned answer sheet; the preset vertical length = B*the height of the currently scanned answer sheet; wherein A and B are preset multiples, generally taking a value of 0.98.
[0107] Furthermore, the target straight line in the currently scanned answer sheet image is determined by the following steps:
[0108] Step 1: Detect the straight line in the currently scanned answer sheet image to obtain the initial straight line.
[0109] In the implementation manner of the present application, the currently scanned answer sheet image is preprocessed; a straight line in the preprocessed currently scanned answer sheet image is detected by the Hough transform method, and the straight line is used as the initial straight line. There may be 0, 1 or more initial straight lines in the currently scanned answer sheet image.
[0110] Among them, the preprocessing can be to first use a 5×5 structure element Gaussian filter, then use Canny to find the edge to extract the edge in the image after Gaussian filtering, and finally use the 5×5 structure element to dilate the image after edge extraction. Hough transform is a technology widely used in image processing, mainly used to detect shapes in images, especially straight lines and curves. The basic idea of Hough transform is to map the pixels in the image to the parameter space by constructing a mathematical analytical expression for detecting the shape. Through this mapping, the Hough transform converts the detection problem in the image space into the parameter space, and completes the detection task through relatively simple cumulative statistics.
[0111] Step 2: determine the initial straight line whose slope is within the first preset slope range as the horizontal straight line, and determine the initial straight line whose slope is within the second preset slope range as the vertical straight line.
[0112] In the implementation manner of the present application, the first preset slope range is If the slope of the initial straight line is within the first preset slope range, the initial straight line is a horizontal straight line. The second preset slope range is and If the slope of the initial straight line is within the second preset slope range, the initial straight line is a vertical straight line.
[0113] Step 3: Determine a horizontal straight line whose length exceeds a preset horizontal length as a target horizontal straight line, and determine a vertical straight line whose length exceeds a preset vertical length as a target vertical straight line.
[0114] In the embodiment of the present application, if the length of the horizontal straight line exceeds the preset horizontal length, it means that the horizontal straight line is a scratch. If the length of the vertical straight line exceeds the preset vertical length, it means that the vertical straight line is a scratch.
[0115] S302, determining the corner defect position in the currently scanned answer sheet image according to the connected domain shape corresponding to the target connected domain in the corner area image and the proportion of black pixels in the corner area image.
[0116] In the implementation mode of the present application, the corner area image is binarized, and the connected domain of black pixels in the binarized corner area image is searched through a connected domain search algorithm; the target connected domain is determined based on the proportion of black pixels in the minimum external frame corresponding to each connected domain in the corner area image. The ratio of the number of black pixels in the connected domain to the total number of pixels in the minimum external frame of the connected domain is determined as the proportion of black pixels in the minimum external frame corresponding to the connected domain; that is, the proportion of black pixels in the minimum external frame corresponding to the connected domain refers to the proportion of black pixels in the connected domain in the minimum external frame of the connected domain. The ratio of the number of black pixels in the target connected domain to the total number of pixels in the corner area image is determined as the proportion of black pixels in the corner area image corresponding to the target connected domain; that is, the proportion of black pixels in the corner area image refers to the proportion of black pixels in the target connected domain in the corner area image.
[0117] Specifically, the following steps are used to determine the corner defect position in the currently scanned answer sheet image according to the connected domain shape corresponding to the target connected domain in the corner area image and the proportion of black pixels in the corner area image.
[0118] Step 1: Determine a connected domain in which the proportion of black pixels in the smallest bounding box in the corner area image is greater than a first preset proportion of black pixels as an initial connected domain.
[0119] In the implementation manner of the present application, the greater the proportion of black pixels in the minimum external frame, the greater the possibility that the position of the connected domain in the currently scanned answer sheet image is the position of the corner defect. The first preset black pixel proportion can be determined according to the actual situation. If the proportion of black pixels in the minimum external frame corresponding to all connected domains is less than or equal to the first preset black pixel proportion, no further judgment is made, and it is directly considered that there is no corner defect in the currently scanned answer sheet image. If the proportion of black pixels in the minimum external frame corresponding to the target connected domain is greater than the first preset black pixel proportion, it means that the position of the connected domain may be the position of the corner defect, so the connected domain in the corner area image whose proportion of black pixels in the minimum external frame is greater than the first preset black pixel proportion is determined as the initial connected domain.
[0120] Step 2: Determine the target connected domain with the largest area in the initial connected domain.
[0121] In the implementation manner of the present application, generally, the area of the corner defect position is the largest, so the area of the largest initial connected domain is determined as the target connected domain.
[0122] Step 3: Determine whether the proportion of black pixels in the corner area image corresponding to the target connected domain is greater than a second preset proportion of black pixels.
[0123] In the implementation mode of the present application, in order to improve the accuracy of corner defect detection, it is continued to determine whether the proportion of black pixels in the corner area image corresponding to the target connected domain is greater than the second preset black pixel proportion; the greater the proportion of black pixels in the corner area image, the greater the possibility that the position of the target connected domain in the currently scanned answer sheet image is the position of the corner defect. The second preset black pixel proportion can be determined according to actual conditions. If the proportion of black pixels in the corner area image corresponding to the target connected domain is less than or equal to the second preset black pixel proportion, the judgment is no longer continued, and it is directly considered that there is no corner defect in the currently scanned answer sheet image.
[0124] Step 4: If the proportion of black pixels in the corner area image corresponding to the target connected domain is greater than the second preset proportion of black pixels, it is determined whether the shape of the connected domain corresponding to the target connected domain is a triangle.
[0125] In the implementation manner of the present application, in addition to judging the proportion of black pixels in the minimum circumscribed frame corresponding to the target connected domain and the proportion of black pixels in the corner area image, it is also necessary to judge the shape of the target connected domain to further improve the accuracy of corner defect detection.
[0126] Step 5: If the shape of the connected domain corresponding to the target connected domain is a triangle, the position of the target connected domain in the corner area image is determined as the position of the corner defect in the currently scanned answer sheet image.
[0127] In the implementation manner of the present application, corner defects are generally triangles. Therefore, if the shape of the connected domain corresponding to the target connected domain is a triangle, the position of the target connected domain in the corner area image is determined as the position of the corner defect in the currently scanned answer sheet image.
[0128] In addition, if the corner defect has other shapes, it can also be added to the judgment. The triangle here refers to one case, and other shapes can also be added according to the actual situation.
[0129] S303, determining the position of the target pixel whose adjacent pixel on the target straight line has the background color as the scratch defect position in the currently scanned answer sheet image.
[0130] In the implementation of the present application, adjacent pixel points refer to the pixel points adjacent to the target pixel point in the vertical direction of the target straight line. In actual situations, the pixel points of the target straight line may overlap with the original text, symbols, etc. in the currently scanned answer sheet image. Such overlapping pixel points cannot be considered as the scratch defect position, so it is necessary to judge again based on the color of the adjacent pixel points to improve the reliability of the determination of the scratch defect position.
[0131] For example, there is a pixel a on the target line, and the adjacent pixels in the vertical direction of the target line are b and c; if the colors of pixel b and pixel c are the background colors corresponding to the currently scanned answer sheet image, then the position of pixel a is the scratch defect position. If the color of either pixel b or pixel c is not the background color, then the position of pixel a should not be used as the scratch defect position.
[0132] S304, determining the positions of multiple consecutive windows in the currently scanned answer sheet image where the proportion of black pixels exceeds a preset proportion as the positions of black edge defects in the currently scanned answer sheet image.
[0133] In the implementation mode of the present application, the preset proportion includes a preset horizontal proportion and a preset vertical proportion. The size of the window is determined based on the size of the currently scanned answer sheet, and the window includes a horizontal window and a vertical window. The width of the currently scanned answer sheet image is determined as the width of the horizontal window, and the preset height (generally 5) is determined as the height of the horizontal window; the height of the currently scanned answer sheet image is determined as the height of the vertical window, and the preset width (generally 5) is determined as the width of the vertical window.
[0134] Specifically, the positions of multiple consecutive horizontal windows in which the proportion of black pixels in the currently scanned answer sheet image exceeds a preset horizontal proportion are determined as the positions of black edge defects in the currently scanned answer sheet image; the positions of multiple consecutive vertical windows in which the proportion of black pixels in the currently scanned answer sheet image exceeds a preset vertical proportion are determined as the positions of black edge defects in the currently scanned answer sheet image.
[0135] Furthermore, after the defect position of the answer sheet image is determined, the defect of the answer sheet image can be eliminated. Specifically, the color of the pixel point at the corner defect position in the currently scanned answer sheet image is corrected to the background color; the color of the pixel point at the scratch defect position in the currently scanned answer sheet image is corrected to the background color; the color of the pixel point at the black edge defect position in the currently scanned answer sheet image is corrected to the background color.
[0136] Here, the embodiment of the present application provides another intelligent anomaly detection method for answer sheet images based on visual recognition, which can detect the locations of anomalies such as corner defects, scratch defects, and black edge defects in the answer sheet and eliminate them. Among them, any one or more anomalies among corner defects, scratch defects, and black edge defects can be detected at the same time, without any order restriction.
[0137] Further, refer to Figure 5 As shown, another flow chart of an intelligent anomaly detection method for answer sheet images based on visual recognition is provided for the embodiment of the present application, which specifically includes:
[0138] S501, determining the positions of multiple continuous horizontal windows in which the proportion of black pixels in the currently scanned answer sheet image exceeds a preset horizontal proportion as the positions of black edge defects in the currently scanned answer sheet image.
[0139] In the implementation mode of the present application, the preset horizontal proportion is determined based on the width of the currently scanned answer sheet. The currently scanned answer sheet image is preprocessed by grayscale or binarization to obtain the final currently scanned answer sheet image; then the positions of multiple consecutive horizontal windows in which the proportion of black pixels in the currently scanned answer sheet image exceeds the preset horizontal proportion are determined as the positions of black edge defects in the currently scanned answer sheet image through the following steps:
[0140] Step 1: Slide the horizontal window downward and upward respectively from the top and bottom of the currently scanned answer sheet image.
[0141] In the implementation manner of the present application, the horizontal window includes two sliding directions: sliding downward from the upper end of the currently scanned answer sheet image and sliding upward from the lower end of the currently scanned answer sheet image.
[0142] Step 2: If the black pixel ratio of the current sliding horizontal window exceeds the preset horizontal ratio and the sliding distance is less than the first preset distance, continue to slide the horizontal window; the first preset distance is determined based on the height of the currently scanned answer sheet image.
[0143] In the implementation manner of the present application, the first preset distance is generally 1 / 4 of the height of the currently scanned answer sheet image. The greater the proportion of black pixels in the currently sliding horizontal window, the greater the possibility that the currently sliding horizontal window has a black border.
[0144] Specifically, for each sliding direction, if the black pixel ratio of the current sliding horizontal window in the sliding direction exceeds the preset horizontal ratio, and the sliding distance is less than the first preset distance, the horizontal window continues to slide.
[0145] Here, if the proportion of black pixels in the current sliding horizontal window in the sliding direction exceeds the preset horizontal proportion, it means that the current sliding horizontal window has a black border.
[0146] Step 3: If the black pixel ratio of the current sliding horizontal window is less than or equal to the preset horizontal ratio, the sliding horizontal window is terminated.
[0147] In an implementation manner of the present application, if the proportion of black pixels in the current sliding horizontal window in the sliding direction does not exceed the preset horizontal proportion, the current sliding horizontal window is not a black border, and the sliding of the horizontal window is ended.
[0148] Step 4: After the sliding is completed, the positions of the continuous multiple horizontal windows sliding in the currently scanned answer sheet image are determined as the positions of the black edge defects in the currently scanned answer sheet image.
[0149] In the implementation of the present application, the black edge defect area generally includes multiple consecutive windows, not just one, so in the sliding direction, the positions of the multiple consecutive horizontal windows sliding in the currently scanned answer sheet image are determined as the black edge defect position in the currently scanned answer sheet image. If there are no multiple consecutive horizontal windows, it means that there is no black edge defect in this direction.
[0150] S502, determining the positions of multiple consecutive vertical windows in which the proportion of black pixels in the currently scanned answer sheet image exceeds a preset vertical proportion as the positions of black edge defects in the currently scanned answer sheet image.
[0151] In the implementation mode of the present application, the preset vertical ratio is determined based on the height of the currently scanned answer sheet. The currently scanned answer sheet image is preprocessed by grayscale or binarization to obtain the final currently scanned answer sheet image; then the positions of the continuous multiple vertical windows where the black pixel ratio in the currently scanned answer sheet image exceeds the preset vertical ratio are determined as the black edge defect positions in the currently scanned answer sheet image through the following steps:
[0152] Step 1: Starting from the left and right ends of the currently scanned answer sheet image, slide the vertical window to the right and left respectively.
[0153] In the implementation manner of the present application, the vertical window includes two sliding directions: sliding from the left end of the currently scanned answer sheet image to the right, and sliding from the right end of the currently scanned answer sheet image to the left.
[0154] Step 2: If the black pixel ratio of the current sliding vertical window exceeds the preset vertical ratio, and the sliding distance is less than the second preset distance, continue to slide the vertical window; the second preset distance is determined based on the width of the currently scanned answer sheet.
[0155] In the implementation manner of the present application, the second preset distance is generally 1 / 4 of the width of the currently scanned answer sheet image. The larger the proportion of black pixels in the currently sliding vertical window, the greater the possibility that the currently sliding vertical window has a black border.
[0156] Specifically, for each sliding direction, if the black pixel ratio of the current sliding vertical window in the sliding direction exceeds the preset vertical ratio, and the sliding distance is less than the second preset distance, the vertical window continues to slide.
[0157] Here, if the black pixel ratio of the current sliding vertical window in the sliding direction exceeds the preset vertical ratio, it means that the current sliding vertical window has a black border.
[0158] Step 3: If the black pixel ratio of the current sliding vertical window is less than or equal to the preset vertical ratio, the sliding vertical window is terminated.
[0159] In an embodiment of the present application, if the black pixel ratio of the current sliding vertical window in the sliding direction does not exceed the preset vertical ratio, the current sliding horizontal window is not a black border, and the sliding vertical window is ended.
[0160] Step 4: After the sliding is completed, the positions of the continuous multiple vertical windows that slide in the currently scanned answer sheet image are determined as the positions of the black edge defects in the currently scanned answer sheet image.
[0161] In the implementation of the present application, the black edge defect area generally includes multiple consecutive windows, not just one, so in the sliding direction, the positions of the multiple consecutive vertical windows sliding in the currently scanned answer sheet image are determined as the black edge defect position in the currently scanned answer sheet image. If there are no multiple consecutive vertical windows, it means that there is no black edge defect in this direction.
[0162] The embodiment of the present application provides another intelligent anomaly detection method for answer sheet images based on visual recognition, which can accurately determine the location of black edge defects, thereby improving the reliability of answer sheet grading results.
[0163] Based on the same inventive concept, the embodiments of the present application also provide an intelligent anomaly detection device for answer sheet images based on visual recognition corresponding to the intelligent anomaly detection method for answer sheet images based on visual recognition. Since the principle of solving the problem by the device in the embodiments of the present application is similar to the above-mentioned intelligent anomaly detection method for answer sheet images based on visual recognition in the embodiments of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0164] Reference Figure 6 FIG. 1 is a schematic diagram of an intelligent anomaly detection device for answer sheet images based on visual recognition provided by an embodiment of the present application, the device comprising:
[0165] The acquisition module 601 is used to acquire the answer sheet images in the current scanning group;
[0166] A detection module 602 is used to perform an answer sheet integrity detection on the answer sheet images in the current scan group according to the number of matches between corresponding positions of every two answer sheet images in the current scan group if the number of answer sheet images in the current scan group is equal to the number of answer sheets of a single student;
[0167] A calculation module 603 is used to calculate the blank page score of the currently scanned answer sheet image according to the proportion of the window in which the proportion of white pixels in the currently scanned answer sheet image exceeds the preset proportion; the size of the window is determined based on the size of the currently scanned answer sheet;
[0168] The determination module 604 is used to determine that the currently scanned answer sheet image is a blank page if the blank page score is greater than a preset score.
[0169] In one possible implementation, the detection module 602 is specifically used to count the number of matches of corresponding positions in all positions of the two answer sheet images for every two answer sheet images in the current scanning group; if the number of matches of corresponding positions in all positions of the two answer sheet images is greater than a first preset number, then the answer sheet images in the current scanning group have a single student's answer sheet missing page abnormality; if the number of matches of corresponding positions in all positions of the two answer sheet images is less than or equal to the first preset number, then the number of matches of corresponding positions in preset key positions of the two answer sheet images is counted; if the number of matches of corresponding positions in preset key positions of the two answer sheet images is greater than a second preset number, then the answer sheet images in the current scanning group have a single student's answer sheet missing page abnormality and answer sheets between students are disordered abnormality.
[0170] In one possible implementation, the window includes a horizontal window and a vertical window; the determination module 604 is further used to: determine the width of the currently scanned answer sheet image as the width of the horizontal window, and determine the preset height as the height of the horizontal window; determine the height of the currently scanned answer sheet image as the height of the vertical window, and determine the preset width as the width of the vertical window.
[0171] In a possible implementation, the window proportion includes a horizontal window proportion and a vertical window proportion, and the preset proportion includes a preset horizontal proportion and a preset vertical proportion; the calculation module 603 is further used to:
[0172] Determine the proportion of the horizontal window in which the proportion of white pixels in the currently scanned answer sheet image exceeds a preset horizontal proportion; the preset horizontal proportion is determined based on the width of the currently scanned answer sheet;
[0173] Determine the ratio of white pixels in the currently scanned answer sheet image that exceeds the preset vertical ratio and the ratio of the vertical window; the preset vertical ratio is determined based on the height of the currently scanned answer sheet.
[0174] In one possible implementation, the calculation module 603 is specifically used to slide a horizontal window downward or upward starting from the upper end or lower end of the currently scanned answer sheet image; count the number of horizontal windows in which the proportion of white pixels in the currently scanned answer sheet image exceeds a preset horizontal proportion, and obtain a target number of horizontal windows; and determine the ratio of the target number of horizontal windows to the total number of horizontal windows sliding in the currently scanned answer sheet image as the horizontal window proportion.
[0175] In one possible implementation, the calculation module 603 is specifically used to slide the vertical window to the right or left starting from the left end or the right end of the currently scanned answer sheet image; count the number of vertical windows in the currently scanned answer sheet image in which the proportion of white pixels exceeds the preset vertical proportion to obtain the target number of vertical windows; and determine the ratio of the target number of vertical windows to the total number of vertical windows sliding in the currently scanned answer sheet image as the vertical window proportion.
[0176] In a possible implementation, the calculation module 603 is specifically used to substitute the window proportion of the white pixels in the currently scanned answer sheet image exceeding the preset proportion into the following formula to calculate the blank page score of the currently scanned answer sheet image;
[0177] ;
[0178] in, The blank page fraction of the currently scanned answer sheet image. is the horizontal window ratio, is the vertical window ratio, is the proportion of white pixels in the currently scanned answer sheet image, is the preset weight of the horizontal window ratio, is the preset weight of the vertical window ratio, The preset weight for the proportion of white pixels in the currently scanned answer sheet image.
[0179] In a possible implementation, the transposition further includes: an input module 605;
[0180] The acquisition module 601 is also used to obtain the category of the current scanning subject;
[0181] An input module 605 is used to input the currently scanned answer sheet image into the subject recognition model to obtain the subject category corresponding to the currently scanned answer sheet image;
[0182] The detection module 602 is also used to determine that there is a subject anomaly in the currently scanned answer sheet image if the subject category corresponding to the currently scanned answer sheet image is different from the currently scanned subject category.
[0183] The present application provides an intelligent anomaly detection device for answer sheet images based on visual recognition. The transposition can detect anomalies such as the integrity of the answer sheet and blank pages, thereby improving the reliability of answer sheet grading.
[0184] like Figure 7 As shown, an electronic device 700 provided in an embodiment of the present application includes: a processor 701, a memory 702 and a bus, the memory 702 stores machine-readable instructions executable by the processor 701, when the electronic device is running, the processor 701 and the memory 702 communicate through the bus, and the processor 701 executes the machine-readable instructions to perform the steps of the above-mentioned intelligent anomaly detection method for answer sheet images based on visual recognition.
[0185] Specifically, the above-mentioned memory 702 and processor 701 can be general-purpose memory and processor, which are not specifically limited here. When the processor 701 runs the computer program stored in the memory 702, it can execute the above-mentioned intelligent anomaly detection method for answer sheet images based on visual recognition.
[0186] Corresponding to the above-mentioned intelligent anomaly detection method for answer sheet images based on visual recognition, an embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned intelligent anomaly detection method for answer sheet images based on visual recognition are executed.
[0187] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, and will not be repeated in this application. In the several embodiments provided in this application, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0188] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0189] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0190] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the information processing method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.
[0191] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. An intelligent anomaly detection method for answer sheet images based on visual recognition, characterized in that: The method comprises: Get the answer sheet images in the current scanning group; If the number of answer sheet images in the current scan group is equal to the number of answer sheets of a single student, then answer sheet integrity detection is performed on the answer sheet images in the current scan group according to the number of matches between corresponding positions of every two answer sheet images in the current scan group; And according to the proportion of the window in which the proportion of white pixels in the currently scanned answer sheet image exceeds the preset proportion, the blank page score of the currently scanned answer sheet image is calculated; the size of the window is determined based on the size of the currently scanned answer sheet; If the blank page score is greater than the preset score, the currently scanned answer sheet image is a blank page; The answer sheet integrity detection is performed on the answer sheet images in the current scan group according to the number of matches of corresponding positions between every two answer sheet images in the current scan group, including: for every two answer sheet images in the current scan group, counting the number of matches of corresponding positions in all positions of the two answer sheet images; if the number of matches of corresponding positions in all positions of the two answer sheet images is greater than a first preset number, then the answer sheet images in the current scan group have a single student answer sheet duplicate missing page anomaly; if the number of matches of corresponding positions in all positions of the two answer sheet images is less than or equal to a first preset number, counting the number of matches of corresponding positions in preset key positions of the two answer sheet images; if the number of matches of corresponding positions in preset key positions of the two answer sheet images is greater than a second preset number, then the answer sheet images in the current scan group have a single student answer sheet missing page anomaly and a disordered answer sheet between students anomaly; The window proportion includes a horizontal window proportion and a vertical window proportion, and the preset proportion includes a preset horizontal proportion and a preset vertical proportion; Determining the proportion of the horizontal window in which the proportion of white pixels in the currently scanned answer sheet image exceeds the preset horizontal proportion, comprising: sliding the horizontal window downward or upward from the upper end or the lower end of the currently scanned answer sheet image; counting the number of the horizontal windows in which the proportion of white pixels in the currently scanned answer sheet image exceeds the preset horizontal proportion, and obtaining a target number of horizontal windows; determining the ratio of the target number of horizontal windows to the total number of horizontal windows slid in the currently scanned answer sheet image as the horizontal window proportion; Determine the proportion of white pixels in the currently scanned answer sheet image that exceeds the preset vertical proportion and the proportion of the vertical window, including: starting from the left end or the right end of the currently scanned answer sheet image, sliding the vertical window to the right or left; counting the number of vertical windows in which the proportion of white pixels in the currently scanned answer sheet image exceeds the preset vertical proportion, and obtain the target number of vertical windows; determine the ratio of the target number of vertical windows to the total number of vertical windows sliding in the currently scanned answer sheet image as the vertical window proportion.
2. The intelligent anomaly detection method for answer sheet images based on visual recognition according to claim 1 is characterized in that: The window includes a horizontal window and a vertical window; the size of the window is determined by the following steps: Determine the width of the currently scanned answer sheet image as the width of the horizontal window, and determine the preset height as the height of the horizontal window; The height of the currently scanned answer sheet image is determined as the height of the vertical window, and the preset width is determined as the width of the vertical window.
3. The intelligent anomaly detection method for answer sheet images based on visual recognition according to claim 2 is characterized in that: The window proportion in which the proportion of white pixels in the currently scanned answer sheet image exceeds the preset proportion is determined by the following steps: Determine the proportion of the horizontal window in which the proportion of white pixels in the currently scanned answer sheet image exceeds the preset horizontal proportion; the preset horizontal proportion is determined based on the width of the currently scanned answer sheet; Determine that the proportion of white pixels in the currently scanned answer sheet image exceeds the preset vertical proportion and the proportion of the vertical window; the preset vertical proportion is determined based on the height of the currently scanned answer sheet.
4. The intelligent anomaly detection method for answer sheet images based on visual recognition according to claim 1 is characterized in that: The calculating of the blank page score of the currently scanned answer sheet image according to the proportion of windows in which the proportion of white pixels in the currently scanned answer sheet image exceeds a preset proportion includes: Substitute the window proportion of white pixels in the currently scanned answer sheet image that exceeds the preset proportion into the following formula to calculate the blank page score of the currently scanned answer sheet image; ; in, is the blank page fraction of the currently scanned answer sheet image, is the horizontal window ratio, is the vertical window ratio, is the proportion of white pixels in the currently scanned answer sheet image, is the preset weight of the horizontal window ratio, is the preset weight of the vertical window ratio, The preset weight for the proportion of white pixels in the currently scanned answer sheet image.
5. The intelligent anomaly detection method for answer sheet images based on visual recognition according to claim 4 is characterized in that: The method further comprises: Get the current scanning subject category; Inputting the currently scanned answer sheet image into a subject recognition model to obtain a subject category corresponding to the currently scanned answer sheet image; If the subject category corresponding to the currently scanned answer sheet image is different from the currently scanned subject category, then there is a subject anomaly in the currently scanned answer sheet image.
6. An intelligent anomaly detection device for answer sheet images based on visual recognition, characterized in that: The device comprises: An acquisition module is used to acquire the answer sheet images in the current scanning group; A detection module, configured to perform an answer sheet integrity detection on the answer sheet images in the current scanning group according to the number of matches between corresponding positions of every two answer sheet images in the current scanning group if the number of answer sheet images in the current scanning group is equal to the number of answer sheets of a single student; A calculation module, used to calculate the blank page score of the answer sheet image currently scanned according to the proportion of windows in which the proportion of white pixels in the answer sheet image currently scanned exceeds a preset proportion; the size of the window is determined based on the size of the answer sheet currently scanned; A determination module, configured to determine that the currently scanned answer sheet image is a blank page if the blank page score is greater than a preset score; The detection module is specifically used to count the number of matches of corresponding positions in all positions of the two answer sheet images for every two answer sheet images in the current scan group; if the number of matches of corresponding positions in all positions of the two answer sheet images is greater than a first preset number, then the answer sheet images in the current scan group have a single student's answer sheet duplicate missing page anomaly; if the number of matches of corresponding positions in all positions of the two answer sheet images is less than or equal to the first preset number, then count the number of matches of corresponding positions in preset key positions of the two answer sheet images; if the number of matches of corresponding positions in preset key positions of the two answer sheet images is greater than a second preset number, then the answer sheet images in the current scan group have a single student's answer sheet missing page anomaly and answer sheets between students are disordered anomaly; The window proportion includes a horizontal window proportion and a vertical window proportion, and the preset proportion includes a preset horizontal proportion and a preset vertical proportion; The calculation module is specifically used to slide the horizontal window downward or upward starting from the upper end or the lower end of the currently scanned answer sheet image; count the number of the horizontal windows whose white pixel ratio in the currently scanned answer sheet image exceeds the preset horizontal ratio to obtain the target number of horizontal windows; determine the ratio of the target number of horizontal windows to the total number of horizontal windows sliding in the currently scanned answer sheet image as the horizontal window ratio; The calculation module is specifically used to slide the vertical window to the right or left starting from the left end or the right end of the currently scanned answer sheet image; count the number of vertical windows in which the proportion of white pixels in the currently scanned answer sheet image exceeds the preset vertical proportion, and obtain the target number of vertical windows; and determine the ratio of the target number of vertical windows to the total number of vertical windows sliding in the currently scanned answer sheet image as the vertical window proportion.
7. An electronic device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the intelligent anomaly detection method for answer sheet images based on visual recognition as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the intelligent anomaly detection method for answer sheet images based on visual recognition as described in any one of claims 1 to 5 are executed.
Citation Information
Patent Citations
Method for detecting secondary pollution generated by scanning of answer sheet and device thereof
CN106855948A
Blank answer detection method and system for examination paper marking
CN112700414A
Scanning recognition method and device for automatic question number recognition
CN113822266A
Blank answer sheet identification method and system, storage medium and computer equipment
CN115100656A
Exam paper reading system, device and method based on pattern recognition technology
WO2018006294A1
