A YOLOv7 optimization-based test card filling mode detection method
By introducing the C3GhostV2 lightweight convolutional module and SimAM attention mechanism into the YOLOv7 network, combined with the WIoU loss function, the problem of cumbersome answer sheet filling detection steps and reliance on manual labor is solved, achieving efficient and accurate answer sheet filling detection.
Patent Information
- Application Number
- CN202310873155.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2023-04-28
- Filing Date
- 2023-07-17
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2043-07-17
AI Technical Summary
Existing technologies for answer sheet filling and inspection have problems such as cumbersome inspection steps and limited types of filling, which makes answer sheet grading rely on visual inspection by examiners, which is time-consuming and labor-intensive.
A detection method based on YOLOv7 optimization is adopted. By introducing C3GhostV2 lightweight convolutional modules into the backbone and neck network, replacing the ELAN module with C3GhostV2 lightweight convolutional modules, adding the SimAM attention mechanism in the MP module, replacing the CIoU loss function with the WIoU loss function, and combining data augmentation preprocessing techniques, the detection accuracy and efficiency are improved.
It achieves efficient and accurate detection of answer sheet filling methods, especially for small-scale filling blocks, reducing detection time and manual intervention, and improving the reliability and efficiency of answer sheet marking.
Smart Images

Figure CN117152782B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to computer image processing technology, and in particular to a method for detecting answer sheet filling patterns based on YOLOv7 optimization. Background Technology
[0002] To address the issues of high cost and low equipment utilization of cursor readers, extensive research on answer sheet detection has been conducted both domestically and internationally in recent years. For example, patent CN115409665A proposes an adaptive grading system for hardware answer sheets, including a central processing module, a test paper service module, a test paper printing module, an answer sheet uploading module, and a result service module; however, its usage cost is high. Another example is patent CN108960235B, which combines image erosion and dilation algorithms with mathematical distribution statistical models to calculate the black-and-white threshold range for image filling, and then identifies the grayscale values of each option to determine the filling status of each option.
[0003] While the image processing methods used in the aforementioned existing technologies achieve high accuracy, the process of dividing the answer sheet into filling areas is cumbersome and offers limited detection capabilities for different types of answer sheet markings. Deep learning algorithms, on the other hand, are widely used in image processing and can effectively extract target features in complex scenes, overcoming the limitations of traditional algorithms. Convolutional neural networks (CNNs), as a representative deep learning algorithm, have been widely applied to the classification, localization, detection, and segmentation of industrial images. Summary of the Invention
[0004] Purpose of the invention: To detect improper answer sheet filling, this invention proposes an answer sheet filling method optimized based on YOLOv7, which effectively solves the problem that answer sheet grading relies heavily on visual inspection by the examiner, resulting in time-consuming and labor-intensive processes.
[0005] Technical solution: The present invention provides a method for detecting answer sheet filling methods based on YOLOv7 optimization, comprising the following steps:
[0006] Simulated answer sheet images were collected to generate an answer sheet image dataset. The simulated answer sheet images in the dataset were labeled and enhanced preprocessing was performed to obtain an expanded answer sheet image dataset, which was further divided into training, validation, and test sets. An improved YOLOv7 network model was built. The improved YOLOv7 network model was trained using the training set and validated using the validation set to obtain a trained improved YOLOv7 network model. Finally, the test set was input into the trained improved YOLOv7 network model to obtain the annotation information of the detected answer sheet filling method.
[0007] The improved YOLOv7 network model is based on the YOLOv7 network and includes the following improvements: replacing some ELAN modules in the backbone network and the ELAN modules in the neck network with C3GhostV2 lightweight convolutional modules; replacing the original 3×1 convolutions in the MP modules of the backbone network and the neck network with SimAM attention mechanism modules; and replacing the CIoU loss function with the WIoU loss function.
[0008] Furthermore, the C3GhostModleMul module in the C3GhostV2 lightweight convolutional module first increases the dimensionality of the pooled feature information, then decreases it, and then fuses it with other inexpensive 1×1 convolutions to fully generalize the network performance.
[0009] Furthermore, the C3 modules in the backbone and neck networks reduce information loss by using inexpensive 1×1 convolutions and splicing the same number of channels.
[0010] Furthermore, for a given input feature image of size H×W×C, the SimAM attention mechanism module first passes the H×W elements through the SimAM attention mechanism, then normalizes the weights using the Sigmoid function, and finally obtains the output feature map.
[0011] Furthermore, the WIoU loss function expression is as follows:
[0012] L WIoUv3 =rL WIoUv1
[0013] Where r is a combined index describing the discreteness of the anchor boxes generated during network detection and the gradient assignment, and L WIoUv1 This is the first version of WIoU, and its expression is:
[0014] L WIoUv1 =R WIoU L IoU
[0015] Among them, L IoU R represents the intersection-union loss between the true bounding boxes and the ordinary anchor boxes. WIoU R is a parameter that measures the gradient of model convergence. WIoU ∈[1,e).
[0016] Furthermore, LabelImg software was used to annotate the answer sheet image data.
[0017] Further enhancements to the preprocessing include:
[0018] (a) Mirror the image horizontally or vertically;
[0019] (b) Enhance or reduce the contrast of the image;
[0020] (c) Crop the image and resize it;
[0021] (d) Introduce Gaussian noise into the image to alter its sharpness;
[0022] (e) Perform RGB color perturbation transformation on the image.
[0023] In another embodiment of the present invention, a YOLOv7-optimized answer sheet filling method detection system includes:
[0024] The data acquisition and processing module is used to acquire simulated answer sheet images, generate an answer sheet image dataset, label the simulated answer sheet image data in the dataset, and perform enhanced preprocessing to obtain an expanded answer sheet image dataset, which is further divided into training set, validation set and test set;
[0025] The model building and training module is used to build an improved YOLOv7 network model, train the improved YOLOv7 network model with the training set, and validate it with the validation set to obtain the trained improved YOLOv7 network model.
[0026] The detection module is used to input the test set into the trained improved YOLOv7 network model and obtain the annotation of the answer sheet filling method after detection;
[0027] The improved YOLOv7 network model is based on the YOLOv7 network model and includes the following improvements: replacing some ELAN modules in the backbone network and the ELAN modules in the neck network with C3GhostV2 lightweight convolutional modules; replacing the original 3×1 convolutions in the MP modules of the backbone network and the neck network with SimAM attention mechanism modules; and replacing the CIoU loss function with the WIoU loss function.
[0028] In another embodiment of the present invention, an electronic device includes:
[0029] At least one processor, and
[0030] A memory communicatively connected to the at least one processor; wherein,
[0031] The memory stores instructions that can be executed by the at least one processor, which are executed by the at least one processor to enable the at least one processor to perform the steps of the above-described YOLOv7-optimized answer sheet filling method detection method.
[0032] In another embodiment of the present invention, a storage medium stores a computer program, which, when executed by at least one processor, implements the steps of the above-described method for detecting answer sheet filling methods based on YOLOv7 optimization.
[0033] Beneficial effects: Compared with the prior art, the significant technical effects of this invention are as follows: 1. This invention integrates the lightweight C3GhostV2 network on the basis of the YOLOv7 network, which can reduce feature redundancy in the channels, alleviate the defects of high heavy parameters, and at the same time ensure the improvement of detection accuracy; 2. This invention adds the SimAM attention mechanism to the MP module, which better aggregates spatial and positional information; 3. Using WIoU to replace CIoU as the new loss function, the convergence of the model is significantly improved and the training parameters are reduced; 4. This invention is particularly accurate in detecting small-scale answer sheet filling blocks.
[0034] This invention integrates artificial intelligence and industrial development, scientifically guiding examiners to effectively fill in and verify answer sheets, while improving the reliability of answer sheet marking. Attached Figure Description
[0035] Figure 1 This is a flowchart of the method of the present invention;
[0036] Figure 2 These are the original images of the answer sheet filling method in this embodiment of the invention; wherein, (a) is an example of a tick image, (b) is an example of a letter-only image, (c) is an example of a slanted line image, (d) is an example of a circle image, (e) is an example of a line image, (f) is an example of a shallow image, (g) is an example of a fork image, (h) is an example of a fold image, (i) is an example of a correct image, (j) is an example of a point image, and (k) and (l) are examples of mixed images;
[0037] Figure 3 yes Figure 2Images of answer sheet filling methods after preprocessing the original image; where (a) is a tick-type preprocessed image, (b) is a letter-only preprocessed image, (c) is a diagonal line-type preprocessed image, (d) is a circle-type preprocessed image, (e) is a line-type preprocessed image, (f) is a shallow-type preprocessed image, (g) is a fork-type preprocessed image, (h) is a fold-type preprocessed image, (i) is a correct-type preprocessed image, (j) is a point-type preprocessed image, and (k) and (l) are mixed-type preprocessed images;
[0038] Figure 4 This is a schematic diagram of the improved YOLOv7 network structure in an embodiment of the present invention;
[0039] Figure 5 This is a schematic diagram of the C3GhostV2 structure in this invention; wherein, (a) is a schematic diagram of the structure when Stride=1, (b) is a schematic diagram of the structure when Stride=2, and (c) is a schematic diagram of the DFG attention structure.
[0040] Figure 6 This is a schematic diagram of the GhostModle and C3GhostModleMul module structures in this invention; where (a) is a schematic diagram of the GhostModle module and (b) is a schematic diagram of the C3GhostModleMul module.
[0041] Figure 7 These are schematic diagrams of the CBS, UP, improved MP, ELAN, SPPCSPC, and C3 modules in this invention; where (a) is a schematic diagram of the CBS module, (b) is a schematic diagram of the UP module, (c) is a schematic diagram of the improved MP module, (d) is a schematic diagram of the ELAN module, (e) is a schematic diagram of the SPPCSPC module, and (f) is a schematic diagram of the C3 module.
[0042] Figure 8 This is a schematic diagram of the SimAM attention mechanism structure in this invention;
[0043] Figure 9These are images of the answer sheet filling methods after testing; among them, (a) is the image after tick detection, (b) is the image after letter detection, (c) is the image after diagonal line detection, (d) is the image after circle detection, (e) is the image after line detection, (f) is the image after shallow detection, (g) is the image after fork detection, (h) is the image after fold detection, (i) is the image after correct detection, (j) is the image after point detection, and (k) and (l) are the images after mixed detection. Detailed Implementation
[0044] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments.
[0045] This invention discloses a YOLOv7-optimized method for detecting answer sheet filling patterns. First, 242 simulated answer sheets from a civil service exam institution are selected, and the dataset is expanded to 1210 sheets through data augmentation preprocessing. Second, a lightweight convolutional neural network based on YOLOv7 and GhostNetV2 is established. For the loss function, WIoU replaces the original CIoU as the new loss function. Then, the answer sheet images are fed into the built model in batches, and training hyperparameters are set to generate a detection weight file. Finally, the test set is input into the trained model to obtain the detected answer sheet filling pattern annotation results. This invention can clearly distinguish between correct and incorrect answer sheet filling patterns, providing technical support for answer sheet graders working in complex environments with dense filling. Figure 1 As shown, the specific steps include:
[0046] (1) Select 242 mock answer sheets from a civil service exam institution, annotate them, and perform data augmentation preprocessing on the image dataset; divide the training set, validation set, and test set into an 8:1:1 ratio;
[0047] Image data augmentation and preprocessing methods include:
[0048] (a) Mirror the image horizontally or vertically;
[0049] (b) Enhance or reduce the contrast of the image by (0.5-1.5);
[0050] (c) Crop the image by (0.85-0.95) and resize it;
[0051] (d) Introduce Gaussian noise into the image to alter its sharpness;
[0052] (e) Perform RGB color perturbation transformation on the image.
[0053] Each image must undergo at least one of the above preprocessing operations.
[0054] Specifically, the LabelImg software was first used to label the 10 different ways of filling in the answer sheet, with a size limit of 1706×1280. To increase the number of images, each image was subjected to various operations, including horizontal or vertical flipping, contrast enhancement or reduction, cropping, introducing Gaussian noise, and RGB color perturbation, to expand the number of images to 1210. Figure 2 Images (a) through (l) are the original images. Figure 3 Images (a) through (l) are the images after data augmentation.
[0055] (2) An improved YOLOv7 network model was constructed, which integrates the C3GhostV2 lightweight convolutional module and includes three parts: a backbone network, a neck network, and a head detection network. First, some ELAN modules in the backbone network and the neck network were replaced with C3GhostV2 modules; second, the original 3×1 convolutions in the MP module were replaced with SimAM attention modules. The structure of the improved YOLOv7 network model is as follows: Figure 4 As shown.
[0056] To better integrate image features of different scales extracted from the backbone and neck network and reduce information loss between transmission layers, GhostNetV2 was optimized by designing modules C3 and C3GhostModleMul. Module C3 reduces information loss by concatenating inexpensive 1×1 convolutions and splicing features with the same number of channels. C3GhostModleMul first upscales and then downscales the pooled feature information before fusing it with the remaining inexpensive convolutions, thus fully generalizing the network performance.
[0057] Specifically:
[0058] In the backbone network, the image first passes through four CBS convolutional modules of sizes (3,1), (3,2), (3,1), and (3,2) respectively. Then it passes through an improved C3GhostV2 lightweight convolutional module, followed by a (3,2) CBS convolutional module, an improved MP module, and an ELAN module to obtain the first output image feature size of 80×80×128. Next, it passes through an improved MP module and an ELAN module to obtain the second output image feature size of 40×40×256. Finally, it passes through an improved MP module, an improved C3 module, and a (3,1) CBS convolutional module to obtain the third output image feature size of 20×20×1024.
[0059] Note: (3,1) represents the size of a convolution with a kernel of 3 and a stride of 1;
[0060] (3,2) represents the size of a convolution with a kernel of 3 and a stride of 2.
[0061] In the neck network section, the third output image from the backbone network is passed through an SPPCSPC module, then upsampled by an UP module, concatenated with the second output image from the backbone network, and then passed through a C3GhostV2 lightweight convolutional module to obtain an output image feature size of 40×40×256. Next, it undergoes another UP upsampling and is concatenated with the first output image from the backbone network, then passes through another C3GhostV2 lightweight network module to obtain the final first-class image to be detected, with a size of 80×80×256. Then, another branch after passing through a C3GhostV2 lightweight convolutional module passes through an improved MP module and is concatenated with the upper-layer 40×40×256 output image, followed by another C3GhostV2 lightweight convolutional module to obtain the final second-class image to be detected, with a size of 40×40×512. Finally, it passes through an improved MP module and is concatenated with the upper-layer branch after passing through the SPPCSPC module, then passes through a C3 module to obtain the final third-class image to be detected, with a size of 20×20×1024.
[0062] In the head detection network, the three types of image features to be detected, with sizes of 80×80×256, 40×40×512, and 20×20×1024, are passed through a REP module and then through a (3,1) convolution module to obtain the final detect image.
[0063] The C3GhostV2 lightweight convolutional module employs an Inverted bottleneck design, utilizing two GhostModle modules to first increase the feature dimension and then decrease it. Figure 5 In Figure (a), the module structure is shown when Stride = 1. First, it passes through the first GhostModle module, which works synchronously with the DFC attention mechanism and is fused in the C3GhostModleMul module to enhance the reliability of capturing long-distance spatial information. Then, it enters the second GhostModle module, and after normalization, it is concatenated with the original input image to obtain the final output image. Figure 5 In diagram (b), the module structure is shown when Stride = 2. The difference from the module structure when Stride = 1 is that a depthwise separable convolutional module with a stride of 2 is added between the C3GhostModleMul module and the second GhostModle module. The DFC attention mechanism module structure is as follows: Figure 5 As shown in (c).
[0064] The GhostModle module and C3GhostModleMul module structures are as follows: Figure 6 As shown in (a) and (b), the GhostModle module is constructed by first passing through a (1,1) CBS convolution and a (3,1) CBS convolution, and then concatenating the image features with the original input branch.
[0065] C3GhostModleMul consists of three branches. The first branch first passes through a (2,2) pooling layer, followed by (5,1) and (1,5) CBS convolutions, and then a sigmoid function. The second branch passes through a (1,1) CBS convolution. The third branch passes through a (3,1) CBS convolution. The second branch and the first branch are then concatenated, and finally concatenated with the first branch to obtain the output image features. C3GhostModleMul first upscales and then downscales the pooled features before fusing them with the remaining inexpensive 1×1 convolutions, thus fully generalizing the network performance.
[0066] like Figure 7 As shown in (a)-(f):
[0067] The structure of the CBS module is a regular convolution with normalization and activation function SiLU.
[0068] The UP upsampling module uses a (3,1)CBS convolution and UPSample upsampling to reduce the number of channels to half of the original.
[0069] The MP module is divided into two branches, each with half the number of channels as the original. The first branch performs a MaxPool operation on the image feature layer, expanding its receptive field, and then passes it through a (1,1) CBS convolutional module. The second branch first passes through a SimAM attention module, taking into account both channel and spatial image feature information, and then concatenates it with the feature information obtained from a regular (3,2) CBS convolution. Finally, the two branches are concatenated, improving the network's generalization ability.
[0070] The ELAN module is divided into three branches. The first branch passes through one (1,1) CBS convolution and four (3,1) CBS convolutions in sequence. The second branch concatenates the CBS convolution of the branch that passed through the (1,1) CBS convolution in the first branch with the branch that passed through the second (3,1) CBS convolution. The third branch passes through one (1,1) CBS convolution. After concatenating the three branches together, another (1,1) CBS convolution is performed to obtain the final output image.
[0071] The SPPC module is divided into two branches. The first branch is more complex. It first goes through (1,1), (3,2), and (1,1)CBS convolutions in sequence, then is concatenated with three parallel MaxPool operations, and finally goes through (1,1) and (3,2)CBS convolutions again. The second branch goes through a (1,1)CBS convolution. After concatenating the two branches, it goes through a (1,1)CBS convolution to obtain the final output image.
[0072] The C3 module reduces information loss by using ensembled, inexpensive convolutions and splicing features with the same number of channels. First, the first branch passes through two (1,1) CBS convolutional modules in sequence, followed by a (3,1) CBS convolutional module. If the number of channels at this point is the same as the number of channels after passing through the first (1,1) CBS convolutional module, the image features are spliced; otherwise, they are not spliced. The second branch passes through a (1,1) CBS convolutional module. Finally, the two branches are spliced together and then passed through a (1,1) CBS convolutional module to obtain the output image features.
[0073] The SimAM attention mechanism module captures the spatial and positional information of objects better by focusing on the 3D information of the feature image. This module does not require adding parameters to the original network and avoids spending a lot of computational effort on structural adjustments. Figure 8 As shown: For a given feature image of size H×W×C, the H×W elements are first passed through the SimAM attention mechanism, and then the weights are normalized by the Sigmoid function to obtain the output feature map.
[0074] (3) Replacing CIoU with WIoU as the new loss function reduces the interference of penalty terms such as distance and aspect ratio, and the design of the monotonic focusing mechanism improves the localization performance of the model;
[0075] The WIoU loss function expression is:
[0076] L WIoUv3 =rL WIoUv1
[0077] Where r is a comprehensive index describing the discreteness of the anchor boxes generated during network detection and the gradient assignment; in this embodiment, r = 1. WIoUv1 This is the first version of WIoU, which is defined as:
[0078] L WIoUv1 =R WIoU L IoU
[0079] Among them, L IoU R represents the intersection-union loss between the true bounding boxes and the ordinary anchor boxes. WIoU∈[1,e), its expression is:
[0080]
[0081] Where x and y represent the length and width of the anchor frame, respectively; x gt y gt W represents the length and width of the actual annotation box, respectively; g H g These represent the width and height of the minimum bounding box, respectively, to prevent R from being visible. WIoU To generate a gradient that hinders convergence, W needs to be... g and H g Separating the model from the original computation graph (* indicates a separation operation) effectively eliminates factors that hinder model convergence, thus eliminating the need to introduce new metrics such as aspect ratio, thereby demonstrating the simplicity and efficiency of the WIoU loss function.
[0082] Specifically: First, create a code file for the WIoU loss function based on the WIoU formula above; second, import this file to replace all the code of the original CIoU loss function; finally, set the code path for the loss function during training.
[0083] (4) Input the training set into the improved YOLOv7 network model built above, set the hyperparameters and start training for 300 rounds. Then, use the validation set to validate the trained network model. Finally, select the model with the best detection weight file as the trained improved YOLOv7 network model and save the detection weight file.
[0084] During training, the training set is used as the image for each epoch, primarily to determine the learned parameter variables, such as weights w and biases b. The validation set is used in the later stages of the training epoch to determine the network structure and adjust the model parameters. The learning rate is updated in segments during network training.
[0085] In this embodiment, the hyperparameters are set as follows: image size / pixels is 640×640, batch processing number is 16, number of iterations is 300, optimizer is Adam, initial learning rate is 0.001, and the learning rate will be automatically adjusted according to the cosine method.
[0086] The hardware system used in this experiment is Windows 11, with an Intel(R) Platinum 8255C CPU (40GB), an RTX 3080Ti GPU (10GB), Python 3.8 and Pythorch 1.11.0, and CUDA version 11.3.
[0087] (5) Input the test set into the improved YOLOv7 network model trained above to obtain the annotation results of the answer sheet filling method after detection. For example... Figure 9 (a) to (l) are the results after testing the test set.
[0088] This invention proposes a YOLOv7-optimized method for detecting improperly filled answer sheets, effectively addressing the problem of time-consuming and labor-intensive answer sheet grading due to its heavy reliance on visual inspection by examiners. By introducing the lightweight GhostNetV2 network into the backbone and neck network, the high parameter load is mitigated while ensuring improved detection accuracy. The SimAM attention mechanism is added to the MP module to better aggregate spatial and positional information. Finally, the loss function is optimized to improve the model's localization capability, especially for detecting and locating small targets.
[0089] In another embodiment of the present invention, a YOLOv7-optimized answer sheet filling method detection system includes:
[0090] The data acquisition and processing module is used to acquire simulated answer sheet images, generate an answer sheet image dataset, label the simulated answer sheet image data in the dataset, and perform enhanced preprocessing to obtain an expanded answer sheet image dataset, which is further divided into training set, validation set and test set;
[0091] The model building and training module is used to build an improved YOLOv7 network model, train the improved YOLOv7 network model with the training set, and validate it with the validation set to obtain the trained improved YOLOv7 network model.
[0092] The detection module is used to input the test set into the trained improved YOLOv7 network model and obtain the annotation of the answer sheet filling method after detection;
[0093] The improved YOLOv7 network model is based on the YOLOv7 network model and includes the following improvements: replacing some ELAN modules in the backbone network and the ELAN modules in the neck network with C3GhostV2 lightweight convolutional modules; replacing the original 3×1 convolutions in the MP modules of the backbone network and the neck network with SimAM attention mechanism modules; and replacing the CIoU loss function with the WIoU loss function.
[0094] In another embodiment of the present invention, an electronic device includes:
[0095] At least one processor, and
[0096] A memory communicatively connected to the at least one processor; wherein,
[0097] The memory stores instructions that can be executed by the at least one processor, which are executed by the at least one processor to enable the at least one processor to perform the steps of the above-described YOLOv7-optimized answer sheet filling method detection method.
[0098] The electronic device includes a paper roll machine that can highlight the black and white interlaced information features of the paper surface. The answer sheet is fed into the machine, and pressing the push rod can fix the answer sheet on the plate for testing. Rotating the pressure plate can place the next answer sheet into the testing area for further testing. During execution, the steps of the above-described YOLOv7-optimized answer sheet filling method detection method are implemented.
[0099] In another embodiment of the present invention, a storage medium stores a computer program, which, when executed by at least one processor, implements the steps of the above-described method for detecting answer sheet filling methods based on YOLOv7 optimization.
[0100] The storage media includes Qt and OpenCV. A question sheet detection page system is built using Qt; OpenCV is used to recognize images and realize human-computer image information interaction. During execution, the steps of the question sheet filling method detection method optimized based on YOLOv7, as described above, are implemented.
Claims
1. A YOLOv7 optimization-based test card filling mode detection method, characterized in that, The method comprises the following steps: Collecting analog answer sheet images, generating answer sheet image data sets, labeling analog answer sheet image data in the data sets, and performing enhancement preprocessing to obtain an expanded answer sheet image data set, and further dividing the expanded answer sheet image data set into a training set, a verification set and a test set; building an improved YOLOv7 network model; training the improved YOLOv7 network model with the training set, and verifying the improved YOLOv7 network model with the verification set to obtain a trained improved YOLOv7 network model; and finally inputting the test set into the trained improved YOLOv7 network model to obtain the labeled information of the detected answer sheet filling mode; The improved YOLOv7 network model is improved on the basis of the YOLOv7 network, including: replacing part of the ELAN modules in the backbone network and the ELAN modules in the neck network with C3GhostV2 lightweight convolution modules; replacing the original 3x1 convolution in the MP module in the backbone network and the neck network with a SimAM attention mechanism module; and replacing the CIoU loss function with a WIoU loss function.
2. The YOLOv7-optimized test card filling method according to claim 1, characterized in that, The C3GhostModleMul in the C3GhostV2 lightweight convolution module first increases the dimension of the pooled feature information, then reduces the dimension, and then fuses the remaining 1x1 convolution, fully generalizing the network performance.
3. The method according to claim 1, wherein, The backbone network and the neck network include a C3 module, which reduces information loss by 1x1 convolution and splicing channels with the same number of features.
4. The YOLOv7-optimized test card filling method according to claim 1, characterized in that, The SimAM attention mechanism module obtains an output feature map by normalizing the weights of the HxW elements in the given input feature map of size HxWxC through the SimAM attention mechanism and the Sigmoid function.
5. The method according to claim 1, wherein, The expression of the WIoU loss function is: ; wherein, is a comprehensive index of the discrete quantity and the gradient distribution of the anchor box generated when describing the network detection, ; is the first version of WloU, whose expression is: ; wherein, represents the intersection over union loss of the real label frame and the common anchor frame, is a parameter for measuring the gradient of model convergence; The expression of is: ; wherein, , respectively represent the length and width of the anchor box; , respectively represent the length and width of the ground truth bounding box; , respectively represent the width and height of the minimum enclosing box.
6. The YOLOv7-optimized test paper filling mode detection method according to claim 1, characterized in that, The answer sheet image data is labeled by using the LabelImg software.
7. The method according to claim 1, wherein the method is characterized in that, The enhancement preprocessing includes: (a) horizontally or vertically flipping the image; (b) enhancing or weakening the contrast of the image; (c) cutting the image to change the size; (d) introducing Gaussian noise interference to the image to change the image clarity; (e) performing RGB color disturbance transformation on the image.
8. A YOLOv7 optimization-based test sheet filling mode detection system, characterized in that, The method comprises the following steps: The data acquisition and processing module is used for collecting analog answer sheet images, generating answer sheet image data sets, labeling analog answer sheet image data in the data sets, and performing enhancement preprocessing to obtain an expanded answer sheet image data set, and further dividing the expanded answer sheet image data set into a training set, a verification set and a test set; The model building and training module is used for building an improved YOLOv7 network model, training the improved YOLOv7 network model with the training set, and verifying the improved YOLOv7 network model with the verification set to obtain a trained improved YOLOv7 network model; The detection module is used for inputting the test set into the trained improved YOLOv7 network model to obtain the labeled information of the detected answer sheet filling mode. The improved YOLOv7 network model is improved on the basis of the YOLOv7 network model, including: replacing part of the ELAN modules in the backbone network and the ELAN modules in the neck network with C3GhostV2 lightweight convolution modules; replacing the original 3*1 convolution in the MP module in the backbone network and the neck network with a SimAM attention mechanism module; and replacing the CIoU loss function with a WIoU loss function.
9. An electronic device, comprising: The method comprises the following steps: at least one processor, and a memory connected in communication with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the steps of the YOLOv7 optimization-based test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test method for the test 10. A storage medium, characterized by
Citation Information
Patent Citations
A method for identifying answer sheet fill-in blocks
CN108960235B
Power transmission line nest detection method in complex environment based on improved yolox algorithm
CN115861853A
Litchi fruit growth period identification method based on improved YOLOv5
CN115984698A