Data desensitization processing method, device and electronic device
By detecting and determining the areas of faces and license plates in the autonomous driving data and desensitizing them, the problem of insufficient recall in the desensitization of autonomous driving data is solved, and a more efficient desensitization effect is achieved.
Patent Information
- Application Number
- CN202210130586.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-11
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2042-02-11
AI Technical Summary
In the prior art, deep learning algorithms are used to desensitize private data such as faces and license plates in autonomous driving data, which has the problem of insufficient recall.
By obtaining source image data, the area of target objects such as faces and license plates is detected, the desensitization area is determined, and the desensitization treatment is performed. The specific steps include acquiring source image data, detecting target objects, determining first type of area and second type of area, determining desensitized areas based on these areas, and processing image data in the desensitized areas.
It significantly improves the desensitization efficiency, improves the recognition recall rate of faces and license plates in autonomous driving data, and solves the problem of insufficient recall.
Smart Images

Figure CN114463168B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of autonomous driving, and more specifically, to a method, device and electronic device for data desensitization processing. Background Art
[0002] As society pays more and more attention to personal privacy protection, autonomous driving data needs to be desensitized before it can be used in compliance with regulations. Among them, the size of unstructured data such as pictures and videos accounts for more than 95% of the total amount of autonomous driving data. The processing of faces and license plates of these unstructured data has become an indispensable part of privacy protection.
[0003] At present, the technology of desensitizing unstructured data is relatively common, and there are relatively mature deep learning algorithm models available. However, desensitizing faces and license plates based entirely on deep learning algorithms has the problem of insufficient recall rate.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present application provide a method, device and electronic device for data desensitization processing, so as to at least solve the technical problem of insufficient recall rate in the related art of using deep learning algorithms to desensitize privacy data such as faces and license plates in autonomous driving data.
[0006] According to one aspect of an embodiment of the present application, a method for data desensitization is provided, including: acquiring source image data; detecting target objects in the source image data respectively to obtain first-category areas and second-category areas in the source image data, wherein the second-category areas are areas occupied by the target objects in the source image data, and the first-category areas are areas where target parts of the target objects in the source image data are located; determining a desensitized area in the source image data based on at least the first-category areas and the second-category areas; and desensitizing the image data in the desensitized area.
[0007] Optionally, the target object includes: a first object and a second object, and the first object and the second object are associated with each other; the target objects in the source image data are detected respectively to obtain a first type of area and a second type of area in the source image data, including: when the first object is a pedestrian, the facial image of the pedestrian in the target object is detected, and a first target detection frame is output, and the first target detection frame is used as the first type of area corresponding to the first object, wherein the first target detection frame is the minimum circumscribed frame covering the facial information of the first object; or, when the second object is a vehicle, the license plate area of the vehicle is detected, and a second target detection frame is output, and the second target detection frame is used as the first type of area corresponding to the second object, wherein the second target detection frame is the minimum circumscribed frame covering the license plate information of the vehicle.
[0008] Optionally, detecting the license plate area of the vehicle includes: detecting license plate areas of different colors using a test model trained based on a test set including different colors.
[0009] Optionally, it is determined that the first object and the second object have an association relationship in one of the following cases: the first object and the second object are pedestrians in the driving environment of the target vehicle and surrounding vehicles in the environment of the target vehicle; the first object and the second object are passengers in the target vehicle and surrounding vehicles in the driving environment of the target vehicle.
[0010] Optionally, when the first object is a pedestrian, the facial image of the pedestrian in the target object is detected and a first target detection frame is output, including: determining a first length of the first target detection frame in the vertical direction and a second length in the horizontal direction, and when the first length and the second length meet a first preset condition, outputting the first target detection frame.
[0011] Optionally, the first preset condition is that the first length is greater than or equal to a first target number of pixels, and the second length is greater than or equal to a second target number of pixels, wherein the first target number and the second target number are any value between 16 and 40.
[0012] Optionally, when the second object is a vehicle, the license plate area of the vehicle is detected and a second target detection frame is output, including: determining a third length of the second target detection frame in the vertical direction and a fourth length in the horizontal direction, and when the third length and the fourth length meet a second preset condition, outputting the second target detection frame.
[0013] Optionally, the second preset condition is that the third length is greater than or equal to a third target number of pixels, and the fourth length is greater than or equal to a fourth target number of pixels, wherein the third target number is any value between 10 and 20, and the fourth target number is any value between 20 and 40.
[0014] Optionally, the target objects in the source image data are detected separately to obtain the first category area and the second category area in the source image data, including: when the first object is a pedestrian, the pedestrian contour in the target object is detected, and a third target detection frame is output, and the third target detection frame is used as the second category area corresponding to the first object, wherein the third target detection frame is the minimum circumscribed frame including the pedestrian contour; or, when the second object is a vehicle, the vehicle contour is detected, and a fourth target detection frame is output, and the fourth target detection frame is used as the second category area corresponding to the second object, wherein the fourth target detection frame is the minimum circumscribed frame including the entire vehicle.
[0015] Optionally, when the first object is a pedestrian, the outline of the pedestrian in the target object is detected and a third target detection frame is output, including: determining a fifth length of the third target detection frame in the vertical direction and a sixth length in the horizontal direction, and when the fifth length and the sixth length meet a third preset condition, outputting the third target detection frame.
[0016] Optionally, the third preset condition is that the fifth length is greater than or equal to the fifth target number of pixels, and the sixth length is greater than or equal to the sixth target number of pixels, wherein the fifth target number is any value between 60 and 120, and the sixth target number is any value between 30 and 60.
[0017] Optionally, when the second object is a vehicle, the vehicle outline of the vehicle is detected and a fourth target detection frame is output, including: determining a seventh length of the fourth target detection frame in the vertical direction and an eighth length in the horizontal direction, and when the seventh length and the eighth length meet a fourth preset condition, outputting the fourth target detection frame.
[0018] Optionally, the fourth preset condition is that the seventh length is greater than or equal to a seventh target number of pixels, and the eighth length is greater than or equal to an eighth target number of pixels, wherein the seventh target number and the eighth target number are any value between 80 and 120.
[0019] Optionally, the desensitized area in the source image data is determined based on at least the first type of area and the second type of area, including: when there are a first target detection box and a third target detection box in the source image data, the area corresponding to the first target detection box is used as the desensitized area; when there is a first target detection box in the source image data and there is no third target detection box, the area corresponding to the first target detection box is used as the desensitized area; when there is no first target detection box in the source image data and there is a third target detection box, the third target detection box is processed and the area obtained after the processing is used as the desensitized area; when there are no first target detection box and no third target detection box in the source image data, the desensitized area is refused to be output.
[0020] Optionally, the third target detection frame is processed and the area obtained after the processing is used as the desensitized area, including: fixing the upper border of the third target detection frame, compressing the other three borders according to a first preset ratio, and using the area corresponding to the compressed third target detection frame as the desensitized area.
[0021] Optionally, the other three borders are compressed according to a first preset ratio, including: moving the left border and the right border of the third target detection frame inward by a first target distance, respectively, and moving the bottom border of the third target detection frame upward to a second target distance, wherein the first target distance is any value between 1 / 4 and 1 / 2 of the length of the upper border of the third target detection frame or the lower border of the third target detection frame, and the second target distance is any value between 1 / 8 and 1 / 6 of the length of the left border of the third target detection frame or the right border of the third target detection frame.
[0022] Optionally, the desensitized area in the source image data is determined based on at least the first type of area and the second type of area, including: when there are a second target detection box and a fourth target detection box in the source image data, the area corresponding to the second target detection box is used as the desensitized area; when there is a second target detection box in the source image data but no fourth target detection box, the area corresponding to the second target detection box is used as the desensitized area; when there is no second target detection box in the source image data but there is a fourth target detection box, the fourth target detection box is processed and the area obtained after the processing is used as the desensitized area; when there are no second target detection box and no fourth target detection box in the source image data, refusing to output the desensitized area.
[0023] Optionally, the fourth target detection frame is processed and the area obtained after the processing is used as the desensitized area, including: taking the geometric center of the fourth target detection frame as the center point, scaling the fourth target detection frame according to a second preset ratio, and using the area corresponding to the scaled fourth target detection frame as the desensitized area.
[0024] Optionally, scaling the fourth target detection frame according to a second preset ratio includes: determining the distance from any endpoint of the fourth target detection frame to the center point as a first distance; moving the fourth target detection frame inward by a third target distance along the direction from the endpoint to the center point, wherein the third target distance is any value between 1 / 4 and 1 / 3 of the first distance.
[0025] Optionally, the image data in the desensitized area is desensitized, including: randomly moving the pixels in the desensitized area; or setting all the pixels in the desensitized area to a target color, wherein the color of the pixels is a combination of any one or more of the following colors: red, green, and blue.
[0026] According to another aspect of an embodiment of the present application, a device for data desensitization processing is also provided, including: an acquisition module for acquiring source image data; a detection module for respectively detecting target objects in the source image data to obtain first-category areas and second-category areas in the source image data, wherein the second-category areas are areas occupied by the target objects in the source image data, and the first-category areas are areas where the target parts of the target objects in the source image data are located; a determination module for determining a desensitized area in the source image data based at least on the first-category areas and the second-category areas; and a processing module for desensitizing the image data in the desensitized area.
[0027] According to another aspect of the embodiments of the present application, there is also provided an electronic device, comprising: a memory for storing program instructions; a processor, connected to the memory, for executing program instructions to implement the following functions: acquiring source image data; detecting target objects in the source image data separately to obtain first-category areas and second-category areas in the source image data, wherein the second-category areas are areas occupied by the target objects in the source image data, and the first-category areas are areas where the target parts of the target objects in the source image data are located; determining a desensitized area in the source image data based at least on the first-category areas and the second-category areas; and performing desensitization processing on the image data in the desensitized area.
[0028] In an embodiment of the present application, by respectively detecting different target objects in the source image data, a first type of area and a second type of area in the source image data are obtained, wherein the second type of area is the area occupied by the target object in the source image data, and the first type of area is the area where the target part of the target object in the source image data is located, and the desensitized area in the source image data is determined based on at least the first type of area and the second type of area, thereby achieving the purpose of desensitizing the source image data based on the desensitized area, thereby achieving the technical effect of significantly improving the desensitization efficiency, and further solving the technical problem of insufficient recall rate in the related technology of using deep learning algorithms to desensitize privacy data such as faces and license plates in autonomous driving data. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0030] Figure 1 It is a hardware structure block diagram of a computer terminal (or electronic device) for implementing a method for data desensitization processing according to an embodiment of the present application;
[0031] Figure 2 is a flow chart of a method for data desensitization processing according to an embodiment of the present application;
[0032] Figure 3 is a flowchart of desensitizing image data according to an embodiment of the present application;
[0033] Figure 4a is an example picture of face detection according to an embodiment of the present application;
[0034] Figure 4b is an example picture of license plate detection according to an embodiment of the present application;
[0035] Figure 5a is a flow chart for determining a desensitized area in source image data according to an embodiment of the present application;
[0036] Figure 5b is a schematic diagram of processing a third target detection frame according to an embodiment of the present application;
[0037] Figure 6a is another flow chart for determining a desensitized area in source image data according to an embodiment of the present application;
[0038] Figure 6b is a schematic diagram of processing a fourth target detection frame according to an embodiment of the present application;
[0039] Figure 7 This is an architecture diagram of data desensitization processing according to an embodiment of the present application;
[0040] Figure 8 It is a structural diagram of a data desensitization processing device according to an embodiment of the present application. DETAILED DESCRIPTION
[0041] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0042] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0043] In order to better understand the embodiments of the present application, the terms involved in the present application are explained as follows:
[0044] Data desensitization: refers to the deformation of certain sensitive information through desensitization rules to achieve reliable protection of sensitive privacy data. In this way, the desensitized real data set can be safely used in development, testing and other non-production environments as well as outsourcing environments.
[0045] Face recognition (Facial Recognition): It is to obtain the user's facial image through a video acquisition device, and then use the core algorithm to calculate and analyze the position, face shape and angle of the facial features, and then compare it with the existing templates in its own database to determine the user's true identity. Face recognition technology is based on the single training sample face recognition method of local feature areas. The first step is to define the local area; the second step is to extract the features of the local area of the face, and map the face image vector to the face feature vector according to the transformation matrix obtained after sample training; the third step is local feature selection (optional); the last step is classification. The classifier is mostly in the form of a combined classifier, each local feature corresponds to a classifier, and the final recognition result can be obtained by voting or linear weighting. Face recognition combines multiple technologies such as digital image / video processing, pattern recognition, and computer vision. The core technology is the face recognition algorithm. There are 4 types of face recognition algorithms: recognition algorithm based on facial feature points, recognition algorithm based on the entire face image, recognition algorithm based on templates, and algorithm using neural network for recognition.
[0046] The Yolo algorithm, whose full name is You Only Look Once: Unified, Real-Time Object Detection, is a type of target detection algorithm that only requires one CNN operation. Unified means that this is a unified framework that provides end-to-end predictions, and Real-Time means that the Yolo algorithm is fast.
[0047] At present, the technology of desensitization of unstructured data is relatively common, and there are relatively mature deep learning algorithm models available for use. However, there is a problem of insufficient recall rate when desensitizing faces and license plates based entirely on deep learning algorithms. There are two main reasons: 1. Faces and license plates are small targets in the images of autonomous driving data, and the texture information is insufficient, making them difficult to identify; 2. Many scenes that need to be desensitized for faces and license plates belong to long-tail scenes (such as faces and license plates are partially blocked, and there are special license plates such as yellow and red license plates). There are few effective data samples that can be used for algorithm training, and the performance requirements of high recall rate cannot be met. Although there are also manual desensitization methods, that is, the desensitized content is manually identified and screened on the platform, manual desensitization is time-consuming and cannot meet the business timeliness requirements under large data volumes. In response to the above problems, the embodiments of the present application provide corresponding solutions, which are described in detail below.
[0048] According to an embodiment of the present application, a method embodiment of data desensitization processing is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0049] The method embodiment of data desensitization processing provided in the embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 The hardware structure block diagram of a computer terminal (or electronic device) for implementing a method for data desensitization processing is shown. Figure 1 As shown, the computer terminal 10 (or electronic device 10) may include one or more (102a, 102b, ..., 102n are used to illustrate) processors (the processor may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission module 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0050] It should be noted that the one or more processors and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or electronic device). As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0051] The memory 104 can be used to store software programs and modules of application software, such as program instructions / data storage devices corresponding to the method for data desensitization processing in the embodiment of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, realizing the above-mentioned method for data desensitization processing. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0052] The transmission module 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0053] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or electronic device).
[0054] It should be noted that, in some optional embodiments, the above Figure 1 The computer device (or electronic device) shown may include hardware elements (including circuits), software elements (including computer code stored on a computer-readable medium), or a combination of hardware elements and software elements. It should be noted that Figure 1This is merely one example of a particular embodiment and is intended to illustrate the types of components that may be present in the above-described computer device (or electronic device).
[0055] Under the above operating environment, the embodiment of the present application provides the following Figure 2 The method of data desensitization shown. Figure 2 is a flow chart of a method for data desensitization processing according to an embodiment of the present application, such as Figure 2 As shown, the method comprises the following steps:
[0056] Step S202, obtaining source image data;
[0057] Step S204, respectively detecting the target object in the source image data to obtain a first type of region and a second type of region in the source image data, wherein the second type of region is the region occupied by the target object in the source image data, and the first type of region is the region where the target part of the target object in the source image data is located;
[0058] Step S206, determining a desensitized area in the source image data based at least on the first type of area and the second type of area;
[0059] Step S208, performing desensitization processing on the image data in the desensitization area.
[0060] In an embodiment of the present application, the first type of area is a local area, and the second type of area is an overall area. Specifically, the first type of area corresponds to a facial image or a license plate area, and a first detection algorithm can be used to detect a pedestrian's facial image or a vehicle's license plate area. The second type of area corresponds to a pedestrian outline or a vehicle outline, and a second detection algorithm can be used to detect a pedestrian outline or a vehicle outline. The pedestrian outline at least includes the pedestrian's facial image, and the vehicle outline at least includes the vehicle's license plate area, that is, the second type of area includes the first type of area.
[0061] In step S202 of the data desensitization processing method, when obtaining the source image data, it is first necessary to determine the data format of the source image data. When the data format of the source image data is the target format, the source image data is obtained; when the data format of the source image data is not the target format, the format is converted to obtain the image data in the target format.
[0062] like Figure 3The desensitization flow chart of the image data shown in the figure shows that after the source image data is imported, the data format of the source image data needs to be judged first. When the data format of the source image data is the target format, the source image data is detected simultaneously by the first detection algorithm and the second detection algorithm, and the first and second regions are output, wherein the target format is a picture format, and the target format includes but is not limited to jpg, jpeg, png and other formats. When the data format of the source image data is not the target format, the format conversion is required, and after the image data in the target format is obtained, it is input into the first detection algorithm and the second detection algorithm, and the first and second regions are output. The desensitized region in the source image data is determined based on at least the first and second regions, and the image data in the desensitized region is desensitized, i.e., anonymized.
[0063] When the imported data is video data, the data in video format is first parsed, and the video format includes but is not limited to mp4, avi, mkv and other formats, and converted into image data in a target format, i.e., image data in a picture format. The converted image data in the target format is then detected simultaneously by a first detection algorithm and a second detection algorithm, and a first area and a second area are output. A desensitized area in the image data is determined based on at least the first area and the second area, and the image data in the desensitized area is desensitized, i.e., anonymized.
[0064] It should be noted that the above-mentioned overall desensitization process is carried out on a compliant private cloud and follows the Kafka streaming process. It only anonymizes the desensitized content and does not change the format of the data itself.
[0065] In step S204 of the data desensitization processing method, the target object includes: a first object and a second object, and the first object and the second object have an association relationship; the target objects in the source image data are detected respectively to obtain the first type of area and the second type of area in the source image data, specifically including the following two situations:
[0066] In the case where the first object is a pedestrian, a facial image of the pedestrian in the target object is detected, and a first object detection frame is output, and the first object detection frame is used as a first type of region corresponding to the first object, wherein the first object detection frame is a minimum bounding box covering facial information of the first object; or,
[0067] When the second object is a vehicle, the license plate area of the vehicle is detected and a second target detection frame is output, and the second target detection frame is used as the first type of area corresponding to the second object, wherein the second target detection frame is the minimum external frame covering the license plate information of the vehicle. Considering that there are special license plates such as yellow and red, license plates of different colors can be detected during detection.
[0068] Since there is an association relationship between the first object and the second object, it can be determined that the first object and the second object have an association relationship in one of the following cases: the first object and the second object are pedestrians in the driving environment of the target vehicle and surrounding vehicles in the environment of the target vehicle; the first object and the second object are passengers in the target vehicle and surrounding vehicles in the driving environment of the target vehicle.
[0069] In an embodiment of the present application, the first detection algorithm is a face and license plate detection algorithm, which is encapsulated in an SDK (SDK is a software development kit). The input of the algorithm is source image data or video data in a target format. The first detection algorithm includes a first algorithm and a second algorithm. The first algorithm is a face detection algorithm, and the second algorithm is a license plate detection algorithm. A deep learning target detection model is used to output a corresponding target detection frame.
[0070] The face detection algorithm is a target detection algorithm based on deep learning. The algorithm uses a RetinaFace model for detection and outputs a first target detection frame represented by a bounding box. Usually, the first target detection frame needs to contain the minimum external frame of the pedestrian's face information.
[0071] The license plate detection algorithm is a target detection algorithm based on deep learning. The algorithm uses a face detection algorithm model (such as RetinaFace) for detection and outputs a second target detection frame represented by a bounding box. Usually, the second target detection frame is the smallest external frame that covers the entire license plate information corresponding to the vehicle, and it must be able to support the detection of license plates of different colors such as blue, green, yellow, white, and black. Specifically, the test model obtained by training based on the algorithm test set of different colors can detect license plates of different colors.
[0072] In object detection, a bounding box is often used to describe the spatial location of an object. A bounding box is rectangular and is determined by the x and y coordinates of the upper left and lower right corners of the rectangle. Another commonly used representation of a bounding box is the (x,y) (x,y) axis coordinates of the center of the bounding box and the width and height of the box.
[0073] In the above steps, when the first object is a pedestrian, the facial image of the pedestrian in the target object is detected, and a first target detection frame is output, which specifically includes the following steps: determining a first length of the first target detection frame in the vertical direction and a second length in the horizontal direction, and outputting the first target detection frame when the first length and the second length meet a first preset condition, wherein the first preset condition is that the first length is greater than or equal to the first target number of pixels, and the second length is greater than or equal to the second target number of pixels, wherein the first target number and the second target number are any value between 16 and 40, for example, 16, 18, 20, 25, 30, 35, 40, etc. between 16 and 40 can be taken.
[0074] Generally, both algorithms in the first detection algorithm are set with a threshold for detecting targets. The first preset condition corresponding to the face detection algorithm can be set as follows: the first target detection frame is greater than or equal to 16 pixels, that is, the first length and the second length are both set to be greater than or equal to 16 pixels. If the first preset condition is not met, the first target detection frame is not output, and the side face is not detected. Figure 4a In the face detection example picture shown, when the detected face image is a side face or the pixels are less than 16 pixels (unrecognizable to the human eye), no desensitization processing is performed.
[0075] In another optional embodiment, the first preset condition is set to: the first target detection frame is greater than or equal to 40 pixels, that is, the first length and the second length are both set to be greater than or equal to 40 pixels. When the first preset condition is not met, that is, when the pixels of the detected face image are less than 40 pixels in at least one of the vertical and horizontal directions, the first target detection frame is not output and desensitization processing is not required.
[0076] In another optional embodiment, the first preset condition is set to: the first target detection frame is greater than or equal to 30 pixels, that is, the first length and the second length are both set to be greater than or equal to 30 pixels. When the first preset condition is not met, that is, when the pixels of the detected face image are less than 30 pixels in at least one of the vertical and horizontal directions, the first target detection frame is not output, and desensitization processing is not required.
[0077] It should be noted that the first length and the second length set here are both expressed in pixels, indicating the length occupied by pixels in the picture, and are empirical values. They can be set or adjusted according to actual conditions. The length of the first target detection frame in the horizontal direction and the vertical direction is the same.
[0078] In the above steps, when the second object is a vehicle, the license plate area of the vehicle is detected and a second target detection frame is output, which specifically includes the following process: determining a third length of the second target detection frame in the vertical direction and a fourth length in the horizontal direction, and outputting the second target detection frame when the third length and the fourth length meet a second preset condition, wherein the second preset condition is that the third length is greater than or equal to the third target number of pixels, and the fourth length is greater than or equal to the fourth target number of pixels, wherein the third target number is any value between 10 and 20, and the fourth target number is any value between 20 and 40, for example, 10, 12, 15, 18, 20, etc., between 10 and 20, 25, 30, 35, 40, etc., between 20 and 40.
[0079] The second preset condition corresponding to the license plate detection algorithm can be set as: the length in the vertical direction is greater than or equal to 10 pixels, and the length in the horizontal direction is greater than or equal to 20 pixels, that is, the third length must be greater than or equal to 10 pixels, and the fourth length must be greater than or equal to 20 pixels. If the pixels in any direction of the vertical and horizontal directions are lower than the set value, no detection is performed. Figure 4b In the license plate detection example picture shown, the license plate of the target vehicle in the picture does not meet the second preset condition (i.e., it is not recognizable by the naked eye), and no desensitization process is performed. It should be noted that the third length and the fourth length set here are both expressed in pixels, indicating the length occupied by the pixel in the picture, and are empirical values, which can be set or adjusted according to actual conditions.
[0080] In another optional embodiment, the second preset condition is set to: the length in the vertical direction is greater than or equal to 20 pixels, and the length in the horizontal direction is greater than or equal to 40 pixels, that is, the third length must be greater than or equal to 20 pixels, and the fourth length must be greater than or equal to 40 pixels. When the pixels in any direction of the vertical and horizontal directions are lower than the set value, no detection is performed.
[0081] In another optional embodiment, the second preset condition is set to: the length in the vertical direction is greater than or equal to 15 pixels, and the length in the horizontal direction is greater than or equal to 30 pixels, that is, the third length must be greater than or equal to 15 pixels, and the fourth length must be greater than or equal to 30 pixels. When the pixels in any direction of the vertical and horizontal directions are lower than the set value, no detection is performed.
[0082] In step S204 of the data desensitization processing method, the target objects in the source image data are detected respectively to obtain the first type of area and the second type of area in the source image data, which specifically include the following two situations:
[0083] In the case where the first object is a pedestrian, the pedestrian contour in the target object is detected, and a third object detection frame is output, and the third object detection frame is used as the second type of area corresponding to the first object, wherein the third object detection frame is a minimum circumscribed frame including the pedestrian contour; or,
[0084] When the second object is a vehicle, the vehicle contour of the vehicle is detected and a fourth object detection frame is output, and the fourth object detection frame is used as the second type of area corresponding to the second object, wherein the fourth object detection frame is the minimum circumscribed frame including the entire vehicle.
[0085] In an embodiment of the present application, the second detection algorithm includes a third algorithm and a fourth algorithm encapsulated in the SDK. The third algorithm is a pedestrian detection algorithm, and the fourth algorithm is a vehicle detection algorithm. The inputs of these two algorithms are both source image data or video data in a target format. They use a deep learning target detection model to output a corresponding target detection box.
[0086] The pedestrian detection algorithm is a target detection algorithm based on deep learning. The algorithm uses models such as Faster R-CNN or Yolo series for detection and outputs a third target detection frame represented by a bounding box. Usually, the third target detection frame is the smallest external frame that includes the pedestrian outline.
[0087] The vehicle detection algorithm is a target detection algorithm based on deep learning. The algorithm uses a Yolo series model for detection and outputs a fourth target detection frame represented by a bounding box. Usually, the fourth target detection frame is the smallest external frame that includes the entire vehicle.
[0088] In the above steps, when the first object is a pedestrian, the pedestrian contour in the target object is detected and a third target detection frame is output, which specifically includes the following steps: determining a fifth length of the third target detection frame in the vertical direction and a sixth length in the horizontal direction, and outputting the third target detection frame when the fifth length and the sixth length meet a third preset condition, wherein the third preset condition is that the fifth length is greater than or equal to the fifth target number of pixels, and the sixth length is greater than or equal to the sixth target number of pixels, wherein the fifth target number is any value between 60 and 120, and the sixth target number is any value between 30 and 60, for example, 60, 70, 80, 100, 110, 120, etc., between 60 and 120, and 30, 35, 40, 45, 50, 55, 60, etc., between 30 and 60.
[0089] In general, both algorithms in the second detection algorithm are set with thresholds for detecting targets. The third preset condition corresponding to the pedestrian detection algorithm can be set as: the length in the vertical direction is greater than or equal to 60 pixels, and the length in the horizontal direction is greater than or equal to 30 pixels, that is, the fifth length must be greater than or equal to 60 pixels, and the sixth length must be greater than or equal to 30 pixels. When the pixels in any direction of the vertical and horizontal directions are lower than the set value, the face is considered invisible and no detection is performed. It should be noted that the fifth length and the sixth length set here are both expressed in pixels, indicating the length occupied by the pixel in the picture, and are empirical values, which can be set or adjusted according to actual conditions.
[0090] In another optional embodiment, the third preset condition is set to: the length in the vertical direction is greater than or equal to 120 pixels, and the length in the horizontal direction is greater than or equal to 60 pixels, that is, the third length must satisfy that it is greater than or equal to 120 pixels, and the fourth length must satisfy that it is greater than or equal to 60 pixels. When the pixels in any direction of the vertical and horizontal directions are lower than the set value, no detection is performed.
[0091] In another optional embodiment, the third preset condition is set to: the length in the vertical direction is greater than or equal to 80 pixels, and the length in the horizontal direction is greater than or equal to 40 pixels, that is, the third length must be greater than or equal to 80 pixels, and the fourth length must be greater than or equal to 40 pixels. When the pixels in any direction of the vertical and horizontal directions are lower than the set value, no detection is performed.
[0092] In the above steps, when the second object is a vehicle, the vehicle contour of the vehicle is detected and a fourth target detection frame is output, which specifically includes the following process: determining the seventh length of the fourth target detection frame in the vertical direction and the eighth length in the horizontal direction, and outputting the fourth target detection frame when the seventh length and the eighth length meet the fourth preset condition, wherein the fourth preset condition is that the seventh length is greater than or equal to the seventh target number of pixels, and the eighth length is greater than or equal to the eighth target number of pixels, wherein the seventh target number and the eighth target number are any value between 80 and 120, for example, 80, 90, 100, 110, 120, etc. between 80 and 120 can be taken.
[0093] The fourth preset condition corresponding to the vehicle detection algorithm can be set as: the length in the vertical direction is greater than or equal to 80 pixels, the length in the horizontal direction is greater than or equal to 80 pixels, that is, the seventh length must be greater than or equal to 80 pixels, and the eighth length must be greater than or equal to 80 pixels. When the pixels in any direction of the vertical and horizontal directions are lower than the set value, the license plate is considered invisible and no detection is performed. It should be noted that the seventh length and the eighth length set here are both expressed in pixels, indicating the length occupied by the pixel in the picture, and are empirical values, which can be set or adjusted according to actual conditions. The fourth target detection frame has the same pixels in the horizontal and vertical directions.
[0094] In another optional embodiment, the fourth preset condition is set to: the length in the vertical direction is greater than or equal to 120 pixels, and the length in the horizontal direction is greater than or equal to 120 pixels, that is, the third length must satisfy that it is greater than or equal to 120 pixels, and the fourth length must satisfy that it is greater than or equal to 120 pixels. When the pixels in any direction of the vertical and horizontal directions are lower than the set value, no detection is performed.
[0095] In another optional embodiment, the fourth preset condition is set to: the length in the vertical direction is greater than or equal to 100 pixels, and the length in the horizontal direction is greater than or equal to 100 pixels, that is, the third length must satisfy that it is greater than or equal to 100 pixels, and the fourth length must satisfy that it is greater than or equal to 100 pixels. When the pixels in any direction of the vertical and horizontal directions are lower than the set value, no detection is performed.
[0096] Since vehicles and pedestrians are large objects with clear outlines and relaxed pixel requirements, the recall rate obtained by the vehicle detection algorithm and the pedestrian detection algorithm will be significantly better than the recall rate obtained by the license plate detection algorithm and the face detection algorithm.
[0097] In step S206 of the data desensitization processing method, the desensitized area in the source image data is determined based on at least the first type of area and the second type of area, such as Figure 5a The flowchart shown specifically includes the following steps:
[0098] Step S502, when there are a first target detection frame and a third target detection frame in the source image data, taking the area corresponding to the first target detection frame as a desensitization area;
[0099] Step S504, when the first target detection frame exists in the source image data and the third target detection frame does not exist, the area corresponding to the first target detection frame is used as the desensitization area;
[0100] Step S506, when the first target detection frame does not exist in the source image data but the third target detection frame exists, the third target detection frame is processed and the area obtained after the processing is used as the desensitization area;
[0101] Step S508: When the first target detection frame and the third target detection frame do not exist in the source image data, the desensitized area is rejected from being output.
[0102] After the first detection algorithm and the second detection algorithm output different types of areas, it is necessary to determine the desensitized area according to the different types of areas contained in the source image data. This process includes the first judgment algorithm, the second judgment algorithm and the processing algorithm, wherein the input of the first judgment algorithm is the detection result of the face detection algorithm and the detection result of the pedestrian detection algorithm. A voting mechanism is used for these two detection results to finally determine the area that needs to be desensitized. The voting conditions and voting results corresponding to the first judgment algorithm are shown in Table 1 below:
[0103]
[0104]
[0105] The first type of voting condition in Table 1 corresponds to step S502, and the second type of voting condition corresponds to step S504. Since the input of the first judgment algorithm is the detection result of the face detection algorithm and the detection result of the pedestrian detection algorithm, the detection result may include a first type of area corresponding to the first object, that is, a first target detection frame, and may also include a second type of area corresponding to the first object, that is, a third target detection frame. When the first target detection frame and the third target detection frame corresponding to the first object exist in the source image data, the area corresponding to the first target detection frame is used as the desensitized area; when the first target detection frame exists in the source image data but the third target detection frame does not exist, the area corresponding to the first target detection frame is used as the desensitized area; the third type of voting condition in Table 1 corresponds to step S506. When the first target detection frame does not exist in the source image data but the third target detection frame exists, the third target detection frame needs to be processed by the processing algorithm, and the area obtained after the processing is used as the desensitized area; the fourth type of voting condition in Table 1 corresponds to step S508. When the first target detection frame and the third target detection frame do not exist in the source image data, the desensitized area is rejected to be output.
[0106] In the above step S506, the third target detection frame is processed, and the area obtained after the processing is used as the desensitization area, which specifically includes the following steps: fixing the upper frame of the third target detection frame, compressing the other three frames according to the first preset ratio, and using the area corresponding to the compressed third target detection frame as the desensitization area, wherein compressing the other three frames according to the first preset ratio specifically includes: moving the left frame and the right frame of the third target detection frame inward by the first target distance respectively, and moving the lower frame of the third target detection frame upward to the second target distance, wherein the first target distance is any value between 1 / 4 and 1 / 2 of the length of the upper frame of the third target detection frame or the lower frame of the third target detection frame, and the second target distance is any value between 1 / 8 and 1 / 6 of the length of the left frame of the third target detection frame or the right frame of the third target detection frame. It should be noted that the above left and right and up and down are relative concepts, which can be interchanged in some cases, and the extension lines of the upper frame and the lower frame are perpendicular to the extension lines of the left frame and the right frame.
[0107] The above steps correspond to the third type of voting in Table 1, i.e., step S506. Since the third target detection frame in Table 1 is the minimum bounding box containing the entire pedestrian outline obtained by the pedestrian detection algorithm, directly desensitizing and anonymizing it may affect autonomous driving applications such as simulation training, so the third target detection frame needs to be processed. The corresponding processing algorithm is specifically: the upper frame of the third target detection frame is fixed, and the other three frames are compressed inward according to the first preset ratio, so as to achieve the purpose of covering the face without affecting the overall outer contour of the pedestrian. For example, the ratio of a person's head to the body is 1 / 8 to 1 / 6. At the same time, the specific scaling ratio also depends on whether it affects the normal usage data of the application end. A comprehensive evaluation takes 1 / 6, that is, the upper border of the third target detection frame is fixed, and the lower border of the third target detection frame is moved upward to the second target distance. The second target distance is 1 / 6 of the length of the left border of the third target detection frame or the right border of the third target detection frame. According to actual conditions, the left border and the right border of the third target detection frame are respectively moved inward by the first target distance. The first target distance is any value between 1 / 4 and 1 / 2 of the length of the upper border of the third target detection frame or the lower border of the third target detection frame, for example, 1 / 2.
[0108] In an optional embodiment, the proportion of a person's head to the body is 1 / 8 to 1 / 6. When the comprehensive evaluation is 1 / 8, the corresponding processing procedure is: fix the upper border of the third target detection frame, move the lower border of the third target detection frame upward to a second target distance, and the second target distance is 1 / 8 of the length of the left border of the third target detection frame or the right border of the third target detection frame; according to actual conditions, move the left border and the right border of the third target detection frame inward by a first target distance, and the first target distance is any value between 1 / 4 and 1 / 2 of the length of the upper border of the third target detection frame or the lower border of the third target detection frame, for example, 1 / 4.
[0109] In another optional embodiment, the ratio of a person's head to the body is 1 / 8 to 1 / 6. When the comprehensive evaluation is 1 / 7, the corresponding processing procedure is: fixing the upper border of the third target detection frame, moving the lower border of the third target detection frame upward to a second target distance, which is 1 / 7 of the length of the left border of the third target detection frame or the right border of the third target detection frame; according to actual conditions, the left border and the right border of the third target detection frame are respectively moved inward by a first target distance, which is any value between 1 / 4 and 1 / 2 of the length of the upper border of the third target detection frame or the lower border of the third target detection frame, for example, 1 / 3.
[0110] like Figure 5b The schematic diagram of processing the third target detection frame is shown, in which the outer rectangular frame is the minimum external frame of the pedestrian. The upper frame of the outer rectangular frame is fixed, and its left frame and right frame are each moved inward by a distance of 1 / 4 of the length of the upper frame of the original outer rectangular frame or the lower frame of the original outer rectangular frame, and its lower frame is moved upward to 1 / 6 of the length of the left frame of the original outer rectangular frame or the right frame of the original outer rectangular frame to obtain an inner rectangular frame, and the inner rectangular frame is used as the final desensitization area.
[0111] Since pedestrians are non-rigid, they may have different postures in the image. For pedestrians in non-upright postures, such as squatting, the selection method of the desensitization area is different. Similarly, for children under 1.1m in height, the proportion of their head to the body is different from that of adults. After comprehensive evaluation, in special cases, when the height of the pedestrian's minimum external frame is less than 1.1m, the processing algorithm is specifically as follows: fix the upper frame of the pedestrian's minimum external frame, and compress the other three frames inward at any ratio between 1 / 4 and 2 / 7. For example, fix the upper frame of the pedestrian's minimum external frame, move the left and right frames of the minimum external frame inward by 1 / 4 of the length of the upper frame of the original minimum external frame or the lower frame of the original minimum external frame, and move the lower frame of the minimum external frame upward to 1 / 4 of the length of the left frame of the original minimum external frame or the right frame of the original minimum external frame.
[0112] In another optional embodiment, when the height of the pedestrian's minimum external frame is less than 1.1m, the corresponding processing process is: fix the upper frame of the pedestrian's minimum external frame, move the left frame and the right frame of the minimum external frame inward by 2 / 7 of the length of the upper frame of the original minimum external frame or the lower frame of the original minimum external frame, and move the lower frame of the minimum external frame upward to 2 / 7 of the length of the left frame of the original minimum external frame or the right frame of the original minimum external frame.
[0113] In another optional embodiment, when the height of the pedestrian's minimum external frame is less than 1.1m, the corresponding processing process is: fix the upper frame of the pedestrian's minimum external frame, move the left frame and the right frame of the minimum external frame inward by 3 / 11 of the length of the upper frame of the original minimum external frame or the lower frame of the original minimum external frame, and move the lower frame of the minimum external frame upward to 3 / 11 of the length of the left frame of the original minimum external frame or the right frame of the original minimum external frame.
[0114] In step S206 of the data desensitization processing method, the desensitized area in the source image data is determined based on at least the first type of area and the second type of area, such as Figure 6a The flowchart shown specifically includes the following steps:
[0115] Step S602, when the source image data contains a second target detection frame and a fourth target detection frame, taking the area corresponding to the second target detection frame as a desensitization area;
[0116] Step S604, when the second target detection frame exists in the source image data and the fourth target detection frame does not exist, the area corresponding to the second target detection frame is used as the desensitization area;
[0117] Step S606, when the second target detection frame does not exist in the source image data but the fourth target detection frame exists, the fourth target detection frame is processed and the area obtained after the processing is used as the desensitization area;
[0118] Step S608: When the second target detection frame and the fourth target detection frame do not exist in the source image data, the desensitized area is rejected from being output.
[0119] In step S602 to step S608, the second judgment algorithm is used to determine the desensitized area. The input of the second judgment algorithm is the detection result of the license plate detection algorithm and the detection result of the vehicle detection algorithm. A voting mechanism is used for these two detection results to finally determine the area that needs to be desensitized. The voting conditions and voting results corresponding to the second judgment algorithm are as follows
[0120] As shown in Table 2:
[0121]
[0122]
[0123] The first type of voting condition in Table 2 corresponds to step S602, and the second type of voting condition corresponds to step S604. Since the input of the second judgment algorithm is the detection result of the license plate detection algorithm and the detection result of the vehicle detection algorithm, there may be a first type of area corresponding to the second object in the detection result, that is, the second target detection frame, and there may also be a second type of area corresponding to the second object, that is, the fourth target detection frame. In the case that the second target detection frame and the fourth target detection frame exist in the source image data, the area corresponding to the second target detection frame is used as the desensitized area; in the case that the second target detection frame exists in the source image data and the fourth target detection frame does not exist, the area corresponding to the second target detection frame is used as the desensitized area; the third type of voting condition in Table 2 corresponds to step S606. In the case that the second target detection frame does not exist in the source image data and the fourth target detection frame exists, the fourth target detection frame needs to be processed by the processing algorithm, and the area obtained after the processing is used as the desensitized area; the fourth type of voting condition in Table 2 corresponds to step S608. In the case that the second target detection frame and the fourth target detection frame do not exist in the source image data, the desensitized area is rejected.
[0124] In the above step S606, the fourth target detection frame is processed, and the area obtained after the processing is used as the desensitized area, which specifically includes the following steps: taking the geometric center of the fourth target detection frame as the center point, scaling the fourth target detection frame according to a second preset ratio, and using the scaled fourth target detection frame as the desensitized area, wherein scaling the fourth target detection frame according to the second preset ratio specifically includes: determining the distance from any endpoint of the fourth target detection frame to the center point as the first distance; moving the fourth target detection frame inward by a third target distance along the direction from the endpoint to the center point, wherein the third target distance is any value between 1 / 4 of the first distance and 1 / 3 of the first distance, thereby obtaining the scaled fourth target detection frame.
[0125] The above steps correspond to the third type of voting in Table 2, i.e., step S606. Since the fourth target detection frame in Table 2 is the minimum bounding box containing the entire vehicle obtained by the vehicle detection algorithm, directly desensitizing and anonymizing it may affect autonomous driving applications such as simulation training, so the fourth target detection frame needs to be processed. The corresponding processing algorithm is specifically: taking the geometric center of the fourth target detection frame as the center point, scaling the fourth target detection frame inward according to the second preset ratio to achieve the purpose of both blocking the license plate and not affecting the outer contour of the vehicle. The specific scaling ratio depends on whether it affects the normal use of data on the application side. For example, after evaluation by the application side, scaling inward by 1 / 3 will not affect the use of data on the application side, i.e. taking the geometric center of the fourth target detection frame as the center point, determining the distance from any end point of the fourth target detection frame to the center point as the first distance; moving the fourth target detection frame inward along the direction from the end point to the center point by 1 / 3 of the first distance.
[0126] In another optional embodiment, when, after evaluation by the application side, scaling inward by 1 / 4 will not affect the data used by the application side, the corresponding processing procedure is: taking the geometric center of the fourth target detection frame as the center point, determining the distance from any endpoint of the fourth target detection frame to the center point as the first distance; moving the fourth target detection frame inward along the direction from the endpoint to the center point by 1 / 4 of the first distance.
[0127] In another optional embodiment, when, after evaluation by the application side, scaling inward by 2 / 7 will not affect the data used by the application side, the corresponding processing procedure is: taking the geometric center of the fourth target detection frame as the center point, determining the distance from any endpoint of the fourth target detection frame to the center point as the first distance; and moving the fourth target detection frame inward in the direction from the endpoint to the center point by 2 / 7 of the first distance.
[0128] like Figure 6b The schematic diagram of processing the fourth target detection frame is shown, in which the outer rectangular frame is the minimum circumscribed frame of the vehicle, and one of the endpoints is scaled inward by 1 / 3 of the distance from the center point, that is, the distance from any endpoint of the outer rectangular frame to the center point, that is, the first distance, is first determined; after the outer rectangular frame is moved inward along the direction from the endpoint to the center point by 1 / 3 of the first distance, an inner rectangular frame is obtained, and the inner rectangular frame is used as the final desensitized area.
[0129] In the above process, the specific selection process of the desensitized area is as follows: 1. Confirm the specific usage scenario of the application party, such as autonomous driving simulation, algorithm training, etc.; 2. Preliminary evaluation of a scaling ratio, and output the desensitized sample data based on this scaling ratio, generally more than 1w frames of pictures are preferred; 3. Provide sample data to the application party, and confirm the proportion of pictures that do not meet the application requirements through actual measurements. For example, for algorithm training, the proportion of pictures that cannot successfully generate the convolution model is counted. If it is less than 1%, it is considered to meet the application requirements, thereby determining the scaling ratio; if it is greater than 1%, it is considered to not meet the application requirements, and the scaling ratio needs to be re-evaluated and measured again.
[0130] In step S208 of the method for data desensitization, the image data in the desensitization area is desensitized, specifically including the following two methods: randomly moving the pixels in the desensitization area; or, setting all the pixels in the desensitization area to the target color, wherein the color of the pixel is a combination of any one or more of the following colors: red, green, and blue. In an embodiment of the present application, the target color can be black, and the pixel color is mixed in proportion according to the three primary colors of R (red), G (green), and B (blue), and the RGB of black is set to (0, 0, 0), and the multiple colors include two or three of the three colors of red, green, and blue. For example, in the case of only two of the three colors of red, green, and blue, it can be red and green, red and blue, or green and blue.
[0131] The anonymization and desensitization processing method is configurable and can be selected according to the needs of the application. For image data, the anonymized images are time-serialized and stored in the database as a desensitized image set, waiting for the application to call. For video data, the program reads the frame rate and number of frames of the video and converts the video into a sequence of frame images. After the images are anonymized, they are serialized based on the frame rate of the original video and restored to video files. They are stored in the database according to the time sequence of the video packets, waiting for the application to call.
[0132] Through the above steps S202 to S208, by respectively detecting different target objects in the source image data, the first category of areas and the second category of areas in the source image data are obtained, wherein the second category of areas are areas occupied by the target objects in the source image data, and the first category of areas are areas where the target parts of the target objects in the source image data are located. The desensitized areas in the source image data are determined at least based on the first category of areas and the second category of areas, thereby achieving the purpose of desensitizing the source image data based on the desensitized areas, thereby achieving the technical effect of significantly improving the desensitization efficiency, and further solving the technical problem of insufficient recall rate in the related technology of using deep learning algorithms to desensitize privacy data such as faces and license plates in autonomous driving data.
[0133] Figure 7is an architecture diagram of data desensitization processing according to an embodiment of the present application, such as Figure 7 As shown, the source image data is simultaneously input into the first detection algorithm and the second detection algorithm, the first detection algorithm includes the first algorithm and the second algorithm, the second detection algorithm includes the third algorithm and the fourth algorithm, in the embodiment of the present application, the first detection algorithm is a face and license plate detection algorithm, the first algorithm is a face detection algorithm, the second algorithm is a license plate detection algorithm, the third algorithm is a pedestrian detection algorithm, and the fourth algorithm is a vehicle detection algorithm, and the corresponding target image data including the first type of area or the second type of area is obtained. Specifically, the target object in the source image data includes the first object and the second object, and the first type of area corresponding to the first object is obtained by the first algorithm, that is, the first target detection frame, the first type of area corresponding to the second object is obtained by the second algorithm, that is, the second target detection frame, the second type of area corresponding to the first object is obtained by the third algorithm, that is, the third target detection frame, and the second type of area corresponding to the second object is obtained by the fourth algorithm, that is, the fourth target detection frame. The detection results obtained by the first algorithm and the third algorithm are input into the first judgment algorithm, and the detection results obtained by the second algorithm and the fourth algorithm are input into the second judgment algorithm, and the desensitization area is determined according to whether the source image data contains the first type of area or the second type of area. It can minimize missed target detections, ensure the quality of desensitization, and improve the efficiency of desensitization as much as possible to meet the timeliness requirements of business use, thereby achieving a high recall rate for faces and license plates.
[0134] Figure 8 is a structural diagram of a data desensitization processing device according to an embodiment of the present application, such as Figure 8 As shown, the device comprises:
[0135] An acquisition module 802 is used to acquire source image data;
[0136] A detection module 804 is used to detect the target object in the source image data respectively to obtain a first type of region and a second type of region in the source image data, wherein the second type of region is the region occupied by the target object in the source image data, and the first type of region is the region where the target part of the target object in the source image data is located;
[0137] A determination module 806, configured to determine a desensitized area in the source image data based at least on the first type of area and the second type of area;
[0138] The processing module 808 is used to perform desensitization processing on the image data in the desensitization area.
[0139] It should be noted that the data desensitization processing device in the embodiment of the present application is used to perform Figures 2 to 6aThe method of data desensitization processing shown in the figure, therefore the relevant explanations and instructions in the above-mentioned method of data desensitization processing are also applicable to the device for data desensitization processing, and will not be repeated here.
[0140] An embodiment of the present application also provides a non-volatile storage medium, which includes a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to perform the following data desensitization processing method: obtaining source image data; detecting the target object in the source image data respectively to obtain a first type of area and a second type of area in the source image data, wherein the second type of area is the area occupied by the target object in the source image data, and the first type of area is the area where the target part of the target object in the source image data is located; determining a desensitized area in the source image data based on at least the first type of area and the second type of area; and desensitizing the image data in the desensitized area.
[0141] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0142] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0143] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0144] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0145] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0146] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0147] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for data desensitization, characterized in that: include: Get source image data; Detecting the target object in the source image data respectively to obtain a first type of region and a second type of region in the source image data, wherein the second type of region is a region occupied by the target object in the source image data, and the first type of region is a region where a target part of the target object in the source image data is located; Determine a desensitized area in the source image data based at least on the first type of area and the second type of area; Performing desensitization processing on the image data in the desensitization area; The method also includes: the target object includes a first object and a second object, and it is determined that the first object and the second object have an associated relationship in one of the following cases: the first object and the second object are pedestrians in the driving environment of the target vehicle and surrounding vehicles in the environment of the target vehicle; the first object and the second object are passengers in the target vehicle and surrounding vehicles in the driving environment of the target vehicle.
2. The method for data desensitization processing according to claim 1, characterized in that: Detecting the target objects in the source image data respectively to obtain the first type of regions and the second type of regions in the source image data includes: In the case where the first object is a pedestrian, detecting a face image of the pedestrian in the target object, and outputting a first target detection frame, and using the first target detection frame as a first type of region corresponding to the first object, wherein the first target detection frame is a minimum bounding box covering the face information of the first object; or When the second object is a vehicle, the license plate area of the vehicle is detected and a second target detection frame is output, and the second target detection frame is used as the first type of area corresponding to the second object, wherein the second target detection frame is the minimum circumscribed frame covering the license plate information of the vehicle.
3. The method for data desensitization processing according to claim 2, characterized in that: Detecting the license plate area of the vehicle includes: detecting license plate areas of different colors using a test model trained based on a test set including different colors.
4. The method for data desensitization processing according to claim 2, characterized in that: In the case where the first object is a pedestrian, detecting a face image of the pedestrian in the target object and outputting a first target detection frame includes: Determine a first length of the first object detection frame in a vertical direction and a second length in a horizontal direction, and output the first object detection frame when the first length and the second length meet a first preset condition.
5. The method for data desensitization processing according to claim 4, characterized in that: The first preset condition is that the first length is greater than or equal to a first target number of pixels, and the second length is greater than or equal to a second target number of pixels, wherein the first target number and the second target number are any value between 16 and 40.
6. The method for data desensitization processing according to claim 2, characterized in that: In the case where the second object is a vehicle, detecting a license plate area of the vehicle and outputting a second target detection frame includes: Determine a third length of the second object detection frame in the vertical direction and a fourth length in the horizontal direction, and output the second object detection frame when the third length and the fourth length meet a second preset condition.
7. The method for data desensitization processing according to claim 6, characterized in that: The second preset condition is that the third length is greater than or equal to a third target number of pixels, and the fourth length is greater than or equal to a fourth target number of pixels, wherein the third target number is any value between 10 and 20, and the fourth target number is any value between 20 and 40.
8. The method for data desensitization processing according to claim 2, characterized in that: Detecting the target objects in the source image data respectively to obtain the first type of regions and the second type of regions in the source image data includes: In the case where the first object is a pedestrian, detecting the pedestrian contour in the target object, and outputting a third target detection frame, and using the third target detection frame as the second type of area corresponding to the first object, wherein the third target detection frame is a minimum circumscribed frame including the pedestrian contour; or, In the case where the second object is a vehicle, the vehicle contour of the vehicle is detected and a fourth object detection frame is output, and the fourth object detection frame is used as the second type of area corresponding to the second object, wherein the fourth object detection frame is the minimum circumscribed frame including the entire vehicle.
9. The method for data desensitization processing according to claim 8, characterized in that: In the case where the first object is a pedestrian, detecting the pedestrian contour in the target object and outputting a third target detection frame includes: Determine a fifth length of the third object detection frame in the vertical direction and a sixth length in the horizontal direction, and output the third object detection frame when the fifth length and the sixth length meet a third preset condition.
10. The method for data desensitization processing according to claim 9, characterized in that: The third preset condition is that the fifth length is greater than or equal to the fifth target number of pixels, and the sixth length is greater than or equal to the sixth target number of pixels, wherein the fifth target number is any value between 60 and 120, and the sixth target number is any value between 30 and 60.
11. The method for data desensitization processing according to claim 8, characterized in that: In the case where the second object is a vehicle, detecting a vehicle contour of the vehicle and outputting a fourth object detection frame includes: Determine a seventh length of the fourth object detection frame in the vertical direction and an eighth length in the horizontal direction, and output the fourth object detection frame when the seventh length and the eighth length meet a fourth preset condition.
12. The method for data desensitization processing according to claim 11, characterized in that: The fourth preset condition is that the seventh length is greater than or equal to a seventh target number of pixels, and the eighth length is greater than or equal to an eighth target number of pixels, wherein the seventh target number and the eighth target number are both any value between 80 and 120.
13. The method for data desensitization processing according to claim 8, characterized in that: Determining the desensitized area in the source image data at least based on the first type of area and the second type of area includes: When the first target detection frame and the third target detection frame exist in the source image data, taking the area corresponding to the first target detection frame as the desensitization area; When the first target detection frame exists in the source image data and the third target detection frame does not exist, taking the area corresponding to the first target detection frame as the desensitization area; When the first target detection frame does not exist in the source image data but the third target detection frame exists, processing the third target detection frame and using the area obtained after the processing as the desensitization area; When the first target detection frame and the third target detection frame do not exist in the source image data, the desensitized area is refused to be output.
14. The method for data desensitization processing according to claim 13, characterized in that: Processing the third target detection frame and using the area obtained after the processing as the desensitization area includes: The upper border of the third target detection frame is fixed, the other three borders are compressed according to a first preset ratio, and the area corresponding to the compressed third target detection frame is used as the desensitization area.
15. The method for data desensitization processing according to claim 14, characterized in that: Compressing the other three borders according to a first preset ratio includes: moving the left border and the right border of the third target detection frame inward by a first target distance respectively, and moving the lower border of the third target detection frame upward to a second target distance, wherein the first target distance is any value between 1 / 4 and 1 / 2 of the length of the upper border of the third target detection frame or the lower border of the third target detection frame, and the second target distance is any value between 1 / 8 and 1 / 6 of the length of the left border of the third target detection frame or the right border of the third target detection frame.
16. The method for data desensitization processing according to claim 8, characterized in that: Determining the desensitized area in the source image data at least based on the first type of area and the second type of area includes: When the second target detection frame and the fourth target detection frame exist in the source image data, taking the area corresponding to the second target detection frame as the desensitization area; When the second target detection frame exists in the source image data and the fourth target detection frame does not exist, taking the area corresponding to the second target detection frame as the desensitization area; When the second target detection frame does not exist in the source image data but the fourth target detection frame exists, processing the fourth target detection frame and using the area obtained after the processing as the desensitization area; When the second target detection frame and the fourth target detection frame do not exist in the source image data, the desensitized area is refused to be output.
17. The method for data desensitization processing according to claim 16, characterized in that: Processing the fourth target detection frame and using the area obtained after the processing as the desensitization area includes: Taking the geometric center of the fourth target detection frame as the center point, the fourth target detection frame is scaled according to a second preset ratio, and the area corresponding to the scaled fourth target detection frame is used as the desensitized area.
18. The method for data desensitization processing according to claim 17, characterized in that: Scaling the fourth object detection frame according to a second preset ratio includes: Determine a distance from any endpoint of the fourth object detection frame to the center point as a first distance; The fourth target detection frame is moved inward by a third target distance along the direction from the endpoint to the center point, wherein the third target distance is any value between 1 / 4 and 1 / 3 of the first distance.
19. The method for data desensitization processing according to claim 1, characterized in that: Performing desensitization processing on the image data in the desensitization area includes: Randomly move the pixels in the desensitized area; or, All pixels in the desensitized area are set to the target color, wherein the color of the pixel is a combination of any one or more of the following colors: red, green, and blue.
20. A device for data desensitization processing, characterized in that: include: An acquisition module, used for acquiring source image data; a detection module, configured to detect the target object in the source image data respectively, and obtain a first type of region and a second type of region in the source image data, wherein the second type of region is a region occupied by the target object in the source image data, and the first type of region is a region where a target part of the target object in the source image data is located; A determination module, configured to determine a desensitized area in the source image data based at least on the first type of area and the second type of area; A processing module, used for performing desensitization processing on the image data in the desensitization area; The target object includes a first object and a second object, and the device is also used to determine that the first object and the second object have an associated relationship in one of the following situations: the first object and the second object are pedestrians in the driving environment of the target vehicle and surrounding vehicles in the environment of the target vehicle; the first object and the second object are passengers in the target vehicle and surrounding vehicles in the driving environment of the target vehicle.
21. An electronic device, characterized in that: include: A memory for storing program instructions; A processor, connected to the memory, is used to execute program instructions to implement the following functions: obtain source image data; The target object in the source image data is detected separately to obtain a first type of area and a second type of area in the source image data, wherein the second type of area is the area occupied by the target object in the source image data, and the first type of area is the area where the target part of the target object in the source image data is located; a desensitized area in the source image data is determined at least based on the first type of area and the second type of area; the image data in the desensitized area is desensitized; the target object includes a first object and a second object, and it is determined that the first object and the second object have an associated relationship in one of the following cases: the first object and the second object are pedestrians in the driving environment of the target vehicle and surrounding vehicles in the environment of the target vehicle; the first object and the second object are passengers in the target vehicle and surrounding vehicles in the driving environment of the target vehicle.
Citation Information
Patent Citations
Image desensitization method and device, electronic equipment and computer readable storage medium
CN113688837A