Machine learning-based machine examination answer rapid identification method and system, and electronic equipment
By combining the RegNet network with the BAM attention mechanism in computer-based exams, a feature extraction and classification model was constructed, which solved the problem of time-consuming answer recognition in computer-based exams and achieved fast and highly accurate answer recognition.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- DUOLUN TECH CO LTD
- Filing Date
- 2026-01-09
- Publication Date
- 2026-04-21
AI Technical Summary
In the current computer-based driving tests (Subject 1 and Subject 4), existing OCR text recognition solutions are time-consuming and cannot achieve real-time, fast, and highly accurate answer recognition.
A lightweight classification model based on the RegNet network, combined with the BAM attention mechanism, is used to construct a feature extraction classification model for rapid identification of computer-based test answers.
It achieves rapid recognition of computer-based exam answers, with a recognition speed of 0.013s, making it suitable for real-time response scenarios and improving accuracy.
Smart Images

Figure CN121904792A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, specifically to a method, system, and electronic device for rapid identification of computer-based exam answers based on machine learning. Background Technology
[0002] Currently, for computer-based driving tests such as Theory Test 1 and Theory Test 4, which use a simultaneous answering and scoring mode, it is necessary not only to monitor the test situation in real time to prevent cheating, but also to identify the test takers' answers quickly and accurately in real time to ensure that there are no test delays or failures due to non-test taker reasons or misjudgments.
[0003] Current technologies utilize OCR (Optical Character Recognition) to identify and judge test takers' answers. This process, whether employing a CNN (Convolutional Neural Network) architecture or a Transformer architecture, requires extensive computation and is time-consuming. For exams like Subject 1, which involve simultaneous answering and scoring, extremely high accuracy and fast response times are required. In applications like Subject 1, current OCR technology takes approximately 0.02 seconds to identify answers, indicating room for improvement in OCR speed.
[0004] For computer-based exams like Subject 1 and Subject 4, which use a simultaneous answering and scoring model, the possible answers to any question are fixed. Therefore, classification networks, such as targeted lightweight classification networks, can be extended to text recognition to meet the need for real-time and rapid identification of answers to specific printed fonts in computer-based exams. The lightweight classification network RegNet, by uniformly controlling the network width and depth through a quantized linear function, performs excellently in image classification tasks with high classification efficiency; however, in real-world scenarios with interference, RegNet's ability to capture key features still has room for improvement. Attention mechanisms, by dynamically allocating feature weights, can enhance the model's focus on important information. Currently, attention mechanisms are mostly applied to traditional architectures such as ResNet, but there is no optimization scheme combining them with RegNet networks for this type of simultaneous answering and scoring computer-based exam. Summary of the Invention
[0005] 1. The technical problem that the invention aims to solve For current computer-based tests like driver's license theory test (subject 1), which involve answering questions and being scored simultaneously, real-time, fast, and highly accurate identification of test takers' answers is required. However, existing OCR text recognition solutions using CNN or Transformer architectures require extensive computation and are time-consuming. This invention aims to propose a lightweight classification network, RegNet, with an added BAM attention mechanism, and extend its application to OCR text recognition. Compared to existing technologies, it can identify and classify test answers at a higher speed and with higher accuracy.
[0006] 2. Technical Solution To achieve the above objectives, the present invention proposes the following technical solution: In a first aspect, this invention proposes a method for rapid identification of computer-based exam answers based on machine learning, comprising: For all questions in the computer-based test question bank, establish a set of possible answers for all questions during the computer-based test, and obtain the first image of each answer in the answer set; wherein, the first image is a screenshot of any answer displayed in the answer area during the computer-based test; Each of the first images is preprocessed, and each of the preprocessed first images is made into a classification label to construct a label set; A feature extraction and classification model based on the RegNet network is constructed, and the model is trained based on the label set to obtain the target feature extraction and classification model; wherein, the RegNet network extracts label features in four stages, and a BAM attention mechanism is added to the bottleneck end of any block in each stage; The second image is obtained, and the target feature extraction and classification model is used to extract features from the second image, outputting the label information for identification and classification; wherein, the second image is a screenshot of the answer to be judged as correct or incorrect displayed in the answer area of the preprocessed computer-based test answering process.
[0007] As an optional approach, the benchmark for the feature extraction and classification model based on the RegNet network is the RegNetx model; The RegNetx model includes a head, a backbone, and a network body. The network body contains four stages for reducing feature resolution. Three convolutional processes are set inside the bottleneck of any block in any stage. After the three convolutional processes, a BAM attention mechanism is added. After the stage performs parallel processing of channel attention and spatial attention for each input starting from the second block through the BAM attention mechanism, the residual connection identity mapping is used. The BAM attention mechanism includes a channel attention branch and a spatial attention branch, which are connected in parallel. After being connected in parallel, the attention weights are generated by activating the sigmoid function and then fused with the input multi-scale feature map in the form of residuals to obtain an output containing features and attention enhancement terms.
[0008] As an optional approach, the training parameters of the feature extraction and classification model based on the RegNet network are as follows: During the pre-training of the feature extraction classification model, the parameters of the BAM attention mechanism are randomly initialized, and the original weights are used for other layers. The number of compressed channels inside the BAM attention mechanism is adjusted according to the number of channels in each stage of the RegNetx model, and the expansion factor is set to 4. The traditional activation layer inside the BAM attention mechanism is replaced with a BN layer; The optimizer uses the Adam adaptive learning rate optimization algorithm. After adding the BAM attention mechanism, the learning rate is adjusted to 1 / 10 of the initial learning rate, and decays by 0.1 times every 10 rounds. The loss function selected for the feature extraction and classification model is the cross-entropy loss function.
[0009] As an optional approach, the machine learning-based method for rapid identification of computer-based exam answers further includes: For all questions in the computer-based test question bank, obtain the third image for each question; wherein the third image is a screenshot of the question content displayed in the question area of the computer-based test interface; A question set is established based on several third images, and each of the third images in the question set is attached with the label information corresponding to the correct answer identification and classification of the question; Obtain the fourth image of the current computer-based exam interface, and search for the third image that matches the fourth image in the exam question set; wherein, the fourth image is a screenshot of the exam question content displayed in the exam question area of the current computer-based exam interface, and the process of searching for the third image is performed synchronously with the process of model classification of the second image; Determine whether the label information attached to the matched third image is consistent with the label information output by the target feature extraction classification model. If the label information is consistent, the question is answered correctly; otherwise, the question is answered incorrectly.
[0010] As an optional method, the process of obtaining the second image is as follows: Based on a preset frequency, screenshots of the answers to be judged as right or wrong displayed in the answer area during the computer-based test are periodically retrieved. The screenshot of the answer is binarized, unified to the target size, and then normalized to obtain the second image.
[0011] As an optional method, the process of obtaining the second image further includes: After receiving the instruction to proceed to the next question after answering the computer-based test, the system selects the answer screenshots from the previous question's answer process that are closest to the time the instruction was received as the final answer screenshot for the question. The system then uses the tag information of the second image category obtained after preprocessing the final answer screenshot as the final tag information for the answer category of the previous question.
[0012] As an optional method, the process of obtaining the fourth image of the current computer-based exam interface is as follows: After receiving the first instruction to proceed to the next question after answering the computer-based test, the system enters the current question. During the answering process of the current question, several area images of the computer-based test interface are acquired at preset frequencies. Among them, the area image closest to the time of receiving the first instruction includes a screenshot of the test content displayed in the question area and a screenshot of the answer to be judged as correct or incorrect displayed in the answer area. The other area images only contain screenshots of the answer to be judged as correct or incorrect displayed in the answer area. The screenshot of the exam question displayed in the exam question area of the image closest to the time the first instruction was received is identified as the fourth image; the screenshot of the answer to be judged as correct or incorrect displayed in the answer area of the image closest to the time the second instruction was issued is identified as the second image; the third image is matched based on the fourth image; and the model is classified based on the second image; wherein, the second instruction is the instruction to proceed to the next exam question issued after the current exam question has been answered.
[0013] In a second aspect, the present invention proposes a machine learning-based system for rapid identification of answers in computer-based exams, comprising: An acquisition module is established to create a set of possible answers for all questions in the computer-based test question bank during the computer-based test, and to acquire the first image of each answer in the answer set; wherein, the first image is a screenshot of any answer displayed in the answer area during the computer-based test. The tag building module is used to preprocess each of the first images, and to create classification tags for each of the preprocessed first images to build a tag set; The model training module is used to build a feature extraction and classification model based on the RegNet network, and to train the model based on the label set to obtain the target feature extraction and classification model; wherein, the RegNet network extracts label features in four stages, and a BAM attention mechanism is added to the bottleneck end of any block in each stage; The classification and recognition module is used to acquire the second image, extract features from the second image using the target feature extraction and classification model, and output the label information for the classification; wherein, the second image is a screenshot of the answer to be judged as correct or incorrect displayed in the answer area of the preprocessed computer-based test.
[0014] In a third aspect, the present invention provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the electronic device enables the machine learning-based method for rapid identification of computer-based exam answers proposed in the first aspect of the present invention.
[0015] In a fourth aspect, the present invention provides a computer-readable storage medium for storing a computer program that, when run on a computer, causes the computer to execute the machine learning-based method for rapid identification of computer-based exam answers proposed in the first aspect of the present invention.
[0016] 3. Beneficial effects This invention discloses a machine learning-based method, system, and electronic device for rapid identification of answers in computer-based exams. The core of the method leverages the characteristics of computer-based exams like Subject 1, which use a simultaneous answering and scoring model. These characteristics include a limited number of answer combinations, allowing for answer classification to quickly identify student answers; and the fixed positions of the question and answer areas during the exam, enabling the use of image feature correspondence for classification. Based on this, the method includes the following steps: obtaining screenshots of exam answers and creating labels; constructing a feature extraction and classification model based on a RegNet network with a BAM attention mechanism; inputting the labels corresponding to the answer combinations into the model and iteratively calculating to obtain the optimal feature extraction target model; inputting the screenshot of the answer to be identified into the classification model to extract features and obtain classification label information, which is the result of the identification and classification. This invention summarizes the process of OCR text recognition in computer-based exams with a simultaneous answering and scoring model as an image classification problem, and extends the improved lightweight classification network RegNet to achieve fast and highly accurate classification.
[0017] The feature extraction and classification model based on the RegNet network with added BAM attention mechanism proposed in this invention is applied to the rapid identification and classification of test questions and answers. Compared with the existing technology, its average recognition speed is improved to 0.013s. This method is faster and more suitable for real-time response scenarios.
[0018] It should be understood that all combinations of the foregoing concepts and the additional concepts described in more detail below can be considered part of the inventive subject matter of this disclosure, provided that such concepts do not contradict each other.
[0019] The foregoing and other aspects, embodiments, and features of the teachings of the present invention will be more fully understood from the following description in conjunction with the accompanying drawings. Other additional aspects of the invention, such as features and / or beneficial effects of exemplary embodiments, will become apparent from the following description or may be learned through practice of specific embodiments according to the teachings of the present invention. Attached Figure Description
[0020] The accompanying drawings are not drawn to scale. In the drawings, each identical or nearly identical component shown in the various figures may be denoted by the same reference numeral. For clarity, not every component is labeled in each figure. Embodiments of various aspects of the invention will now be described by way of example and with reference to the accompanying drawings, wherein: Figure 1 This is a flowchart of the machine learning-based method for rapid identification of computer-based exam answers disclosed in this invention. Figure 2 This is a bottleneck composition diagram of a block in the RegNet network stage disclosed in this invention; Figure 3 This is a flowchart of the method for judging the correctness of test questions based on model classification results disclosed in this invention; Figure 4 This is a flowchart of the process of obtaining screenshots of answers to be judged as correct or incorrect during a computer-based exam, as disclosed in this invention. Figure 5 This is a block diagram of the machine learning-based rapid answer recognition system for computer-based exams disclosed in this invention. Figure 6 This is an example diagram of an electronic device proposed in an embodiment of the present invention. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the described embodiments of the present invention without creative effort are within the scope of protection of the present invention. Unless otherwise defined, the technical or scientific terms used herein should have the ordinary meaning understood by those skilled in the art to which this invention pertains.
[0022] The terms "first," "second," and similar words used in the specification and claims of this patent application do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Similarly, unless the context clearly indicates otherwise, the singular forms of "an," "a," or "the," etc., do not indicate a quantity limitation, but rather indicate the presence of at least one. Terms such as "comprising" or "including" mean that the element or object preceding "comprising" encompasses the features, integrals, steps, operations, elements, and / or components listed following "comprising" or "including," and do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or collections thereof. This invention aims to address the real-time, rapid response required in computer-based exams with edge-based question-and-answer scoring modes. It proposes a machine learning-based method, system, and electronic device for rapid answer recognition in such scenarios. The method utilizes a lightweight classification network, RegNet, with an added BAM attention mechanism to train a classification model, transforming this type of OCR text recognition problem into an image processing classification problem, enabling fast and highly accurate answer classification and recognition.
[0023] The following detailed description, in conjunction with the specific embodiments shown in the accompanying drawings, further illustrates the machine learning-based method, system, and electronic device for rapid identification of computer-based exam answers disclosed in this invention.
[0024] Combination Figure 1 As shown, the machine learning-based method for rapid identification of computer-based exam answers disclosed in this invention includes the following steps: Step S102: For all questions in the computer-based test question bank, establish a set of possible answers for all questions during the computer-based test, and obtain the first image of each answer in the answer set; wherein, the first image is a screenshot of any answer displayed in the answer area during the computer-based test. In driving school theory tests, the positions of the question area and answer area on the computer-based testing interface are fixed and do not change with the test questions. Therefore, when selecting images, it is only necessary to use a selection rectangle to capture a portion of the target image at a fixed position on the test question's computer-based testing interface. In practice, a coordinate system is established on the computer-based testing interface, and the selection rectangle's coordinates are set to complete the selection of the target image.
[0025] Step S104: Preprocess each of the first images, and create classification labels for each of the preprocessed first images to construct a label set; Assuming the question types in the computer-based test question bank are true / false questions and multiple-choice questions with four options (A, B, C, and D), there are 18 possible answer types for all test questions. The constructed tag set consists of a first image and the corresponding tag number. Table 1 below shows the answer options and tag numbers categorized in the first image. In this embodiment, the tag information output by the subsequent model is the tag number.
[0026] Table 1 shows the answer options and corresponding tag numbers for each of the first image categories in the tag set.
[0027] In this embodiment, the preprocessing of the first image mainly involves binarizing it into a binary image to filter out possible background interference. If the first image is a color image, it is first processed in grayscale and then binarized. The binary image is unified to the target size, usually scaled to a smaller size, and then normalized. The normalization process mainly involves converting the image data into floating-point numbers and normalizing them to [0,1] to avoid gradient explosion in each channel of the input image matrix.
[0028] Step S106: Build a feature extraction and classification model based on the RegNet network, and train the model based on the label set to obtain the target feature extraction and classification model; wherein, the RegNet network extracts label features in four stages, and a BAM attention mechanism is added to the bottleneck end of any block in each stage. Step S108: Obtain the second image, use the target feature extraction classification model to extract features from the second image, and output the label information for identification and classification; wherein, the second image is a screenshot of the answer to be judged as correct or incorrect displayed in the answer area of the preprocessed computer test answering process, and the second image is selected using the same coordinates as the first image.
[0029] In this embodiment, the problem of recognizing candidates' answers in computer-based tests with a question-and-answer format, such as driver's license theory test (subject 1), is transformed into a problem of classifying images based on a limited combination of test questions and answers. Therefore, a feature extraction and classification model based on the RegNet network is built. The embodiment selects the RegNetx model as the benchmark for the feature extraction and classification model based on the RegNet network. Compared with the RegNety network structure, the RegNetx model adopts a grouped convolutional structure, which is more lightweight and has a faster computation speed.
[0030] The basic network of the RegNetx model consists of a head, a backbone, and a main body. The main body contains four stages for reducing feature resolution. To improve classification accuracy while maintaining computational speed, the feature extraction classification model introduces the BAM attention mechanism in each stage. The BAM attention mechanism consists of a channel attention branch and a spatial attention branch. The two are connected in parallel and activated by the Sigmoid function to generate attention weights. Finally, the attention weights are fused with the input feature map in the form of residuals.
[0031] The BAM attention mechanism is introduced at the following location: Each stage consists of a series of blocks, and each block contains at least one bottleneck. Inside the bottleneck, three convolutional processes are implemented: a dimensionality reduction layer, a feature extraction layer, and a dimensionality increase layer. At the end of the bottleneck, the BAM attention mechanism is inserted to add the BAM output after the multi-scale transformation of the feature map. Then, the residual is connected to the identity mapping, as shown below. Figure 2 As shown, the convolutional processing within the bottleneck widens the channels and spatial attention, increasing the stability of the feature extraction process. After adding the BAM attention mechanism to each stage, except for the first block which is not processed, each input from the second block onwards undergoes parallel processing of channel and spatial attention, resulting in a channel attention map and a spatial attention map. The output of each block contains the internally obtained channel and spatial attention maps. The BAM attention mechanism fuses multi-scale features with the spatial and channel attention maps as a whole, obtaining an output containing feature and attention enhancement terms, which is then added to the identity mapping.
[0032] The formula for calculating the BAM attention mechanism is as follows:
[0033] In the formula, X is the input. It is the output. It is channel attention. It is spatial attention; After training the RegNetx model with the BAM attention mechanism, we obtain a model with the minimum loss and the best performance, which is denoted as the target feature extraction classification model.
[0034] The parameters for training the RegNetx model with the BAM attention mechanism described above are as follows: During pre-training, the parameters of the BAM attention mechanism are randomly initialized for the feature extraction classification model, while other layers use the original weights. The number of compressed channels within the BAM attention mechanism is adjusted according to the number of channels in each stage of the RegNetx model, and the expansion factor is set to 4. The traditional activation layer within the BAM attention mechanism is replaced with a BN layer. The optimizer uses the Adam adaptive learning rate optimization algorithm, adjusting the learning rate to 1 / 10 of the initial learning rate after adding the BAM attention mechanism, and decaying by 0.1 times every 10 rounds. The loss function of the feature extraction classification model is the cross-entropy loss function. During training, each iteration reduces the loss, meaning the output matrix is closer to the matrix corresponding to the label. For example, if there are 5 labels for the classification category, and the input image corresponds to the 2nd label, with a corresponding feature matrix of [0 1 0 0 0], the feature matrix output by the model after the first pass during training is [0.3 0.3 0.2 0.1 0.1], and the feature matrix output after the nth pass is [0.1 0.8 0.05 0.05 0], resulting in reduced loss and more accurate results.
[0035] Compared to the regular RegNetx model, the RegNetx model with BAM attention mechanism, after multiple iterations of training, becomes a classifier for the answers to computer-based exam questions. Adding BAM attention mechanism can effectively extract features without increasing network depth to improve model performance.
[0036] As an optional implementation, the above-mentioned machine learning-based method for rapid identification of computer-based exam answers further includes using categorized and tagged screenshots of answers during the exam to determine the correctness of the questions, in order to ultimately obtain the exam score; specifically, it includes the following steps: Step S202: Obtain a third image for each question in the computer-based test question bank; wherein, the third image is a screenshot of the question content displayed in the question area of the computer-based test interface; the screenshot of the question area can also be selected using coordinate boxes in the coordinate system established in the computer-based test interface, and because the questions are randomly selected from the question bank during the computer-based test, the question content displayed synchronously on the computer-based test interface is matched with the question bank, which is accurate and efficient.
[0037] Step S204: Establish a test question set based on a number of the third images, wherein any of the third images in the test question set is attached with the label information for identifying and classifying the correct answer of the corresponding test question; Similar to the driver's license theory test, its computer-based test question bank is universally applicable nationwide. This is because the test question set, which is built based on the third-party images obtained from the computer-based test question bank, can be directly used in any test without the need for repeated creation. Only when the computer-based test question bank is updated, the third-party images corresponding to the test questions are updated with added tag information, such as the added tag number, and then added to the test question set.
[0038] Step S206: Obtain the fourth image of the current computer-based exam interface, and search for the third image that matches the fourth image in the exam question set; wherein, the fourth image is a screenshot of the exam question content displayed in the exam question area of the current computer-based exam interface, and the process of searching for the third image is performed synchronously with the process of model classification of the second image; Step S208: Determine whether the label information attached to the matched third image is consistent with the label information output by the target feature extraction classification model. If the label information is consistent, the question is answered correctly; otherwise, the question is answered incorrectly.
[0039] Optionally, the method further includes step S210, which involves counting incorrect questions based on the judgment result after determining whether the questions are correct or incorrect, so that when the number of incorrect questions exceeds a set threshold, the exam is declared a failure and the current computer-based exam ends.
[0040] As an optional implementation, the process of acquiring the second image in step S108 is as follows: Figure 4 As shown, the process includes: Step S1081, acquiring screenshots of answers to be judged as correct or incorrect in the answer area during the computer-based test at a preset frequency, such as 1 second; Step S1082, binarizing the answer screenshots, unifying them to a target size, and then normalizing them to obtain the second image. For the recognition and classification task, the second image obtained by capturing and preprocessing at any given second constitutes a classification task. However, due to factors such as the candidate's answering speed or the candidate's answer modification, the target feature extraction classification model can classify answer screenshots with high accuracy and speed, but it cannot be used to directly determine the correctness of the answers. Therefore, when using the categorized and labeled answer screenshots for judging the correctness of the test questions, it is also necessary to combine the answering time to determine the final answer screenshot of the candidate's answer.
[0041] That is, as an optional implementation, step S108, which involves acquiring the second image, further includes: Step S108, receiving an instruction to proceed to the next question after answering the computer-based exam questions, selecting the answer screenshot closest to the time of receiving the instruction from several screenshots of the answers to be judged during the previous question's answering process as the final answer screenshot of the exam question, and using the tag information of the second image category obtained after preprocessing the final answer screenshot of the exam question as the final tag information of the answer category of the previous exam question. The determination of the distance from the time of receiving the instruction is based on the screenshot time.
[0042] As an optional implementation, the process of obtaining the second image in step S206 above includes: step S2061, receiving a first instruction to proceed to the next exam question after answering the computer-based exam questions and entering the current exam question, and periodically acquiring several area images of the computer-based exam interface according to a preset frequency during the answering process of the current exam question; wherein, the area image closest to the time of receiving the first instruction includes a screenshot of the exam question content displayed in the exam question area and a screenshot of the answer to be judged as correct or incorrect displayed in the answer area, and the other area images only contain screenshots of the answer to be judged as correct or incorrect displayed in the answer area; during the answering process of an exam question, the exam question content does not change, so the exam question content is only captured when the area image is acquired for the first time when entering a new exam question.
[0043] Step S2062: The screenshot of the exam question displayed in the question area of the image closest to the time the first instruction was received is identified as the fourth image; the screenshot of the answer to be judged as correct or incorrect displayed in the answer area of the image closest to the time the second instruction was issued is identified as the second image; the third image is matched based on the fourth image; and model classification is performed based on the second image. The second instruction is the instruction to proceed to the next question after the current question has been answered. Similarly, the determination of the proximity to the time of receiving any instruction is based on the screenshot time.
[0044] Once the exam questions are determined and the screenshots of the final answers are identified and categorized using tags, the correctness of the candidate's final answers during the computer-based testing process can be accurately determined.
[0045] Taking the ImageNet dataset as an example, the feature extraction and classification model based on the RegNet network disclosed in this embodiment is trained and classified. The feature extraction and classification model disclosed in this embodiment improves the Top-1 accuracy by 2.1% compared with RegNetx-400MF, while maintaining a similar inference speed.
[0046] Based on the subject questions of the third-party driving test learning software "Driving Test Treasure Book", 54 test questions were customized and obtained. The answer recognition was performed using the fast answer recognition method for computer-based tests disclosed in this embodiment and the PaddleOCR tool library. The results show that the method of the present invention significantly improves the recognition and reasoning speed compared with the PaddleOCR tool library. The recognition rate is increased from 0.02s to 0.013s, and the time consumption is reduced by 35%. This fully demonstrates that the machine learning-based fast answer recognition method for computer-based tests disclosed in this embodiment is more suitable for this type of scenario that requires real-time response.
[0047] Based on the same inventive concept as the above-described method embodiments, this application also discloses a machine learning-based rapid answer recognition system for computer-based exams, such as... Figure 5 The diagram shows a framework of a machine learning-based rapid answer recognition system for computer-based exams, comprising: an acquisition module for establishing a set of possible answers for all questions in the exam question bank and acquiring a first image of each answer in the set; wherein the first image is a screenshot of any answer displayed in the answer area during the exam; a label construction module for preprocessing each first image and creating classification labels for each preprocessed first image to construct a label set; a model training module for building a feature extraction and classification model based on a RegNet network and training the model based on the label set to obtain a target feature extraction and classification model; wherein the RegNet network extracts label features in four stages, and a BAM attention mechanism is added to the bottleneck end of each block in each stage; and a classification and recognition module for acquiring a second image, extracting features from the second image using the target feature extraction and classification model, and outputting label information for classification; wherein the second image is a screenshot of the answer to be judged as correct or incorrect displayed in the answer area during the preprocessed exam.
[0048] As an optional implementation, the process of the classification and recognition module acquiring the second image is as follows: according to a preset frequency, periodically acquire screenshots of the answers to be judged as correct or incorrect displayed in the answer area during the computer-based test; binarize the answer screenshots, unify them to a target size, and then perform normalization processing to obtain the second image. Optionally, the process of the classification and recognition module acquiring the second image further includes: receiving an instruction to proceed to the next test question after completing the computer-based test; selecting the answer screenshot closest to the time of receiving the instruction from several screenshots of the answers to be judged as correct or incorrect from the previous test question's answer process as the final answer screenshot of the test question; and using the label information of the second image classification obtained after preprocessing the final answer screenshot of the test question as the final label information of the answer classification of the previous test question.
[0049] The steps of the system for implementing the machine learning-based rapid answer recognition method for computer-based exams disclosed in the above embodiments have already been described and will not be repeated here.
[0050] For example, the benchmark for the feature extraction and classification model based on the RegNet network built in the model training module is the RegNetx model. The RegNetx model includes a head, a backbone, and a network body. The network body contains four stages for reducing feature resolution. Within the bottleneck of any block in any stage, three convolutional processes are set. After the three convolutional processes, a BAM attention mechanism is added. After the BAM attention mechanism enables each input in the stage to undergo parallel processing of channel attention and spatial attention starting from the second block, an identity mapping is connected using residuals. The BAM attention mechanism includes channel attention branches and spatial attention branches, which are connected in parallel. After parallel connection, attention weights are generated by activating the sigmoid function and fused with the multi-scale feature map of the input in residual form, thereby obtaining an output containing feature and attention enhancement terms. The training parameters of the feature extraction classification model based on the RegNet network are as follows: During the pre-training of the feature extraction classification model, the parameters of the BAM attention mechanism are randomly initialized, and the original weights are used for other layers. The number of compressed channels inside the BAM attention mechanism is adjusted according to the number of channels in each stage of the RegNetx model, and the expansion factor is set to 4. The traditional activation layer inside the BAM attention mechanism is replaced with a BN layer. The optimizer adopts the Adam adaptive learning rate optimization algorithm. After adding the BAM attention mechanism, the learning rate is adjusted to 1 / 10 of the initial learning rate, and decays by 0.1 times every 10 rounds. The loss function of the feature extraction classification model is the cross-entropy loss function.
[0051] For example, a machine learning-based rapid answer recognition system for computer-based exams, when accurately judging the candidate's computer-based exam answers based on the classification results output by the classification recognition module, further includes: a question acquisition module, used to acquire a third image for each question in the computer-based exam question bank; wherein the third image is a screenshot of the question content displayed in the question area of the computer-based exam interface; an attachment module, used to build a question set based on several of the third images, wherein any third image in the question set is attached with the label information corresponding to the correct answer recognition classification of the question; a matching module, used to acquire a fourth image of the current computer-based exam interface, and search for a third image that matches the fourth image in the question set; wherein the fourth image is a screenshot of the question content displayed in the question area of the current computer-based exam interface, and the process of searching for the third image is performed synchronously with the process of model classification of the second image; and an answer judgment module, used to judge whether the label information attached to the matched third image is consistent with the label information output by the target feature extraction classification model, and if the label information is consistent, the question answer is correct; otherwise, the question answer is incorrect.
[0052] As an optional implementation, the process of the matching module acquiring the fourth image of the current computer-based exam interface is as follows: receiving a first instruction to proceed to the next exam question after answering the computer-based exam questions and entering the current exam question; during the answering process of the current exam question, acquiring several regional images of the computer-based exam interface at preset frequencies; wherein, the regional image closest to the time of receiving the first instruction includes a screenshot of the exam question content displayed in the exam question area and a screenshot of the answer to be judged as correct or incorrect displayed in the answer area, and the other regional images only contain screenshots of the answer to be judged as correct or incorrect displayed in the answer area; determining the screenshot of the exam question content displayed in the exam question area of the regional image closest to the time of receiving the first instruction as the fourth image, determining the screenshot of the answer to be judged as correct or incorrect displayed in the answer area of the regional image closest to the time of issuing the second instruction as the second image, searching for and matching the third image based on the fourth image, and performing model classification based on the second image; wherein, the second instruction is the instruction to proceed to the next exam question issued after the current exam question is answered.
[0053] The present invention discloses a machine learning-based method, system, and electronic device for rapid identification of answers in computer-based exams. Based on the characteristic that the positions of the question and answer areas remain unchanged during computer-based exams with a side-answer / variable-scoring mode, and the characteristic that the questions are true / false or multiple-choice questions with only a limited number of answer combinations, the method summarizes the process of OCR text recognition as an image classification problem. It then utilizes a lightweight classification network, RegNet, improved with a BAM attention mechanism, to achieve fast and highly accurate classification. Compared to existing technologies, the proposed solution is more suitable for applications requiring real-time responses, offering both fast classification speed and high accuracy.
[0054] Based on the same inventive concept as the above method embodiments, this application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the electronic device enables the machine learning-based rapid identification method for computer-based exam answers described in the above embodiments.
[0055] In one embodiment, the electronic device may be a server, and in this embodiment, the structure of the electronic device may be as follows: Figure 6 As shown, it includes a memory 201, a communication module 203, and one or more processors 202. Memory 201 is used to store computer programs executed by processor 202. Memory 201 may mainly include a program storage area and a data storage area. The program storage area may store the operating system and programs required for running instant messaging functions, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc. Memory 201 may be volatile memory, such as random-access memory (RAM); memory 201 may also be non-volatile memory, such as read-only memory, flash memory, hard disk drive (HDD), or solid-state drive (SSD); or memory 201 may be any other medium capable of carrying or storing a desired computer program in the form of instructions or data structures, and accessible by a computer, but is not limited thereto. Memory 201 may be a combination of the above-mentioned memories. The processor 202 may include one or more central processing units (CPUs) or digital processing units, etc. The processor 202 is used to implement the aforementioned audio data processing method when calling a computer program stored in the memory 201. The communication module 203 is used to communicate with terminal devices and other servers. This application embodiment does not limit the specific connection medium between the memory 201, communication module 203, and processor 202 described above. This application embodiment... Figure 6 The memory 201 and the processor 202 are connected via a bus 204, and the bus 204 is in Figure 6 The connections between other components are illustrated with arrows and are for illustrative purposes only, not as limiting information. Bus 204 can be divided into address bus, data bus, control bus, etc. For ease of description, Figure 6The text uses only one arrow to describe it, but does not indicate that there is only one bus or one type of bus. Based on the same inventive concept as the above-described method embodiments, embodiments of the present invention also provide a computer-readable storage medium for storing a computer program. When the computer program is run on a computer, it enables the electronic device to implement the machine learning-based rapid answer recognition method for computer-based exams described in the above embodiments. The computer-readable storage medium can be a readable signal medium or a readable storage medium. A readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a magnetic disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. Based on the same inventive concept as the above-described method embodiments, embodiments of the present invention also provide a computer program product, which includes a computer program that, when run on an electronic device, causes the electronic device to perform the steps in the machine learning-based rapid answer recognition method for computer-based exams according to various exemplary embodiments of this application described above. The program product may take the form of any combination of one or more readable media. These computer program commands can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to produce a machine, such that the commands executed by the processor of the computer or other programmable data processing device generate a process for implementing... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0056] While the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the invention. Those skilled in the art can make various modifications and refinements without departing from the spirit and scope of the invention. Therefore, the scope of protection of the present invention shall be determined by the claims.
Claims
1. A method for rapid identification of computer-based exam answers based on machine learning, characterized in that, include: For all questions in the computer-based test question bank, establish a set of possible answers for all questions during the computer-based test, and obtain the first image of each answer in the answer set; wherein, the first image is a screenshot of any answer displayed in the answer area during the computer-based test; Each of the first images is preprocessed, and each of the preprocessed first images is made into a classification label to construct a label set; A feature extraction and classification model based on the RegNet network is constructed, and the model is trained based on the label set to obtain the target feature extraction and classification model; wherein, the RegNet network extracts label features in four stages, and a BAM attention mechanism is added to the bottleneck end of any block in each stage; The second image is obtained, and the target feature extraction and classification model is used to extract features from the second image, outputting the label information for identification and classification; wherein, the second image is a screenshot of the answer to be judged as correct or incorrect displayed in the answer area of the preprocessed computer-based test answering process.
2. The method for rapid identification of computer-based exam answers based on machine learning according to claim 1, characterized in that, The benchmark for the feature extraction and classification model based on the RegNet network is the RegNetx model; The RegNetx model includes a head, a backbone, and a network body, with the network body containing four stages for reducing feature resolution. In any of the stages, three convolutional processes are set inside the bottleneck of any block. After the three convolutional processes, a BAM attention mechanism is added. After the stage performs parallel processing of channel attention and spatial attention for each input starting from the second block through the BAM attention mechanism, the residual connection identity mapping is used. The BAM attention mechanism includes a channel attention branch and a spatial attention branch, which are connected in parallel. After being connected in parallel, the attention weights are generated by activating the sigmoid function and then fused with the input multi-scale feature map in the form of residuals to obtain an output containing features and attention enhancement terms.
3. The method for rapid identification of computer-based exam answers based on machine learning according to claim 2, characterized in that, The training parameters of the feature extraction and classification model based on the RegNet network are as follows: During the pre-training of the feature extraction classification model, the parameters of the BAM attention mechanism are randomly initialized, and the original weights are used for other layers. The number of compressed channels inside the BAM attention mechanism is adjusted according to the number of channels in each stage of the RegNetx model, and the expansion factor is set to 4. The traditional activation layer inside the BAM attention mechanism is replaced with a BN layer; The optimizer uses the Adam adaptive learning rate optimization algorithm. After adding the BAM attention mechanism, the learning rate is adjusted to 1 / 10 of the initial learning rate, and decays by 0.1 times every 10 rounds. The loss function selected for the feature extraction and classification model is the cross-entropy loss function.
4. The method for rapid identification of computer-based exam answers based on machine learning according to claim 1, characterized in that, Also includes: For all questions in the computer-based test question bank, obtain the third image for each question; wherein the third image is a screenshot of the question content displayed in the question area of the computer-based test interface; A question set is established based on several third images, and each of the third images in the question set is attached with the label information corresponding to the correct answer identification and classification of the question; Obtain the fourth image of the current computer-based exam interface, and search for the third image that matches the fourth image in the exam question set; wherein, the fourth image is a screenshot of the exam question content displayed in the exam question area of the current computer-based exam interface, and the process of searching for the third image is performed synchronously with the process of model classification of the second image; Determine whether the label information attached to the matched third image is consistent with the label information output by the target feature extraction classification model. If the label information is consistent, the question is answered correctly; otherwise, the question is answered incorrectly.
5. The method for rapid identification of computer-based exam answers based on machine learning according to claim 1, characterized in that, The process of obtaining the second image is as follows: Based on a preset frequency, screenshots of the answers to be judged as right or wrong displayed in the answer area during the computer-based test are periodically retrieved. The screenshot of the answer is binarized, unified to the target size, and then normalized to obtain the second image.
6. The method for rapid identification of computer-based exam answers based on machine learning according to claim 5, characterized in that, The process of obtaining the second image also includes: After receiving the instruction to proceed to the next question after answering the computer-based test, the system selects the answer screenshots from the previous question's answer process that are closest to the time the instruction was received as the final answer screenshot for the question. The system then uses the tag information of the second image category obtained after preprocessing the final answer screenshot as the final tag information for the answer category of the previous question.
7. The method for rapid identification of computer-based exam answers based on machine learning according to claim 4, characterized in that, The process of obtaining the fourth image of the current computer-based exam interface is as follows: After receiving the first instruction to proceed to the next question after answering the computer-based test, the system enters the current question. During the answering process of the current question, several area images of the computer-based test interface are acquired at preset frequencies. Among them, the area image closest to the time of receiving the first instruction includes a screenshot of the test content displayed in the question area and a screenshot of the answer to be judged as correct or incorrect displayed in the answer area. The other area images only contain screenshots of the answer to be judged as correct or incorrect displayed in the answer area. The screenshot of the exam question displayed in the exam question area of the image closest to the time the first instruction was received is identified as the fourth image; the screenshot of the answer to be judged as correct or incorrect displayed in the answer area of the image closest to the time the second instruction was issued is identified as the second image; the third image is matched based on the fourth image; and the model is classified based on the second image; wherein, the second instruction is the instruction to proceed to the next exam question issued after the current exam question has been answered.
8. A machine learning-based system for rapid identification of answers in computer-based exams, characterized in that, include: An acquisition module is established to create a set of possible answers for all questions in the computer-based test question bank during the computer-based test, and to acquire the first image of each answer in the answer set; wherein, the first image is a screenshot of any answer displayed in the answer area during the computer-based test. The tag building module is used to preprocess each of the first images, and to create classification tags for each of the preprocessed first images to build a tag set; The model training module is used to build a feature extraction and classification model based on the RegNet network, and to train the model based on the label set to obtain the target feature extraction and classification model; wherein, the RegNet network extracts label features in four stages, and a BAM attention mechanism is added to the bottleneck end of any block in each stage; The classification and recognition module is used to acquire the second image, extract features from the second image using the target feature extraction and classification model, and output the label information for the classification; wherein, the second image is a screenshot of the answer to be judged as correct or incorrect displayed in the answer area of the preprocessed computer-based test.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it enables the electronic device to implement the machine learning-based method for rapid identification of computer-based exam answers as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program that, when run on a computer, causes the computer to perform the machine learning-based method for rapid identification of computer-based exam answers as described in any one of claims 1 to 7.