Personnel intrusion detection method and system for custom area, terminal and storage medium

By delineating a custom area in the image perspective and using the improved YOLOv4 model, combined with key point judgment, the problem of low accuracy of human intrusion detection and difficulty in mobile terminal deployment in the existing technology is solved, achieving high-precision and real-time human intrusion detection.

CN118609045APending Publication Date: 2024-09-06DATA SPACE RES INST +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410695556.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-31
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

Existing methods for detecting personnel intrusion into dangerous areas have deficiencies in accuracy and mobile terminal deployment. The algorithm has low accuracy and a large amount of calculation, making it difficult to deploy on mobile terminals.

Method used

Using a custom area human intrusion detection method, by delineating dangerous areas in the image perspective, using the improved YOLOv4 model for human detection, combining multiple key points to determine the intrusion direction, replacing the traditional CSPDarknet53 with the mobileNetv3 backbone network, reducing the amount of parameters , convenient for mobile deployment.

Benefits of technology

It improves the detection accuracy and real-time capabilities, reduces the calculation amount of the model on the mobile terminal, achieves high-precision human intrusion detection, and avoids missed detections.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118609045A
    Figure CN118609045A
Patent Text Reader

Abstract

The invention relates to the technical field of pedestrian detection, and discloses a user-defined area personnel intrusion detection method and system, a terminal and a storage medium. According to the method, a dangerous area is delimited in an image acquisition view angle, when a human body frame is identified and the distance between the human body frame and the dangerous area is within a certain range, the invasion direction of a person is judged, a plurality of key points are deployed on the human body frame, and the key points are selected as a judgment basis according to the invasion direction. The relative spatial position relation between the person and the dangerous area is judged, whether the person invades the dangerous area or not is detected, and therefore detection leakage caused by the image view angle can be avoided. According to the method, intelligent intrusion detection of the static dangerous area is realized, and the method has relatively high detection precision and real-time detection capability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of pedestrian detection, in particular to a method for detecting human intrusion in a custom area, and a monitoring system, a computer terminal and a computer-readable storage medium applying the method. Background Art

[0002] Personnel intrusion into static hazardous areas is an important cause of accidents. Traditional engineering safety management mainly relies on manual methods, such as safety officer inspections, which are time-consuming, labor-intensive, and difficult to achieve complete safety supervision. In recent years, the emergence of artificial intelligence technology and computer vision technology has provided new ideas for intrusion detection.

[0003] Currently, existing intrusion detection solutions have the following problems:

[0004] (1) Existing methods use a single human intrusion judgment method for static dangerous areas without in-depth consideration of the influence of factors such as human posture and intrusion direction, resulting in low algorithm accuracy.

[0005] (2) Existing classic deep learning models, such as the YOLO series of models, have high detection accuracy, but they have large computational complexity and many parameters, making them difficult to deploy on mobile devices.

[0006] In summary, how to provide a high-precision detection solution for people intruding into dangerous areas that is easy to deploy on mobile terminals is an urgent problem to be solved in the field of pedestrian detection. Summary of the invention

[0007] In order to solve the technical problem of low accuracy in detecting personnel intrusion into dangerous areas in the prior art, the present invention provides a method, system, terminal and storage medium for detecting personnel intrusion into a custom area.

[0008] To achieve the above object, the present invention provides the following technical solutions:

[0009] The present invention discloses a method for detecting human intrusion in a user-defined area, which comprises the following steps, namely S1 to S9.

[0010] S1. Define a custom danger zone in the current image viewing angle, and generate a rectangular region of interest outside the danger zone.

[0011] S2. Acquire a real-time image to be tested, perform person detection on a region of interest in the image to be tested, and generate a corresponding human body frame on the detected human body.

[0012] S3. Calculate the distance d between the center point of each human body frame in the image to be tested and the center point of the dangerous area 0 , d 0 With a preset interval [d1 ,d 2 ] to compare and make the following judgment: when d 1 ≤d 0 ≤d 2 When d 0 <d 1 When d 0 >d 2 Execute S9.

[0013] S4. Generate a regular circumscribed rectangle for the dangerous area, where four sides of the regular circumscribed rectangle are parallel to the edges of the image to be tested.

[0014] S5. Using the straight lines where the two sides of the regular circumscribed rectangle are parallel to the height direction, the area of ​​interest is divided into a No. 1 zone and a No. 2 zone, which are located on the outside of the left straight line and the right straight line respectively; the danger zone is divided into a No. 3 zone and a No. 4 zone in the area of ​​interest on the inside of the two straight lines, and the No. 3 zone and the No. 4 zone are located on the upper side and the lower side of the danger zone respectively.

[0015] S6. Deploy four key points on the human body frame, where key point No. 2 and key point No. 1 are located at the left and right ends of the bottom of the human body frame respectively, key point No. 4 is located at the center point of the human body frame, and key point No. 3 is located at the center of the bottom of the human body frame.

[0016] S7. Analyze the partition where the center point of the human body frame is located, and select the key point with the serial number corresponding to the partition as the identification point. When the identification point is located in the danger zone, execute S8, otherwise execute S9;

[0017] S8. Determine whether the person corresponding to the human body frame has invaded the danger zone.

[0018] S9. Determine whether the person corresponding to the human body frame has not invaded the dangerous area.

[0019] As a further improvement of the above solution, in step S2, people detection is performed on the region of interest in the image to be tested based on the improved YOLOv4 model; wherein the improvement of the YOLOv4 model includes:

[0020] The backbone network of the traditional YOLOv4 is replaced by CSPDarknet53 with mobileNetv3.

[0021] As a further improvement of the above solution, in step S1, a custom danger area is defined in the current image viewing angle by setting a mouse response event in OpenCV. The specific steps are as follows:

[0022] S11. Define the node selection key, deselection key, and confirmation key of the mouse;

[0023] S12. Provide a sample image that matches the current image viewing angle, click the node selection keys in the sample image in sequence according to the custom order, select the nodes in the danger zone, and during this period, cancel the selected nodes by clicking the cancel selection key. Finally, click the confirmation key to combine the selected nodes into a closed polygon, namely the danger zone.

[0024] As a further improvement of the above scheme, in step S1, the sample image is also masked to obtain a mask image, that is, a region of interest outside the dangerous area is formed; in step S2, the mask image is multiplied by the image to be tested to retain the region of interest in the image to be tested, thereby shielding irrelevant information in the image.

[0025] As a further improvement of the above scheme, in step S8, when it is determined that a person has intruded into a dangerous area, a marking frame for marking the person's legs is generated in the image to be tested based on the human body frame corresponding to the person, and an interactive end is controlled to display the image to be tested and the marking frames of all persons who have intruded into the dangerous area in real time.

[0026] The invention also discloses a monitoring system, which comprises: an image acquisition module and a detection module.

[0027] The image acquisition module is used to acquire the image to be tested in real time.

[0028] The detection module applies the above-mentioned human intrusion detection method in the custom area to detect whether there is human intrusion behavior in the image to be tested.

[0029] The present invention also discloses a computer terminal, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps of the above-mentioned method for detecting intrusion of personnel into a custom area are implemented.

[0030] The present invention also discloses a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the above-mentioned method for detecting human intrusion in a custom area are implemented.

[0031] Compared with the prior art, the present invention has the following beneficial effects:

[0032] 1. The method for detecting intrusion of personnel in a custom area disclosed in the present invention delineates a dangerous area in the image acquisition perspective, and when a human body frame is identified and the distance between the human body frame and the dangerous area is within a certain range, determines the intrusion direction of the person and deploys multiple key points on the human body frame, selects key points as the basis for determination according to the intrusion direction, determines the relative spatial position relationship between the person and the dangerous area, and detects whether the person has intruded into the dangerous area, thereby helping to avoid missed detection caused by image perspective, and realizes intelligent intrusion detection of static dangerous areas, with high detection accuracy and real-time detection capability.

[0033] 2. The present invention replaces the backbone network of the YOLOv4 model with mobileNetv3, and uses the improved model to perform human target detection on the image to be tested, thereby reducing the number of parameters of the original YOLO-V4 and facilitating deployment on devices with low computing power such as mobile terminals.

[0034] 3. The monitoring system, computer terminal and computer-readable storage medium disclosed in the present invention can produce the same beneficial effects as the above method by applying the above method, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 This is a flow chart of the method for detecting human intrusion in a custom area in Example 1 of the present invention.

[0036] Figure 2 This is a network architecture diagram of the original YOLOv4 model in Example 1 of the present invention.

[0037] Figure 3 This is a network architecture diagram of mobileNetv3 in Example 1 of the present invention.

[0038] Figure 4 This is a statistical diagram of data distribution for training in Example 1 of the present invention.

[0039] Figure 5 This is a statistical diagram of the data size trained in Example 1 of the present invention.

[0040] Figure 6 This is the PR curve of the YOLOv4 model before optimization in Example 1 of the present invention.

[0041] Figure 7 This is the PR curve of the YOLOv4 model after optimization in Example 1 of the present invention.

[0042] Figure 8 This is the F1 score curve of the YOLOv4 model before optimization in Example 1 of the present invention.

[0043] Fig. 9 This is the F1 score curve of the YOLOv4 model after optimization in Example 1 of the present invention.

[0044] Fig.10 This is a schematic diagram of the relative positions of key points deployed on the human body frame in Example 1 of the present invention.

[0045] Fig.11 Schematic diagram of the relative positions of the dangerous area, the regular circumscribed rectangle, the region of interest and the image to be tested in Example 1 of the present invention.

[0046] Fig.12 for Fig.11Schematic diagram of the distribution of medium-risk areas and four zones. DETAILED DESCRIPTION

[0047] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0048] Example 1

[0049] See also Figure 1 , this embodiment provides a method for detecting human intrusion in a custom area, including the following steps, namely S1 to S9.

[0050] S1. Define a custom danger zone in the current image viewing angle, and generate a rectangular region of interest outside the danger zone.

[0051] In step S1, a custom danger zone is defined in the current image viewing angle by setting a mouse response event in OpenCV. The specific steps are as follows:

[0052] S11. Define the left button of the mouse as the node selection button, the middle button of the mouse as the cancel selection button, and the right button as the confirmation button;

[0053] S12. Provide a sample image that matches the current image viewing angle as a reference, click the node selection keys in the sample image in sequence according to the custom order, select the nodes in the danger zone, and during this period, cancel the selected nodes by clicking the cancel selection key. Finally, click the confirmation key to combine the selected nodes into a closed polygon, namely the danger zone.

[0054] In order to improve the detection speed, this embodiment obtains a mask image by masking the sample image, that is, forming a region of interest outside the dangerous area; in step S2, the region of interest in the image to be tested is retained by performing image multiplication operation on the mask image and the image to be tested, thereby shielding irrelevant information in the image, so that the model only focuses on the intruder in the region of interest.

[0055] S2. Acquire a real-time image to be tested, perform person detection on a region of interest in the image to be tested, and generate a corresponding human body frame on the detected human body.

[0056] See also Figure 2 ,The original YOLOv4 includes the backbone network (CSPDarknet53), spatial pyramid pooling (SPP), path aggregation network (PANet), and multiple detection heads (Yolo Head).

[0057] Among them, the backbone network is composed of convolution, batch normalization (DarknetConv2D_BN_Mish) and multiple residual blocks (Resblock_body) in series.

[0058] SPP includes multiple pooling layers, including 5, 9, and 13 maximum pooling layers.

[0059] PANet includes multiple concatenations + convolutions (Concat+Conv×5), where Conv+UpSampling means convolution + upsampling; Downsampling means downsampling.

[0060] In order to reduce the computational complexity of the detection network, this embodiment modifies the backbone network of the original YOLOv4 model based on the design concept of mobileNet, reduces the number of parameters, and facilitates deployment on the mobile terminal. The modified YOLOv4 model is used to detect people in the region of interest in the image to be tested; the improvements to the YOLOv4 model are as follows:

[0061] Will Figure 3 The traditional YOLOv4 backbone network is replaced by CSPDarknet53 as follows Figure 4 The mobileNetv3 shown in Figure 1. mobileNetv3 consists of multiple bottleneck structures connected in series. In the bottleneck, n×n represents the convolution kernel size; out represents the output dimension; s represents the step size; t represents the expansion factor; RE represents the residual block; SE represents the channel attention; HS represents the activation function.

[0062] In mobileNetv3, the Resblock_body module has the following features: ① It has an inverted residual structure with the current bottleneck, that is, first use 1×1 convolution to increase the latitude; ② It has 3×3DW convolution (i.e. Depthwise Convolution); ③ A lightweight attention mechanism for adjusting the weight of each channel; ④ Use the h-swish activation function.

[0063] In this embodiment, when training the improved YOLOv4 model, the training data is obtained from daily shooting, totaling 6500 photos, of which 4500 photos are used as training set, 1000 photos are used as test set, and 1000 photos are used as validation set. Figure 4 and Figure 5 , Figure 4 Visualize the data distribution of training data. Figure 4From the aspect ratio of the frames in the upper right corner, we can see that most of them are long and thin rectangular frames, which conform to the characteristics of a rectangular frame when the human body is standing. It can be seen that the characteristics of the people in this training are standing posture.

[0064] Figure 5 It is a common scatter plot (Pairplot), which is usually used to explore the relationship between multiple variables. Each sub-graph in the figure (the sub-graph is a staggered scatter plot and histogram) shows the relationship between different variables and the distribution of each variable. Through these scatter plots and histograms, we can observe the pairwise relationship of variables and the distribution of each variable, which helps to find patterns, trends and outliers in the data. Among them, the horizontal and vertical coordinates of the scatter plot are explained as follows: x vs. y: The sub-graph in the upper left corner shows a scatter plot between variables x and y. The horizontal axis is x and the vertical axis is y. Through this scatter plot, we can see whether there is a relationship between x and y.

[0065] x vs.width: The sub-graph on the left side of the second row shows a scatter plot between the variable x and width. The horizontal axis is x and the vertical axis is width.

[0066] x vs.height: The sub-graph on the left side of the third row shows a scatter plot between variables x and height. The horizontal axis is x and the vertical axis is height.

[0067] y vs.width: The middle sub-graph in the second row shows a scatter plot between the variable y and width. The horizontal axis is y and the vertical axis is width.

[0068] y vs. height: The middle sub-graph in the third row shows a scatter plot between the variable y and height. The horizontal axis is y and the vertical axis is height.

[0069] Width vs. Height: The sub-graph on the right side of the third row shows a scatter plot between the variables width and height. The horizontal axis is width and the vertical axis is height.

[0070] The explanation of the univariate histogram is as follows:

[0071] Histogram of x: The top histogram in the first row shows the distribution of variable x.

[0072] Histogram of y: The histogram on the far right of the first column shows the distribution of variable y.

[0073] Histogram of width: The histogram on the far right of the second row shows the distribution of the variable width.

[0074] Histogram of height: The histogram on the far right of the third row shows the distribution of the variable height.

[0075] Also, see Figures 6 to 9 ,This embodiment also compares the Pr and F1 scores of the YOLOv4 model before and after the improvement. In addition to detecting people (person), the YOLOv4 model can also detect cars (car). Figure 6 "all classes 0.728mAP@0.5" means that when the threshold is 0.5, the average accuracy is 0.728; Figure 7 Same reason. Figure 8 All classes 0.71at 0.365 in the graph means that when the threshold is 0.365, the average accuracy is 0.71; Fig. 9 Similarly, the multiple indicators of the model before and after improvement are shown in Table 1.

[0076] Table 1: Model indicators before and after improvement

[0077] Model Parameter quantity Calculation Amount Pr F1 YOLOv4 11136358 28.6GF 0.72 0.71 YOLOv4s-mobileNetv3 7249102 18.7GF 0.88 0.84 Proportion 35% reduction 35% reduction Up 22% Up 18%

[0078] As can be seen from Table 1, in the improved model of mobileNetv3 as the backbone network (i.e., YOLOv4s-mobileNetv3), the calculation time can be reduced by about 35%, but the model performance will also increase to a certain extent, with Pr increasing by about 22% and F1 score increasing by about 18%.

[0079] S3. Calculate the distance d between the center point of each human body frame in the image to be tested and the center point of the dangerous area 0 , d 0 With a preset interval [d 1 ,d 2 ] to compare and make the following judgment: when d 1 ≤d 0 ≤d 2 When d 0 <d 1 When d 0 >d 2 Execute S9.

[0080] It should be noted that the interval [d 1 ,d 2 ] can be set according to the empirical value. The reason why the present invention sets the interval and makes different judgments in combination with the interval is that when d 0 When in this range, it is not possible to directly determine whether a person has actually invaded the danger zone. The person may just be near the outline of the danger zone but has not actually invaded the danger zone. If the traditional method is used, misjudgment is likely to occur. Therefore, further judgment is required based on subsequent evidence.

[0081] S4. Generate a regular circumscribed rectangle for the dangerous area, where four sides of the regular circumscribed rectangle are parallel to the edges of the image to be tested.

[0082] S5. Using the straight lines where the two sides of the regular circumscribed rectangle are parallel to the height direction, the area of ​​interest is divided into a No. 1 partition and a No. 2 partition which are respectively located on the outside of the left straight line and the right straight line; the dangerous area is divided into a No. 3 partition and a No. 4 partition in the area of ​​interest which are relatively inside the two straight lines, and the No. 3 partition and the No. 4 partition are respectively located on the upper side and the lower side of the dangerous area.

[0083] S6. Deploy four key points on the human body frame, where key point No. 2 and key point No. 1 are located at the left and right ends of the bottom of the human body frame respectively, key point No. 4 is located at the center point of the human body frame, and key point No. 3 is located at the center of the bottom of the human body frame.

[0084] In order to simplify the scene of human invasion into the specified area, the present invention performs the following steps on the human frame detected by the model: Fig.10 As shown in the simplification, a total of four key points are given. Considering the mapping relationship from the 2D image to the three-dimensional world, the key point extraction focuses on the three points on the bottom edge of the human body frame and one point in the center. Fig.10 1, 2, 3, and 4 are key points No. 1, No. 2, No. 3, and No. 4 respectively.

[0085] S7. Analyze the partition where the center point of the human body frame is located, and select the key point with the serial number corresponding to the partition as the identification point. When the identification point is located in the danger zone, execute S8, otherwise execute S9;

[0086] like Fig.11 and Fig.12 As shown, the present invention divides the surroundings of the danger zone into four areas, and different areas are judged according to different intrusion rules. When the human body frame is in the left-right direction (i.e., the first and second partitions), the left and right two points of the key points at the bottom of the human body frame will be focused on; when the human body frame is in the up-down direction (i.e., the third and fourth partitions), the center point of the human body frame and the center point of the bottom will be focused on. For example, if the center point of the human body frame is located in the first partition, the key point No. 1 is selected as the identification point. If the identification point is located in the danger zone, it is intruded.

[0087] S8. Determine whether the person corresponding to the human body frame has invaded the danger zone.

[0088] In some embodiments, when it is determined that a person has intruded into a dangerous area, a marking frame for marking the person's legs is generated in the image to be tested according to the human body frame corresponding to the person, and an interactive terminal is controlled to display the image to be tested and the marking frames of all persons who have intruded into the dangerous area in real time. The yellow line is a custom dangerous area. When a person is detected to have intruded into the yellow area, a green marking frame will appear on the person's legs, otherwise it will not be marked.

[0089] S9. Determine whether the person corresponding to the human body frame has not invaded the dangerous area.

[0090] The present invention introduces the concept of "key points", preliminarily evaluates the positional relationship between people and dangerous areas, and formulates corresponding rules to determine whether people have invaded dangerous areas. When an intrusion is detected, an alarm signal is output. This method takes into account the impact of the viewing angle of the plane image and the specific intrusion state of humans on intrusion judgment, thereby effectively improving the accuracy and robustness of detection.

[0091] Example 2

[0092] This embodiment provides a monitoring system, including: an image acquisition module and a detection module.

[0093] The image acquisition module is used to acquire the image to be tested in real time.

[0094] The detection module applies the above-mentioned human intrusion detection method in the custom area to detect whether there is human intrusion behavior in the image to be tested.

[0095] Example 3

[0096] This embodiment provides a computer terminal, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor.

[0097] The computer terminal may be a smart phone, tablet computer, laptop computer, etc. capable of executing a program. The processor may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip in some embodiments. The processor is generally used to control the overall operation of a computer device. In this embodiment, the processor is used to run a program code stored in a memory or process data. When the processor executes the program, the steps of the detection method for intrusion of personnel in a custom area in Example 1 are implemented.

[0098] Example 4

[0099] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the method for detecting human intrusion into a custom area in Embodiment 1 are implemented.

[0100] The computer-readable storage medium may include flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the storage medium may be an internal storage unit of a computer device, such as a hard disk or memory of the computer device. In other embodiments, the storage medium may also be an external storage device of a computer device, such as a plug-in hard disk equipped on the computer device, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Of course, the storage medium may also include both an internal storage unit of a computer device and an external storage device thereof. In this embodiment, the memory is generally used to store an operating system and various application software installed on the computer device, etc. In addition, the memory may also be used to temporarily store various types of data that have been output or are to be output.

[0101] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.

Claims

1. A method for detecting intrusion of personnel in a custom area, characterized in that: The following steps are involved: S1. Define a custom danger zone in the current image viewing angle, and generate a rectangular region of interest outside the danger zone; S2. Acquire a real-time image to be tested, detect a person in a region of interest in the image to be tested, and generate a corresponding human frame on the detected human body; S3. Calculate the distance d0 between the center point of each human body frame in the image to be tested and the center point of the dangerous area, compare d0 with a preset interval [d1, d2], and make the following judgment: when d1≤d0≤d2, execute S4; when d0<d1, execute S8; when d0>d2, execute S9; S4. Generate a regular circumscribed rectangle for the dangerous area, wherein the four sides of the regular circumscribed rectangle are parallel to the edges of the image to be tested; S5. Using the straight lines where the two sides of the regular circumscribed rectangle are parallel to the height direction, the region of interest is divided into a first partition and a second partition located on the outside of the left straight line and the right straight line respectively; the dangerous area is divided into a third partition and a fourth partition in the region of interest on the inside of the two straight lines, and the third partition and the fourth partition are located on the upper side and the lower side of the dangerous area respectively; S6. deploy four key points on the human body frame, wherein the second key point and the first key point are located at the left and right ends of the bottom of the human body frame, the fourth key point is located at the center of the human body frame, and the third key point is located at the center of the bottom of the human body frame; S7. Analyze the partition where the center point of the human body frame is located, and select the key point with the serial number corresponding to the partition as the identification point. When the identification point is located in the dangerous area, execute S8, otherwise execute S9; S8. Determine that the person corresponding to the human frame has invaded the dangerous area; S9. Determine whether the person corresponding to the human body frame has not invaded the dangerous area.

2. The method for detecting intrusion of a person into a custom area according to claim 1, characterized in that: In step S2, based on the improved YOLOv4 model, people detection is performed on the region of interest in the image to be tested; wherein the improvement of the YOLOv4 model includes: The backbone network of the traditional YOLOv4 is replaced by CSPDarknet53 with mobileNetv3.

3. The method for detecting intrusion of a person into a custom area according to claim 1, characterized in that: In step S1, a custom danger zone is defined in the current image viewing angle by setting a mouse response event in OpenCV. The specific steps are as follows: S11. Define the node selection key, deselection key, and confirmation key of the mouse; S12. Provide a sample image that conforms to the current image viewing angle, click the node selection keys in the sample image in sequence according to a custom order, select the nodes of the dangerous area, during which the selected nodes can be cancelled by clicking the cancel selection key, and finally the selected nodes are combined into a closed polygon, namely the dangerous area, by clicking the confirmation key.

4. The method for detecting intrusion of a person into a custom area according to claim 3, characterized in that: In step S1, a mask image is obtained by performing mask processing on the sample image, that is, forming a region of interest outside the dangerous area; In step S2, the mask image is multiplied with the image to be tested to retain the region of interest in the image to be tested, thereby shielding irrelevant information in the image.

5. The method for detecting intrusion of a person into a custom area according to claim 1, characterized in that: In step S8, when it is determined that a person has invaded the dangerous area, a marking frame for marking the person's legs is generated in the image to be tested based on the human body frame corresponding to the person, and an interactive end is controlled to display the image to be tested and the marking frames of all persons invading the dangerous area in real time.

6. A monitoring system, characterized in that: include: An image acquisition module, which is used to acquire the image to be tested in real time; as well as A detection module, which applies the human intrusion detection method for a custom area as described in any one of claims 1 to 5, so as to detect whether there is human intrusion behavior in the image to be detected.

7. A computer terminal comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method for detecting human intrusion in a custom area as described in any one of claims 1 to 5 are implemented.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method for detecting human intrusion in a custom area as described in any one of claims 1 to 5 are implemented.