A method for detecting off-duty and empty post based on YOLOvX improved algorithm
By adding a filtering layer to the input of the YOLOvX algorithm, the center point and width and height of the bounding box are calculated, which solves the problem that existing technologies cannot detect by a specified area, and realizes efficient and economical absence detection.
Patent Information
- Application Number
- CN202310854994.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-12
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2043-07-12
AI Technical Summary
Existing leave-of-post and vacancy detection schemes based on the YOLOvX algorithm cannot detect according to a specified area, resulting in low efficiency and affecting the accuracy of detection.
A filtering layer is added to the input of the YOLOvX algorithm. The coordinates of the center point of the bounding box are calculated using the formulas bx=(2·σ(tx)-0.5)+cx and by=(2·σ(ty)-0.5)+cy. The width and height of the bounding box are calculated using bw=pw·(2·σ(tw))2 and bh=ph·(2·σ(th))2, which reduces the detection range and improves the confidence level.
The detection efficiency has been doubled, the confidence level has been increased by half, and the equipment computing power has been reduced by half, thus solving the economic problem.
Smart Images

Figure CN117011788B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computer vision, edge computing, and object detection. Specifically, it relates to a method for detecting absenteeism based on an improved YOLOvX algorithm. Background Technology
[0002] In critical positions such as the fire control room, which serves as the central hub for a unit's fire-fighting operations, the fire alarm signals are received, displayed, and processed. If the personnel on duty in the fire control room are frequently absent, creating an "empty area," they may be unable to take immediate action and raise the alarm in the event of a fire. Conversely, swift and timely fire suppression can minimize the damage. Statistics show that the earlier most fires are detected and dealt with, the less severe the damage. Therefore, according to the "General Technical Requirements for Fire Control Rooms," fire control rooms must implement a 24-hour on-duty system with no fewer than two people per shift. If one person leaves the fire control room for more than the prescribed time, it is considered absenteeism; if two people leave for more than the prescribed time, it is considered vacant duty. Ensuring that the fire control room is staffed 24 hours a day is a pressing challenge and a significant problem that needs to be addressed.
[0003] Currently commonly used solutions include:
[0004] (1) Poll the on-site cameras based on the existing YOLOvX algorithm.
[0005] (2) Real-time monitoring of on-site cameras based on the existing YOLOvX algorithm.
[0006] Both of the above schemes are based on the YOLOvX single-stage object detection method. They are based on the combination of Backbone, Neck, and Head and different levels of enhancement to improve YOLOvX. However, neither of them can currently support object detection with parameterized dynamics based on a specified region.
[0007] The existing solution has the following problems:
[0008] In most current implementations, the following common problems arise when deployed in a production environment:
[0009] 1. Both methods perform model detection based on the entire image after frame extraction, and cannot perform detection by specified regions;
[0010] 2. Both methods involve filtering the specified area a second time based on the detection results, which is relatively inefficient.
[0011] 3. During model training, image sizes are generally set to the default 640 or multiples of 32, and scaled proportionally. After scaling, some images will still differ from the original data, affecting realism.
[0012] No effective solutions have yet been proposed to address the problems in the relevant technologies. Summary of the Invention
[0013] To address the problems in related technologies, this invention proposes a method for detecting absenteeism based on an improved YOLOvX algorithm, in order to overcome the aforementioned technical problems existing in the current related technologies.
[0014] Therefore, the specific technical solution adopted by the present invention is as follows:
[0015] A method for detecting absenteeism based on an improved YOLOvX algorithm, comprising the following steps:
[0016] S1. Register the algorithm model in the configuration service center, and the administrator manually associates the video device with the alarm configuration in the configuration service center. At the same time, the latest alarm configuration is automatically pushed to the streaming frame extraction service center.
[0017] S2. After the video device pulls the stream and extracts frames, the streaming and frame extraction service center calls the corresponding algorithm model interface to notify the algorithm service center of the image based on the algorithm model and polling strategy configured on the device.
[0018] S3. After receiving the image, the algorithm service center calls the corresponding algorithm model according to the configured region and notifies the message service center of the result.
[0019] After calling the corresponding algorithm model according to the configured region, the image is detected based on the YOLOvX algorithm.
[0020] Furthermore, the registration of the algorithm model in the configuration service center includes both manual registration and automatic registration;
[0021] During manual registration, the administrator performs manual registration in the configuration service center according to the specific parameters of the algorithm model.
[0022] During automatic registration, the algorithm model automatically registers according to a predefined interface protocol.
[0023] Furthermore, if the video device and alarm configuration are modified, a notification will be automatically broadcast to the streaming frame extraction service center.
[0024] Furthermore, after the video device pulls the stream and extracts frames, when the streaming and frame extraction service center calls the corresponding algorithm model interface to notify the algorithm service center of the image according to the algorithm model and polling strategy configured by the device, the image is notified to the algorithm service center in a synchronous or asynchronous manner.
[0025] Furthermore, during the synchronous distribution, the polling device invokes the HTTP protocol to synchronously notify the algorithm service center;
[0026] During asynchronous distribution, the real-time device calls the PUBLISH message channel to asynchronously notify the algorithm service center.
[0027] Furthermore, after receiving the image, the algorithm service center calls the corresponding algorithm model according to the configured region and notifies the message service center of the result using asynchronous result notification HTTP or asynchronous result notification PUB.
[0028] Furthermore, when the result is asynchronously notified via HTTP, the algorithm service center asynchronously sends out the target detection result via HTTP.
[0029] When the result is asynchronously notified to the PUB, the algorithm service center asynchronously notifies the PUB of the target detection result.
[0030] Furthermore, when detecting images based on the YOLOvX algorithm, the detection is performed based on YOLOvX, and a filtering layer is added after the input of YOLOvX.
[0031] Furthermore, the formula for the filter layer is:
[0032] b x =(2·σ(t) x )-0.5)+c x
[0033] b y =(2·σ(t) y )-0.5)+c y
[0034] b w =p w ·(2·σ(t w )) 2
[0035] b h =p h ·(2·σ(t h )) 2
[0036] In the formula, x and y represent the coordinates of the upper left and lower right corners of the bounding box, respectively;
[0037] b x b y These represent the coordinates of the center point of the label bounding box, respectively.
[0038] c x c y These represent the widths of the grid cells containing the top-left and bottom-right corners of the bounding box, respectively.
[0039] t x t y It is the predicted coordinate offset value (center point coordinates), t w t h It's a scaling process, passing through a sigmoid function, outputting an offset between 0 and 1, and then comparing it with c. x c y The sum gives the position of the center point of the bounding box;
[0040] P w P h It refers to the width and height of the preset anchor box mapped onto the feature map, while it refers to the width and height of the manually set anchor.
[0041] t w t h respectively with p w p h After the action, the width and height of the bounding box are obtained;
[0042] b w and b h These are the width and height of the bounding box, respectively.
[0043] in,
[0044] Conffidence = 1 - ∑(y i -c y )^2 / (n-1)
[0045] In the formula, y i This represents the coordinates of the bottom right corner of the i-th predicted bounding box, n represents the number of predicted pixels, and c y This represents the width of the grid containing the top-left corner of the bounding box. After filtering, y i It will get smaller, c y As n increases, the confidence level also increases.
[0046] Furthermore, the image detection based on the YOLOvX algorithm also includes the following steps:
[0047] Cropping is performed on the start and end coordinates of the input image;
[0048] Scaling the cropped image;
[0049] Enhance the scaled image.
[0050] The beneficial effects of this invention are as follows:
[0051] (1) This invention proposes a method to quickly improve confidence, a method to quickly improve efficiency, reduces the computing power of the graphics processor in the entire system, proposes how to avoid false alarms, and improves the production safety of enterprises.
[0052] (2) This invention optimizes and modifies the existing YOLOvX algorithm by adding a filter layer before the backbone, which greatly improves efficiency. Detecting a 1920*1080 target image only requires detection within the designated area of office workers' seats, thus reducing the detection range by more than half. Theoretically, this also increases confidence and detection efficiency by more than half. The improved detection efficiency after the filter layer is significant, saving considerable computing power. Given the current high cost of computing chips, this can help solve many economic problems. Attached Figure Description
[0053] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0054] Figure 1 This is a flowchart of a method for detecting absenteeism based on an improved YOLOvX algorithm according to an embodiment of the present invention;
[0055] Figure 2 This is a flowchart of the improved YOLOvX algorithm in an off-duty vacancy detection method according to an embodiment of the present invention;
[0056] Figure 3 This is a schematic diagram illustrating the specific features of the Filter layer in a method for detecting absenteeism based on an improved YOLOvX algorithm according to an embodiment of the present invention.
[0057] Figure 4 This is an explanatory diagram of the filter layer in a method for detecting absenteeism based on an improved YOLOvX algorithm according to an embodiment of the present invention;
[0058] Figure 5 This is a comparison image before and after filtering in a method for detecting absenteeism based on an improved YOLOvX algorithm according to an embodiment of the present invention. Detailed Implementation
[0059] To further illustrate the various embodiments, the present invention provides accompanying drawings, which are part of the disclosure of the present invention. These drawings are mainly used to illustrate the embodiments and can be used in conjunction with the relevant descriptions in the specification to explain the operating principles of the embodiments. With reference to these drawings, those skilled in the art should be able to understand other possible implementation methods and the advantages of the present invention. The components in the drawings are not drawn to scale, and similar component symbols are generally used to represent similar components.
[0060] According to an embodiment of the present invention, a method for detecting absence from duty based on an improved YOLOvX algorithm is provided.
[0061] The present invention will now be further described in conjunction with the accompanying drawings and specific embodiments, such as... Figure 1 As shown, the method for detecting absenteeism based on the improved YOLOvX algorithm according to an embodiment of the present invention includes the following steps:
[0062] S1. Register the algorithm model in the configuration service center, and the administrator manually associates the video device with the alarm configuration (algorithm model) in the configuration service center. At the same time, the latest alarm configuration is automatically pushed to the streaming frame extraction service center.
[0063] In one embodiment, registering the algorithm model in the configuration service center includes both manual registration and automatic registration.
[0064] During manual registration, the administrator performs manual registration in the configuration service center according to the specific parameters of the algorithm model.
[0065] During automatic registration, the algorithm model automatically registers according to a predefined interface protocol.
[0066] In one embodiment, if the video device and alarm configuration are modified, a notification is automatically broadcast to the streaming frame extraction service center.
[0067] S2. After the video device pulls the stream and extracts frames, the streaming and frame extraction service center calls the corresponding algorithm model interface to notify the algorithm service center of the image based on the algorithm model and polling strategy configured on the device (supporting one-to-many).
[0068] In one embodiment, after the video device pulls the stream and extracts frames, the streaming and frame extraction service center, based on the algorithm model and polling strategy configured on the device, calls the corresponding algorithm model interface to notify the algorithm service center of the image, and uses synchronous or asynchronous distribution to notify the algorithm service center of the image.
[0069] In one embodiment, during the synchronous distribution, the polling device invokes the HTTP protocol to synchronously notify the algorithm service center;
[0070] During asynchronous distribution, the real-time device calls the PUBLISH (a message publishing mechanism) message channel to asynchronously notify the algorithm service center.
[0071] S3. After receiving the image, the algorithm service center calls the corresponding algorithm model according to the configured region and notifies the message service center of the result.
[0072] After calling the corresponding algorithm model according to the configured region, the image is detected based on the YOLOvX algorithm.
[0073] In one embodiment, after receiving an image, the algorithm service center calls the corresponding algorithm model according to the configured region and notifies the message service center of the result using either asynchronous result notification via HTTP or asynchronous result notification via PUB.
[0074] In one embodiment, when the result is asynchronously notified via HTTP, the algorithm service center sends out the target detection result asynchronously via HTTP.
[0075] When the result is asynchronously notified to the PUB, the algorithm service center asynchronously notifies the PUB of the target detection result.
[0076] In one embodiment, when detecting images based on the YOLOvX algorithm, the images are detected based on YOLOvX (e.g., YOLOv5), and a filter layer is added after the input of YOLOvX.
[0077] In one embodiment, such as Figure 4 As shown, the formula for the filter layer is:
[0078] b x =(2σ(t) x )-0.5)+c x
[0079] b y =(2σ(t) y )-0.5)+c y
[0080] b w =p w ·(2·σ(t w )) 2
[0081] b h =ph·(2·σ(t) h )) 2
[0082] In the formula, x and y represent the coordinates (pixel coordinates) of the top left and bottom right corners of the bounding box, respectively;
[0083] c x c y These represent the width (in pixels) of the grid cells containing the top-left and bottom-right corners of the bounding box, respectively.
[0084] t x t y It is the predicted coordinate offset value (center point coordinates), t w t h It's a scaling process, passing through a sigmoid function, outputting an offset between 0 and 1, and then comparing it with c. x c y The sum gives the position of the center point of the bounding box.
[0085] P w P h It refers to the width and height of the preset anchor box mapped onto the feature map, while it refers to the width and height of the manually set anchor.
[0086] t w t h respectively with p w p h After the action, the width and height of the bounding box are obtained;
[0087] b w and b h These are the width and height of the bounding box, respectively.
[0088] in,
[0089] Confidence = 1 - ∑(yi) - c y )^2 / (n-1)
[0090] In the formula, y i This represents the coordinates of the bottom right corner of the i-th predicted bounding box, n represents the number of predicted pixels, and c y This represents the width of the grid containing the top-left corner of the bounding box. After filtering, y i It will get smaller, c y As n increases, the confidence level also increases.
[0091] By cropping the unused areas around the image, the image size was reduced by approximately 60%. When performing object detection on the specified area, the confidence improved from 0.48 to 0.73. In addition, the inference time (the time required for the model to run) was also improved from 231.0ms to 115.0ms (based on a local laptop test in the same environment).
[0092] like Figure 2-3 As shown, the leave-of-post vacancy algorithm is just one type of algorithm. Other algorithms are actually similar. We will use the leave-of-post vacancy algorithm as an example to illustrate this.
[0093] Adding a filter layer right after the input layer can greatly improve efficiency. A 1920*1080 target detection only needs to be performed in the designated office worker's seat area of 516*872. This reduces the detection range of the image by more than half and improves the confidence and detection efficiency by more than half.
[0094] The detection efficiency is improved after passing through the filter layer: this has a very significant effect, saving more than half of the device's computing power. Given the current high price of computing chips, this can help solve many economic problems.
[0095] like Figure 5 As shown, the comparison image is before and after filtering, and the speed is significantly improved.
[0096] In one embodiment, the image detection based on the YOLOvX algorithm further includes the following steps:
[0097] Cropping is performed on the start and end coordinates of the input image (parameters) (return if the area is less than 64);
[0098] Resize the cropped image (process it into small 416, medium 608, and large sizes);
[0099] Enhance the scaled image (remove noise).
[0100] Key points of this invention:
[0101] (1) Under the same environment, a method and device for rapidly improving confidence was designed. The detection method based on off-duty and vacant duty scenarios can basically improve confidence by 1 time.
[0102] (2) Under the same environment, a method and device that can quickly improve computing power were designed, and the efficiency of the detection method based on the off-duty and vacant scenarios can be basically doubled.
[0103] (3) It greatly improves the training speed of the network.
[0104] (4) Reduce the memory requirements of the model.
[0105] This invention proposes an innovative method and device for detecting absence and vacancy based on an improved YOLOvX algorithm. This method has a certain degree of universality and is not limited to the scenarios exemplified in this invention. It can also be applied to cloud-edge message transmission in certain constrained environments.
[0106] In summary, this invention proposes a method to rapidly improve confidence levels and efficiency, reduces the computational power of the graphics processing unit (GPU) in the entire system, and addresses how to avoid false positives, thereby enhancing enterprise production safety. This invention optimizes the existing YOLOvX algorithm by adding a filter layer before the backbone (the existing process: input => backbone => neck => head => output). This significantly improves efficiency; a 1920*1080 target detection only needs to be performed within a designated area of office workers' seats, reducing the detection range by more than half and theoretically increasing confidence and detection efficiency by a significant margin. The improved detection efficiency after the filter layer is substantial, saving considerable computing power, which can significantly alleviate economic problems given the current high cost of computing chips.
[0107] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for detecting off-duty and empty post based on YOLOvX improved algorithm, characterized in that, The method comprises the following steps: S1, register the algorithm model in the configuration service center, and manually associate the video device with the alarm configuration in the configuration service center by the administrator, and automatically push the latest alarm configuration to the stream pulling and frame extracting service center; S2, after the video device pulls the stream and extracts the frame, the stream pulling and frame extracting service center calls the corresponding algorithm model interface according to the algorithm model and the polling strategy configured by the device to notify the picture to the algorithm service center; S3, after the algorithm service center receives the picture, the corresponding algorithm model is called according to the configured area, and the result is notified to the message service center; After the corresponding algorithm model is called according to the configured area, the picture is detected based on the YOLOvX algorithm; When the picture is detected based on the YOLOvX algorithm, a filtering layer is added after the input end of YOLOvX; The formula of the filtering layer is: where x, y represent the coordinates of the upper left and lower right corners of the bounding box, respectively. b x , b y respectively represent the label bounding box center point coordinates; c x , c y respectively represent the width of the grid where the top-left corner and the bottom-right corner of the bounding box are located. t x 、t y is a predicted coordinate offset value, t w 、t h is a scale, respectively, through sigmoid, output 0-1 between the offset, and c x 、c y is added to get the position of the center point of the bounding box. p w , p h is the preset anchor box width and height mapped into the feature map, and is the manually set anchor width and height; t w , t h , p w , p h , respectively, after acting on the bounding box b w and b h are the width and height of the bounding box, respectively; wherein, wherein, y i represents the coordinate of the right bottom corner of the i-th prediction frame, n represents the number of pixels of the prediction, c y represents the width of the grid where the top left corner of the bounding box is located, after filtering, y i becomes smaller, c y becomes larger, n becomes larger, and thus the corresponding confidence also becomes larger, Confidence represents the confidence.
2. The off-duty and empty post detection method based on the improved YOLOvX algorithm according to claim 1, characterized in that, When the algorithm model is registered in the configuration service center, it includes manual registration and automatic registration; When the manual registration, the administrator manually registers according to the specific parameters of the algorithm model in the configuration service center; When the automatic registration, the algorithm model automatically registers according to the pre-defined interface protocol.
3. The off-duty and empty post detection method based on the improved YOLOvX algorithm according to claim 2, characterized in that, If the video device and the alarm configuration are modified, the stream pulling and frame extracting service center is automatically notified.
4. The off-duty and empty post detection method based on the improved YOLOvX algorithm according to claim 2 or 3, characterized in that, After the video device pulls the stream and extracts the frame, the stream pulling and frame extracting service center calls the corresponding algorithm model interface according to the algorithm model and the polling strategy configured by the device to notify the picture to the algorithm service center, which adopts the synchronous distribution or asynchronous distribution mode to notify the picture to the algorithm service center.
5. The off-duty and empty post detection method based on the improved YOLOvX algorithm according to claim 4, characterized in that, When the synchronous distribution, the polling device calls the HTTP protocol to synchronize the notification to the algorithm service center; When the asynchronous distribution, the real-time device calls the PUBLISH message channel to asynchronously notify the algorithm service center.
6. The off-duty and empty post detection method based on the improved YOLOvX algorithm according to claim 5, characterized in that, When the algorithm service center receives the picture, the corresponding algorithm model is called according to the configured area, and the result is notified to the message service center, which adopts the result asynchronous notification HTTP or the result asynchronous notification PUB mode to notify the result to the message service center.
7. The off-duty and empty post detection method based on the improved YOLOvX algorithm according to claim 6, characterized in that, When the result asynchronous notification HTTP, the algorithm service center asynchronously notifies the result of target detection by HTTP; When the result asynchronous notification PUB, the algorithm service center asynchronously notifies the result of target detection by PUB.
8. The off-duty and empty post detection method based on the improved YOLOvX algorithm according to claim 1, characterized in that, The detection of the picture based on the YOLOvX algorithm further comprises the following steps: Cut the input picture start coordinate and end coordinate; Scale the cut picture; Enhance the scaled picture.
Citation Information
Patent Citations
Mobile phone playing and leaving detection alarm system and method based on deep learning
CN115019236A
Offsite timeout algorithm model training and personnel identity logic judgment method
CN115050056A