Design method of mask monitoring and QR code recognition system based on Maixduino AI K210 development board

By designing mask monitoring and QR code identification systems on the Maixduino AI K210 development board, using the YOLOv2 model and the K-Means clustering algorithm, the problem of mask wearing and health code status monitoring in the epidemic prevention and control in public places was solved, and efficient, low-cost and reliable monitoring effects were achieved.

CN114944001BActive Publication Date: 2025-03-04HANGZHOU DIANZI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210638342.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-07
Publication Date
2025-03-04
Estimated Expiration
2042-06-07

AI Technical Summary

Technical Problem

In the epidemic prevention and control of unsupervised public places, it is difficult for the existing technology to effectively monitor the wearing of masks and health code status of people, especially in terms of cost and reliability.

Method used

A mask monitoring and QR code recognition system based on the Maixduino AI K210 development board was designed, and mask target recognition is used to identify the YOLOv2 model and the K-Means clustering algorithm, and QR code recognition is realized through machine vision target recognition and processing.

Benefits of technology

It has achieved efficient and low-cost monitoring of the wearing of masks and health code status of people in public places, with high reliability and real-time performance, and is suitable for the current needs of the normalized public epidemic prevention work.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114944001B_ABST
    Figure CN114944001B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for designing a mask monitoring and two-dimensional code recognition system based on a MaixduinoAIK210 development board. The present invention utilizes the support of the MaixduinoAIK210 development board for functions such as artificial intelligence, visual target recognition, and deep learning to design an effective, convenient, and practical mask monitoring and two-dimensional code recognition system. The algorithm used in the present invention is the K-Means algorithm, which is an unsupervised clustering algorithm with simple implementation and good clustering effect. The system designed in this way also has the characteristics of simplicity and efficiency, and the actual installation and use cost is low, which is very suitable for the current requirements for large coverage, reliability, and high real-time requirements in the normalization of public epidemic prevention. At the same time, the present invention has higher readability and wider compatibility, and can improve the system and add the required basic functions according to different application scenarios and actual needs, which is very suitable for on-demand expansion and use in various complex real-life scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the design application based on the Maixduino AI K210 artificial intelligence open source hardware platform, and designs an intelligent mask monitoring and QR code recognition system. The system hardware is based on the Maixduino AI K210 development board, the software is based on Mind+ and Maxipy IDE, and is programmed in Python. Background Art

[0002] At present, the situation of the novel coronavirus pneumonia epidemic at home and abroad is still severe, and the pressure of health and epidemic prevention work is huge. Installing intelligent devices, using artificial intelligence and machine equipment to identify the mask wearing and health code status of people at the entrances and exits of public places, and realizing epidemic prevention and control under unsupervised conditions will become inevitable. The hardware required to implement the system based on the MaixduinoAI K210 artificial intelligence open source hardware platform development board is simple and low-cost, which is very suitable for the current needs of large coverage, reliability, and high real-time requirements in the normalization of public epidemic prevention. At the same time, the software is based on Mind+ and Maxipy IDE and is programmed in Python. The Maixduino AI K210 artificial intelligence open source hardware platform development board has high readability and excellent compatibility. It can improve the system or add additional basic functions required according to different application scenarios and actual needs. It is very suitable for on-demand expansion and use in various complex real-life scenarios. The algorithm used in the present invention is the K-Means algorithm, which is an unsupervised clustering algorithm with simple implementation and good clustering effect. The system designed in this way also has the characteristics of simplicity and efficiency, and the actual installation and use cost is low. It can be seen that the mask monitoring and QR code recognition system based on the MaixduinoAI K210 artificial intelligence open source hardware platform development board has sufficient feasibility and good development prospects in the current normalization of public epidemic prevention work. Summary of the invention

[0003] The present invention proposes a design method for a mask monitoring and QR code recognition system based on the Maixduino AI K210 development board. The present invention is based on the MaixduinoAI K210 artificial intelligence open source hardware platform development board, and utilizes the MaixduinoAI K210 development board's support for artificial intelligence, visual target recognition, and deep learning functions to design an effective, convenient, and practical mask monitoring and QR code recognition system.

[0004] The technical solution adopted by the present invention to solve the technical problem comprises the following steps:

[0005] Step 1: Establishment of machine vision learning library for mask monitoring;

[0006] Step 2: Construction of mask monitoring system;

[0007] Step 3: Build the QR code recognition system.

[0008] Furthermore, the establishment of the machine vision learning library for mask monitoring described in step 1 is based on the Maixduino AIK210 artificial intelligence open source hardware platform, using the YOLOv2 model and the K-Means clustering algorithm to identify the mask target, as follows:

[0009] The BN layer in the YOLOv2 model can achieve a higher average accuracy and a good number of frames per second. Therefore, after the image preparation data is captured and recognized, the anchor point parameters are calculated and configured, and the initial training of the model begins.

[0010] The BN layer preprocesses the data before convolution. Specifically, it normalizes each data output after convolution pooling and before activation function.

[0011]

[0012] in, is the result of normalization of data within the batch, E[x (k) ] is the batch mean, Var is the variance; γ and β are additional parameters introduced;

[0013] At the same time, the anchor box algorithm is introduced for object prediction. The anchor boxes algorithm compresses the image and makes the dimension of the feature map an odd number. When predicting some large object operations, the center point falls at the center of the picture, making it easier to use a center point of the feature map to predict the bounding box of these objects.

[0014] The K-Means algorithm makes the anchor boxes and the adjacent real boxes have a larger intersection-over-union ratio. At the same time, due to the addition of the anchor mechanism, the relative position DLP of the network unit is directly predicted by the offsets.

[0015] b x =σ(t x )+c x (3)

[0016] b y =σ(t y )+c y (4)

[0017]

[0018] Pr(object)*IOU(b,object)=σ(to ) (7)

[0019] Among them, b x , b y , b w , b h is the center and width of the predicted border, Pr(object) is the grid target object, IOU(b,object) is the IOU score, and Pr(object)*IOU(b,object) is the confidence of the predicted border. Here, the parameter t o After σ transformation, it is used as the confidence value; c x 、c y is the distance from the upper left corner of the current grid to the upper left corner of the image. The grid size must be normalized first, that is, the width of a grid is 1 and the height is 1; p w 、p h is the width and height of the prior box; σ is the sigmoid function; t x ,t y ,t w ,t h ,t o are the parameters to be learned, which are used to predict the center, width, height and confidence of the bounding box respectively.

[0020] Furthermore, the mask recognition system is specifically implemented as follows:

[0021] When the camera detects a valid face target, the Maixduino AI K210 artificial intelligence open source hardware platform development board performs machine vision target recognition and processing; specific processing: use lines to frame the effective recognition area of ​​the mask on the screen, and output the mask recognition result just above the recognition area to determine whether the target is wearing a mask; if the target is wearing a mask, no alarm will be given and the system will continue to operate normally; if the target is not wearing a mask, the system will flash an indicator light to alarm, record the alarm data and upload it to the host device.

[0022] Furthermore, the QR code recognition system is specifically implemented as follows:

[0023] When the camera detects a valid QR code target, the Maixduino AI K210 artificial intelligence open source hardware platform development board performs machine vision target recognition and processing; specific processing: use lines to frame the effective recognition area of ​​the QR code on the screen, and output the QR code recognition result just above the recognition area.

[0024] The beneficial effects of the present invention are as follows:

[0025] The algorithm used in the present invention is the K-Means algorithm, which is an unsupervised clustering algorithm with simple implementation and good clustering effect. The system designed in this way also has the characteristics of simplicity and efficiency, and the actual installation and use cost is low, which is very suitable for the current needs of large coverage, reliability and high real-time requirements in the normalization of public epidemic prevention. At the same time, the compilation and burning software Mind+ and Maxipy IDE used by the MaixduinoAI K210 artificial intelligence open source hardware platform development board support Python language, which has higher readability and wider compatibility. It can improve the system and increase the required basic functions according to different application scenarios and actual needs, and is very suitable for on-demand expansion and use in various complex real-life scenarios.

[0026] Compared with the traditional mask monitoring and QR code recognition system, the present invention has lower configuration and cost requirements, and at the same time has sufficient reliability, and has the ability to add additional functions or link with other systems as needed to meet the needs of various complex scenarios in practical applications, that is, good adaptability. The present invention has sufficient feasibility and good market development prospects in the current public epidemic prevention normalization work. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 This is the block diagram of the MaixduinoAI K210 artificial intelligence open source hardware platform;

[0028] Figure 2 This is a physical picture of the mask monitoring and QR code recognition system based on the MaixduinoAI K210 artificial intelligence open source hardware platform development board;

[0029] Figure 3 This is the training result diagram of the mask recognition model;

[0030] Figure 4 This is the workflow diagram of the mask monitoring system;

[0031] Figure 5 Implementing a scene graph for a mask monitoring system;

[0032] Figure 6 This is the workflow diagram of the QR code recognition system. DETAILED DESCRIPTION

[0033] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0034] like Figure 1 As shown in the figure, the design method of the mask monitoring and QR code recognition system based on the Maixduino AI K210 development board is as follows:

[0035] Step 1: Establishment of machine vision learning library for mask monitoring:

[0036] The core of mask recognition is machine vision target recognition and processing. Based on the Maixduino AI K210 artificial intelligence open source hardware platform, the YOLOv2 model is used and the K-Means clustering algorithm is adopted to identify mask targets.

[0037] The batch normalization (BN) layer in the YOLOv2 model can achieve a higher mean average precision (mAP) and a good number of frames per second (FPS). After the necessary image preparation data capture and recognition, the calculation and configuration of parameters such as anchors are performed, and the initial training of the model begins.

[0038] The regularization of the BN layer is to reduce the speed reduction caused by the network learning to adapt to different distributions in each iteration. The solution is to preprocess the data before convolution. The purpose of preprocessing is to balance the data and reduce noise at the same time.

[0039] BN processes each layer of data based on this idea. BN normalizes each data output after convolution and pooling and before activation.

[0040]

[0041] The first part is the classic variance calculation, while the second part is the core of the algorithm. By introducing additional parameters γ and β, the error of the data in the simple normalization process is reduced, and the model capability is improved on a certain basis without destroying the original data characteristics.

[0042] At the same time, the anchor boxes algorithm is introduced for object prediction. The anchor boxes algorithm compresses the image and makes the dimension of the feature map an odd number. When predicting some large object operations, the center point falls at the center of the image, which makes it easier to use a center point of the feature map to predict the bounding box of these objects. For example, compress a 448*448 image to a size of 416, and the total step length of the YOLOv2 model downsampling is 32, 416 / 32=13, and a middle cell will be obtained. Although anchors have reduced mAP, compared with YOLOv1, the recall rate has been improved while greatly increasing the number of measurement frames, and it also has a certain effect on the subsequent optimization of the model.

[0043] The K-Means algorithm requires data. The number of center points needs to be specified manually. The position can be randomly initialized, but the distance to the cluster center needs to be measured. If the standard Euclidean distance is used for distance measurement, large boxes will produce more errors than small boxes. Therefore, other distance measurement formulas are used. The purpose of clustering is to make the anchorboxes and the adjacent ground truth have a larger intersection over union (IOU) value, which has no direct relationship with the size of the anchorbox. The custom distance measurement formula is: d(box, centroid) = 1-IOU(box, centroid). The smaller the distance to the cluster center, the better, but the larger the IOU value, the better, so 1-IOU is used to ensure that the smaller the distance, the larger the IOU value.

[0044] At the same time, due to the addition of the anchor mechanism, the predicted position in the box is very random, which means that if you want to generate a stable predicted offset, you need to calculate it for a long time, which obviously does not meet the system design requirements. Therefore, we use Direct Location Prediction (DLP) to directly predict the relative position of the offset to the network unit.

[0045] b x =σ(t x )+c x (3)

[0046] b y =σ(t y )+c y (4)

[0047]

[0048] Pr(object)*IOU(b,object)=σ(t o ) (7)

[0049] Compared with the offset prediction, direct location prediction (DIP) is more direct and predicts (t x ,t y ,t w ,t h ,t o ), constrain the center point of the prediction box to the current cell, and use the sigmoid function to convert t x ,t yNormalization processing constrains the value to 0-1, making model training more stable.

[0050] The loss rate graph is initially optimized by labeling, and the initial model training and testing are completed. In order to ensure the further accuracy of the model, the samples are screened, repeatedly captured and anchor points are calculated to increase the accuracy, the model training is further deepened and the pruning theory is appropriately used to ensure the lightweight of the MaixduinoAI K210 artificial intelligence open source hardware platform development board.

[0051] Step 2: Construction of mask monitoring system:

[0052] The main process of the mask recognition system is as follows: when the camera detects a valid face target, the MaixduinoAIK210 artificial intelligence open source hardware platform development board performs machine vision target recognition and processing. The processing result is that the effective recognition area of ​​the mask is framed with lines on the screen, and the mask recognition result (i.e., Masks) is output just above the recognition area to determine whether the target is wearing a mask. If the target is wearing a mask, there is no alarm and the system continues to operate normally; if the target is not wearing a mask, the system will flash an indicator light to alarm (which can be replaced with a buzzer or other effective alarm device as needed), record the alarm data and upload it to the host device.

[0053] Step 3: Building a QR code recognition system:

[0054] The main process of the QR code recognition system is as follows: when the camera detects a valid QR code target, the MaixduinoAI K210 artificial intelligence open source hardware platform development board performs machine vision target recognition and processing. The processing result is that the effective recognition area of ​​the QR code is framed with lines on the screen, and the QR code recognition result (that is, the string corresponding to the QR code or the network link address corresponding to the QR code) is output directly above the recognition area.

[0055] Figure 1 This is the block diagram of the Maixduino AI K210 artificial intelligence open source hardware platform. The MaixduinoAI K210 artificial intelligence open source hardware platform uses the MaixduinoAI K210 visual target recognition microprocessor as the CPU. The platform integrates multiple interface modules such as GPIO, 24PLCD, USB, TF CARD, camera, DAC, WIFI, etc. The platform uses a 6-12V DC power supply and uses DC-DC step-down to DC 5V to power the CPU.

[0056] Figure 2This is a physical picture of the mask monitoring and QR code recognition system based on the Maixduino AI K210 artificial intelligence open source hardware platform development board. The main modules used in the figure are the MaixduinoAI K210 artificial intelligence open source hardware platform development board, camera and LCD display. The TF CARD module in the figure can be inserted into the TK card, which stores the machine vision recognition model file for mask monitoring. The mask recognition model can be completed by the built-in module of the development board after setting, without additional addition. After testing, the built-in mask recognition model of the development board is accurate and reliable and can be put into use directly.

[0057] Figure 3 This is the training result of the mask recognition model. As can be seen from the figure, the model has trained the loss rate to below 0.25 and can basically be put into use directly. If the equipment allows, there is enough time, and the number of samples is sufficient, the model can be trained and adjusted more finely to ensure the accuracy and reliability of the model.

[0058] Figure 4 The following is the workflow diagram of the mask monitoring system. When the camera detects a valid face target, the Maixduino AIK210 artificial intelligence open source hardware platform development board performs machine vision target recognition and processing. The processing result is that the effective recognition area of ​​the mask is framed with lines on the screen, and the mask recognition result (i.e., Masks) is output directly above the recognition area to determine whether the target is wearing a mask. If the target is wearing a mask, no alarm will be triggered and the system will continue to operate normally; if the target is not wearing a mask, the system will flash an indicator light to alarm (which can be replaced with a buzzer or other effective alarm device as needed), record the alarm data and upload it to the host device. The alarm function is completed by the buzzer module in the development board. In combination with the actual environment and hardware conditions, the buzzer alarm process can be replaced with other functions, such as opening the gate, broadcasting a specific prompt tone, etc. The MaixduinoAI K210 artificial intelligence open source hardware platform is equipped with a WIFI module. In addition to transmitting data to the host device through a data cable, it can also use WIFI to send data to a pre-set mobile device (such as a security guard's smartphone or other device).

[0059] Figure 5 Implement a scene graph for the mask monitoring system. When the camera detects a valid face target wearing a mask, the Maixduino AI K210 artificial intelligence open source hardware platform development board performs machine vision target recognition and processing. The processing result is that the effective recognition area of ​​the mask is framed with lines on the screen, and the mask recognition result is output just above the recognition area (that is, Masks are displayed), so as to determine that the target face is wearing a mask.

[0060] Figure 6The following is a flowchart of the QR code recognition system. The main process of the QR code recognition system is as follows: When the camera detects a valid QR code target, the Maixduino AI K210 artificial intelligence open source hardware platform development board performs machine vision target recognition and processing. The processing result is that the effective recognition area of ​​the QR code is framed with lines on the screen, and the QR code recognition result (that is, the string corresponding to the QR code or the network link address corresponding to the QR code) is output directly above the recognition area. In combination with the actual application environment and basic hardware conditions, the system theoretically fully supports the transmission of the recognized string to the designated mobile terminal or server to record data, which is convenient for storing the flow of people in and out of the designated place.

[0061] When the camera detects a valid QR code target, the Maixduino AI K210 artificial intelligence open source hardware platform development board performs machine vision target recognition and processing. The processing result is that the effective recognition area of ​​the QR code is framed with lines on the screen, and the QR code recognition result is output directly above the recognition area (that is, the mobile phone number corresponding to the QR code is recognized).

[0062] Those skilled in the art should recognize that the above embodiments are only used to illustrate the present invention, and are not intended to limit the present invention. As long as they are within the scope of the present invention, any changes or modifications to the above embodiments will fall within the protection scope of the present invention.

Claims

1. Design method of mask monitoring and QR code recognition system based on Maixduino AI K210 development board, characterized by The following steps are involved: Step 1: Establishment of machine vision learning library for mask monitoring; Step 2: Construction of mask monitoring system; Step 3: Building a QR code recognition system; The establishment of the machine vision learning library for mask monitoring described in step 1 is based on the Maixduino AI K210 artificial intelligence open source hardware platform, using the YOLOv2 model and the K-Means clustering algorithm to identify mask targets, as follows: The BN layer in the YOLOv2 model can achieve a higher average accuracy and a good number of frames per second. Therefore, after the image preparation data is captured and recognized, the anchor point parameters are calculated and configured, and the initial training of the model begins. The BN layer preprocesses the data before convolution. Specifically, it normalizes each data output after convolution pooling and before activation function. in, is the result of data normalization within the batch, E[x (k) ] is the batch mean, Var is the variance; γ and β are additional parameters introduced; At the same time, the anchor box algorithm is introduced for object prediction. The anchor boxes algorithm compresses the image and makes the dimension of the feature map an odd number. When predicting some large object operations, the center point falls at the center of the picture, making it easier to use a center point of the feature map to predict the bounding box of these objects. The K-Means algorithm makes the anchor boxes and the adjacent real boxes have a larger intersection-over-union ratio. At the same time, due to the addition of the anchor mechanism, the relative position DLP of the network unit is directly predicted by the offsets. b x =σ(t x )+c x (3) b y =σ(t y )+c y (4) Pr(object)*IOU(b,object)=σ(t o ) (7) Among them, b x , b y , b w , b h is the center and width of the predicted border, Pr(object) is the grid target object, IOU(b,object) is the IOU score, and Pr(object)*IOU(b,object) is the confidence of the predicted border. Here, the parameter t o After σ transformation, it is used as the confidence value; c x 、c y is the distance from the upper left corner of the current grid to the upper left corner of the image. The grid size must be normalized first, that is, the width of a grid is 1 and the height is 1; p w 、p h is the width and height of the prior box; σ is the sigmoid function; t x ,t y ,t w ,t h ,t o are the parameters to be learned, which are used to predict the center, width, height and confidence of the bounding box respectively; The specific implementation of the mask recognition system is as follows: When the camera detects a valid face target, the Maixduino AI K210 artificial intelligence open source hardware platform development board performs machine vision target recognition and processing; specific processing: use lines to frame the effective recognition area of ​​the mask on the screen, and output the mask recognition result just above the recognition area to determine whether the target is wearing a mask; if the target is wearing a mask, no alarm will be triggered and the system will continue to operate normally; if the target is not wearing a mask, the system will flash an indicator light to alarm, record the alarm data and upload it to the host device; The specific implementation of the QR code recognition system is as follows: When the camera detects a valid QR code target, the Maixduino AI K210 artificial intelligence open source hardware platform development board performs machine vision target recognition and processing; specific processing: use lines to frame the effective recognition area of ​​the QR code on the screen, and output the QR code recognition result just above the recognition area.

Citation Information

Patent Citations

  • Mask wearing recognition method and device based on full-convolution single-step target detection algorithm

    CN111898479A

  • Mask wearing detection method based on deep learning

    CN112232199A