Arithmetic problem correction method and device, storage medium and electronic equipment
The arithmetic problem grading method, which generates a character probability matrix and performs two-level judgments, solves the problem of low accuracy in handwritten character recognition and improves the accuracy of the grading system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGZHOU SHIYUAN ELECTRONICS CO LTD
- Filing Date
- 2021-09-30
- Publication Date
- 2026-04-28
AI Technical Summary
Existing arithmetic problem grading systems have low accuracy in recognizing handwritten characters, leading to incorrect grading results and affecting the system's overall accuracy.
By generating a character probability matrix, the correction results are output based on a two-level judgment method. The first correction result is output when it is correct, and the second correction result is used for verification otherwise, thus reducing the error in the correction results caused by recognition errors.
It improved the accuracy of grading arithmetic problems and reduced the probability of grading errors due to recognition mistakes.
Smart Images

Figure CN115909373B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, storage medium and electronic device for grading arithmetic problems. Background Technology
[0002] With the development of artificial intelligence technology, homework correction systems that use detection and recognition algorithms are becoming increasingly mature. More and more teachers and parents are using these systems to correct students' homework, bringing convenience to teachers and parents in guiding their children's education. Summary of the Invention
[0003] This application provides a method, apparatus, storage medium, and electronic device for grading arithmetic problems. It performs two-level judgments based on two grading results, reducing the probability of grading errors due to misidentification of the arithmetic problem and improving the accuracy of grading arithmetic problems. The technical solution is as follows:
[0004] In a first aspect, embodiments of this application provide a method for grading arithmetic problems, the method comprising:
[0005] Get the image containing the arithmetic problem;
[0006] Identify the target arithmetic problem in the image to obtain the character probability matrix corresponding to the target arithmetic problem. The character probability matrix includes columns with the same number of characters as the target arithmetic problem, and each column includes the recognition probability corresponding to all characters of the same character type.
[0007] The first and second recognition results are determined based on the recognition probability of each column;
[0008] Based on the first recognition result and the second recognition result, the correction result of the target arithmetic problem is output.
[0009] Secondly, embodiments of this application provide an arithmetic problem grading device, the device comprising:
[0010] The image acquisition module is used to acquire images containing arithmetic problems;
[0011] The matrix acquisition module is used to identify the target arithmetic problem in the image and obtain the character probability matrix corresponding to the target arithmetic problem. The character probability matrix includes columns with the same number of characters as the target arithmetic problem, and each column includes the recognition probability corresponding to all characters of the same character type.
[0012] The result determination module is used to determine the first recognition result and the second recognition result based on the recognition probability of each column;
[0013] The result output module is used to output the correction result of the target arithmetic problem based on the first recognition result and the second recognition result.
[0014] Thirdly, embodiments of this application provide a computer storage medium storing a plurality of instructions adapted for loading by a processor and executing the above-described method steps.
[0015] Fourthly, embodiments of this application provide an electronic device that may include: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to execute the above-described method steps.
[0016] The beneficial effects of the technical solutions provided in this application include at least the following:
[0017] By employing the embodiments of this application, arithmetic problems in an image are identified, and a first batch of correction results and a second batch of correction results are obtained based on the character recognition probability. Two-level judgments are made using the two correction results, which reduces the probability of incorrect correction results due to misidentification of arithmetic problems and improves the accuracy of correcting arithmetic problems. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1a This is a system architecture diagram of an arithmetic problem grading method provided in an embodiment of this application;
[0020] Figure 1b This is a system architecture diagram of another arithmetic problem grading method provided in the embodiments of this application;
[0021] Figure 2 This is a flowchart illustrating a method for grading arithmetic problems provided in an embodiment of this application;
[0022] Figure 3 This is an example illustration of an arithmetic problem in machine-written font provided in an embodiment of this application;
[0023] Figure 4 This is an example illustration of an arithmetic problem in handwritten form provided in an embodiment of this application;
[0024] Figure 5 This is an example illustration of how arithmetic problems in an image receive corrected results, provided in an embodiment of this application.
[0025] Figure 6 This is a flowchart illustrating a method for grading arithmetic problems provided in an embodiment of this application;
[0026] Figure 7 This is an example diagram illustrating a merged character recognition probability column provided in an embodiment of this application;
[0027] Figure 8 This is a schematic diagram of the structure of an arithmetic problem correction device provided in an embodiment of this application;
[0028] Figure 9 This is a schematic diagram of the structure of an identification result determination module provided in an embodiment of this application;
[0029] Figure 10 This is a schematic diagram of the structure of a second result determination unit provided in an embodiment of this application;
[0030] Figure 11 This is a schematic diagram of the structure of a correction result output module provided in an embodiment of this application;
[0031] Figure 12 This is a schematic diagram of the structure of a probability matrix determination module provided in an embodiment of this application;
[0032] Figure 13 This is a schematic diagram of the structure of an arithmetic problem detection unit provided in an embodiment of this application;
[0033] Figure 14 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0034] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0035] In the following description, when referring to the accompanying drawings, the same numbers in different drawings denote the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0036] In the description of this application, it should be understood that the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances. Furthermore, in the description of this application, unless otherwise stated, "multiple" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship.
[0037] Existing arithmetic problem grading systems typically employ the following method: acquiring an image containing arithmetic problems, detecting and recognizing the characters within the problem, and then obtaining the grading result based on the recognized characters. While this method efficiently yields grading results, it only performs a single recognition operation, compromising accuracy. This is particularly problematic for mental arithmetic problems, where answers in images are presented in both typed and handwritten formats. Typed text is generally neater and easier to recognize, while handwritten text, due to its varied fonts, suffers from lower accuracy. Combined with limited training data, this ultimately leads to grading errors, impacting the overall accuracy of the grading system.
[0038] Based on this, this application provides a method for grading arithmetic problems. It can obtain the first and second grading results based on the character probability matrix generated during the character recognition process. If the first grading result is incorrect, the second grading result is output, thereby reducing the probability of obtaining incorrect grading results due to misrecognition of arithmetic problems and improving the accuracy of grading arithmetic problems.
[0039] The present application will now be described in detail with reference to specific embodiments.
[0040] Please see Figure 1a as well as Figure 1b This is a system architecture diagram of two arithmetic problem grading methods provided in the embodiments of this application. Figure 1a The system includes the user, the mobile terminal, and an image containing arithmetic problems. When it is necessary to correct the arithmetic problems in the image, the user only needs to use the mobile terminal to take a picture of the displayed arithmetic problems to obtain the image and start correcting the arithmetic problems.
[0041] Figure 1bThe system includes a user, a camera, a mobile terminal, and an image containing arithmetic problems. When the user needs to correct the arithmetic problems in the image, they trigger the camera to open the lens, capture a picture of the displayed arithmetic problems, and send the resulting image to the mobile terminal. The mobile terminal then begins correcting the arithmetic problems in the image. The camera can send the image to the mobile terminal via a device that communicates with the mobile terminal wirelessly or via a wired connection. Wireless communication methods between the mobile terminal and the camera include, but are not limited to, cellular networks, wireless LANs, infrared networks, near-field communication networks, or Bluetooth networks. Wired communication methods include, but are not limited to, Universal Serial Bus (USB).
[0042] After acquiring an image containing arithmetic problems, the mobile terminal detects the arithmetic problems and identifies the characters of the target arithmetic problem, obtaining the character probability matrix corresponding to the target arithmetic problem. Based on the character probability matrix, it obtains the first recognition result and the second recognition result of the target arithmetic problem, and then obtains the first batch of correction results and the second batch of correction results. If the first batch of correction results is correct, the first batch of correction results is output; if the first batch of correction results is incorrect, the second batch of correction results is output.
[0043] The above method corrects the target arithmetic problem based on two correction results, and judges whether the target arithmetic problem is correct. This avoids the probability of incorrect correction results due to misidentification of the arithmetic problem, and improves the accuracy of correcting arithmetic problems.
[0044] The above method can be applied to an arithmetic problem grading device, which can be the aforementioned mobile terminal, including but not limited to: smart interactive whiteboards, personal computers, tablets, handheld devices, computing devices, or other processing devices connected to a wireless modem. In different networks, user terminals may have different names, such as: user equipment, access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication equipment, user agent or user device, cellular phone, cordless phone, personal digital assistant (PDA), terminal equipment in 5G networks or future evolved networks, etc.
[0045] Please see Figure 2 This is a flowchart illustrating a method for grading arithmetic problems provided in an embodiment of this application. This embodiment uses a mobile terminal as an example for description, and the method for grading arithmetic problems may include the following steps:
[0046] S101, Obtain the image containing the arithmetic problem;
[0047] Among them, arithmetic problems can be any mathematical calculation problems, and there are no restrictions on the form and type of arithmetic problems. For example, arithmetic problems can be such as Figure 3 The machine-printed font shown can also be in the form of, for example... Figure 4 The handwritten font shown indicates that the type of arithmetic problem can be mental arithmetic.
[0048] There are several ways to obtain images containing arithmetic problems. Common methods include taking pictures with a camera, obtaining them from the mobile device's image library, downloading them from the network or database, or taking screenshots directly from the mobile device's screen.
[0049] Taking the acquisition of images containing arithmetic problems via a camera as an example, the specific acquisition methods are divided into two types based on the camera's position. The first type is as follows: Figure 1a In the first scenario, the camera is located on the mobile device, allowing the user to directly capture images containing arithmetic problems using the device's camera; the second scenario is as follows... Figure 1b In the scenario shown, the camera is mounted on a video camera. The user uses the camera on the video camera to take an image containing arithmetic problems and then sends the image to a mobile terminal.
[0050] S102, identify the target arithmetic problem in the image and obtain the character probability matrix corresponding to the target arithmetic problem. The character probability matrix includes columns with the same number of characters as the target arithmetic problem, and each column includes the recognition probability corresponding to all characters of the same character type.
[0051] The target arithmetic problem in the image is identified based on the recognition algorithm. The character recognition probability of each character in the target arithmetic problem is obtained, and the character recognition probability of each character is composed of the character probability matrix of the target arithmetic problem.
[0052] In the recognition process, a matrix with the same number of columns as the target arithmetic problem is generated, and the character types included in the target arithmetic problem are determined. The number of rows in the matrix is the same as the number of character types. The characters and characters of the same type are arranged in a certain order to obtain a matrix with the same number of columns as the target arithmetic problem and the same number of rows as the number of character types in the target arithmetic problem.
[0053] Among these, "character type same" can mean belonging to the same character category as the character. For example, if the character is 1, its character type can be an Arabic numeral, and other characters belonging to the same character type can be other Arabic numerals such as 0-9. The character type can also be other characters used in arithmetic operations. For example, if the character is 4, other characters belonging to the same character type as it, besides Arabic numerals, can also be +, -, ×, ÷, =, etc. The number of characters with the same type as those in the target arithmetic problem is the number of characters with the same character type as those in the target arithmetic problem. For example, if the character type is defined as Arabic numeral, then the number of characters with the same character type is 10.
[0054] Among them, the character prediction probability can be the character probability obtained by the recognition algorithm when recognizing the character, that is, the probability of what kind of character the character may be. For example, taking expression (1) as an example, the third character in expression (1) is the printed 6. The recognition algorithm obtains the character probability that the character may be 6 with a probability of 85%. The 6 in the rightmost column of expression (1) is a handwritten font. The recognition algorithm obtains the character probability that the character may be 0 with a probability of 15%, the character may be 6 with a probability of 70%, and the character may be = with a probability of 5%. Although the character in the rightmost column of expression (1) is also 6, it is a handwritten font, which is more difficult to recognize. Therefore, the corresponding highest recognition probability is relatively smaller.
[0055]
[0056] S103, determine the first recognition result and the second recognition result based on the recognition probability of each column;
[0057] Determine the highest and second-highest recognition probabilities for each column in the character probability matrix, and take the character corresponding to the highest recognition probability in each column as the first recognition result. Subtract the highest and second-highest recognition probabilities in each column to obtain the difference for that column. Based on the difference for each column, determine the column with the smallest difference, and select the character corresponding to the second-highest recognition probability in the column with the smallest difference, along with the character corresponding to the highest recognition probability in the remaining columns, as the second recognition result.
[0058] The highest recognition probability can be the highest recognition probability in each column of the character probability matrix. Based on the highest recognition probability in each column, the corresponding character in each column of the first recognition result can be determined. For example, in a certain column, the recognition probability of 1 is 25%, the recognition probability of 2 is 5%, the recognition probability of 3 is 10%, the recognition probability of 7 is 60%, and the recognition probability of the remaining characters is 0%. The highest recognition probability is 60%. Based on this highest recognition probability, the corresponding character can be determined to be 7, and 7 is taken as one of the characters in the first recognition result.
[0059] The second-highest recognition probability can be the probability in each column of the character probability matrix that is second only to the highest recognition probability. The difference between the second-highest and highest recognition probabilities in each column determines the unique character in the first recognition result that needs to be replaced. For example, in a column, the recognition probability of 0 is 35%, 6 is 40%, 8 is 10%, and 9 is 15%, while the recognition probabilities of the remaining characters are all 0. The difference for this column is 5%. If the differences in the remaining columns are all greater than 5%, then this column corresponds to the character that needs to be replaced. In the first recognition result, 6 in this column is replaced with 0. The remaining columns in the first recognition result still select the character corresponding to the highest recognition probability, thus obtaining the second recognition result.
[0060] S104, based on the first recognition result and the second recognition result, output the correction result of the target arithmetic problem;
[0061] After determining the character corresponding to the first recognition result, perform calculations on the character corresponding to the first recognition result to obtain the correct answer to the arithmetic problem corresponding to the first recognition result. Take the character to the right of the equal sign in the first recognition result as the recognized answer. If the correct answer is the same as the recognized answer, it is determined that the first batch of corrected results for this arithmetic problem is correct, and the first batch of corrected results is output.
[0062] If the correct answer is different from the identified answer, the first batch of corrections for this arithmetic problem is determined to be incorrect. The character corresponding to the second identification result is then calculated to obtain the correct answer for the arithmetic problem corresponding to the second identification result. The character to the right of the equal sign in the second identification result is taken as the new identified answer. It is then determined whether the correct answer corresponding to the second identification result is the same as the new identified answer. If they are the same, the second batch of corrections is correct; otherwise, the second batch of corrections is incorrect, and the second batch of corrections is output.
[0063] After all the arithmetic problems on the image have been graded, the graded results are displayed after the corresponding area of each problem. The method of displaying the graded results can be common methods such as checkmarks and crosses, or other methods such as circles; there are no restrictions here. One feasible method is as follows: Figure 5 The method shown indicates that if the final output correction result is correct, check the box; otherwise, check the cross.
[0064] It should be noted that the first batch of correction results is only output if the first batch of correction results is correct. If the first batch of correction results is incorrect, it is considered that the first batch of correction results is incorrect due to identification error. The second batch of correction results is taken as the correction results obtained by correct identification. Regardless of whether the second batch of correction results is correct or incorrect, the second batch of correction results is output.
[0065] The correct answer can be obtained by performing calculations on the characters to the left of the equal sign in the identified characters.
[0066] The identified answer can be the character to the right of the equal sign in the identified characters; that is, the character to the right of the equal sign is considered the identified answer.
[0067] In this embodiment of the application, the recognition probability of characters is obtained during the process of recognizing the target arithmetic problem in the image, thereby obtaining the character probability matrix of the target arithmetic problem and the corresponding recognition result. Then, based on the recognition result, the first batch of correction results and the second batch of correction results of the target arithmetic problem are obtained. The two-level judgment method of the first batch of correction results and the second batch of correction results can reduce the probability of incorrect correction results due to the recognition error of the arithmetic problem and improve the accuracy of correcting the arithmetic problem.
[0068] Please see Figure 6 This is a flowchart illustrating a method for grading arithmetic problems provided in this application. This application uses a target arithmetic problem in an image as an example, where the answer is handwritten. The method for grading arithmetic problems may include the following steps:
[0069] S201, Obtain the image containing the arithmetic problem;
[0070] For details, please refer to step S101, which will not be elaborated here.
[0071] S202, sequentially traverse each arithmetic problem in the image, and take the currently traversed arithmetic problem as the target arithmetic problem;
[0072] The algorithm detects arithmetic problems in an image, iterates through each detected problem, and sets the currently detected problem as the target problem. The iteration order is not limited; it can be done sequentially from top to bottom according to the image's arrangement, or it can be done row by row, meaning that all problems in the same row are iterated before moving on to the next row.
[0073] It should be noted that the next arithmetic problem will only be traversed after the currently encountered arithmetic problem has been used as the target arithmetic problem and the corresponding grading result has been output.
[0074] S203, identify the characters in the target arithmetic problem and obtain the recognition probabilities of all characters with the same character type as each character;
[0075] The process involves identifying characters in a target arithmetic problem, determining the character type of each character, and then identifying all characters of the same type. This yields the recognition probability for each character and all other characters of the same type. The character recognition algorithm can be a CRNN algorithm. This algorithm generates a matrix of the same length as the image region occupied by the target arithmetic problem, identifies each column of pixels to obtain the corresponding recognition probability column, and then uses a method such as... Figure 7 The method shown merges the recognition probability columns of the same character into a single character recognition probability column.
[0076] It should be noted that the recognition probability column for the blank areas between characters will be automatically discarded during the merging process, while also serving to distinguish characters and prevent situations where characters such as 22 are recognized as 2.
[0077] Among them, the same character type can be the same character category as the character. For example, if the character is 1, the character type can be Arabic numerals, and other characters belonging to the same character category can be other Arabic numerals such as 0-9. The character type can also be other characters in the four arithmetic operations. For example, if the character is 4, other characters belonging to the same character type as it, in addition to Arabic numerals, can also be other characters such as +, -, ×, ÷, and =.
[0078] The recognition probability is the probability obtained by the recognition algorithm when judging a character. For example, the recognition probability of the character 6 is 70%, while the recognition probability of other characters of the same type is 20% for 0, 10% for 8, and so on. The recognition probability is generated by the characteristics of the recognition algorithm and has certain limitations, but it also has a certain degree of fault tolerance. This characteristic can be used to compensate for errors caused by recognition and improve the overall recognition accuracy.
[0079] S204, arrange the recognition probabilities of all characters of the same character type in the same column in a certain order to obtain the character probability matrix corresponding to the target arithmetic problem;
[0080] After obtaining the recognition probabilities of each character and all characters of the same type, the recognition probabilities are arranged in a certain order to obtain a concise, clear and easy-to-judge character probability matrix.
[0081] For example: the target arithmetic problem is 1+1=2. The characters of the same type are judged as Arabic numerals and four arithmetic operators. The order of recognition probability can be 0-9, +, -, ×, ÷, =. Then the recognition probability of the first character 1 and all characters of the same type is arranged in the same column to obtain the matrix as shown in expression (2). The recognition probability of each character and all characters of the same type is arranged according to the character probability matrix corresponding to the target arithmetic problem to obtain the matrix as shown in expression (3).
[0082]
[0083]
[0084] It should be noted that the character corresponding to the recognition probability of each row in the character probability matrix is fixed, which facilitates the retrieval and judgment of character recognition probabilities. The sum of the recognition probabilities of each column is 100%, and the above expression does not specifically list all the data.
[0085] S205, Based on the recognition probability of each column in the character probability matrix, determine the character corresponding to the highest recognition probability and the character corresponding to the second highest recognition probability in each column;
[0086] Based on the character probability matrix obtained in step S204, the highest recognition probability and the second highest recognition probability of each column in the character probability matrix are determined, and the characters corresponding to the highest recognition probability and the second highest recognition probability are further determined.
[0087] For example, the recognition probability of a certain column in a certain character probability matrix is as shown in expression (4). The recognition probability of character 0 is 30% and the recognition probability of character 6 is 65%. Since the total recognition probability in a column is 100%, it is not difficult to conclude that 65% and 30% are the highest and second highest recognition probabilities in this column, respectively. Since the order of recognition probabilities in the column is predetermined, it can be determined that the character corresponding to the highest recognition probability is 6 and the second highest recognition probability is 0.
[0088]
[0089] S206, Select the character with the highest recognition probability in each column of the character probability matrix as the first recognition result of the target arithmetic problem;
[0090] After determining the highest recognition probability of each column in the character probability matrix and the character corresponding to the highest recognition probability, the corresponding character is used as part of the first recognition result of the corresponding column in the target arithmetic problem. The characters corresponding to the highest recognition probabilities of all columns constitute the first recognition result.
[0091] Taking expression (5) as an example, it is not difficult to see that the character corresponding to the highest recognition probability in the first column is 1, the character corresponding to the highest recognition probability in the second column is +, the character corresponding to the highest recognition probability in the third column is 1, the character corresponding to the highest recognition probability in the fourth column is =, and the character corresponding to the highest recognition probability in the fifth column is 2. Therefore, the first recognition result corresponding to this target arithmetic problem is 1+1=2.
[0092]
[0093] It should be noted that the characters in the first column on the left side of expression (5) are added for ease of explanation, and the actual character probability matrix does not have this column.
[0094] S207, obtain the difference between the highest recognition probability and the second highest recognition probability in each column of the character probability matrix;
[0095] After determining the highest and second-highest recognition probabilities in each column of the character probability matrix, the difference between the highest and second-highest recognition probabilities is obtained, which prepares for obtaining the second recognition result of the target arithmetic problem.
[0096] Taking expression (4) as an example, we can see that the highest recognition probability in this column is 65% and the second highest recognition probability is 30%. Subtracting the highest recognition probability from the second highest recognition probability gives us the difference of 35%.
[0097] S208, determine the column with the smallest difference in the character probability matrix;
[0098] After obtaining the differences between all columns in the character probability matrix, the column with the smallest difference is determined to prepare for obtaining the second recognition result of the target arithmetic problem.
[0099] Taking expression (5) as an example, we can see that the column with the smallest difference between the highest recognition probability and the second highest recognition probability in the character probability matrix is the column where character 2 is located. Therefore, the column where character 2 is located is determined to be the column with the smallest difference in the character probability matrix.
[0100] S209, Select the character with the second highest recognition probability in the column with the smallest difference from the characters corresponding to the characters with the second highest recognition probability in each column, and select the character with the highest recognition probability in the remaining columns to obtain the second recognition result of the target arithmetic problem;
[0101] After determining the column with the smallest difference in the character probability matrix, from the characters corresponding to the characters with the second-highest recognition probability in each column, select the character corresponding to the second-highest recognition probability in the column with the smallest difference. Combine this character with the characters corresponding to the highest recognition probability in the remaining columns of the character probability matrix to form a new string. This new string is used as the second recognition result for the target arithmetic problem. Intuitively, this replaces the character corresponding to the highest recognition probability in the column with the smallest difference in the first recognition result, while leaving the other characters unchanged.
[0102] Taking expression (5) as an example, we know from the previous steps that the column difference value corresponding to character 2 in the character probability matrix is the smallest, and the character corresponding to the highest recognition probability is 2, and the character corresponding to the second highest recognition probability is 1. Therefore, the second recognition result of the target arithmetic problem in expression (5) is 1+1=1.
[0103] S210, Based on the first identification result, determine the first batch of corrected results for the target arithmetic problem; if the first batch of corrected results is correct, output the first batch of corrected results.
[0104] Based on the first recognition result, the characters in the first recognition result are operated on, that is, the characters to the left of the character "=" in the first recognition result are operated on to obtain the corresponding correct answer. The characters to the right of the character "=" in the first recognition result are taken as the recognized answer. Then the correct answer is compared with the recognized answer to obtain the first batch of corrected results of the target arithmetic problem. If the correct answer is the same as the recognized answer, the first batch of corrected results is judged to be correct and the first batch of corrected results is output.
[0105] Taking expression (5) as an example, we know that the first recognition result of expression (5) is "1+1=2", where the character to the left of the character "=" is "1+1". Through calculation, we know that the correct answer corresponding to the character to the left of the character "=" is 2. Comparing the correct answer 2 with the recognized answer, that is, the character "2" to the right of the character "=", we can find that the correct answer is the same as the recognized answer. Therefore, the first batch of corrected results corresponding to the target arithmetic problem of expression (5) is correct, and the first batch of corrected results "correct" is output. The way to output the corrected results can be the commonly used form of checkmarks and crosses, or other forms such as circles, which are not limited here.
[0106] If the obtained character probability matrix is the matrix shown in expression (6), we can know that the first recognition result in expression (6) is "1+1=1", where the character to the left of the character "=" is "1+1". Through calculation, we can know that the correct answer corresponding to the character to the left of the character "=" is 2. Comparing the correct answer 2 with the recognized answer, that is, the character "1" to the right of the character "=", we can find that the correct answer is different from the recognized answer. This indicates that the "2" in expression (6) may be misrecognized as "1" during recognition because it is handwritten, resulting in the first recognition result being incorrect.
[0107]
[0108] S211, if the first batch of correction results is incorrect, determine the second batch of correction results for the target arithmetic problem based on the second identification result, and output the second batch of correction results;
[0109] If the first batch of corrected results for the target arithmetic problem obtained through step S210 is incorrect, then the first batch of corrected results is considered to be incorrect due to an identification error. The second batch of corrected results is then taken as the corrected results obtained after correct identification, and a judgment is made based on the second identification result. The specific steps are the same as the method for obtaining the first batch of corrected results: obtaining the corresponding correct answer and the identified answer, comparing the correct answer with the identified answer; if the correct answer and the identified answer are the same, then the second batch of corrected results is correct, and the second batch of corrected results "correct" is output; if the correct answer and the identified answer are different, then the second batch of corrected results is incorrect, and the second batch of corrected results "incorrect" is output.
[0110] Taking expression (6) as an example, in step S210, it can be known that the first correction result is incorrect. Therefore, based on the second recognition result, the second correction result is determined as the correction result of the target arithmetic problem. The difference between the highest probability and the second highest probability in the rightmost column of expression (6) is the smallest difference among the columns in the character probability matrix. The character corresponding to the highest probability in the rightmost column is "1", and the character corresponding to the second highest probability is "2". The character "1" corresponding to the rightmost column in the first recognition result is replaced by "2" corresponding to the second highest probability. Then the second recognition result is "1+1=2". The character "1+1" to the left of the character "=" in the second recognition result is calculated to obtain the corresponding correct answer. Then it is compared with the character to the right of the character "=" as the recognized answer, i.e., the character "2". It can be found that the correct answer is the same as the recognized answer. Therefore, the second correction result is correct, and the second correction result "correct" is output.
[0111] It's important to note that the second batch of corrections is only retrieved if the first batch is incorrect. If the first batch is incorrect, the second batch will be output regardless of whether it's correct or incorrect. This is because, statistically, students are more likely to answer the questions correctly. Therefore, the possibility that the first batch was incorrect due to misidentification is also relatively higher. Using the second batch for a second check when the first batch is incorrect can reduce the possibility of misjudgment to some extent.
[0112] Through the embodiments of this application, the recognition probability of each character in the target arithmetic problem in the image can be obtained, and the recognition probability of each character can be arranged in a certain order to obtain the character probability matrix corresponding to the target arithmetic problem. Then, a first recognition result and a second recognition result are obtained. Based on the first recognition result and the second recognition result, a first batch of correction results and a second batch of correction results for the target arithmetic problem are obtained. If the first batch of correction results is correct, the first batch of correction results is output. If the first batch of correction results is incorrect, the second batch of correction results is output. The two-level judgment method avoids the error in the correction result caused by the misrecognition of the arithmetic problem, reduces the probability of error in the correction of the arithmetic problem, and improves the accuracy of the correction of the arithmetic problem.
[0113] Please see Figure 8 This illustration shows a schematic diagram of an arithmetic problem grading device provided in an exemplary embodiment of this application. The arithmetic problem grading device can be implemented as all or part of a terminal through software, hardware, or a combination of both. The device 1 includes an image acquisition module 11, a matrix acquisition module 12, a result determination module 13, and a result output module 14.
[0114] An arithmetic problem grading device, characterized in that it comprises:
[0115] Image acquisition module 11 is used to acquire images containing arithmetic problems;
[0116] The matrix acquisition module 12 is used to identify the target arithmetic problem in the image and obtain the character probability matrix corresponding to the target arithmetic problem. The character probability matrix includes columns with the same number of characters as the target arithmetic problem, and each column includes the recognition probability corresponding to all characters of the same character type.
[0117] Result determination module 13 is used to determine the first recognition result and the second recognition result based on the recognition probability of each column;
[0118] The result output module 14 is used to output the correction result of the target arithmetic problem based on the first recognition result and the second recognition result.
[0119] Optional, such as Figure 9As shown, the result determination module 13 includes:
[0120] The character determination unit 131 is used to determine the character corresponding to the highest recognition probability and the character corresponding to the second highest recognition probability in each column based on the recognition probability of each column in the character probability matrix.
[0121] The first result determination unit 132 is used to select the character with the highest recognition probability in each column of the character probability matrix as the first recognition result of the target arithmetic problem;
[0122] The second result determination unit 133 is used to obtain the difference between the highest recognition probability and the second highest recognition probability in each column of the character probability matrix, and to determine the second recognition result of the target arithmetic problem based on the difference, the character corresponding to the highest recognition probability in each column of the character probability matrix, and the character corresponding to the second highest recognition probability in each column of the character probability matrix.
[0123] Optional, such as Figure 10 As shown, the second result determining unit 133 includes:
[0124] Column determination subunit 1331 is used to determine the column with the smallest difference in the character probability matrix;
[0125] The result determination subunit 1332 is used to select the character with the second highest recognition probability in the column with the smallest difference from the characters corresponding to the characters corresponding to the second highest recognition probability in each column, and select the character corresponding to the highest recognition probability in the remaining columns to obtain the second recognition result of the target arithmetic problem.
[0126] Optional, such as Figure 11 As shown, the result output module 14 includes:
[0127] The first result output unit 141 is used to determine the first batch of corrected results of the target arithmetic problem based on the first identification result, and output the first batch of corrected results if the first batch of corrected results is correct.
[0128] The second result output unit 142 is used to determine the second correction result of the target arithmetic problem based on the second identification result if the first correction result is incorrect, and output the second correction result.
[0129] Optional, such as Figure 12 As shown, the matrix determination module 12 includes:
[0130] Arithmetic problem detection unit 121 is used to detect target arithmetic problems in the image;
[0131] The probability acquisition unit 122 is used to identify the characters in the target arithmetic problem and obtain the recognition probability of all characters with the same character type as each character.
[0132] The matrix determination unit 123 is used to arrange the recognition probabilities corresponding to all characters of the same character type in a certain order in the same column to obtain the character probability matrix corresponding to the target arithmetic problem.
[0133] Optional, such as Figure 13 As shown, the arithmetic problem detection unit 121 includes:
[0134] Arithmetic problem traversal subunit 1211 is used to traverse each arithmetic problem in the image in sequence, and take the currently traversed arithmetic problem as the target arithmetic problem;
[0135] Arithmetic problem identification subunit 1212 is used to identify the target arithmetic problem.
[0136] It should be noted that the arithmetic problem correction device provided in the above embodiments is only illustrated by the division of the above functional modules when executing the arithmetic problem correction method. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the arithmetic problem correction device and the arithmetic problem correction method embodiments provided in the above embodiments belong to the same concept, and the implementation process is detailed in the method embodiments, which will not be repeated here.
[0137] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0138] The technical solution provided in this application embodiment can obtain the recognition probability of each character in the target arithmetic problem in the image, and arrange the recognition probabilities of each character in a certain order to obtain the character probability matrix corresponding to the target arithmetic problem, thereby obtaining the first recognition result and the second recognition result. Based on the first recognition result and the second recognition result, the first batch correction result and the second batch correction result of the target arithmetic problem are obtained. If the first batch correction result is correct, the first batch correction result is output. If the first batch correction result is incorrect, the second batch correction result is output. The two-level judgment method avoids the error in the correction result caused by the misrecognition of the arithmetic problem, reduces the probability of error in the correction of the arithmetic problem, and improves the accuracy of the correction of the arithmetic problem.
[0139] This application embodiment also provides a computer storage medium that can store multiple instructions, the instructions being adapted to be loaded and executed by a processor as shown in Figure 1 above. Figure 7 The method steps of the illustrated embodiment, and the specific execution process, can be seen in Figure 1- Figure 7The specific details of the illustrated embodiments will not be elaborated here.
[0140] This application also provides an electronic device that stores at least one instruction, which is loaded and executed by the processor as shown in Figure 1 above. Figure 7 The specific details of the illustrated embodiments will not be elaborated here.
[0141] Please see Figure 14 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 14 As shown, the electronic device 1000 may include: at least one processor 1001, at least one network interface 1004, a user interface 1003, a memory 1005, and at least one communication bus 1002.
[0142] The communication bus 1002 is used to realize the connection and communication between these components.
[0143] The user interface 1003 may include a display screen and a camera. Optionally, the user interface 1003 may also include a standard wired interface and a wireless interface.
[0144] The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface).
[0145] The processor 1001 may include one or more processing cores. The processor 1001 connects to various parts within the electronic device 1000 using various interfaces and lines. It executes various functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 1005, and by calling data stored in the memory 1005. Optionally, the processor 1001 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 1001 may integrate one or more of the following: a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), and a modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content to be displayed on the screen; and the modem handles wireless communication. It is understood that the modem may also be implemented as a separate chip without being integrated into the processor 1001.
[0146] The memory 1005 may include random access memory (RAM) or read-only memory. Optionally, the memory 1005 may include a non-transitory computer-readable storage medium. The memory 1005 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 1005 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-described method embodiments, etc.; the data storage area may store data involved in the above-described method embodiments, etc. Optionally, the memory 1005 may also be at least one storage device located remotely from the aforementioned processor 1001. Figure 14 As shown, the memory 1005, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and an arithmetic problem correction application.
[0147] exist Figure 14In the illustrated electronic device 1000, the user interface 1003 is mainly used to provide an input interface for the user and to obtain the user's input data; while the processor 1001 can be used to call the arithmetic problem correction application stored in the memory 1005 and specifically perform the following operations:
[0148] Get the image containing the arithmetic problem;
[0149] Identify the target arithmetic problem in the image to obtain the character probability matrix corresponding to the target arithmetic problem. The character probability matrix includes columns with the same number of characters as the target arithmetic problem, and each column includes the recognition probability corresponding to all characters of the same character type.
[0150] The first and second recognition results are determined based on the recognition probability of each column;
[0151] Based on the first recognition result and the second recognition result, the correction result of the target arithmetic problem is output.
[0152] In one embodiment, when the processor 1001 performs the operation of determining the first and second recognition results based on the recognition probability of each column, it specifically performs the following operations:
[0153] Based on the recognition probability of each column in the character probability matrix, determine the character corresponding to the highest recognition probability and the character corresponding to the second highest recognition probability in each column;
[0154] The character with the highest recognition probability in each column of the character probability matrix is selected as the first recognition result of the target arithmetic problem;
[0155] Obtain the difference between the highest recognition probability and the second highest recognition probability in each column of the character probability matrix, and determine the second recognition result of the target arithmetic problem based on the difference, the character corresponding to the highest recognition probability in each column of the character probability matrix, and the character corresponding to the second highest recognition probability in each column of the character probability matrix.
[0156] In one embodiment, when the processor 1001 determines the second recognition result of the target arithmetic problem based on the difference, the character corresponding to the highest recognition probability in each column of the character probability matrix, and the character corresponding to the second highest recognition probability in each column of the character probability matrix, the processor 1001 specifically performs the following operations:
[0157] Determine the column with the smallest difference in the character probability matrix;
[0158] From the characters corresponding to the second highest recognition probability in each column, select the character corresponding to the second highest recognition probability in the column with the smallest difference, and select the character corresponding to the highest recognition probability in the remaining columns to obtain the second recognition result of the target arithmetic problem.
[0159] In one embodiment, when the processor 1001 executes the output of the correction result for the target arithmetic problem based on the first recognition result and the second recognition result, it specifically performs the following operations:
[0160] Based on the first identification result, determine the first batch of corrected results for the target arithmetic problem. If the first batch of corrected results is correct, output the first batch of corrected results.
[0161] If the first batch of correction results is incorrect, the second batch of correction results for the target arithmetic problem is determined based on the second identification result, and the second batch of correction results is output.
[0162] In one embodiment, when the processor 1001 performs the operation of recognizing a target arithmetic problem in the image and obtaining the character probability matrix corresponding to the target arithmetic problem, it specifically performs the following operations:
[0163] Detect the target arithmetic problem in the image;
[0164] Identify the characters in the target arithmetic problem and obtain the recognition probability of all characters with the same character type as each character.
[0165] The recognition probabilities of all characters of the same character type are arranged in a certain order in the same column to obtain the character probability matrix corresponding to the target arithmetic problem.
[0166] In one embodiment, when the processor 1001 performs the operation of recognizing a target arithmetic problem in the image, it specifically performs the following operations:
[0167] The arithmetic problems in the image are traversed sequentially, and the currently traversed arithmetic problem is taken as the target arithmetic problem;
[0168] Identify the target arithmetic problem.
[0169] Through the embodiments of this application, the recognition probability of each character in the target arithmetic problem in the image can be obtained, and the recognition probability of each character can be arranged in a certain order to obtain the character probability matrix corresponding to the target arithmetic problem. Then, a first recognition result and a second recognition result are obtained. Based on the first recognition result and the second recognition result, a first batch of correction results and a second batch of correction results for the target arithmetic problem are obtained. If the first batch of correction results is correct, the first batch of correction results is output. If the first batch of correction results is incorrect, the second batch of correction results is output. The two-level judgment method avoids the error in the correction result caused by the misrecognition of the arithmetic problem, reduces the probability of error in the correction of the arithmetic problem, and improves the accuracy of the correction of the arithmetic problem.
[0170] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory, or random access memory, etc.
[0171] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.
Claims
1. A method for grading arithmetic problems, characterized in that, include: Get the image containing the arithmetic problem; Identify the target arithmetic problem in the image to obtain the character probability matrix corresponding to the target arithmetic problem. The character probability matrix includes columns with the same number of characters as the target arithmetic problem, and each column includes the recognition probability corresponding to all characters of the same character type. The first and second recognition results are determined based on the recognition probability of each column; Output the correction result for the target arithmetic problem based on the first recognition result and the second recognition result; The determination of the first and second recognition results based on the recognition probability of each column includes: Based on the recognition probability of each column in the character probability matrix, determine the character corresponding to the highest recognition probability and the character corresponding to the second highest recognition probability in each column; The character with the highest recognition probability in each column of the character probability matrix is selected as the first recognition result of the target arithmetic problem; Obtain the difference between the highest recognition probability and the second highest recognition probability in each column of the character probability matrix; Determine the column with the smallest difference in the character probability matrix; From the characters corresponding to the second highest recognition probability in each column, select the character corresponding to the second highest recognition probability in the column with the smallest difference, and select the character corresponding to the highest recognition probability in the remaining columns to obtain the second recognition result of the target arithmetic problem.
2. The method according to claim 1, characterized in that, The step of outputting the correction result for the target arithmetic problem based on the first recognition result and the second recognition result includes: Based on the first identification result, determine the first batch of corrected results for the target arithmetic problem. If the first batch of corrected results is correct, output the first batch of corrected results. If the first batch of correction results is incorrect, the second batch of correction results for the target arithmetic problem is determined based on the second identification result, and the second batch of correction results is output.
3. The method according to claim 1, characterized in that, The process of identifying the target arithmetic problem in the image and obtaining the character probability matrix corresponding to the target arithmetic problem includes: Detect the target arithmetic problem in the image; Identify the characters in the target arithmetic problem and obtain the recognition probability of all characters with the same character type as each character. The recognition probabilities of all characters of the same character type are arranged in a certain order in the same column to obtain the character probability matrix corresponding to the target arithmetic problem.
4. The method according to claim 1, characterized in that, The process of identifying the target arithmetic problem in the image includes: The arithmetic problems in the image are traversed sequentially, and the currently traversed arithmetic problem is taken as the target arithmetic problem; Identify the target arithmetic problem.
5. The method according to any one of claims 1 to 4, characterized in that, The arithmetic problems mentioned are mental arithmetic problems.
6. An arithmetic problem grading device, characterized in that, include: The image acquisition module is used to acquire images containing arithmetic problems; The matrix acquisition module is used to identify the target arithmetic problem in the image and obtain the character probability matrix corresponding to the target arithmetic problem. The character probability matrix includes columns with the same number of characters as the target arithmetic problem, and each column includes the recognition probability corresponding to all characters of the same character type. The result determination module is used to determine the first recognition result and the second recognition result based on the recognition probability of each column; The result output module is used to output the correction result of the target arithmetic problem based on the first recognition result and the second recognition result; The result determination module includes: The character determination unit is used to determine the character corresponding to the highest recognition probability and the character corresponding to the second highest recognition probability in each column based on the recognition probability of each column in the character probability matrix. The first result determination unit is used to select the character with the highest recognition probability in each column of the character probability matrix as the first recognition result of the target arithmetic problem; The second result determination unit is used to obtain the difference between the highest recognition probability and the second highest recognition probability in each column of the character probability matrix; The second result determination unit further includes a column determination subunit, used to determine the column with the smallest difference in the character probability matrix; The second result determination unit further includes a result determination subunit, which is used to select the character corresponding to the second highest recognition probability in the column with the smallest difference from the characters corresponding to the second highest recognition probability in each column, and select the character corresponding to the highest recognition probability in the remaining columns to obtain the second recognition result of the target arithmetic problem.
7. A computer storage medium, characterized in that, The computer storage medium contains multiple instructions adapted for loading by a processor and executing the method steps as claimed in any one of claims 1 to 5.
8. An electronic device, characterized in that, include: A processor and a memory; wherein the memory stores a computer program adapted for the processor to load and execute the method steps as claimed in any one of claims 1 to 5.
Citation Information
Patent Citations
A method and a device for correcting oral arithmetic questions in an examination paper
CN109284355A
Question correcting method and computer storage medium
CN113033721A