Head detection model generation method, device, head detection model and head detection method

By adding negative hand examples and positive head example training samples to the head detection model and performing data enhancement, the problem of low detection accuracy of the existing model is solved, achieving higher detection accuracy and shorter training time. .

CN113569691BActive Publication Date: 2024-09-27XINSUAN INFINITY (SHENZHEN) TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110828287.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-19
Publication Date
2024-09-27
Estimated Expiration
2041-07-19

AI Technical Summary

Technical Problem

Existing head detection models are prone to false detections and missed detections when detecting whether students' heads extend beyond the railings, resulting in low detection accuracy. The model cannot be too large due to limitations of chip capabilities.

Method used

By obtaining the initial model and training sample set, adding hand negative training samples and head positive training samples, perform data enhancement, generate training images, reduce the possibility of misdetection of hands as heads, improve detection accuracy, and adjust The coordinates of the upper left corner of the training image, reducing the number of training images to shorten training time.

Benefits of technology

It effectively improves the accuracy of head detection, reduces false detections and missed detections, improves detection accuracy, and shortens training time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113569691B
    Figure CN113569691B
Patent Text Reader

Abstract

The present application relates to the technical field of model generation, and in particular to a method and device for generating a head detection model, a head detection model, and a head detection method. The method comprises: obtaining an initial model and a training sample set, wherein the training samples in the training sample set include sample images; obtaining a first training image and a second training image based on the sample images, wherein the first training image includes a positive training sample of the head, and the second training image includes a negative training sample of the hand; and, training the initial model according to the first training image and the second training image to obtain a head detection model. Adding negative training samples of the hand and positive training samples of the head to the training sample set effectively reduces the possibility of misdetecting the hand as the head during the detection process, thereby facilitating the improvement of the accuracy of head detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of deep learning of artificial neural networks, and in particular to a method and device for generating a head detection model, a head detection model, and a head detection method. Background Art

[0002] Railings are safety facilities on bridges and buildings. They act as partitions during use, making the boundaries of the divided areas clear and distinct. However, in schools, some students often stick their heads out of the railings, causing safety hazards.

[0003] To solve the above problems, the model used cannot be too large due to the chip capacity constraints. Therefore, the RFSong-779 model is used to obtain images and automatically detect whether the head is sticking out of the railing to help the school find students who make dangerous movements. However, due to the small size of the RFSong-779 model, it is easy to cause false detection and missed detection during detection, resulting in low detection accuracy. Summary of the invention

[0004] In order to improve the accuracy of head detection, the present application provides a head detection model generation method, device, head detection model and head detection method.

[0005] In the first aspect, the present application provides a method for generating a head detection model, which adopts the following technical solution:

[0006] A method for generating a head detection model, characterized by comprising:

[0007] Acquire an initial model and a training sample set, wherein the training sample set includes a sample image, wherein the sample image includes a head positive training sample, head annotation information, a hand negative training sample, and hand annotation information;

[0008] Obtaining a first training image and a second training image according to the sample image, wherein the first training image includes a head positive training sample and head annotation information, and the second training image includes a hand negative training sample and hand annotation information;

[0009] The initial model is trained according to the first training image and the second training image to obtain a head detection model.

[0010] By adopting the above technical solution, negative hand training samples and positive head training samples are added to the training sample set, which effectively reduces the possibility of misdetecting hands as heads during the detection process, thereby facilitating improving the accuracy of head detection.

[0011] Optional, including:

[0012] Performing data enhancement on the first training image and the second training image to generate a training picture; the training picture includes a positive training sample of the head, a negative training sample of the hand, and head annotation information;

[0013] The initial model is trained according to the training images and the head annotation information to obtain a head detection model.

[0014] By adopting the above technical solution, data enhancement is used to increase the richness of samples, thereby improving the detection accuracy. In addition, when training the training pictures, the first training image marked with the position information of the head target is trained to further improve the accuracy of head detection. The first training image and the second training image are placed in one picture, which does not affect the detection accuracy and reduces the number of training pictures, thereby helping to shorten the training time.

[0015] Optionally, the method for acquiring the first training image or the second training image includes:

[0016] Annotate the head positive training sample or the hand negative training sample in the sample image to generate a sample image annotation frame, and perform cutout on the sample image corresponding to the sample image annotation frame;

[0017] The cutout range satisfies the following formula:

[0018] in, is the minimum value of the x-axis of the sample image annotation box, is the maximum value of the x-axis of the sample image annotation box, is the minimum value of the y-axis of the sample image annotation box, is the maximum value of the y-axis of the sample image annotation box, width is the width of the sample image, height is the height of the sample image, and a is a custom coefficient.

[0019] By adopting the above technical solution, a sample image annotation box is customized to be annotated on the sample image, wherein the sample image in the sample image annotation box is usually an approximate range that includes positive training samples of the head or negative training samples of the hand, and the area in the sample image annotation box is cut out based on the width and height of the sample image and the values ​​of the x-axis and y-axis of the sample image annotation box, so as to facilitate the acquisition of the first training image or the second training image.

[0020] Optionally, the method for acquiring the header annotation information includes:

[0021] Where x and y are the positions of the first training image or the second training image in the training picture.

[0022] The coordinates of the upper left corner, width is the width of the sample image, and height is the height of the sample image.

[0023] Optionally, the method further includes: a method for acquiring the coordinates of the upper left corner of the first training image or the second training image in the sample image includes:

[0024] in, is the width of the first training image or the second training image, is the height of the first training image or the second training image, num is the height of the first training image or the second training image

[0025] The placement sequence number of the image.

[0026] By adopting the above technical solution, after the sample image is generated, the upper left corner position of the first training image and / or the second training image in the sample image is relatively fixed, which facilitates judging whether the sample image contains a positive head training sample.

[0027] Optionally, also include:

[0028] Obtaining the upper left corner coordinates of the first training image and / or the second training image in the training picture;

[0029] The coordinates of the upper left corner of the first training image and / or the second training image are adjusted to obtain a final training image.

[0030] By adopting the above technical solution, the situation in which the generalization ability of the model is not favorable due to the relatively fixed position of the upper left corner of the first training image and / or the second training image is effectively reduced.

[0031] Optionally, the adjustment range of the upper left corner coordinates of the first training image and / or the second training image satisfies the following formula:

[0032] Among them, β and γ are random integers automatically generated by the function.

[0033] By adopting the above technical solution, a range is set for the first training image or the second training image, thereby effectively reducing the possibility of overlapping training images.

[0034] In a second aspect, the present application provides a device for generating a head detection model, which adopts the following technical solution:

[0035] A device for generating a head detection model, characterized by comprising:

[0036] An acquisition module (4) is used to acquire a training sample set, wherein the training samples in the training sample set include sample images;

[0037] A training image generation module (5) is used to obtain a first training image and a second training image according to the sample image, wherein the first training image includes a positive training sample of the head, and the second training image includes a negative training sample of the hand; and

[0038] A training module (6) is used to train the initial model according to the first training image and the second training image to obtain a head detection model.

[0039] By adopting the above technical solution, negative hand training samples and positive head training samples are added to the training sample set, which effectively reduces the possibility of misdetecting hands as heads during the detection process, thereby facilitating improving the accuracy of head detection.

[0040] In the third aspect, the present application provides a head detection model, which adopts the following technical solution:

[0041] A head detection model, characterized by comprising:

[0042] The first submodule is used to obtain sample images included in the training samples in the training sample set;

[0043] The second submodule is used to determine whether the sample image contains a head positive training sample, and if so, generate a first training image;

[0044] The third submodule is used to determine whether the sample image contains a negative training sample of the hand, and if so, generate a second training image;

[0045] The fourth submodule performs data enhancement on the first training image and the second training image to generate a training picture; the training picture includes location information of the detected head target;

[0046] The fifth submodule is used to determine whether the training image contains a positive head training sample, and output the detection result information if the determination is yes.

[0047] By adopting the above technical solution, negative hand training samples and positive head training samples are added to the training sample set, which effectively reduces the possibility of misdetecting hands as heads during the detection process, thereby facilitating the improvement of the accuracy of head detection; in addition, data enhancement is performed on the first training image and the second training image to facilitate the improvement of sample richness, thereby facilitating the further improvement of head detection accuracy.

[0048] In a fourth aspect, the present application provides a head detection method based on a head detection model, which adopts the following technical solution:

[0049] A head detection method based on a head detection model, characterized in that the head detection method is based on the head detection model according to any one of claim 9, comprising:

[0050] Acquire an image to be identified and send the image to be identified to a head detection model;

[0051] According to the head detection model, it is determined whether the image to be identified contains a positive head training sample, and if so, the detection result information is output.

[0052] By adopting the above technical solution, the target image is obtained, and the target image is input into the head detection model. Based on the head detection model, it is determined whether the target image contains a positive head training sample. If so, it proves that the head is sticking out of the railing, which helps the school find students who have performed dangerous actions. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] FIG. 1 is a flow chart of a system architecture shown in one embodiment of the present application.

[0054] FIG. 2 is a flow chart of a method for generating a head detection model according to one embodiment of the present application.

[0055] FIG. 3 is a schematic diagram of a training image according to one embodiment of the present application.

[0056] FIG. 4 is a schematic diagram of a final training image according to one embodiment of the present application.

[0057] Figure 5 It is a schematic diagram of the final training image area division shown in one embodiment of the present application.

[0058] FIG. 6 is a structural block diagram of a device for generating a head detection model according to one embodiment of the present application.

[0059] FIG. 7 is a structural block diagram of a head detection model shown in one embodiment of the present application.

[0060] Explanation of the accompanying drawings: 1. terminal device; 2. network; 3. server; 4. acquisition module; 5. training image generation module; 6. training module. DETAILED DESCRIPTION

[0061] The present application will be further described in detail below in conjunction with the accompanying drawings. It should be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention.

[0062] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application may be combined with each other.

[0063] First, the terms involved in the embodiments of the present application are introduced.

[0064] The positive training sample is the correct query result obtained when querying the target image.

[0065] Negative training samples are incorrect query results obtained when querying the target image.

[0066] Mosaic data enhancement is to splice four pictures by random scaling, random cropping, and random arrangement. Randomly using 4 pictures, randomly scaling, and then randomly distributing them for splicing greatly enriches the detection data set; and directly calculating the data of 4 pictures makes the Mini-batch size not need to be very large, and a GPU can achieve relatively good results.

[0067] FIG. 1 shows an exemplary system architecture of an embodiment of a method for generating a human head detection model or an apparatus for generating a human head detection model that can be applied in an embodiment of the present application.

[0068] As shown in FIG1 , the system architecture may include a terminal device 1, a network 2 and a server 3. The network 2 is used to provide a medium for a communication link between the terminal device 1 and the server 3. The network 2 may include various connection types, such as wired, wireless communication or optical fiber cable.

[0069] A user can use a terminal device 1 to interact with a server 3 via a network 2 to receive or send data, etc.

[0070] The terminal device 1 can be hardware or software. When the terminal device 1 is hardware, it can be various electronic devices with communication functions, including but not limited to smart phones, tablet computers, and desktop computers. When the terminal device 1 is software, it can be installed in the electronic devices listed above.

[0071] The server 3 may be a server 3 that provides various services, such as a background server that processes the image sent by the terminal device 1 and feeds back the processing result to the terminal device 1. As an example, the server 3 may be a cloud server or a physical server.

[0072] It should also be noted that the model generation method provided in the embodiment of the present application can be executed by the server 3, can also be executed by the terminal device 1, and can also be executed by the server 3 and the terminal device 1 in cooperation with each other. Accordingly, the various parts (such as various units, sub-units, modules, and sub-modules) included in the model generation device can be all set in the server 3, can also be all set in the terminal device 1, and can also be set in the server 3 and the terminal device 1 respectively.

[0073] It should be understood that the number of terminal devices 1, networks 2 and servers 3 in FIG. 1 is merely illustrative; any number of terminal devices 1, networks 2 and servers 3 may be selected according to implementation requirements.

[0074] The embodiment of the present application discloses a method for generating a head detection model. The embodiment mainly uses the method to be applied to an electronic device with a certain computing capability as an example, and the electronic device may be the server shown in FIG1 .

[0075] As shown in FIG. 2 , an implementation of a method for generating a head detection model includes the following steps:

[0076] S1. Obtain an initial model and a training sample set, where the training sample set includes sample images, and the sample images include head positive training samples, head annotation information, hand negative training samples, and hand annotation information.

[0077] The initial model may be a model to be trained or a model that has not been trained. As an example, the initial model may be a convolutional neural network.

[0078] Specifically, the training sample set may be an image containing positive head training samples and negative hand training samples, or may be an image not containing positive head training samples and negative hand training samples. The positive head training samples may be features of the photographed human head presented in an image obtained by photographing the human body, and the negative hand training samples may be features of the photographed human hand presented in an image obtained by photographing the human body. The head annotation information is the position coordinates of the position of the positive head training samples in the sample image, and the hand annotation information is the position coordinates of the position of the negative hand training samples in the sample image.

[0079] As an implementation of the method for acquiring a training sample set, a model generation device may acquire a training sample set, wherein the model generation device may be deployed on a terminal device or on a server.

[0080] S2. Obtain a first training image and a second training image according to the sample image, wherein the first training image includes a positive training sample of the head and head annotation information, and the second training image includes a negative training sample of the hand.

[0081] As an implementation method of obtaining the first training image or the second training image, the sample image is annotated to generate a sample image annotation frame, and the sample image corresponding to the sample image annotation frame is cut out to obtain the first training image or the second training image. At the same time, the hand annotation information of the hand negative example training sample in the second training image is cancelled.

[0082] The user can customize the image region of the sample image according to the requirements, and set a rectangular frame around the image region, and obtain the sample image annotation frame by moving or reducing the rectangular frame to reduce the interference information in the rectangular frame.

[0083] It should be noted that the initial position of the rectangular frame can be determined by key points. If there is only one key point, the key point is the center point of the rectangular frame. After determining the length and width of the rectangular frame, the position information of the rectangular frame can be obtained by determining the position of the key point; if there are two key points, the key points can be two points on any diagonal line of the matrix frame. In order to reduce the image of the interference information in the rectangular frame on the training results, the rectangular frame can be moved or reduced to obtain the sample image annotation frame. The image area in the sample image annotation frame is usually an approximate range that includes positive training samples of the head or negative training samples of the hand, and the image area in the sample image annotation frame is cut out as the cutout area.

[0084] As an implementation method of setting the cutout area, the range of the cutout area satisfies the following formula:

[0085] in, is the minimum value of the x-axis of the sample image annotation box, is the maximum value of the x-axis of the sample image annotation box, is the minimum value of the y-axis of the sample image annotation box, is the maximum value of the y-axis of the sample image annotation box, width is the width of the training image, height is the height of the training image, and a is a custom coefficient that can be defined according to actual conditions, for example, a=0.5.

[0086] Specifically, the upper left corner of the sample image annotation box is taken as the origin. is the x-axis coordinate of the upper left corner of the sample image annotation box. is the y-axis coordinate of the upper left corner of the sample image annotation box. is the x-axis coordinate of the lower right corner of the sample image annotation box. The y-axis coordinate of the lower right corner of the sample image annotation box.

[0087] S3. Train the initial model according to the first training image and the second training image to obtain a head detection model.

[0088] During training, the first training image annotated with head annotation information is trained, and the unannotated image is considered to be a target that does not need to be recognized, which effectively reduces the possibility of misdetecting hands as heads in the original model, thereby facilitating improving the accuracy of head detection.

[0089] Specifically, a machine learning algorithm is used to take the training image as input data of the initial model to obtain discrimination information, which may include the position coordinates of the head positive training sample. The discrimination information is compared with the head annotation information, and a loss value is obtained according to the loss function. Based on the loss value, it is determined whether the trained head detection model has converged.

[0090] Specifically, it can be: determine whether the loss value is less than a preset threshold value. If so, determine that the trained head detection model has converged to obtain the head detection model; if not, determine that the trained head detection model has not converged, adjust the parameters of the head detection model, and continue to train the head detection model until the loss value is less than the preset threshold value.

[0091] As another implementation of the method for generating a head detection model, step S3 specifically includes the following steps:

[0092] S31, performing data enhancement on the first training image and the second training image, and generating a training picture; the training picture includes a head positive training sample, a hand negative training sample, and head annotation information;

[0093] Specifically, the first training image is subjected to Mosaic data enhancement, and the head annotation information is retained; the second training image is subjected to Mosaic data enhancement, and the hand annotation information is cancelled.

[0094] S32. Train the initial model according to the training images and head annotation information to obtain a head detection model.

[0095] During training, the targets in the training images that are marked with head annotation information are trained, and the images without annotations are considered to be targets that do not need to be recognized, which effectively reduces the possibility of misdetecting hands as heads in the original model, thereby facilitating the improvement of the accuracy of head detection.

[0096] As an implementation of the method for acquiring the detection head annotation information, the method includes:

[0097] Among them, x and y are the upper left corner coordinates of the first training image or the second training image in the training picture, width is the width of the sample image, and height is the height of the sample image.

[0098] As shown in FIG. 3 , as an implementation of a method for obtaining the position of a first training image and / or a second training image in a training picture, the method includes:

[0099] Wherein, x is the x-axis coordinate of the upper left corner position point of the first training image or the second training image, and y is the y-axis coordinate of the upper left corner position point of the first training image or the second training image. is the width of the first training image or the second training image, is the height of the first training image or the second training image, num is the placement number of the first training image or the second training image, % means taking the remainder, and "⌊⌋" means rounding down to an integer. For example, the placement number of the training image in the upper left corner of the image is 0, the placement number of the training image in the upper right corner is 1, the placement number of the training image in the lower left corner is 2, and the placement number of the training image in the lower right corner is 3.

[0100] For example, if the first training image is placed in the upper right corner of the training image, then num is 1. ,but , , the position coordinates of the first training image are (45mm, 0mm).

[0101] After performing Mosaic data enhancement on the first training image and / or the second training image to generate a training picture, the upper left corner of the first training image and / or the second training image in the training picture is relatively fixed, so as to facilitate determining whether the training picture contains a positive head training sample.

[0102] As shown in Fig. 4, as another implementation of the head detection model generation method, background negative training samples are obtained and fitted with training images. The background negative training samples are images that do not contain hand negative training samples and head positive training samples.

[0103] After the training images are generated, since the area occupied by the head or hand is small, most of the training images will be gray areas, which will easily cause interference when detecting whether the training images contain positive head training samples, and the background images will be easily identified as head training samples, resulting in reduced recognition accuracy. By obtaining background negative training samples and fitting them with the training images, the influence of the background images can be effectively removed, greatly reducing the probability of false detection and improving detection accuracy.

[0104] As shown in FIG. 4 , another implementation of the head detection model generation method further includes: obtaining the upper left corner coordinates of the first training image and / or the second training image in the training picture, and adjusting the upper left corner coordinates to obtain a final training picture.

[0105] As an implementation of the method for adjusting the upper left corner coordinates of the first training image and / or the second training image, the upper left corner coordinate adjustment range satisfies the following formula:

[0106] Among them, β and γ are random integers automatically generated by the function. In order to prevent the training image from exceeding the specified range, the two random integers have the above range restrictions, which effectively reduces the possibility of overlapping training images. At the same time, it effectively reduces the situation where the upper left corner position of the first training image and / or the second training image is relatively fixed, which is not conducive to the generalization ability of the model.

[0107] Among them, generalization ability refers to the ability of machine learning algorithms to adapt to fresh samples. The purpose of learning is to learn the rules hidden behind the data. For data outside the learning set with the same rules, the trained network can also give appropriate output. This ability is called generalization ability.

[0108] Specifically, as shown in FIG5 , the final training image is evenly divided into four areas, namely, the upper left corner area, the upper right corner area, the lower left corner area, and the lower right corner area, through the above-mentioned method of adjusting the upper left corner coordinates, and the upper left corner coordinates of the first training image and / or the second training image are limited in range so that the first training image or the second training image moves within the corresponding area.

[0109] As an implementation of the above-mentioned method for generating a head detection model, an embodiment of the present application further discloses a device for generating a head detection model, which can be applied to various electronic devices.

[0110] As shown in FIG6 , an implementation of a device for generating a head detection model includes:

[0111] An acquisition module 4 is used to acquire a training sample set, wherein the training samples in the training sample set include sample images; the sample images include head positive training samples, head annotation information, hand negative training samples and hand annotation information;

[0112] A training image generation module 5 is used to obtain a first training image and a second training image according to the sample image, wherein the first training image includes a positive training sample of the head, and the second training image includes a negative training sample of the hand; and

[0113] The training module 6 is used to train the initial model according to the first training image and the second training image to obtain a head detection model.

[0114] During training, training module 6 trains the first training image annotated with head annotation information, and the second training image without annotation is considered to be a target that does not need to be recognized, which effectively reduces the possibility of misdetecting hands as heads in the original model, thereby facilitating improving the accuracy of head detection.

[0115] Based on the above-mentioned method and device for generating a head detection model, an embodiment of the present application also discloses a head detection model.

[0116] As shown in FIG7 , a head detection model includes:

[0117] The first submodule is used to obtain sample images included in the training samples in the training sample set;

[0118] The second submodule is used to obtain the sample image and determine whether the sample image contains a head positive training sample, and if so, generate a first training image;

[0119] The third submodule is used to obtain the sample image and determine whether the sample image contains a hand positive training sample, and if so, generate a second training image;

[0120] The fourth submodule performs Mosaic data enhancement on the first training image and the second training image to generate a training image; wherein the training image is based on Yolov5 and Mosaic data.

[0121] Generated by enhancement algorithm;

[0122] The fifth submodule is used to determine whether the corresponding area in the training image contains a positive head training sample, and output the detection result information.

[0123] Based on the above head detection model, an embodiment of the present application also discloses a head detection method based on the head detection model.

[0124] A head detection method based on a head detection model includes: acquiring a target image, inputting the target image into a pre-trained head detection model, determining whether the target image contains a head positive training sample, and if so, outputting detection result information.

[0125] Specifically, the target image is input into the head detection model, and the head detection model is used to determine whether the target image contains a positive head training sample. If so, it proves that the head is sticking out of the railing, which helps the school find students who have performed dangerous actions.

[0126] The above are all preferred embodiments of the present application, and the protection scope of the present application is not limited thereto. Therefore, any equivalent changes made according to the structure, shape, and principle of the present application should be included in the protection scope of the present application.

Claims

1. A method for generating a head detection model, characterized in that: include: Acquire an initial model and a training sample set, wherein the training sample set includes a sample image, wherein the sample image includes a head positive training sample, head annotation information, a hand negative training sample, and hand annotation information; Obtaining a first training image and a second training image according to the sample image, wherein the first training image includes a head positive training sample and head annotation information, and the second training image includes a hand negative training sample and hand annotation information; The initial model is trained according to the first training image and the second training image to obtain a head detection model.

2. The method for generating a head detection model according to claim 1, characterized in that: Also includes: Performing data enhancement on the first training image and the second training image to generate a training picture; The training images include positive training samples of the head, negative training samples of the hands, and head annotation information; The initial model is trained according to the training images and the head annotation information to obtain a head detection model.

3. The method for generating a head detection model according to claim 1, characterized in that: The method for acquiring the first training image or the second training image includes: Annotate the head positive training sample or the hand negative training sample in the sample image to generate a sample image annotation frame, and perform cutout on the sample image corresponding to the sample image annotation frame; The cutout range satisfies the following formula: in, is the minimum value of the x-axis of the sample image annotation box, is the maximum value of the x-axis of the sample image annotation box, is the minimum value of the y-axis of the sample image annotation box, is the maximum value of the y-axis of the sample image annotation box, width is the width of the sample image, height is the height of the sample image, and a is a custom coefficient.

4. The method for generating a head detection model according to claim 1 or 3, characterized in that: Also includes: The method for acquiring the head annotation information includes: Where x and y are the positions of the first training image or the second training image in the training picture. The coordinates of the upper left corner, width is the width of the sample image, and height is the height of the sample image.

5. The method for generating a head detection model according to claim 1, characterized in that: Also included is that a method for acquiring the upper left corner coordinates of the first training image or the second training image in the sample image includes: in, is the width of the first training image or the second training image, is the height of the first training image or the second training image, num is the height of the first training image or the second training image The placement sequence number of the image.

6. The method for generating a head detection model according to claim 5, characterized in that: Also includes: Obtaining the upper left corner coordinates of the first training image and / or the second training image in the training picture; The coordinates of the upper left corner of the first training image and / or the second training image are adjusted to obtain a final training image.

7. The method for generating a head detection model according to claim 6, characterized in that: The adjustment range of the upper left corner coordinates of the first training image and / or the second training image satisfies the following formula: Among them, β and γ are random integers automatically generated by the function.

8. A device for generating a head detection model, characterized in that: include: An acquisition module (4) is used to acquire a training sample set, wherein the training samples in the training sample set include sample images; A training image generation module (5), used for obtaining a first training image and a second training image according to the sample image, wherein the first training image comprises a positive training sample of the head, and the second training image comprises a negative training sample of the hand; as well as, A training module (6) is used to train the initial model according to the first training image and the second training image to obtain a head detection model.

9. A head detection model, characterized in that: include: The first submodule is used to obtain sample images included in the training samples in the training sample set; The second submodule is used to determine whether the sample image contains a head positive training sample, and if so, generate a first training image; The third submodule is used to determine whether the sample image contains a negative training sample of the hand, and if so, generate a second training image; The fourth submodule performs data enhancement on the first training image and the second training image to generate a training picture; The training picture includes location information of the detected head target; The fifth submodule is used to determine whether the training image contains a positive head training sample, and output the detection result information if the determination is yes.

10. A head detection method based on a head detection model, characterized in that: The head detection method is based on the head detection model described in any one of claim 9, comprising: Acquire an image to be identified and send the image to be identified to a head detection model; According to the head detection model, it is determined whether the image to be identified contains a positive head training sample, and if so, the detection result information is output.