CN112926542B - Sex detection method and device, electronic equipment and storage medium - Google Patents

Sex detection method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112926542B
CN112926542B CN202110384949.6A CN202110384949A CN112926542B CN 112926542 B CN112926542 B CN 112926542B CN 202110384949 A CN202110384949 A CN 202110384949A CN 112926542 B CN112926542 B CN 112926542B
Authority
CN
China
Prior art keywords
face
image
target person
detection
sex
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110384949.6A
Other languages
Chinese (zh)
Other versions
CN112926542A (en
Inventor
李娜
刘启帆
陈永强
王艾清
涂志恒
郭峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bozhon Precision Industry Technology Co Ltd
Original Assignee
Bozhon Precision Industry Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bozhon Precision Industry Technology Co Ltd filed Critical Bozhon Precision Industry Technology Co Ltd
Priority to CN202110384949.6A priority Critical patent/CN112926542B/en
Publication of CN112926542A publication Critical patent/CN112926542A/en
Application granted granted Critical
Publication of CN112926542B publication Critical patent/CN112926542B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/161Detection; Localisation; Normalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/40Scenes; Scene-specific elements in video content

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Human Computer Interaction (AREA)
  • Image Analysis (AREA)
  • Closed-Circuit Television Systems (AREA)

Abstract

The embodiment of the invention discloses a sex detection method, a sex detection device, electronic equipment and a storage medium. The method comprises the following steps: acquiring a current image frame from a monitoring video, and acquiring a face detection frame in the current image frame and a face confidence of the face detection frame; when the face confidence degree meets the preset confidence degree condition, tracking a target person in the face detection frame and acquiring a face image of the target person; selecting a target image meeting a preset quality condition from the face image; and performing sex detection on the target image to obtain the sex identification of the target person. The embodiment of the invention provides a solution for the automatic gender detection requirements in various scenes, and can realize the automatic gender detection in various scenes; in addition, by presetting the confidence condition and the quality condition, the target image for performing sex detection can be accurately obtained, the image processing quantity is reduced, and the detection efficiency and accuracy are improved.

Description

Sex detection method and device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a sex detection method, a sex detection device, electronic equipment and a storage medium.
Background
In real life, there are many situations where gender detection is required. Such as: in dormitory buildings for women, in order to protect personal safety of women, only women are generally allowed to enter, so that sex detection is needed to detect an intruded male; for another example, in a mother-infant room, in order to protect the privacy of women, only women are generally allowed to enter the room, and thus sex detection is also required, but related implementation schemes for automatically carrying out sex detection are lacking in the prior art.
Disclosure of Invention
The embodiment of the invention provides a sex detection method, a sex detection device, electronic equipment and a storage medium, provides a solution for the automatic sex detection requirement under various scenes, and can realize automatic sex detection under various scenes.
In a first aspect, an embodiment of the present invention provides a gender detection method, including:
acquiring a current image frame from a monitoring video, and acquiring a face detection frame in the current image frame and a face confidence coefficient of the face detection frame;
when the face confidence degree meets the preset confidence degree condition, tracking a target person in the face detection frame and acquiring a face image of the target person;
selecting a target image meeting a preset quality condition from the face image;
And performing sex detection on the target image to obtain the sex identification of the target person.
Further, after tracking the target person in the face detection frame and acquiring the face image of the target person, the method further includes:
And determining whether the quality score of the face image of the target person acquired at the current moment is larger than a preset score.
Further, the selecting the target image meeting the preset quality condition from the face image includes:
and when the quality score of the face image of the target person acquired at the current moment is larger than the preset score, determining the face image of the target person acquired at the current moment as the target image.
Further, the selecting the target image meeting the preset quality condition from the face image includes:
When the quality score of the face image of the target person acquired at the current moment is not more than the preset score, determining whether the tracking duration of the target person at the current moment exceeds the preset duration;
when the tracking time of the target person exceeds the preset time at the current moment, selecting a face image with the highest quality score from face images of the target person acquired in the tracking time to obtain the target image.
Further, performing gender detection on the target image to obtain the gender identification of the target person, including:
Inputting the target image into a gender detection model to perform gender detection, so as to obtain a gender probability value of the target person;
And determining the gender identification of the target person according to the gender probability value of the target person and a preset gender probability threshold.
Further, after the gender detection is performed on the target image to obtain the gender identification of the target person, the method further comprises:
determining whether the gender identification of the target person is consistent with the gender identification allowed by the current area;
and when the gender identification of the target person is inconsistent with the gender identification allowed by the current area, prompting an alarm, and storing the target image into a preset image library.
Further, the gender detection model comprises four Thin modules, each Thin module is formed by constructing two basic blocks, a 1*1 point-by-point convolution and a 3*3 depth separable convolution, and each basic block is formed by combining two 1*1 point-by-point convolution and a 3*3 depth separable convolution.
In a second aspect, an embodiment of the present invention further provides a gender detection device, including:
The confidence coefficient acquisition module is used for acquiring a current image frame from the monitoring video and acquiring a face detection frame in the current image frame and a face confidence coefficient of the face detection frame;
The image tracking module is used for tracking the target person in the face detection frame and acquiring a face image of the target person when the face confidence meets the preset confidence condition;
The image selecting module is used for selecting a target image meeting a preset quality condition from the face image;
and the sex determination module is used for performing sex detection on the target image to obtain the sex identification of the target person.
In a third aspect, an embodiment of the present invention further provides an electronic device, including:
one or more processors;
a storage means for storing one or more programs;
The one or more programs, when executed by the one or more processors, cause the one or more processors to implement the gender detection method according to any of the embodiments of the present invention.
In a fourth aspect, an embodiment of the present invention further provides a computer readable storage medium having stored thereon a computer program, which when executed by a processor, implements the gender detection method according to any of the embodiments of the present invention.
In the embodiment of the invention, the current image frame can be acquired from the monitoring video, the face detection frame in the current image frame and the face confidence of the face detection frame are acquired, when the face confidence meets the preset confidence condition, the target person in the face detection frame is tracked, the face image of the target person is acquired, the target image meeting the preset quality condition is selected from the face images, and the sex detection is carried out on the target image, so that the sex identification of the target person is obtained. In the embodiment of the invention, the sex detection of the person can be realized by analyzing and processing the monitoring video, so that the monitoring video of the scene is analyzed and processed for the scene with the sex detection requirement, a solution is provided for the automatic sex detection requirement in various scenes, and the automatic sex detection can be realized in various scenes; in addition, by presetting the confidence condition and the quality condition, the target image for performing sex detection can be accurately obtained, the image processing quantity is reduced, and the detection efficiency and accuracy are improved.
Drawings
Fig. 1 is a schematic flow chart of a sex detection method according to an embodiment of the present invention.
Fig. 2 is another flow chart of a sex detection method according to an embodiment of the present invention.
Fig. 3 is a schematic structural diagram of a basic block according to an embodiment of the present invention.
Fig. 4 is a schematic structural diagram of the Thin module according to the embodiment of the present invention.
Fig. 5 is a schematic structural view of a sex detection device according to an embodiment of the present invention.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Fig. 1 is a schematic flow chart of a gender detection method according to an embodiment of the present invention, where the method may be performed by a gender detection device according to an embodiment of the present invention, and the device may be implemented in software and/or hardware. In a specific embodiment, the apparatus may be integrated in an electronic device, which may be a server, for example. The following embodiments will be described taking the example of the integration of the apparatus in an electronic device, and referring to fig. 1, the method may specifically include the following steps:
Step 101, acquiring a current image frame from a monitoring video, and acquiring a face detection frame and a face confidence of the face detection frame in the current image frame.
The monitoring video can be from video acquisition equipment, wherein the video acquisition equipment can be equipment with video acquisition functions such as a camera and a video recorder, and the monitoring video can be real-time acquired monitoring video or pre-acquired monitoring video; when the monitoring video is a monitoring video collected in real time, the current image frame can be the latest frame in the monitoring video, and in this case, the sex of the target person in the current scene is detected in real time by utilizing the real-time monitoring video; when the monitoring video is a pre-collected monitoring video, the current image frame may be a start frame of the monitoring video or any frame in the middle process, or may be a current playing frame when the monitoring video is played back, in which case, the pre-collected monitoring video is used to detect the sex of the target person in the current scene.
After the current image frame is acquired from the monitoring video, face detection can be performed on the current image frame; for example, the current image frame may be input into a face detection model, so that the face in the current image frame is detected and positioned by using the face detection model, and the detection output of the face detection model may include a face detection frame in the current image frame and a face confidence of the face detection frame; of course, the face detection model may also output other relevant information, such as location information (such as location coordinates) of the face detection frame, and person identification information of the target person in the face detection frame, where the person identification information may be a person code, a number id, etc., and one person identification information may uniquely identify or correspond to one person.
In the embodiment of the invention, the face detection frame is used for marking the position of the face in the current image frame, the face confidence is used for indicating the probability or degree of the face in the face detection frame, the face detection model can be a deep learning network model, and the face detection model can be trained in advance.
Step 102, tracking a target person in a face detection frame and acquiring a face image of the target person when the face confidence meets a preset confidence condition.
For example, a confidence threshold may be preset according to actual requirements or experimental data, and whether the face confidence of the face detection frame meets a preset confidence condition is determined through the confidence threshold. For example, the face confidence level may be compared with a confidence level threshold, and if the face confidence level is greater than the confidence level threshold, it is determined that the face confidence level satisfies a preset confidence level condition, otherwise, if the face confidence level is not greater than the confidence level threshold, it is determined that the face confidence level does not satisfy the preset confidence level condition.
In a specific implementation, when the face confidence meets a preset confidence condition, it is stated that the face detection frame is very likely to be a face, then the target person in the face detection frame can be tracked and the face image of the target person can be obtained, and the target person is the person in the face detection frame. For example, the target person may be tracked based on the identification information of the target person, and a face image of the target person may be acquired, and the acquired face image may include a plurality of pieces.
And step 103, selecting a target image meeting a preset quality condition from the face image.
Specifically, for example, a quality threshold may be preset according to actual requirements or experimental data, and whether each face image meets a preset quality condition is determined according to the quality threshold. For example, for any face image, the quality score of the face image can be compared with a quality threshold, if the quality score of the face image is greater than the quality threshold, the face image is determined to meet the preset quality condition, otherwise, if the quality score of the face image is not greater than the quality threshold, the face image is determined to not meet the preset quality condition; and traversing each face image to obtain a target image.
Of course, in order to avoid that the quality threshold is unreasonable, so that the target image cannot be selected, in practical application, the face image with the highest quality score in the obtained face images can be directly used as the target image, which is not particularly limited herein.
And 104, performing sex detection on the target image to obtain the sex identification of the target person.
For example, the sex detection may be performed by inputting the target image into a sex detection model, the output of the sex detection model may be the probability that the target person belongs to each type of sex (male, female), and the sex identification of the target person, such as male, female, may be obtained from the probability that the target person belongs to each type of sex. For example, the sex probability that the target person belongs to a male and the sex probability that the target person belongs to a female may be compared, and if the sex probability that the target person belongs to a male is greater than the sex probability that the target person belongs to a female, it is determined that the sex of the target person is identified as a male. In addition, the sex-detecting model may be a deep neural network model, and the sex-detecting model may be trained in advance.
In the embodiment of the invention, the current image frame can be acquired from the monitoring video, the face detection frame in the current image frame and the face confidence of the face detection frame are acquired, when the face confidence meets the preset confidence condition, the target person in the face detection frame is tracked, the face image of the target person is acquired, the target image meeting the preset quality condition is selected from the face images, and the sex detection is carried out on the target image, so that the sex identification of the target person is obtained. In the embodiment of the invention, the sex detection of the person can be realized by analyzing and processing the monitoring video, so that the monitoring video of the scene is analyzed and processed for the scene with the sex detection requirement, a solution is provided for the automatic sex detection requirement in various scenes, and the automatic sex detection can be realized in various scenes; in addition, by presetting the confidence condition and the quality condition, the target image for performing sex detection can be accurately obtained, the image processing quantity is reduced, and the detection efficiency and accuracy are improved.
The sex detection method provided by the embodiment of the invention is further described below, and as shown in fig. 2, the method specifically includes the following steps:
Step 201, acquiring a current image frame from a monitoring video, and acquiring a face detection frame and a face confidence of the face detection frame in the current image frame.
The monitoring video can be from video acquisition equipment, wherein the video acquisition equipment can be equipment with video acquisition functions such as a camera and a video recorder, and the monitoring video can be real-time acquired monitoring video or pre-acquired monitoring video; when the monitoring video is a monitoring video collected in real time, the current image frame can be the latest frame in the monitoring video, and in this case, the sex of the target person in the current scene is detected in real time by utilizing the real-time monitoring video; when the monitoring video is a pre-collected monitoring video, the current image frame may be a start frame of the monitoring video or any frame in the middle process, or may be a current playing frame when the monitoring video is played back, in which case, the pre-collected monitoring video is used to detect the sex of the target person in the current scene. In this embodiment, for convenience of description, the monitoring video is taken as an example of a monitoring video collected in real time.
After the current image frame is acquired from the monitoring video, face detection can be performed on the current image frame; for example, the current image frame may be input into a face detection model, so that the face in the current image frame is detected and positioned by using the face detection model, and the detection output of the face detection model may include a face detection frame in the current image frame and a face confidence of the face detection frame; of course, the face detection model may also output other relevant information, such as location information (such as location coordinates) of the face detection frame, and person identification information of the target person in the face detection frame, where the person identification information may be a code, a number id, etc. of the person, and one person identification information may be uniquely identified or corresponds to one person.
In the embodiment of the invention, the face detection frame is used for marking the position of the face in the current image frame, and can be a rectangular frame, a square frame and the like; the face confidence is used for representing the probability or degree of the face in the face detection frame, and the face confidence is 70% and 80%; in addition, the face detection model may be a deep learning network model, and the face detection model may be trained in advance.
Step 202, tracking a target person in a face detection frame and acquiring a face image of the target person when the face confidence meets a preset confidence condition.
For example, a confidence threshold may be preset according to actual requirements or experimental data, where the confidence threshold is, for example, 80%, 90%, and whether the face confidence of the face detection frame meets a preset confidence condition is determined through the set confidence threshold. For example, the face confidence level may be compared with a confidence level threshold, and if the face confidence level is greater than the confidence level threshold, it is determined that the face confidence level satisfies a preset confidence level condition, otherwise, if the face confidence level is not greater than the confidence level threshold, it is determined that the face confidence level does not satisfy the preset confidence level condition.
In a specific implementation, when the face confidence meets a preset confidence condition, it is indicated that the face detection frame is very likely to be a face, a tracker can be created, a target person in the face detection frame is tracked by using the tracker, the tracking duration is recorded, and a face image of the target person is acquired, wherein the target person is the person in the face detection frame. For example, the target person may be tracked according to the identification information of the target person, and face images of the target person may be acquired (e.g., captured from the surveillance video) according to a certain rule (e.g., every 1 second or 2 seconds), and the acquired face images may include a plurality of pieces.
Step 203, determining whether the quality score of the face image of the target person acquired at the current moment is greater than a preset score, if so, executing step 205, otherwise, executing step 204.
Step 204, determining whether the tracking duration of the target person at the current moment exceeds the preset duration, if yes, executing step 206, otherwise returning to step 202.
Step 205, determining the face image of the target person acquired at the current moment as the target image.
And 206, selecting the face image with the highest quality score from the face images of the target person acquired in the tracking time length to obtain the target image.
In a specific embodiment, when tracking the target person is started, an image storage area can be created for the target person according to the identification information of the target person, and after the first face image of the target person is acquired, the quality of the first face image can be scored to obtain the quality score of the first face image; judging whether the quality score of the first face image is larger than a preset score, if so, taking the first face image as a target image and stopping acquiring the face image of the target person; if the image is not larger than the image storage area, the first face image is stored in the created image storage area, and the target person is tracked continuously to acquire the face image of the target person.
If the target person is to be tracked continuously to acquire the face image of the target person, then carrying out quality scoring on the face image every time a face image is acquired; if the quality score of the face image is higher than the preset score, taking the face image as a target image and stopping obtaining; if the quality score of the face image is not higher than the preset score, the quality score of all face images currently stored in the image storage area is obtained, the maximum value of the quality score is found, the quality score of the face image is compared with the maximum value of the quality score, if the quality score of the face image is higher than the maximum value of the quality score, the face image is stored in the image storage area, and if the quality score of the face image is not higher than the maximum value of the quality score, the face image is abandoned; and continuously acquiring the face image of the target person until the tracking time of the target person exceeds the preset time and the face image with the quality score exceeding the preset score is not acquired yet, and taking the face image of the target person with the highest quality score stored in the image storage area as the target image.
Specifically, the preset score and the preset duration can be values according to actual demands or experimental data, the preset score is 80 minutes, 90 minutes, etc., and the preset duration is 3 minutes, 5 minutes, etc.
Step 207, inputting the target image into the gender detection model to perform gender detection, so as to obtain the gender probability value of the target person.
For example, the sex detection may be performed by inputting the target image into a sex detection model, the output of the sex detection model may be the probability that the target person belongs to each type of sex (male, female), and the sex identification of the target person, such as male, female, may be obtained from the probability that the target person belongs to each type of sex. For example, the sex probability that the target person belongs to a male and the sex probability that the target person belongs to a female may be compared, and if the sex probability that the target person belongs to a male is greater than the sex probability that the target person belongs to a female, it is determined that the sex of the target person is identified as a male. The gender detection model may be a deep neural network model, which may be pre-trained.
Step 208, determining the gender identification of the target person according to the gender probability value of the target person and the preset gender probability threshold.
In a specific implementation, a gender probability threshold may also be set to improve the accuracy of gender identification. For example, after obtaining the probability that the target person belongs to each type of sex, judging the sex probability that the target person belongs to the male and the size of the sex probability that the target person belongs to the female; if the sex probability of the target person belonging to the male is larger, comparing the sex probability of the target person belonging to the male with a preset sex probability threshold, and if the sex probability of the target person belonging to the male is larger than the preset sex probability threshold, determining that the sex of the target person is marked as male; if the sex probability of the target person belonging to the female is larger, the sex probability of the target person belonging to the female is compared with a preset sex probability threshold, and if the sex probability of the target person belonging to the female is larger than the preset sex probability threshold, the sex identification of the target person is determined to be female.
Step 209, determining whether the gender identification of the target person is consistent with the gender identification allowed by the current area, if so, executing step 210, otherwise, executing step 211 to end the process.
In a specific embodiment, whether the gender identification of the target person is consistent with the gender identification allowed by the current area can also be determined, if so, the current area is indicated to allow the person with the gender to enter or stay, and no processing is performed; if not, then step 210 is performed indicating that the current region does not allow the gender person to enter or stay.
Step 210, alarming and prompting, and storing the target image into a preset image library.
In a specific embodiment, an alarm notification may be sent to the alarm device to notify the alarm device to perform an alarm prompt, where the alarm device may be, for example, a speaker, a loudspeaker, a display screen, etc., and the alarm prompt may be in the form of voice, text, etc., which is not specifically limited herein.
In addition, the target image (only the face image, which can be understood as a small image) can be stored in a preset image library for related personnel to verify, and even the original image frame (including the images of the face area, the background, and the like, which can be understood as a large image) corresponding to the target image can be stored in the preset image library, and the images stored in the preset image library can carry the information of the video acquisition equipment number, the shooting time, and the like, so that the related personnel can conveniently verify. Specifically, the preset image library may be built in a file transfer Protocol (FILE TRANSFER Protocol, FTP) server. To improve database performance, images in the preset image library may be deleted periodically, e.g., the preset image library may store images generated in the next, more than one month of images may be deleted.
Step 211, end.
In the embodiment of the invention, the current image frame can be acquired from the monitoring video, the face detection frame in the current image frame and the face confidence of the face detection frame are acquired, when the face confidence meets the preset confidence condition, the target person in the face detection frame is tracked, the face image of the target person is acquired, the target image meeting the preset quality condition is selected from the face images, and the sex detection is carried out on the target image, so that the sex identification of the target person is obtained. In the embodiment of the invention, the sex detection of the person can be realized by analyzing and processing the monitoring video, so that the monitoring video of the scene is analyzed and processed for the scene with the sex detection requirement, a solution is provided for the automatic sex detection requirement in various scenes, and the automatic sex detection can be realized in various scenes; in addition, by presetting the confidence condition and the quality condition, the target image for performing sex detection can be accurately obtained, the image processing quantity is reduced, and the detection efficiency and accuracy are improved.
In a specific embodiment, in order to improve the detection efficiency, the embodiment of the invention also designs a gender detection model, which comprises a plurality of Thin modules, wherein each Thin module is built by a base block, 1*1 point-by-point convolution and 3*3 depth separable convolution, and each base block is formed by combining 1*1 point-by-point convolution and 3*3 depth separable convolution.
Specifically, as shown in table 1 below, the gender detection model may include four Thin modules, each of which is built up of two base blocks, one 1*1 point-by-point convolution and one 3*3 depth separable convolution, each of which is combined of two 1*1 point-by-point convolutions and one 3*3 depth separable convolution.
TABLE 1
In a specific implementation, the structure of the basic block may be as shown in fig. 3, and the structure of the Thin module may be as shown in fig. 4.
The basic block adopts small kernel convolution of 1×1 and 3×3, so that the number of network parameters can be reduced, and the calculation efficiency is higher. As shown in fig. 3, the point-by-point convolution of the 1x1 PW (1) is used for realizing dimension reduction, reducing the number of parameters, and the 1x1 PW (2) and the 3x3 DW (1) adopt a multi-branch fusion mode to better realize feature characterization.
The Thin module, as shown in fig. 4, uses Skip Connection (Skip Connection), and can effectively reduce the problems of gradient disappearance and network degradation while multiplexing features, so that training is easier, where 3×3 DW (2) is used to reduce the size of the feature map, where Block is the basic Block in fig. 3. All convolutions described above are followed by BN and ReLU layers.
Experiments prove that the sex detection model is constructed through four Thin modules, the total parameter number of the sex detection model is about 670000, the model file size is about 2.8M, the memory occupation amount is extremely low, meanwhile, the calculation complexity is kept, and the superior performance of the model is ensured.
The sex detection method provided by the implementation of the invention is described below with two specific application scenarios.
For example, the sex detection method of the embodiment of the invention can be applied to dormitory of girls, cameras can be installed at the entrances of dormitory buildings of the girls, the cameras can be associated with speakers or can be integrated with speakers, the collected monitoring videos can be stored in a video monitoring server in a distinguishing mode according to camera identifications (such as camera numbers id, serial numbers and the like), when sex detection is needed, the monitoring videos can be obtained from the video monitoring server, the sex detection flow is executed on the obtained monitoring videos by using the method of the embodiment of the invention, and once a male appears in the monitoring videos collected by a certain camera, alarm notification can be sent to the corresponding camera according to the camera identifications, so that the corresponding camera can carry out alarm prompt by utilizing the speaker integrated with the camera or the corresponding camera can carry out alarm prompt by utilizing the speaker associated with the camera identification, and the effect of protecting the personal safety of the girls is achieved.
For another example, the gender detection method provided by the embodiment of the invention can be applied to a mother-infant room or a nursing room arranged in a public place, a camera can be installed at the entrance of the mother-infant room, the camera can be associated with a loudspeaker or can be integrated with the loudspeaker, the collected monitoring video can be stored in a video monitoring server, when the gender detection is required, the monitoring video can be obtained from the video monitoring server, the gender detection process can be performed on the obtained monitoring video by using the method provided by the embodiment of the invention, once the occurrence of a male in the monitoring video is detected, the camera can be alerted, so that the camera can use the loudspeaker integrated with the camera to carry out an alarm prompt, or the camera can use the loudspeaker associated with the camera to carry out an alarm prompt, thereby playing a role in protecting the privacy of females.
It should be noted that the above application scenario is only illustrative, and in practical application, the present invention may also be applied to other scenarios with gender detection requirements, such as public restrooms, which are not limited herein.
Fig. 5 is a schematic structural diagram of a sex detection device according to an embodiment of the present invention, as shown in fig. 5, the sex detection device includes:
the confidence coefficient obtaining module 501 is configured to obtain a current image frame from a surveillance video, and obtain a face detection frame in the current image frame and a face confidence coefficient of the face detection frame;
The image tracking module 502 is configured to track a target person in the face detection frame and acquire a face image of the target person when the face confidence meets a preset confidence condition;
An image selecting module 503, configured to select a target image that meets a preset quality condition from the face images;
and the sex determination module 504 is configured to perform sex detection on the target image to obtain a sex identification of the target person.
In one embodiment, the apparatus further comprises:
And the quality determining module is used for determining whether the quality score of the face image of the target person acquired at the current moment is larger than a preset score.
In one embodiment, the image selecting module 503 selects a target image that meets a preset quality condition from the face images, including:
and when the quality score of the face image of the target person acquired at the current moment is larger than the preset score, determining the face image of the target person acquired at the current moment as the target image.
In one embodiment, the image selecting module 503 selects a target image that meets a preset quality condition from the face images, including:
When the quality score of the face image of the target person acquired at the current moment is not more than the preset score, determining whether the tracking duration of the target person at the current moment exceeds the preset duration;
when the tracking time of the target person exceeds the preset time at the current moment, selecting a face image with the highest quality score from face images of the target person acquired in the tracking time to obtain the target image.
In one embodiment, the gender determination module 504 performs gender detection on the target image to obtain the gender identification of the target person, including:
Inputting the target image into a gender detection model to perform gender detection, so as to obtain a gender probability value of the target person;
And determining the gender identification of the target person according to the gender probability value of the target person and a preset gender probability threshold.
In one embodiment, the apparatus further comprises:
The alarm module is used for determining whether the gender identification of the target person is consistent with the gender identification allowed by the current area; and when the gender identification of the target person is inconsistent with the gender identification allowed by the current area, prompting an alarm, and storing the target image into a preset image library.
In an embodiment, the gender detection model includes four Thin modules, each Thin module is formed by combining two basic blocks, one 1*1 point-by-point convolution and one 3*3 depth separable convolution, and each basic block is formed by combining two 1*1 point-by-point convolution and one 3*3 depth separable convolution.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional modules is illustrated, and in practical application, the above-described functional allocation may be performed by different functional modules according to needs, i.e. the internal structure of the apparatus is divided into different functional modules to perform all or part of the functions described above. The specific working process of the functional module described above may refer to the corresponding process in the foregoing method embodiment, and will not be described herein.
The device provided by the embodiment of the invention can acquire the current image frame from the monitoring video, acquire the face detection frame in the current image frame and the face confidence coefficient of the face detection frame, track the target person in the face detection frame and acquire the face image of the target person when the face confidence coefficient meets the preset confidence coefficient condition, select the target image meeting the preset quality condition from the face image, and execute sex detection on the target image to obtain the sex identification of the target person. In the embodiment of the invention, the sex detection of the person can be realized by analyzing and processing the monitoring video, so that the monitoring video of the scene is analyzed and processed for the scene with the sex detection requirement, a solution is provided for the automatic sex detection requirement in various scenes, and the automatic sex detection can be realized in various scenes; in addition, by presetting the confidence condition and the quality condition, the target image for performing sex detection can be accurately obtained, the image processing quantity is reduced, and the detection efficiency and accuracy are improved.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. Fig. 6 illustrates a block diagram of an exemplary electronic device 12 suitable for use in implementing embodiments of the present invention. The electronic device 12 shown in fig. 6 is merely an example and should not be construed as limiting the functionality and scope of use of embodiments of the present invention.
As shown in fig. 6, the electronic device 12 is in the form of a general purpose computing device. Components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, a bus 18 that connects the various system components, including the system memory 28 and the processing units 16.
Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, and a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include Industry Standard Architecture (ISA) bus, micro channel architecture (MAC) bus, enhanced ISA bus, video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Electronic device 12 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by electronic device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 30 and/or cache memory 32. The electronic device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from or write to non-removable, nonvolatile magnetic media (not shown in FIG. 6, commonly referred to as a "hard disk drive"). Although not shown in fig. 6, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be coupled to bus 18 through one or more data medium interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored in, for example, memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 42 generally perform the functions and/or methods of the embodiments described herein.
The electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), one or more devices that enable a user to interact with the electronic device 12, and/or any devices (e.g., network card, modem, etc.) that enable the electronic device 12 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 22. Also, the electronic device 12 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet, through a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 over the bus 18. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with electronic device 12, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processing unit 16 executes various functional applications and data processing by running a program stored in the system memory 28, for example, to implement a sex detection method provided by an embodiment of the present invention, the method including:
acquiring a current image frame from a monitoring video, and acquiring a face detection frame in the current image frame and a face confidence coefficient of the face detection frame;
when the face confidence degree meets the preset confidence degree condition, tracking a target person in the face detection frame and acquiring a face image of the target person;
selecting a target image meeting a preset quality condition from the face image;
And performing sex detection on the target image to obtain the sex identification of the target person.
The fourth embodiment of the present invention also provides a computer readable storage medium having stored thereon a computer program which when executed by a processor implements the gender detection method according to the embodiment of the present invention, the method comprising:
acquiring a current image frame from a monitoring video, and acquiring a face detection frame in the current image frame and a face confidence coefficient of the face detection frame;
when the face confidence degree meets the preset confidence degree condition, tracking a target person in the face detection frame and acquiring a face image of the target person;
selecting a target image meeting a preset quality condition from the face image;
And performing sex detection on the target image to obtain the sex identification of the target person.
The computer storage media of embodiments of the invention may take the form of any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (9)

1. A sex determination method, comprising:
acquiring a current image frame from a monitoring video, and acquiring a face detection frame in the current image frame and a face confidence coefficient of the face detection frame;
when the face confidence degree meets the preset confidence degree condition, tracking a target person in the face detection frame and acquiring a face image of the target person;
selecting a target image meeting a preset quality condition from the face image;
performing sex detection on the target image through a sex detection model to obtain a sex identification of the target person; the sex detection model comprises four Thin modules, each Thin module is formed by constructing two basic blocks, a 1*1 point-by-point convolution and a 3*3 depth separable convolution, and each basic block is formed by combining two 1*1 point-by-point convolution and a 3*3 depth separable convolution; the basic block adopts 1×1 and 3×3 kernel convolution, and each Thin module adopts jump connection.
2. The method of claim 1, further comprising, after tracking the target person in the face detection box and acquiring the face image of the target person:
And determining whether the quality score of the face image of the target person acquired at the current moment is larger than a preset score.
3. The method according to claim 2, wherein selecting a target image satisfying a preset quality condition from the face images includes:
and when the quality score of the face image of the target person acquired at the current moment is larger than the preset score, determining the face image of the target person acquired at the current moment as the target image.
4. The method according to claim 2, wherein selecting a target image satisfying a preset quality condition from the face images includes:
When the quality score of the face image of the target person acquired at the current moment is not more than the preset score, determining whether the tracking duration of the target person at the current moment exceeds the preset duration;
when the tracking time of the target person exceeds the preset time at the current moment, selecting a face image with the highest quality score from face images of the target person acquired in the tracking time to obtain the target image.
5. The method of claim 1, wherein performing gender detection on the target image by a gender detection model results in a gender identification of the target persona, comprising:
Inputting the target image into a gender detection model to perform gender detection, so as to obtain a gender probability value of the target person;
And determining the gender identification of the target person according to the gender probability value of the target person and a preset gender probability threshold.
6. The method of claim 5, wherein the performing gender detection on the target image by the gender detection model, after deriving the gender identification of the target person, further comprises:
determining whether the gender identification of the target person is consistent with the gender identification allowed by the current area;
and when the gender identification of the target person is inconsistent with the gender identification allowed by the current area, prompting an alarm, and storing the target image into a preset image library.
7. A sex detection device, characterized in that the sex detection device comprises:
The confidence coefficient acquisition module is used for acquiring a current image frame from the monitoring video and acquiring a face detection frame in the current image frame and a face confidence coefficient of the face detection frame;
The image tracking module is used for tracking the target person in the face detection frame and acquiring a face image of the target person when the face confidence meets the preset confidence condition;
The image selecting module is used for selecting a target image meeting a preset quality condition from the face image;
The sex determination module is used for performing sex detection on the target image through a sex detection model to obtain the sex identification of the target person; the sex detection model comprises four Thin modules, each Thin module is formed by constructing two basic blocks, a 1*1 point-by-point convolution and a 3*3 depth separable convolution, and each basic block is formed by combining two 1*1 point-by-point convolution and a 3*3 depth separable convolution; the basic block adopts 1×1 and 3×3 kernel convolution, and each Thin module adopts jump connection.
8. An electronic device, the electronic device comprising:
one or more processors;
a storage means for storing one or more programs;
The one or more programs, when executed by the one or more processors, cause the one or more processors to implement the gender detection method of any of claims 1 to 6.
9. A computer-readable storage medium, on which a computer program is stored, characterized in that the program, when executed by a processor, implements the sex detection method according to any one of claims 1 to 6.
CN202110384949.6A 2021-04-09 2021-04-09 Sex detection method and device, electronic equipment and storage medium Active CN112926542B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110384949.6A CN112926542B (en) 2021-04-09 2021-04-09 Sex detection method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110384949.6A CN112926542B (en) 2021-04-09 2021-04-09 Sex detection method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112926542A CN112926542A (en) 2021-06-08
CN112926542B true CN112926542B (en) 2024-04-30

Family

ID=76173833

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110384949.6A Active CN112926542B (en) 2021-04-09 2021-04-09 Sex detection method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112926542B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115082836B (en) * 2022-07-23 2022-11-11 深圳神目信息技术有限公司 Behavior recognition-assisted target object detection method and device

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104036236A (en) * 2014-05-27 2014-09-10 厦门瑞为信息技术有限公司 Human face gender recognition method based on multi-parameter index weighting
CN105488478A (en) * 2015-12-02 2016-04-13 深圳市商汤科技有限公司 Face recognition system and method
CN109543560A (en) * 2018-10-31 2019-03-29 百度在线网络技术(北京)有限公司 Dividing method, device, equipment and the computer storage medium of personage in a kind of video
CN109977781A (en) * 2019-02-26 2019-07-05 上海上湖信息技术有限公司 Method for detecting human face and device, readable storage medium storing program for executing
CN110717414A (en) * 2019-09-24 2020-01-21 青岛海信网络科技股份有限公司 Target detection tracking method, device and equipment
CN111401315A (en) * 2020-04-10 2020-07-10 浙江大华技术股份有限公司 Face recognition method, recognition device and storage device based on video
CN111652175A (en) * 2020-06-11 2020-09-11 山东大学 Real-time surgical tool detection method applied to robot-assisted surgical video analysis
CN111797733A (en) * 2020-06-22 2020-10-20 浙江大华技术股份有限公司 Behavior recognition method, behavior recognition device, behavior recognition equipment and storage medium based on image
WO2020244032A1 (en) * 2019-06-03 2020-12-10 罗普特科技集团股份有限公司 Face image detection method and apparatus

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100738080B1 (en) * 2005-11-08 2007-07-12 삼성전자주식회사 Method of and apparatus for face recognition using gender information
US11113838B2 (en) * 2019-03-26 2021-09-07 Nec Corporation Deep learning based tattoo detection system with optimized data labeling for offline and real-time processing

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104036236A (en) * 2014-05-27 2014-09-10 厦门瑞为信息技术有限公司 Human face gender recognition method based on multi-parameter index weighting
CN105488478A (en) * 2015-12-02 2016-04-13 深圳市商汤科技有限公司 Face recognition system and method
CN109543560A (en) * 2018-10-31 2019-03-29 百度在线网络技术(北京)有限公司 Dividing method, device, equipment and the computer storage medium of personage in a kind of video
CN109977781A (en) * 2019-02-26 2019-07-05 上海上湖信息技术有限公司 Method for detecting human face and device, readable storage medium storing program for executing
WO2020244032A1 (en) * 2019-06-03 2020-12-10 罗普特科技集团股份有限公司 Face image detection method and apparatus
CN110717414A (en) * 2019-09-24 2020-01-21 青岛海信网络科技股份有限公司 Target detection tracking method, device and equipment
CN111401315A (en) * 2020-04-10 2020-07-10 浙江大华技术股份有限公司 Face recognition method, recognition device and storage device based on video
CN111652175A (en) * 2020-06-11 2020-09-11 山东大学 Real-time surgical tool detection method applied to robot-assisted surgical video analysis
CN111797733A (en) * 2020-06-22 2020-10-20 浙江大华技术股份有限公司 Behavior recognition method, behavior recognition device, behavior recognition equipment and storage medium based on image

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
应用于嵌入式平台的实时红外行人检测方法;张童;谭南林;包辰铭;;激光与红外;20200220(第02期);全文 *

Also Published As

Publication number Publication date
CN112926542A (en) 2021-06-08

Similar Documents

Publication Publication Date Title
WO2021217934A1 (en) Method and apparatus for monitoring number of livestock, and computer device and storage medium
JP7047970B2 (en) Methods, devices and programs for determining periods of interest and at least one area of interest for managing events.
US11113838B2 (en) Deep learning based tattoo detection system with optimized data labeling for offline and real-time processing
JP2010267030A (en) Apparatus and method for processing information
CN111241883A (en) Method and device for preventing remote detected personnel from cheating
CN108806151A (en) Monitoring alarm method, device, server and storage medium
WO2020052062A1 (en) Detection method and device
CN112926542B (en) Sex detection method and device, electronic equipment and storage medium
CN110246292B (en) Household video monitoring method, device and storage medium
CN104050785A (en) Safety alert method based on virtualized boundary and face recognition technology
JP6214762B2 (en) Image search system, search screen display method
CN113869115A (en) Method and system for processing face image
US9805272B1 (en) Storage system of original frame of monitor data and storage method thereof
KR20170098113A (en) Method for creating image group of electronic device and electronic device thereof
CN113158773A (en) Training method and training device for living body detection model
CN108334811B (en) Face image processing method and device
CN113947795B (en) Mask wearing detection method, device, equipment and storage medium
CN115641701A (en) Event reminding method, device, equipment and storage medium
US8682834B2 (en) Information processing apparatus and information processing method
CN113255438B (en) Structured video file marking method, system, host and storage medium
JPWO2019187107A1 (en) Information processing equipment, control methods, and programs
CN114245032A (en) Automatic switching method and system for video framing, video player and storage medium
CN112989083B (en) Personnel identity analysis method, device, equipment and storage medium
CN111062337B (en) People stream direction detection method and device, storage medium and electronic equipment
WO2023179692A1 (en) Motion video generation method and apparatus, terminal device, and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant