A method, device and apparatus for object detection
By generating target timing features and using timing detection models, the problem of low detection accuracy of target object position changes in automated testing is solved, and higher detection accuracy is achieved.
Patent Information
- Application Number
- CN201910989269.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-10-17
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2040-08-10
AI Technical Summary
In automated testing, small changes in the position of the target object result in small differences in depth features, making it difficult to identify the position changes of the target object, reducing detection accuracy.
By acquiring an image collection, extracting a deep feature set and generating target temporal features, the temporal sequence detection model is used for object detection, and the information of multiple frames of images is fused to improve detection accuracy.
The accuracy of object detection is improved, and the accuracy of detection results is enhanced by fusing multi-frame image features.
Smart Images

Figure CN110738211B
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence, and in particular to a method, related apparatus and device for object detection. Background Art
[0002] With the improvement of living standards, people can experience a variety of games anytime and anywhere through terminal devices such as computers, mobile phones and tablets. These games provide users with convenient and fast leisure and entertainment methods and have the effect of relieving stress. In order to better maintain the normal operation of the game, it is usually necessary to perform automated testing on the game.
[0003] In the process of automated testing, it is necessary to detect the target objects in the user interface (UI). At present, the target detection algorithm based on the deep network can be used to detect the location and category of the target object, that is, to extract the deep features of the target object in each frame of the game screen, predict the location of the target object based on the deep features, and perform corresponding operations based on the location of the target object.
[0004] However, since the position change of the target object is often small in a short period of time, the depth features between adjacent frames of game screens detected by the above method are relatively close, resulting in a small difference in the detection results, making it difficult to identify the position change of the target object, thereby reducing the detection accuracy. Summary of the invention
[0005] The embodiments of the present application provide a method, related devices and equipment for object detection, which can fuse the features of adjacent images in the same area to obtain target time series features with time series characteristics. The detection results predicted based on the target time series features are more accurate, thereby improving the detection accuracy.
[0006] In view of this, the first aspect of the present application provides a method for object control, comprising:
[0007] Acquire an image set, wherein the image set includes at least a first image and a second image, and the first image is a previous frame image of the second image;
[0008] Based on the image set, a depth feature set is obtained, wherein the depth feature set includes a first depth feature and a second depth feature, the first depth feature belongs to a depth feature of a region to be detected in the first image, and the second depth feature belongs to a depth feature of a region to be detected in the second image;
[0009] Generating target time series features corresponding to the area to be detected according to the depth feature set;
[0010] Based on the target time series feature, an object detection result is obtained through a time series detection model, wherein the object detection result is a detection result of the area to be detected in the second image.
[0011] A second aspect of the present application provides an object detection device, comprising:
[0012] An acquisition module, used to acquire an image set, wherein the image set includes at least a first image and a second image, and the first image is a previous frame image of the second image;
[0013] The acquisition module is further used to acquire a depth feature set based on the image set, wherein the depth feature set includes a first depth feature and a second depth feature, the first depth feature belongs to a depth feature of a region to be detected in the first image, and the second depth feature belongs to a depth feature of a region to be detected in the second image;
[0014] A generating module, used for generating target time series features corresponding to the area to be detected according to the depth feature set acquired by the acquiring module;
[0015] The acquisition module is further used to obtain an object detection result through a time series detection model based on the target time series features generated by the generation module, wherein the object detection result is a detection result of the area to be detected in the second image.
[0016] In a possible design, in a first implementation of the second aspect of the embodiments of the present application,
[0017] The acquisition module is specifically configured to acquire the first depth feature through the target detection model based on the first image, wherein the first depth feature includes a first feature of the area to be detected at P scales, where P is an integer greater than or equal to 1;
[0018] Based on the second image, acquiring the second depth feature through the target detection model, wherein the second depth feature includes second features of the area to be detected at P scales;
[0019] The depth feature set is generated according to the first depth feature and the second depth feature.
[0020] In a possible design, in a second implementation of the second aspect of the embodiment of the present application,
[0021] The generation module is specifically used to perform cascade processing on the first depth feature and the second depth feature to obtain the target time series feature, wherein the target time series feature is a feature matrix, and the first depth feature and the second depth feature are both feature vectors.
[0022] In a possible design, in a third implementation of the second aspect of the embodiments of the present application,
[0023] The generating module is specifically configured to perform cascade processing on the first feature in the first depth feature and the second feature in the second depth feature based on a first scale to obtain the first target time series feature, wherein the first target time series feature is a feature matrix, the first feature and the second feature are both feature vectors, and the first scale belongs to one of the P scales;
[0024] Based on a second scale, a first feature in the first depth feature and a second feature in the second depth feature are cascaded to obtain a second target time series feature, wherein the second target time series feature is a feature matrix, the second scale belongs to another scale among the P scales, and the second scale and the first scale belong to different scales.
[0025] In a possible design, in a fourth implementation of the second aspect of the embodiments of the present application,
[0026] The acquisition module is specifically used to acquire object detection features through the time series detection model based on the target time series features, wherein the object detection features are feature vectors;
[0027] The object detection result is generated according to the object detection feature, wherein the object detection result includes the occurrence probability, category information and location information of the object in the area to be detected.
[0028] In a possible design, in a fifth implementation of the second aspect of the embodiments of the present application,
[0029] The acquisition module is specifically configured to acquire a first object detection feature through the time series detection model based on the first target time series feature, wherein the first object detection feature is a feature vector;
[0030] Based on the second target time series feature, obtaining a second object detection feature through the time series detection model, wherein the second object detection feature is a feature vector;
[0031] determining a first confidence level based on the first object detection feature;
[0032] determining a second confidence level based on the second object detection feature;
[0033] If the first confidence level is greater than the second confidence level, generating the object detection result according to the first object detection feature, wherein the object detection result includes the probability of occurrence of the object in the area to be detected, category information, and location information;
[0034] If the second confidence level is greater than the first confidence level, the object detection result is generated according to the second object detection feature.
[0035] In a possible design, in a sixth implementation of the second aspect of the embodiments of the present application,
[0036] The acquisition module is also used to, after the acquisition module acquires the object detection result through the timing detection model based on the target timing feature, if the object detection result is determined to include the target object, acquire the auxiliary operation result according to executing the target operation.
[0037] In a possible design, in a seventh implementation manner of the second aspect of the embodiments of the present application, the object detection device further includes a training module;
[0038] The acquisition module is further used to acquire a set of images to be trained, wherein the set of images to be trained includes at least one image to be trained, and the image to be trained carries real annotation information;
[0039] The acquisition module is further used to acquire the prediction annotation information corresponding to the to-be-trained image through the to-be-trained object detection model based on the to-be-trained image set;
[0040] The acquisition module is further used to calculate a first loss function according to the real annotation information of the image to be trained and the predicted annotation information of the image to be trained;
[0041] A training module is used to train and obtain a target detection model when the first loss function converges.
[0042] In a possible design, in an eighth implementation of the second aspect of the embodiments of the present application,
[0043] The acquisition module is specifically used to determine the position information of the predicted bounding box according to the predicted annotation information, wherein the position information of the predicted bounding box includes the central horizontal coordinate value, the central vertical coordinate value, the height value and the width value of the predicted bounding box;
[0044] Determine the position information of the real bounding box according to the real annotation information, wherein the position information of the real bounding box includes a central abscissa value, a central ordinate value, a height value, and a width value of the real bounding box;
[0045] Determining the confidence level of the bounding box based on the obtained real annotation information and the predicted annotation information;
[0046] Determining a prediction category according to the prediction annotation information;
[0047] Determine the real category according to the real annotation information;
[0048] The first loss function is calculated based on the position information of the predicted bounding box, the position information of the true bounding box, the frame confidence, the predicted category, and the true category.
[0049] In a possible design, in a ninth implementation of the second aspect of the embodiment of the present application,
[0050] The acquisition module is specifically used to acquire a video to be processed, wherein the video to be processed includes multiple frames of images to be processed;
[0051] Deduplication processing is performed on the video to be processed to obtain the image set to be trained.
[0052] In a possible design, in a tenth implementation manner of the second aspect of the embodiments of the present application,
[0053] The acquisition module is specifically used to acquire a video to be processed, wherein the video to be processed includes multiple frames of images to be processed;
[0054] Obtaining the object size of the object to be trained in the image to be processed;
[0055] If the object size of the object to be trained is greater than or equal to the size threshold, the image to be processed is determined to be the image to be trained.
[0056] In a possible design, in an eleventh implementation manner of the second aspect of the embodiments of the present application,
[0057] The acquisition module is further used to acquire a set of images to be trained, wherein the set of images to be trained includes a plurality of images to be trained, and the images to be trained carry real annotation information;
[0058] The generating module is further used to generate a set of samples to be trained according to the set of images to be trained, wherein the set of samples to be trained includes at least one sample to be trained, and the sample to be trained includes a plurality of images to be trained;
[0059] The acquisition module is further used to acquire the prediction labeling information corresponding to the to-be-trained samples through the to-be-trained time series detection model based on the to-be-trained sample set generated by the generation module;
[0060] The acquisition module is further used to calculate a second loss function according to the real labeling information of the sample to be trained and the predicted labeling information of the image to be trained;
[0061] The training module is also used to train a time series detection model when the second loss function converges.
[0062] A third aspect of the present application provides an electronic device, including: a memory, a transceiver, a processor, and a bus system;
[0063] Wherein, the memory is used to store programs;
[0064] The processor is used to execute the program in the memory, including executing the method described in any one of the first aspects above;
[0065] The bus system is used to connect the memory and the processor so that the memory and the processor can communicate with each other.
[0066] A fourth aspect of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the methods described in the above aspects.
[0067] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
[0068] In an embodiment of the present application, a method for object detection is provided, wherein an image set is first obtained, the image set includes at least a first image and a second image, and then a depth feature set is obtained based on the image set, and then a target time series feature corresponding to the area to be detected is generated based on the first depth feature and the second depth feature, and finally an object detection result is obtained through a time series detection model based on the target time series feature, and the object detection result is a detection result of the area to be detected in the second image. In the above manner, the depth features of multiple frames of adjacent images are extracted, and the features of adjacent images in the same area are fused to obtain a target time series feature with time series. Since the target time series feature utilizes the information of multiple images, the detection result predicted based on the target time series feature is more accurate, thereby improving the detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] Figure 1 A schematic diagram of the architecture of an object detection system in an embodiment of the present application;
[0070] Figure 2A A schematic diagram of a display scale based on a virtual scene in an embodiment of the present application;
[0071] Figure 2B This is another schematic diagram of a display scale based on a virtual scene in an embodiment of the present application;
[0072] Figure 3 A schematic diagram of an embodiment of a method for object detection in an embodiment of the present application;
[0073] Figure 4 A schematic diagram of the structure of the target detection network in the embodiment of the present application;
[0074] Figure 5 A schematic diagram of the structure of a timing detection network in an embodiment of the present application;
[0075] Figure 6 This is a schematic diagram of a target detection network structure based on multi-scale extraction in an embodiment of the present application;
[0076] Figure 7 This is a schematic diagram of a time sequence detection network structure based on three-frame continuous image detection in an embodiment of the present application;
[0077] Figure 8 This is a schematic diagram of an embodiment based on single-scale object detection in an embodiment of the present application;
[0078] Fig. 9 This is a schematic diagram of an embodiment based on multi-scale object detection in an embodiment of the present application;
[0079] Fig.10 A schematic diagram of a flow chart of an object detection framework in an embodiment of the present application;
[0080] Fig.11 A schematic diagram of an embodiment of an object detection device in an embodiment of the present application;
[0081] Fig.12 This is a schematic diagram of another embodiment of the object detection device in the embodiment of the present application;
[0082] Fig.13 A schematic diagram of the structure of a terminal device in an embodiment of the present application;
[0083] Fig.14 A structural diagram of a server in an embodiment of the present application. DETAILED DESCRIPTION
[0084] The embodiments of the present application provide a method, related devices and equipment for object detection, which can fuse the features of adjacent images in the same area to obtain target time series features with time series characteristics. The detection results predicted based on the target time series features are more accurate, thereby improving the detection accuracy.
[0085] The terms "first", "second", "third", "fourth", etc. (if any) 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, for example. In addition, the terms "including" and "corresponding to" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0086] It should be understood that the method provided in this application can realize the detection of objects based on the computer vision technology (Computer Vision, CV) of artificial intelligence (AI). Artificial intelligence is the theory, method, technology and application system of simulating, extending and expanding human intelligence, perceiving the environment, acquiring knowledge and using knowledge to obtain the best results by using digital computers or machines controlled by digital computers. In other words, artificial intelligence is a comprehensive technology of computer science, which attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that the machines have the functions of perception, reasoning and decision-making. Artificial intelligence technology is a comprehensive discipline involving a wide range of fields, including both hardware-level technology and software-level technology. Basic artificial intelligence technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0087] Computer vision technology Computer vision is a science that studies how to make machines "see". To put it more specifically, it refers to machine vision such as using cameras and computers to replace human eyes to identify, track and measure targets, and further perform graphic processing so that the computer processing becomes an image that is more suitable for human eye observation or transmission to instrument detection. As a scientific discipline, computer vision studies related theories and technologies, and attempts to establish an artificial intelligence system that can obtain information from images or multi-dimensional data. Computer vision technology usually includes image processing, image recognition, image semantic understanding, image retrieval, optical character recognition (OCR), video processing, video semantic understanding, video content / behavior recognition, three-dimensional object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous positioning and mapping, and other technologies, as well as common biometric recognition technologies such as face recognition and fingerprint recognition.
[0088] It should be understood that the object detection method provided in this application can be applied to automated testing scenarios, human-machine battle scenarios or intelligent teammate assistance scenarios, and can also be applied to intelligent demonstration scenarios, etc. Taking the human-machine battle scenario as an example, the machine can detect the location of different objects in the game screen based on the object detection method. When the location of the real player is detected, the real player can be attacked. Operations such as launching attacks. Taking the intelligent teammate assistance scenario as an example, the machine can detect the location of different objects in the game screen based on the object detection method. When the location of the opponent player or the location of the non-player character (NPC) is detected, the opponent player or NPC can be attacked. Operations such as launching attacks, thereby achieving the purpose of assisting real players. Taking the intelligent demonstration scenario as an example, the machine can detect the location of different buttons in the application screen based on the object detection method. When the start button is detected, the user is shown the operation of simulating clicking the start button, and when the close button is detected, the user is shown the operation of simulating clicking the close button.
[0089] The following will take the automated testing scenario as an example to introduce that automated testing can be used to test different types of applications, including but not limited to interactive applications, instant messaging applications, and video applications. Among them, interactive applications include but are not limited to shooting games (STG), multiplayer online tactical competitive games (MOBA), and role-playing games (RPG). Automated testing can improve the efficiency of application production, such as reducing the difficulty of coding rules and behavior trees, testing games, and level generation. For automated testing of games, an important task is to identify different objects in the user interface (UI), including detecting the type of object and the location of the object, and executing the corresponding action strategy based on the detection results, that is, controlling the operation of the game through the program interface to simulate the user's behavior.
[0090] For ease of understanding, this application proposes a method for object detection, which is applied to Figure 1 The object detection system shown in Figure 1 , Figure 1 This is a schematic diagram of the architecture of the object detection system in the embodiment of the present application. As shown in the figure, it is first necessary to train a detection model, which includes two parts, namely a target detection model and a timing detection model, and then use the detection model to detect and identify the image. The detection object of the target detection model is a single-frame image, and the detection object of the timing detection model is a multi-frame image. In the process of detection, it can be divided into two implementation methods, namely online detection and offline detection. The following will be explained separately: During online detection, the target detection model and the timing detection model are both stored in the server. After the client collects the image to be detected, the image to be processed is transmitted to the server, and the server uses the target detection model and the timing detection model to detect the image to be detected, and then the detection result is fed back to the client, and the client displays the detection result. During offline detection, the target detection model and the timing detection model are both stored locally in the terminal device. After the client collects the image to be detected, the image to be processed is input into the locally stored detection model, thereby obtaining the output detection result, and the client directly displays the detection result.
[0091] It should be noted that the client is deployed on a terminal device, wherein the terminal device includes but is not limited to tablet computers, laptop computers, PDAs, mobile phones, voice interaction devices and personal computers (PCs), which are not limited here. Among them, the voice interaction device includes but is not limited to smart speakers and smart home appliances.
[0092] In the automated testing of STG games, the target objects to be detected will be affected by different game scenarios. For ease of introduction, please refer to Figure 2A and Figure 2B , Figure 2A This is a schematic diagram of a display scale based on a virtual scene in an embodiment of the present application. Figure 2B This is another display scale schematic diagram based on a virtual scene in an embodiment of the present application, as shown in the figure, Figure 2A The target object (the area indicated by A1) is located on the right side of the screen. Figure 2B The target object (the area indicated by A2) is located on the left side of the screen, and Figure 2A The scale of the target object is relative to Figure 2B It is relatively large for the scale of the target object.
[0093] With the research and advancement of artificial intelligence technology, artificial intelligence technology has been studied and applied in many fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned driving, automatic driving, drones, robots, smart medical care, smart customer service, etc. I believe that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.
[0094] Combined with the above introduction, the object detection method in this application is introduced below. Figure 3 , an embodiment of the method for object detection in the embodiment of the present application includes:
[0095] 101. Acquire an image set, wherein the image set includes at least a first image and a second image, and the first image is a previous frame image of the second image;
[0096] In this embodiment, the object detection device first obtains an image set, wherein the image set includes multiple frames of images, that is, at least a first image and a second image, and the first image and the second image to be predicted are two adjacent images. It should be noted that the object detection device in this application can be deployed on a terminal device or on a server, which is not limited at this time.
[0097] It should be noted that the image set may also include 3 frames of images to be predicted, or other numbers of images to be predicted, and the time interval between two adjacent frames of images to be predicted may be 0.2 seconds, or other time intervals may be set, which are not limited here.
[0098] 102. Based on the image set, obtain a depth feature set, wherein the depth feature set includes a first depth feature and a second depth feature, the first depth feature belongs to a depth feature of a region to be detected in the first image, and the second depth feature belongs to a depth feature of a region to be detected in the second image;
[0099] In this embodiment, the object detection device inputs the image set into the target detection model, and the target detection model outputs a depth feature set. Specifically, it is assumed that the first image includes N areas to be detected, and the second image also includes R areas to be detected, and R is an integer greater than or equal to 1. The kth area to be detected in the first image is input into the target detection model, and the target detection model outputs the first depth feature. The kth area to be detected in the first image is input into the target detection model, and the target detection model outputs the first depth feature. The kth area to be detected in the second image corresponding to the first image is input into the target detection model, and the target detection model outputs the second depth feature. The first depth feature refers to the abstract information extracted from the area to be detected in the first image, represented as a multi-dimensional feature vector. The second depth feature refers to the abstract information extracted from the area to be detected in the second image, represented as a multi-dimensional feature vector.
[0100] For easier understanding, see Figure 4 , Figure 4 This is a structural diagram of the target detection network in the embodiment of the present application. As shown in the figure, taking the target detection network You only look once (YOLO) network as an example, the YOLO network can use the deep network 53 (Darknet53) to realize the extraction of deep features. Darknet53 is a deep network containing 53 convolutional layers. The Darknet53 deep network can better utilize the graphics processing unit (Graphics Processing Unit, GPU), and the number of residual layers used is relatively small. This makes the prediction using the Darknet53 deep network more efficient and faster. The YOLO network rasterizes the input image to obtain P*P units, each unit is a detection area, and the area to be detected is the area to be detected. The YOLO network can output the deep features of each area to be detected, and the deep features contain the abstract information of the area to be detected. Among them, Figure 4 The ×2 in the figure indicates that the structure is repeated twice, and the ×8 indicates that the structure is repeated eight times.
[0101] It should be noted that the target detection network can also be a single shot multi-box detector (SSD), a region convolutional neural network (R-CNN), a fast region convolutional neural network (Fast R-CNN) and a faster region convolutional neural network (Faster R-CNN). This application takes the YOLO network as an example, but this should not be understood as a limitation of the present application.
[0102] 103. Generate target time series features corresponding to the area to be detected according to the depth feature set;
[0103] In this embodiment, the object detection device generates a target time series feature corresponding to the kth area to be detected based on the first depth feature and the second depth feature. Assuming that the first depth feature is a 1×N-dimensional feature vector and the second depth feature is a 1×N-dimensional feature vector, the target time series feature is a 2×N feature matrix. It can be understood that N represents the dimension. It can be understood that the target time series feature represents the features corresponding to adjacent multiple frames of images.
[0104] 104. Based on the target time series feature, obtain an object detection result through a time series detection model, wherein the object detection result is a detection result of the area to be detected in the second image.
[0105] In this embodiment, the object detection device inputs the target time series features into the time series detection model, and the time series detection model outputs the object detection results. The object detection results include the detection results corresponding to the kth area to be detected in the second image. The detection results include but are not limited to the probability of occurrence of the target object and the category of the target object.
[0106] For ease of introduction, see Figure 5 , Figure 5This is a structural diagram of a timing detection network in an embodiment of the present application. As shown in the figure, after obtaining the depth features of the kth region in the nth frame and the depth features of the kth region in the n+1th frame, the two depth features are cascaded to obtain the target timing features, and the target timing features are input into the timing detection network, wherein the timing detection network may include a long short term memory (LSTM) network and a fully connected layer (FC layer). The LSTM network is a time recurrent neural network, and the FC layer can convert the feature matrix into a feature vector, such as obtaining a 1×M feature vector, and obtaining the detection result corresponding to the kth region in the n+1th frame according to the 1×M feature vector. It should be noted that the cascade processing means merging two or more feature vectors. Assuming that the first depth feature is a 1×N feature vector and the second depth feature is a 1×N feature vector, the cascaded target timing features of 2×N are obtained, that is, a 2×N feature matrix is obtained. When cascading, the first depth feature can be placed before the second depth feature, or the first depth feature can be placed after the second depth feature, which is not limited here.
[0107] In an embodiment of the present application, a method for object detection is provided, wherein an image set is first obtained, the image set includes at least a first image and a second image, and then a depth feature set is obtained based on the image set, and then a target time series feature corresponding to the area to be detected is generated based on the first depth feature and the second depth feature, and finally an object detection result is obtained through a time series detection model based on the target time series feature, and the object detection result is a detection result of the area to be detected in the second image. In the above manner, the depth features of multiple frames of adjacent images are extracted, and the features of adjacent images in the same area are fused to obtain a target time series feature with time series. Since the target time series feature utilizes the information of multiple images, the detection result predicted based on the target time series feature is more accurate, thereby improving the detection accuracy.
[0108] Optionally, in the above Figure 3 On the basis of the corresponding embodiments, in a first optional embodiment of the object control method provided in the embodiment of the present application, obtaining a depth feature set based on an image set may include:
[0109] Based on the first image, obtaining a first depth feature through the target detection model, wherein the first depth feature includes a first feature of the area to be detected at P scales, where P is an integer greater than or equal to 1;
[0110] Based on the second image, obtaining a second depth feature through the target detection model, wherein the second depth feature includes second features of the area to be detected at P scales;
[0111] A depth feature set is generated according to the first depth feature and the second depth feature.
[0112] In this embodiment, a multi-scale deep feature set extraction method is introduced, where the object detection device inputs a first image into a target detection model, and the target detection model outputs a first deep feature, and the first deep feature includes the first feature of the area to be detected at P scales. In addition, the object detection device also needs to input a second image into the target detection model, and the target detection model outputs a second deep feature, and the first deep feature includes the second feature of the area to be detected at P scales.
[0113] It can be understood that multi-scale includes P scales, and when P is equal to 1, it is the initial scale of the image. When P is greater than 1, the image needs to be segmented. Specifically, assuming that P is equal to 2, it means that the image is segmented into 2*2 areas to be detected. Assuming that P is equal to 3, it means that the image is segmented into 3*3 areas to be detected. By analogy, the larger the scale, the more areas to be detected in the image, and the fewer image features each area to be detected in the image includes. Therefore, feature extraction based on multiple scales has both global overall information and local detailed information, thereby obtaining more comprehensive image information.
[0114] Specifically, for ease of introduction, see Figure 6 , Figure 6 This is a schematic diagram of a target detection network structure based on multi-scale extraction in an embodiment of the present application. As shown in the figure, the target detection network uses Feature Pyramid Networks (FPN) to extract multiple scales, namely, scale one, scale two, and scale three. Figure 6 The number of scales in is only a schematic and should not be construed as limiting the present application. FPN is a feature extractor designed based on the concept of feature pyramid. The predicted image undergoes a series of convolutions to obtain a feature map, which is then upsampled and restored. This increases the size of the feature map while ensuring that high-level semantic information is not lost. The large-size feature map is then used to detect small targets, thereby solving the problem of small targets being difficult to detect. Figure 6 The ×2 in the figure indicates that the structure is repeated 2 times, the ×4 indicates that the structure is repeated 4 times, and the ×8 indicates that the structure is repeated 8 times.
[0115] Taking the first image as an example, the first image is input to Figure 6 The target detection model shown in FIG. 1 outputs a first feature at a first scale, a first feature at a second scale, and a first feature at a third scale, all of which belong to a first depth feature. Similarly, the second image is input to Figure 6The target detection model shown in the figure outputs a second feature at a first scale, a second feature at a second scale, and a second feature at a third scale, all of which belong to a second depth feature. A depth feature set is obtained based on the first depth feature and the second depth feature.
[0116] Secondly, in an embodiment of the present application, a multi-scale deep feature set extraction method is provided, that is, based on the first image, the first feature at P scales is obtained through the target detection model, and based on the second image, the second feature at P scales is obtained through the target detection model, and a deep feature set is generated according to the first feature and the second feature at P scales. Through the above method, features at P scales in the image can be extracted, and features at multiple scales can be fused, thereby increasing the utilization rate of image information, and further improving the accuracy and reliability of object detection.
[0117] Optionally, in the above Figure 3 On the basis of the corresponding embodiments, in a second optional embodiment of the object control method provided in the embodiment of the present application, generating the target time series features corresponding to the area to be detected according to the depth feature set may include:
[0118] The first depth feature and the second depth feature are cascaded to obtain a target time series feature, wherein the target time series feature is a feature matrix, and the first depth feature and the second depth feature are both feature vectors.
[0119] In this embodiment, a method for generating target time series features based on a single scale is introduced. After obtaining a depth feature set, the depth features in the depth feature set can be cascaded, that is, the first depth feature and the second depth feature are cascaded to obtain the target time series features. Here, the first depth feature and the second depth feature are both depth features corresponding to the area to be detected, and the first depth feature and the second depth feature are both feature vectors, and the target time series features obtained after cascading belong to the feature matrix. Assuming that the first depth feature is the depth feature of the kth area to be detected in the first image, and the second depth feature is the depth feature of the kth area to be detected in the second image, and assuming that the first depth feature is a 1×N feature vector and the second depth feature is a 1×N feature vector, a 2×N target time series feature is obtained after cascading, that is, a 2×N feature matrix is obtained.
[0120] For ease of understanding, the following will explain the prediction method based on three consecutive frames of images to be predicted. Figure 7 , Figure 7This is a schematic diagram of a timing detection network structure based on three-frame continuous image detection in an embodiment of the present application. As shown in the figure, specifically, assuming that three consecutive frames of images to be predicted are divided into the nth frame image, the n+1th frame image and the n+2th frame image, these three frames of images to be predicted are divided into R regions to be detected, and here the kth region to be detected is cascaded at the same time to obtain the target timing feature corresponding to the kth region to be detected. For R regions to be detected, R timing features can be obtained, and the target timing feature is used as an example for illustration, but this should not be understood as a limitation on the present application.
[0121] After the target time series features pass through the LSTM network in the time series detection model, a feature matrix is obtained, and the feature matrix is converted into a 1×M object detection feature through the FC layer. The detection result of the kth area to be detected in the n+2th frame image is obtained based on the object detection feature detection, that is, the object detection result is obtained. It can be understood that for R areas to be detected, R object detection features can be obtained. Here, the object detection feature corresponding to the kth area to be detected is used as an example for explanation, but this should not be understood as a limitation of the present application.
[0122] Secondly, in the embodiment of the present application, a method for generating target time series features based on a single scale is provided, that is, the first depth feature and the second depth feature are cascaded to obtain the target time series feature, the target time series feature is a feature matrix, and the first depth feature and the second depth feature are both feature vectors. Through the above method, multiple depth features under a single scale can be fused, thereby increasing the feature quantity and obtaining a time series feature with multi-frame image information. Using the time series feature as the input of the model, more accurate detection results can be predicted.
[0123] Optionally, in the above Figure 3 On the basis of the corresponding embodiments, in a third optional embodiment of the object control method provided in the embodiment of the present application, generating the target time series features corresponding to the area to be detected according to the depth feature set may include:
[0124] Based on the first scale, a first feature in the first depth feature and a second feature in the second depth feature are cascaded to obtain a first target time series feature, wherein the first target time series feature is a feature matrix, the first feature and the second feature are both feature vectors, and the first scale belongs to one of the P scales;
[0125] Based on the second scale, the first feature in the first depth feature and the second feature in the second depth feature are cascaded to obtain a second target time series feature, wherein the second target time series feature is a feature matrix, the second scale belongs to another scale among the P scales, and the second scale and the first scale belong to different scales.
[0126] In this embodiment, a method for generating target time series features based on multiple scales is introduced. After obtaining a depth feature set, the depth features in the depth feature set can be cascaded, that is, the first depth feature and the second depth feature are cascaded to obtain the target time series feature. Here, the first depth feature and the second depth feature both include depth features at different scales. For ease of introduction, this application is illustrated by taking two different scales as examples, namely the first scale and the second scale, respectively. The first feature in the first depth feature and the second feature in the second depth feature both belong to feature vectors. At the first scale, the first image includes R1 areas to be detected, and the second image also includes R1 areas to be detected. The first feature corresponding to the kth area to be detected in the first image and the second feature corresponding to the kth area to be detected in the second image are cascaded. And assuming that the first feature is a 1×N feature vector and the second feature is a 1×N feature vector, a 2×N first target time series feature is obtained after cascading, that is, a 2×N feature matrix is obtained. Wherein, k is an integer greater than or equal to 1 and less than or equal to R1.
[0127] Similarly, at the second scale, the first image includes R2 areas to be detected, and the second image also includes R2 areas to be detected. The first feature corresponding to the kth area to be detected in the first image and the second feature corresponding to the kth area to be detected in the second image are cascaded. Assuming that the first feature is a 1×N feature vector and the second feature is a 1×N feature vector, a 2×N second target time series feature is obtained after cascading, that is, a 2×N feature matrix is obtained. Among them, k is an integer greater than or equal to 1 and less than or equal to R2.
[0128] Again, in an embodiment of the present application, a method for generating target time series features based on multiple scales is provided, that is, based on the first scale, the first feature in the first depth feature and the second feature in the second depth feature are cascaded to obtain the first target time series feature, and based on the second scale, the first feature in the first depth feature and the second feature in the second depth feature are cascaded to obtain the second target time series feature. The first depth feature and the second depth feature are cascaded to obtain the target time series feature, the target time series feature is a feature matrix, and the first depth feature and the second depth feature are both feature vectors. Through the above method, feature fusion processing can be performed on multiple depth features at multiple scales, the feature quantity is increased, and a time series feature with multi-frame image information is obtained. Using the time series feature as the input of the model, more accurate detection results can be predicted. In addition, fusing features of multiple scales can also increase the utilization rate of image information, thereby improving the accuracy and reliability of object detection.
[0129] Optionally, in the above Figure 3On the basis of the corresponding embodiments, in a fourth optional embodiment of the object control method provided in the embodiment of the present application, obtaining the object detection result through the time series detection model may include:
[0130] Based on the target time series feature, an object detection feature is obtained through a time series detection model, wherein the object detection feature is a feature vector;
[0131] An object detection result is generated according to the object detection feature, wherein the object detection result includes the occurrence probability, category information and location information of the object in the area to be detected.
[0132] In this embodiment, a method for generating object detection results based on a single scale is introduced. For the sake of convenience, the following will be combined with Figure 8 For instructions, see Figure 8 , Figure 8 This is a schematic diagram of an embodiment based on single-scale object detection in an embodiment of the present application. As shown in the figure, assume that the first image is image A and the second image is image B. Assume that image A is divided into 3×3 areas to be detected and image B is also divided into 3×3 areas to be detected. First, extract the first depth feature (1×N feature vector) of area 1 in image A, and extract the second depth feature (1×N feature vector) of area 1 in image B. Then, cascade the first depth feature and the second depth feature of area 1 to obtain the target time series feature (2×N feature matrix) corresponding to area 1. Then, input the target time series feature corresponding to area 1 into the time series detection model to obtain the object detection feature corresponding to area 1. Determine the object detection result based on the object detection feature. The object detection result includes the probability of occurrence of the object in area 1, category information and location information. Figure 8 For example, the object detection result can be that the probability of object occurrence is 1, the category information is "lurker", the position information includes the center horizontal coordinate value, the center vertical coordinate value, the height value and the width value, the center horizontal coordinate value x is 50, the center vertical coordinate value y is 70, the height value h is 30, and the width value w is 15.
[0133] Similarly, the first depth feature (1×N feature vector) of region 2 in image A is extracted, and the second depth feature (1×N feature vector) of region 2 in image B is extracted, and then the first depth feature and the second depth feature of region 2 are cascaded to obtain the target time series feature (2×N feature matrix) corresponding to region 2, and then the target time series feature corresponding to region 2 is input into the time series detection model to obtain the object detection feature corresponding to region 2. The object detection result is determined according to the object detection feature, and the object detection result includes the probability of occurrence of the object in region 2, category information, and position information.
[0134] Furthermore, in an embodiment of the present application, a method for generating object detection results based on a single scale is provided, that is, based on the target time series features, the object detection features are obtained through the time series detection model, and then the object detection results are generated according to the object detection features. Through the above method, the object detection features under a single scale can be directly used without secondary processing of the object detection features, thereby improving the efficiency of model prediction.
[0135] Optionally, in the above Figure 3 On the basis of the corresponding embodiments, in a fifth optional embodiment of the object control method provided in the embodiment of the present application, obtaining the object detection result through the time series detection model based on the target time series feature may include:
[0136] Based on the first target time series feature, obtaining a first object detection feature through a time series detection model, wherein the first object detection feature is a feature vector;
[0137] Based on the second target time series feature, obtaining a second object detection feature through a time series detection model, wherein the second object detection feature is a feature vector;
[0138] determining a first confidence level based on the first object detection feature;
[0139] determining a second confidence level based on the second object detection feature;
[0140] If the first confidence level is greater than the second confidence level, generating an object detection result according to the first object detection feature, wherein the object detection result includes the probability of occurrence of the object in the area to be detected, category information, and location information;
[0141] If the second confidence level is greater than the first confidence level, an object detection result is generated according to the second object detection feature.
[0142] In this embodiment, a method for generating object detection results based on multiple scales is introduced. For the sake of convenience, the following will be combined with Fig. 9 For instructions, see Fig. 9 , Fig. 9 This is a schematic diagram of an embodiment based on multi-scale object detection in an embodiment of the present application. As shown in the figure, assuming that the first image is image A and the second image is image B, assuming that image A has two scales, image A is divided into 3×3 areas to be detected at the first scale, and image A is divided into 4×4 areas to be detected at the second scale. Image A also has two scales, image B is divided into 3×3 areas to be detected at the first scale, and image B is divided into 4×4 areas to be detected at the second scale.
[0143] At the first scale, the first feature (1×N feature vector) of region 1 in image A is first extracted, and the second feature (1×N feature vector) of region 1 in image B is extracted, and then the first feature and the second feature of region 1 are cascaded to obtain the first target temporal feature (2×N feature matrix) corresponding to region 1, and then the first target temporal feature corresponding to region 1 is input into the temporal detection model, thereby obtaining the first object detection feature corresponding to region 1. Similarly, the first feature (1×N feature vector) of region 2 in image A is first extracted, and the second feature (1×N feature vector) of region 2 in image B is extracted, and then the first feature and the second feature of region 2 are cascaded to obtain the first target temporal feature (2×N feature matrix) corresponding to region 2, and then the first target temporal feature corresponding to region 2 is input into the temporal detection model, thereby obtaining the first object detection feature corresponding to region 2, that is, object detection feature A.
[0144] At the second scale, the first feature (1×N feature vector) of region 3 in image A is first extracted, and the second feature (1×N feature vector) of region 3 in image B is extracted, and then the first feature and the second feature of region 3 are cascaded to obtain the second target temporal feature (2×N feature matrix) corresponding to region 3, and then the second target temporal feature corresponding to region 3 is input into the temporal detection model, thereby obtaining the second object detection feature corresponding to region 3. Similarly, the first feature (1×N feature vector) of region 4 in image A is first extracted, and the second feature (1×N feature vector) of region 4 in image B is extracted, and then the first feature and the second feature of region 4 are cascaded to obtain the second target temporal feature (2×N feature matrix) corresponding to region 4, and then the second target temporal feature corresponding to region 4 is input into the temporal detection model, thereby obtaining the second object detection feature corresponding to region 4, that is, object detection feature B.
[0145] After obtaining the first object detection feature and the second object detection feature, the non-maximum suppression (NMS) method can be used to select an object detection feature to generate the final object detection result. First, a confidence score is generated for each object detection feature, and then sorted according to the confidence score, and the bounding box (BBox) with the highest confidence is selected. Then the BBoxes corresponding to the remaining object detection features are traversed. If the overlapping area (Intersection over Union, IoU) with the current highest-scoring BBox is greater than the threshold, the BBox corresponding to the object detection feature is deleted. Finally, the highest-scoring BBox is selected from the unprocessed BBoxes, and the above process is repeated until all BBoxes corresponding to the object detection features are processed.
[0146] Taking the first object detection feature and the second object detection feature as an example, the first confidence of the first object detection feature and the second confidence of the second object detection feature are obtained, and the object detection result is generated based on the object detection feature with higher confidence, thereby obtaining the probability of object occurrence, category information and location information in the area to be detected.
[0147] Furthermore, in an embodiment of the present application, a method for generating object detection results based on multiple scales is provided, that is, for the case of multi-scale feature extraction, multiple object detection features will be obtained, and the confidences corresponding to different object detection features will be calculated respectively, and finally the object detection results will be generated according to the object detection features with greater confidence. Through the above method, redundant detection results can be removed, and a more accurate detection result can be retained as the final object detection result, thereby improving the accuracy of object detection.
[0148] Optionally, in the above Figure 3 On the basis of the corresponding embodiments, in a sixth optional embodiment of the object control method provided in the embodiment of the present application, after obtaining the object detection result through the time series detection model based on the target time series feature, it may also include:
[0149] If the object detection result is determined to include the target object, the target operation is performed to obtain the auxiliary operation result.
[0150] In this embodiment, a method for performing auxiliary operations in combination with object detection results is introduced, that is, determining whether a target object exists based on the object detection results, and if a target object exists, performing a target operation on the target object according to an association strategy, thereby obtaining an auxiliary operation result.
[0151] For ease of introduction, see Fig.10 , Fig.10This is a flow chart of an object detection framework in an embodiment of the present application. As shown in the figure, taking the AI operation of a shooting game as an example, specifically:
[0152] In step S1, a video of a shooting game is recorded, and images to be trained are collected from the recorded video;
[0153] In step S2, the object detection features are annotated by a worker or by a machine, and the annotated content includes whether the object to be trained exists in the image to be trained and the location information of the object to be trained;
[0154] In step S3, the YOLO network is trained based on the labeled training images;
[0155] In step S4, the feature pyramid of the image to be predicted is extracted using the trained YOLO network to obtain deep features at P scales;
[0156] In step S5, the deep features of the continuous multi-frame object detection features are cascaded to obtain time series features, and the time series features are input into the LSTM network, and the LSTM network outputs the object detection features;
[0157] In step S6, a target object in the battle game is detected based on the object detection feature;
[0158] In step S7, the AI is assisted to perform corresponding operations according to information such as the type and location of the target object. For ease of explanation, please refer to Table 1, which is a schematic diagram of a corresponding relationship between the association strategy between the object and the operation.
[0159] Table 1
[0160] Object operate Guardian Talk to the Guardian Lurker Use normal skills to attack lurkers Little Monster Use normal skills to attack small monsters Big Monster Use spells to attack big monsters Grass To hide blacksmith Talk to the Blacksmith
[0161] It can be seen that the target object belongs to one of the objects, and the target operation is the operation corresponding to the object. It can be understood that the association strategy shown in Table 1 is only a schematic and should not be understood as a limitation on the present application.
[0162] Secondly, in the embodiment of the present application, a method for performing auxiliary operations in combination with object detection results is provided, that is, if the object detection result is determined to include a target object, the target operation is performed to obtain the auxiliary operation result. In the above manner, a pre-specified execution strategy can be adopted to select the corresponding target operation for the output object detection result, thereby achieving operation results such as automated testing or human-computer combat, and improving the practicality and operability of the solution.
[0163] Optionally, in the above Figure 3 On the basis of the corresponding embodiments, in a seventh optional embodiment of the object control method provided in the embodiment of the present application, the method may further include:
[0164] Acquire a set of images to be trained, wherein the set of images to be trained includes at least one image to be trained, and the image to be trained carries real annotation information;
[0165] Based on the set of images to be trained, the prediction annotation information corresponding to the images to be trained is obtained through the object detection model to be trained;
[0166] Calculate a first loss function according to the real annotation information of the image to be trained and the predicted annotation information of the image to be trained;
[0167] When the first loss function converges, the target detection model is trained.
[0168] In this embodiment, a training method for a target detection model is introduced. After obtaining a set of images to be trained, it is necessary to annotate the images to be trained in the set of images to be trained, so as to obtain the corresponding real annotation information. The real annotation information includes the category label of the object to be trained (such as a guard label or a lurker label, etc.) and the position information (such as the horizontal coordinate of the upper left corner, the vertical coordinate of the upper left corner, the width of the BBox, and the height of the BBox). After obtaining the real annotation information, the image to be trained is input into the target detection model to be trained, and the target detection model to be trained outputs the predicted annotation information corresponding to the image to be trained. Specifically, taking the target detection model as a YOLO network model as an example, feature extraction is performed through the darknet53 deep network, and then the deep features of each area at different scales are extracted by a feature pyramid, wherein the feature pyramid is a common multi-scale feature extraction method, which fuses the underlying features with the high-level features to improve the discriminability of features of different scales. The deep features here refer to the features output by the convolution layer, which are used to predict the category and position of the target object. Based on the real annotation information and predicted annotation information of the image to be trained, the first loss function is calculated, and the model parameters are optimized by minimizing the first loss function to reduce the difference between the real position information and the predicted position information of the target object, and to reduce the difference between the real category and the predicted category of the target object. The model parameters are updated by gradient back propagation. When the first loss function converges, the target detection model is trained using the current model parameters.
[0169] Furthermore, in an embodiment of the present application, a method for training a target detection model is provided, that is, first obtaining a set of images to be trained, then obtaining the predicted annotation information corresponding to the images to be trained through the target detection model to be trained based on the set of images to be trained, and then calculating the first loss function based on the real annotation information of the images to be trained and the predicted annotation information of the images to be trained. When the first loss function converges, the target detection model is trained. Through the above method, a specific implementation basis is provided for the training of the target detection model, thereby increasing the feasibility and operability of the solution.
[0170] Optionally, in the above Figure 3 On the basis of the corresponding embodiments, in an eighth optional embodiment of the object control method provided by the embodiment of the present application, calculating the first loss function according to the real annotation information of the image to be trained and the predicted annotation information of the image to be trained may include:
[0171] Determine the position information of the predicted bounding box according to the predicted annotation information, wherein the position information of the predicted bounding box includes a central abscissa value, a central ordinate value, a height value, and a width value of the predicted bounding box;
[0172] Determine the position information of the real bounding box according to the real annotation information, wherein the position information of the real bounding box includes a central abscissa value, a central ordinate value, a height value, and a width value of the real bounding box;
[0173] Determine the bounding box confidence based on the actual annotation information and the predicted annotation information;
[0174] Determine the prediction category according to the prediction annotation information;
[0175] Determine the true category based on the true labeling information;
[0176] Based on the position information of the predicted bounding box, the position information of the true bounding box, the bounding box confidence, the predicted category and the true category, a first loss function is calculated.
[0177] In this embodiment, a method for calculating the first loss function is introduced. After obtaining the predicted annotation information and the real annotation information, it is necessary to obtain the position information of the predicted bounding box (BBox) according to the predicted annotation information, and obtain the position information of the real bounding box according to the real annotation information. The position information includes the center horizontal coordinate value, the center vertical coordinate value, the height value and the width value. The position information is used to predict the coordinates. The prediction of the bounding box can use the dimension clustering method, and the sum of the squared error loss is used during the training process.
[0178] The confidence of the bounding box is determined based on the real annotation information and the predicted annotation information, that is, the prior bounding box is obtained using dimensional clustering, and the mean square error loss function is used during training. The confidence of the existence of the object is predicted using a logistic regression strategy. When a real bounding box overlaps more with the bounding box than other priors, the corresponding bounding box confidence is 1. If the prior is not the best, but the overlap exceeds the set threshold (such as 0.5), this prediction is ignored.
[0179] Based on the true category and the predicted category, binary cross entropy loss is used for category prediction, and each bounding box uses multi-label classification to predict the class that the bounding box may contain. The following is a first loss function:
[0180]
[0181] Among them, λ coord represents the first coefficient, and λ noobj represents the second coefficient, Indicates whether the jth bounding box in the i-th grid corresponds to the target object. If so, is 1, otherwise, is 0, Indicates that the jth bounding box in the i-th grid does not correspond to the target object. C represents the bounding box confidence. w represents the width value, h represents the height value, x represents the center horizontal coordinate value, y represents the center vertical coordinate value, and P represents the category.
[0182] It can be understood that the target detection network used in this application can be a YOLO V3 network, which can perform three bounding box predictions at three different scales, thereby obtaining nine cluster centers corresponding to the three scales, namely (10×13), (16×30), (33×23), (30×61), (62×45), (59×119), (116×90), (156×198), and (373×326).
[0183] Furthermore, in the embodiment of the present application, a method for calculating the first loss function is provided, that is, the confidence of the bounding box is determined according to the position information of the predicted bounding box and the position information of the real bounding box, and the first loss function is calculated by combining the predicted category and the real category. Through the above method, a specific basis can be provided for the implementation of the solution, which is conducive to the feasibility and operability of the solution.
[0184] Optionally, in the above Figure 3 On the basis of the corresponding embodiments, in a ninth optional embodiment of the object control method provided in the embodiments of the present application, obtaining a set of images to be trained may include:
[0185] Acquire a video to be processed, wherein the video to be processed includes multiple frames of images to be processed;
[0186] The video to be processed is deduplicated to obtain a set of images to be trained.
[0187] In this embodiment, a method for obtaining images to be trained is introduced. Specifically, first, a recorded video to be processed can be obtained, wherein the video to be processed can be a video recorded for an interactive application, for example, a video recorded by a player during a shooting game. The video to be processed includes multiple frames of images to be processed. Assuming that one frame of processed image is collected every 1 second, a 2-minute video to be processed includes 120 frames of images to be processed. After the collection is completed, samples can be manually screened as images to be trained, or the images to be trained can be automatically screened by the device. The screening rule is to remove redundant images. If redundant images are manually screened, several images can be selected for each scene, and the number of images to be trained in the same scene does not exceed Q, where Q is an integer greater than or equal to 1. If redundant images are automatically screened by the device, the similarity between two adjacent frames of images can be calculated. If the similarity is higher than the similarity threshold, deduplication processing is performed. If the similarity is lower than or equal to the similarity threshold, the frame of the image to be processed is used as the image to be trained.
[0188] For example, if the similarity between the image A to be processed and the image B to be processed is higher than the similarity threshold, the image A to be processed is removed, and then the similarity between the image B to be processed and the image C to be processed is compared. Assuming that the similarity between the image B to be processed and the image C to be processed is lower than or equal to the similarity threshold, the image B to be processed is determined as the image to be trained, and the image C to be trained enters the subsequent similarity comparison process, which will not be elaborated here.
[0189] Furthermore, in an embodiment of the present application, a method for obtaining images to be trained is provided, that is, first obtaining a video to be processed, the video to be processed includes multiple frames of images to be processed, and then performing deduplication processing on the video to be processed to obtain a set of images to be trained. In this way, redundant images can be removed, and the images used in the actual training process have more features, thereby preventing the model from overfitting and providing reliability of model training.
[0190] Optionally, in the above Figure 3 On the basis of the corresponding embodiments, in a tenth optional embodiment of the object control method provided in the embodiments of the present application, obtaining a set of images to be trained may include:
[0191] Acquire a video to be processed, wherein the video to be processed includes multiple frames of images to be processed;
[0192] Obtaining the object size of the object to be trained in the image to be processed;
[0193] If the object size of the object to be trained is greater than or equal to the size threshold, the image to be processed is determined to be the image to be trained.
[0194] In this embodiment, a method for obtaining images to be trained is also introduced. Specifically, a recorded video to be processed can be obtained first, and the video to be processed can be a video recorded for an interactive application. After the acquisition is completed, samples can be manually screened as images to be trained, or the images to be trained can be automatically screened by the device. The screening rule is to remove images with too small target areas. For the case of manually screening images to be trained, it can be determined whether the size of the object to be trained (such as NPCs and obstacles, etc.) in each frame of the image to be processed is too small. If the size of the object to be trained is too small, the frame of the image to be processed is discarded. If the size of the object to be trained is appropriate, the frame of the image to be processed is used as the image to be trained.
[0195] In the case where the device automatically screens the images to be trained, the object size of each object to be trained in the image to be processed can be extracted, where the object size can be expressed in pixels, such as 10*10, or 5*50, and the extracted object size of each object to be trained is compared with the size threshold. If the object size of the object to be trained is greater than or equal to the size threshold, the frame of the image to be processed is determined as the image to be trained. If the object size of the object to be trained is less than the size threshold, the frame of the image to be processed is discarded. It can be understood that the size threshold can be 1 / 400 of the area of the entire image to be processed. In practical applications, other size thresholds can also be set, which are not limited this time.
[0196] Furthermore, in an embodiment of the present application, another method for obtaining an image to be trained is provided, that is, first obtaining a video to be processed, and then obtaining the object size of the object to be trained in the image to be processed, and if the object size of the object to be trained is greater than or equal to the size threshold, the image to be processed is determined to be the image to be trained. In this way, images with too small a target area can be removed, thereby reducing the difficulty of model training and preventing the model from being difficult to converge.
[0197] Optionally, in the above Figure 3 On the basis of the corresponding embodiments, in an eleventh optional embodiment of the object control method provided in the embodiment of the present application, the method may further include:
[0198] Obtaining a set of images to be trained, wherein the set of images to be trained includes a plurality of images to be trained, and the images to be trained carry real annotation information;
[0199] Generate a set of samples to be trained according to the set of images to be trained, wherein the set of samples to be trained includes at least one sample to be trained, and the sample to be trained includes a plurality of images to be trained;
[0200] Based on the set of samples to be trained, the prediction labeling information corresponding to the samples to be trained is obtained through the time series detection model to be trained;
[0201] Calculate a second loss function based on the real labeling information of the sample to be trained and the predicted labeling information of the image to be trained;
[0202] When the second loss function converges, the time series detection model is trained.
[0203] In this embodiment, a training method for a time series detection model is introduced. After obtaining a set of images to be trained, it is necessary to annotate the images to be trained in the set of images to be trained, so as to obtain corresponding real annotation information. The real annotation information includes the category label of the object to be trained (such as a guardian label or a lurker label, etc.) and the position information (such as the horizontal coordinate of the upper left corner, the vertical coordinate of the upper left corner, the width of the BBox, and the height of the BBox). After obtaining the real annotation information, multiple consecutive frames of images to be trained are used as a sample to be trained, and multiple samples to be trained constitute a set of samples to be trained. Next, the samples to be trained are input into the time series detection model to be trained. Specifically, the deep features of different regions of the image are extracted through a deep network, and the deep features of the corresponding regions of adjacent images are input into the time series detection model to be trained (such as an LSTM deep network). The time series detection model to be trained outputs predicted annotation information, and the predicted annotation information includes the probability of occurrence of the target object contained in each region, the category information to which the target belongs, and the position information of the bounding box where the target object is located. According to the real labeling information of the samples to be trained and the predicted labeling information of the images to be trained, the second loss function is calculated. It can be understood that the second loss function can be a smooth-L1 loss function or other types of loss functions, which are not limited this time.
[0204] The model parameters are optimized by minimizing the second loss function to reduce the difference between the real position information and the predicted position information of the target object, as well as the difference between the real category and the predicted category of the target object. The gradient is calculated by the second loss function, and the gradient of the model parameters can be calculated by the gradient backward transfer method according to the gradient. Finally, the model parameters are updated. When the second loss function converges, the current model parameters are used to train the time series detection model.
[0205] Furthermore, in an embodiment of the present application, a training method for a time series detection model is provided, that is, first obtaining a set of images to be trained, then generating a set of samples to be trained based on the set of images to be trained, and then obtaining the predicted annotation information corresponding to the samples to be trained through the time series detection model to be trained based on the set of samples to be trained, and finally calculating the second loss function based on the real annotation information of the samples to be trained and the predicted annotation information of the images to be trained, and when the second loss function converges, the time series detection model is trained. Through the above method, a specific implementation basis is provided for the training of the time series detection model, thereby increasing the feasibility and operability of the solution.
[0206] For ease of introduction, the solution provided by this application will be introduced in conjunction with a specific scenario, and a shooting game will be used as an example for illustration. First, the client obtains multiple frames of continuous images, assuming that they are image 1 and image 2, and the interval between image 1 and image 2 is 0.2 seconds. Next, image 1 and image 2 are input into the target detection model, and the depth features of image 1 and image 2 are extracted through the target detection model. Assume that the depth feature of the area to be detected in image 1 is a 1×N feature vector, and the depth feature of the area to be detected in image 2 is also a 1×N feature vector. These two feature vectors are cascaded to obtain 2×N target timing features. The target timing features are then input into the timing detection model, thereby outputting the object detection features. Assume that the object detection features are expressed as (0.8, 0.1, 0.2, 0.7, 50, 70, 30, 15). Among them, 0.8 represents the probability of the target object appearing. Since 0.8 is greater than 0.5, the target object exists in image 2. 0.1 indicates the probability that the target object is an obstacle, 0.2 indicates the probability that the target object is a guard, and 0.7 indicates the probability that the target object is a lurker. Since 0.7 is greater than 0.2 and greater than 0.1, the target object is a lurker. 50 indicates the central abscissa value of the target object, 70 indicates the central ordinate value of the target object, 30 indicates the height value of the target object, and 15 indicates the width value of the target object.
[0207] Based on the object detection feature, the object detection result is that there is a target object in image 2, and the category information of the target object is "lurker". The "lurker" is represented by a BBox in image 2, and the central horizontal coordinate value of the BBox is 50 pixels, the central vertical coordinate value of the BBox is 70 pixels, the height value of the BBox is 30, and the width value of the BBox is 15. Thus, the target object in the shooting game is identified.
[0208] The object detection device in this application is described in detail below. Fig.11 , Fig.11 This is a schematic diagram of an embodiment of an object detection device in an embodiment of the present application. The object detection device 20 includes:
[0209] An acquisition module 201 is used to acquire an image set, wherein the image set includes at least a first image and a second image, and the first image is an image frame before the second image;
[0210] The acquisition module 201 is further used to acquire a depth feature set based on the image set, wherein the depth feature set includes a first depth feature and a second depth feature, the first depth feature belongs to a depth feature of a region to be detected in the first image, and the second depth feature belongs to a depth feature of a region to be detected in the second image;
[0211] A generating module 202, configured to generate a target temporal feature corresponding to the area to be detected according to the depth feature set acquired by the acquiring module 201;
[0212] The acquisition module 201 is further used to acquire an object detection result through a time series detection model based on the target time series feature generated by the generation module 202, wherein the object detection result is a detection result of the area to be detected in the second image.
[0213] In an embodiment of the present application, a method for object detection is provided, wherein an image set is first obtained, the image set includes at least a first image and a second image, and then a depth feature set is obtained based on the image set, and then a target time series feature corresponding to the area to be detected is generated based on the first depth feature and the second depth feature, and finally an object detection result is obtained through a time series detection model based on the target time series feature, and the object detection result is a detection result of the area to be detected in the second image. In the above manner, the depth features of multiple frames of adjacent images are extracted, and the features of adjacent images in the same area are fused to obtain a target time series feature with time series. Since the target time series feature utilizes the information of multiple images, the detection result predicted based on the target time series feature is more accurate, thereby improving the detection accuracy.
[0214] Optionally, in the above Fig.11 On the basis of the corresponding embodiment, in another embodiment of the object detection device 20 provided in the embodiment of the present application,
[0215] The acquisition module 201 is specifically configured to acquire the first depth feature through the target detection model based on the first image, wherein the first depth feature includes a first feature of the area to be detected at P scales, where P is an integer greater than or equal to 1;
[0216] Based on the second image, acquiring the second depth feature through the object detection model, wherein the second depth feature includes second features of the area to be detected at P scales;
[0217] The depth feature set is generated according to the first depth feature and the second depth feature.
[0218] Secondly, in an embodiment of the present application, a multi-scale deep feature set extraction method is provided, that is, based on the first image, the first feature at P scales is obtained through the target detection model, and based on the second image, the second feature at P scales is obtained through the target detection model, and a deep feature set is generated according to the first feature and the second feature at P scales. Through the above method, features at P scales in the image can be extracted, and features at multiple scales can be fused, thereby increasing the utilization rate of image information, and further improving the accuracy and reliability of object detection.
[0219] Optionally, in the above Fig.11 On the basis of the corresponding embodiment, in another embodiment of the object detection device 20 provided in the embodiment of the present application,
[0220] The generating module 202 is specifically configured to perform cascade processing on the first depth feature and the second depth feature to obtain the target time series feature, wherein the target time series feature is a feature matrix, and the first depth feature and the second depth feature are both feature vectors.
[0221] Secondly, in the embodiment of the present application, a method for generating target time series features based on a single scale is provided, that is, the first depth feature and the second depth feature are cascaded to obtain the target time series feature, the target time series feature is a feature matrix, and the first depth feature and the second depth feature are both feature vectors. Through the above method, multiple depth features under a single scale can be fused, thereby increasing the feature quantity and obtaining a time series feature with multi-frame image information. Using the time series feature as the input of the model, more accurate detection results can be predicted.
[0222] Optionally, in the above Fig.11 On the basis of the corresponding embodiment, in another embodiment of the object detection device 20 provided in the embodiment of the present application,
[0223] The generating module 202 is specifically configured to perform cascade processing on the first feature in the first depth feature and the second feature in the second depth feature based on a first scale to obtain the first target time series feature, wherein the first target time series feature is a feature matrix, the first feature and the second feature are both feature vectors, and the first scale belongs to one of the P scales;
[0224] Based on a second scale, a first feature in the first depth feature and a second feature in the second depth feature are cascaded to obtain a second target time series feature, wherein the second target time series feature is a feature matrix, the second scale belongs to another scale among the P scales, and the second scale and the first scale belong to different scales.
[0225] Again, in an embodiment of the present application, a method for generating target time series features based on multiple scales is provided, that is, based on the first scale, the first feature in the first depth feature and the second feature in the second depth feature are cascaded to obtain the first target time series feature, and based on the second scale, the first feature in the first depth feature and the second feature in the second depth feature are cascaded to obtain the second target time series feature. The first depth feature and the second depth feature are cascaded to obtain the target time series feature, the target time series feature is a feature matrix, and the first depth feature and the second depth feature are both feature vectors. Through the above method, feature fusion processing can be performed on multiple depth features at multiple scales, the feature quantity is increased, and a time series feature with multi-frame image information is obtained. Using the time series feature as the input of the model, more accurate detection results can be predicted. In addition, fusing features of multiple scales can also increase the utilization rate of image information, thereby improving the accuracy and reliability of object detection.
[0226] Optionally, in the above Fig.11 On the basis of the corresponding embodiment, in another embodiment of the object detection device 20 provided in the embodiment of the present application,
[0227] The acquisition module 201 is specifically configured to acquire object detection features through the time series detection model based on the target time series features, wherein the object detection features are feature vectors;
[0228] The object detection result is generated according to the object detection feature, wherein the object detection result includes the occurrence probability, category information and location information of the object in the area to be detected.
[0229] Furthermore, in an embodiment of the present application, a method for generating object detection results based on a single scale is provided, that is, based on the target time series features, the object detection features are obtained through the time series detection model, and then the object detection results are generated according to the object detection features. Through the above method, the object detection features under a single scale can be directly used without secondary processing of the object detection features, thereby improving the efficiency of model prediction.
[0230] Optionally, in the above Fig.11 On the basis of the corresponding embodiment, in another embodiment of the object detection device 20 provided in the embodiment of the present application,
[0231] The acquisition module 201 is specifically configured to acquire a first object detection feature through the time series detection model based on the first target time series feature, wherein the first object detection feature is a feature vector;
[0232] Based on the second target time series feature, obtaining a second object detection feature through the time series detection model, wherein the second object detection feature is a feature vector;
[0233] determining a first confidence level based on the first object detection feature;
[0234] determining a second confidence level based on the second object detection feature;
[0235] If the first confidence level is greater than the second confidence level, generating the object detection result according to the first object detection feature, wherein the object detection result includes the probability of occurrence of the object in the area to be detected, category information, and location information;
[0236] If the second confidence level is greater than the first confidence level, the object detection result is generated according to the second object detection feature.
[0237] Furthermore, in an embodiment of the present application, a method for generating object detection results based on multiple scales is provided, that is, for the case of multi-scale feature extraction, multiple object detection features will be obtained, and the confidences corresponding to different object detection features will be calculated respectively, and finally the object detection results will be generated according to the object detection features with greater confidence. Through the above method, redundant detection results can be removed, and a more accurate detection result can be retained as the final object detection result, thereby improving the accuracy of object detection.
[0238] Optionally, in the above Fig.11 On the basis of the corresponding embodiment, in another embodiment of the object detection device 20 provided in the embodiment of the present application,
[0239] The acquisition module 201 is further used to acquire an auxiliary operation result by performing a target operation after acquiring an object detection result through a time series detection model based on the target time series feature, if the object detection result is determined to include a target object.
[0240] Secondly, in the embodiment of the present application, a method for performing auxiliary operations in combination with object detection results is provided, that is, if the object detection result is determined to include a target object, the target operation is performed to obtain the auxiliary operation result. In the above manner, a pre-specified execution strategy can be adopted to select the corresponding target operation for the output object detection result, thereby achieving operation results such as automated testing or human-computer combat, and improving the practicality and operability of the solution.
[0241] Optionally, in the above Fig.11 Based on the corresponding embodiments, please refer to Fig.12 In another embodiment of the object detection device 20 provided in the embodiment of the present application, the object detection device 20 further includes a training module 203;
[0242] The acquisition module 201 is further used to acquire a set of images to be trained, wherein the set of images to be trained includes at least one image to be trained, and the image to be trained carries real annotation information;
[0243] The acquisition module 201 is further used to acquire the prediction annotation information corresponding to the to-be-trained image through the to-be-trained object detection model based on the to-be-trained image set;
[0244] The acquisition module 201 is further used to calculate a first loss function according to the real annotation information of the image to be trained and the predicted annotation information of the image to be trained;
[0245] The training module 203 is used to train and obtain a target detection model when the first loss function converges.
[0246] Furthermore, in an embodiment of the present application, a method for training a target detection model is provided, that is, first obtaining a set of images to be trained, then obtaining the predicted annotation information corresponding to the images to be trained through the target detection model to be trained based on the set of images to be trained, and then calculating the first loss function based on the real annotation information of the images to be trained and the predicted annotation information of the images to be trained. When the first loss function converges, the target detection model is trained. Through the above method, a specific implementation basis is provided for the training of the target detection model, thereby increasing the feasibility and operability of the solution.
[0247] Optionally, in the above Fig.11 or Fig.12 On the basis of the corresponding embodiment, in another embodiment of the object detection device 20 provided in the embodiment of the present application,
[0248] The acquisition module 201 is specifically configured to determine the position information of the predicted bounding box according to the predicted annotation information, wherein the position information of the predicted bounding box includes a central horizontal coordinate value, a central vertical coordinate value, a height value, and a width value of the predicted bounding box;
[0249] Determine the position information of the real bounding box according to the real annotation information, wherein the position information of the real bounding box includes a central abscissa value, a central ordinate value, a height value, and a width value of the real bounding box;
[0250] Determining the confidence level of the bounding box based on the obtained real annotation information and the predicted annotation information;
[0251] Determining a prediction category according to the prediction annotation information;
[0252] Determine the real category according to the real annotation information;
[0253] The first loss function is calculated based on the position information of the predicted bounding box, the position information of the true bounding box, the frame confidence, the predicted category, and the true category.
[0254] Furthermore, in the embodiment of the present application, a method for calculating the first loss function is provided, that is, the confidence of the bounding box is determined according to the position information of the predicted bounding box and the position information of the real bounding box, and the first loss function is calculated by combining the predicted category and the real category. Through the above method, a specific basis can be provided for the implementation of the solution, which is conducive to the feasibility and operability of the solution.
[0255] Optionally, in the above Fig.11 or Fig.12 On the basis of the corresponding embodiment, in another embodiment of the object detection device 20 provided in the embodiment of the present application,
[0256] The acquisition module 201 is specifically used to acquire a video to be processed, wherein the video to be processed includes multiple frames of images to be processed;
[0257] Deduplication processing is performed on the video to be processed to obtain the image set to be trained.
[0258] Furthermore, in an embodiment of the present application, a method for obtaining images to be trained is provided, that is, first obtaining a video to be processed, the video to be processed includes multiple frames of images to be processed, and then performing deduplication processing on the video to be processed to obtain a set of images to be trained. In this way, redundant images can be removed, and the images used in the actual training process have more features, thereby preventing the model from overfitting and providing reliability of model training.
[0259] Optionally, in the above Fig.11 or Fig.12 On the basis of the corresponding embodiment, in another embodiment of the object detection device 20 provided in the embodiment of the present application,
[0260] The acquisition module 201 is specifically used to acquire a video to be processed, wherein the video to be processed includes multiple frames of images to be processed;
[0261] Obtaining the object size of the object to be trained in the image to be processed;
[0262] If the object size of the object to be trained is greater than or equal to the size threshold, the image to be processed is determined to be the image to be trained.
[0263] Furthermore, in an embodiment of the present application, another method for obtaining an image to be trained is provided, that is, first obtaining a video to be processed, and then obtaining the object size of the object to be trained in the image to be processed, and if the object size of the object to be trained is greater than or equal to the size threshold, the image to be processed is determined to be the image to be trained. In this way, images with too small a target area can be removed, thereby reducing the difficulty of model training and preventing the model from being difficult to converge.
[0264] Optionally, in the above Fig.11 or Fig.12 On the basis of the corresponding embodiment, in another embodiment of the object detection device 20 provided in the embodiment of the present application,
[0265] The acquisition module 201 is further used to acquire a set of images to be trained, wherein the set of images to be trained includes a plurality of images to be trained, and the images to be trained carry real annotation information;
[0266] The generating module 202 is further configured to generate a set of samples to be trained according to the set of images to be trained acquired by the acquiring module 201, wherein the set of samples to be trained includes at least one sample to be trained, and the sample to be trained includes a plurality of images to be trained;
[0267] The acquisition module 201 is further configured to acquire prediction labeling information corresponding to the to-be-trained samples through a to-be-trained time series detection model based on the to-be-trained sample set generated by the generation module 202;
[0268] The acquisition module 201 is further used to calculate a second loss function according to the real annotation information of the sample to be trained and the predicted annotation information of the image to be trained;
[0269] The training module 203 is further used to train and obtain a time series detection model when the second loss function converges.
[0270] Furthermore, in an embodiment of the present application, a training method for a time series detection model is provided, that is, first obtaining a set of images to be trained, then generating a set of samples to be trained based on the set of images to be trained, and then obtaining the predicted annotation information corresponding to the samples to be trained through the time series detection model to be trained based on the set of samples to be trained, and finally calculating the second loss function based on the real annotation information of the samples to be trained and the predicted annotation information of the images to be trained, and when the second loss function converges, the time series detection model is trained. Through the above method, a specific implementation basis is provided for the training of the time series detection model, thereby increasing the feasibility and operability of the solution.
[0271] The present application also provides another object detection device, such as Fig.13For the sake of convenience, only the parts related to the embodiments of the present application are shown. For specific technical details not disclosed, please refer to the method part of the embodiments of the present application. The terminal device can be any terminal device including a mobile phone, a tablet computer, a personal digital assistant (PDA), a point of sales (POS), a car computer, etc., taking the mobile phone as an example:
[0272] Fig.13 FIG. 1 is a block diagram showing a partial structure of a mobile phone related to a terminal device provided in an embodiment of the present application. Fig.13 The mobile phone includes: a radio frequency (RF) circuit 310, a memory 320, an input unit 330, a display unit 340, a sensor 350, an audio circuit 360, a wireless fidelity (WiFi) module 370, a processor 380, and a power supply 390. Those skilled in the art will understand that Fig.13 The mobile phone structure shown in the figure does not constitute a limitation on the mobile phone, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0273] Combine the following Fig.13 A detailed introduction to the various components of the mobile phone:
[0274] The RF circuit 310 can be used for receiving and sending signals during the process of sending and receiving information or making calls. In particular, after receiving the downlink information of the base station, it is sent to the processor 380 for processing; in addition, the designed uplink data is sent to the base station. Generally, the RF circuit 310 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (Low Noise Amplifier, LNA), a duplexer, etc. In addition, the RF circuit 310 can also communicate with the network and other devices through wireless communication. The above-mentioned wireless communication can use any communication standard or protocol, including but not limited to the Global System of Mobile communication (Global System of Mobile communication, GSM), General Packet Radio Service (General Packet Radio Service, GPRS), Code Division Multiple Access (Code Division Multiple Access, CDMA), Wideband Code Division Multiple Access (Wideband Code Division Multiple Access, WCDMA), Long Term Evolution (Long Term Evolution, LTE), email, Short Messaging Service (SMS), etc.
[0275] The memory 320 can be used to store software programs and modules. The processor 380 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 320. The memory 320 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 320 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0276] The input unit 330 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the mobile phone. Specifically, the input unit 330 may include a touch panel 331 and other input devices 332. The touch panel 331, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 331 or near the touch panel 331 using any suitable object or accessory such as a finger, stylus, etc.), and drive the corresponding connection device according to a pre-set program. Optionally, the touch panel 331 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 380, and can receive and execute commands sent by the processor 380. In addition, the touch panel 331 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 331, the input unit 330 may also include other input devices 332. Specifically, other input devices 332 may include but are not limited to one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, etc.
[0277] The display unit 340 can be used to display information input by the user or information provided to the user and various menus of the mobile phone. The display unit 340 may include a display panel 341. Optionally, the display panel 341 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. Further, the touch panel 331 may cover the display panel 341. When the touch panel 331 detects a touch operation on or near it, it is transmitted to the processor 380 to determine the type of touch event. Subsequently, the processor 380 provides a corresponding visual output on the display panel 341 according to the type of touch event. Although in Fig.13 In the embodiment, the touch panel 331 and the display panel 341 are used as two independent components to realize the input and output functions of the mobile phone, but in some embodiments, the touch panel 331 and the display panel 341 can be integrated to realize the input and output functions of the mobile phone.
[0278] The mobile phone may also include at least one sensor 350, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 341 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 341 and / or the backlight when the mobile phone is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that can be configured in the mobile phone, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be repeated here.
[0279] The audio circuit 360, the speaker 361, and the microphone 362 can provide an audio interface between the user and the mobile phone. The audio circuit 360 can transmit the received audio data to the speaker 361 after converting the electrical signal, which is converted into a sound signal for output; on the other hand, the microphone 362 converts the collected sound signal into an electrical signal, which is received by the audio circuit 360 and converted into audio data, and then the audio data is output to the processor 380 for processing, and then sent to another mobile phone through the RF circuit 310, or the audio data is output to the memory 320 for further processing.
[0280] WiFi is a short-range wireless transmission technology. The mobile phone can help users send and receive emails, browse web pages and access streaming media through the WiFi module 370. It provides users with wireless broadband Internet access. Fig.13A WiFi module 370 is shown, but it is understandable that it is not an essential component of the mobile phone and can be omitted as needed without changing the essence of the invention.
[0281] The processor 380 is the control center of the mobile phone. It uses various interfaces and lines to connect various parts of the entire mobile phone. It executes various functions of the mobile phone and processes data by running or executing software programs and / or modules stored in the memory 320, and calling data stored in the memory 320. Optionally, the processor 380 may include one or more processing units; optionally, the processor 380 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 380.
[0282] The mobile phone also includes a power supply 390 (such as a battery) for supplying power to various components. Optionally, the power supply can be logically connected to the processor 380 through a power management system, thereby implementing functions such as charging, discharging, and power consumption management through the power management system.
[0283] Although not shown, the mobile phone may also include a camera, a Bluetooth module, etc., which will not be described in detail here.
[0284] In the embodiment of the present application, the processor 380 included in the terminal device also has the following functions:
[0285] Acquire an image set, wherein the image set includes at least a first image and a second image, and the first image is an image frame previous to the second image;
[0286] Based on the image set, a depth feature set is obtained, wherein the depth feature set includes a first depth feature and a second depth feature, the first depth feature belongs to a depth feature of a region to be detected in the first image, and the second depth feature belongs to a depth feature of a region to be detected in the second image;
[0287] Generating target time series features corresponding to the area to be detected according to the depth feature set;
[0288] Based on the target time series feature, an object detection result is obtained through a time series detection model, wherein the object detection result is a detection result of the area to be detected in the second image.
[0289] Optionally, the processor 380 is specifically configured to perform the following steps:
[0290] Based on the first image, acquiring the first depth feature through the target detection model, wherein the first depth feature includes a first feature of the area to be detected at P scales, where P is an integer greater than or equal to 1;
[0291] Based on the second image, acquiring the second depth feature through the object detection model, wherein the second depth feature includes second features of the area to be detected at P scales;
[0292] The depth feature set is generated according to the first depth feature and the second depth feature.
[0293] Optionally, the processor 380 is specifically configured to perform the following steps:
[0294] The first depth feature and the second depth feature are cascaded to obtain the target time series feature, wherein the target time series feature is a feature matrix, and the first depth feature and the second depth feature are both feature vectors.
[0295] Optionally, the processor 380 is specifically configured to perform the following steps:
[0296] Based on a first scale, a first feature in the first depth feature and a second feature in the second depth feature are cascaded to obtain a first target time series feature, wherein the first target time series feature is a feature matrix, the first feature and the second feature are both feature vectors, and the first scale belongs to one of the P scales;
[0297] Based on a second scale, a first feature in the first depth feature and a second feature in the second depth feature are cascaded to obtain a second target time series feature, wherein the second target time series feature is a feature matrix, the second scale belongs to another scale among the P scales, and the second scale and the first scale belong to different scales.
[0298] Optionally, the processor 380 is specifically configured to perform the following steps:
[0299] Based on the target time series feature, obtaining an object detection feature through the time series detection model, wherein the object detection feature is a feature vector;
[0300] The object detection result is generated according to the object detection feature, wherein the object detection result includes the occurrence probability, category information and location information of the object in the area to be detected.
[0301] Optionally, the processor 380 is specifically configured to perform the following steps:
[0302] Based on the first target time series feature, obtaining a first object detection feature through the time series detection model, wherein the first object detection feature is a feature vector;
[0303] Based on the second target time series feature, obtaining a second object detection feature through the time series detection model, wherein the second object detection feature is a feature vector;
[0304] determining a first confidence level based on the first object detection feature;
[0305] determining a second confidence level based on the second object detection feature;
[0306] If the first confidence level is greater than the second confidence level, generating the object detection result according to the first object detection feature, wherein the object detection result includes the probability of occurrence of the object in the area to be detected, category information, and location information;
[0307] If the second confidence level is greater than the first confidence level, the object detection result is generated according to the second object detection feature.
[0308] Optionally, the processor 380 is further configured to perform the following steps:
[0309] If the object detection result is determined to include the target object, the target operation is performed to obtain an auxiliary operation result.
[0310] Fig.14 4 is a schematic diagram of a server structure provided by an embodiment of the present invention. The server 400 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 422 (for example, one or more processors) and a memory 432, and one or more storage media 430 (for example, one or more mass storage devices) storing application programs 442 or data 444. Among them, the memory 432 and the storage medium 430 may be temporary storage or permanent storage. The program stored in the storage medium 430 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the server. Furthermore, the central processing unit 422 may be configured to communicate with the storage medium 430 to execute a series of instruction operations in the storage medium 430 on the server 400.
[0311] The server 400 may also include one or more power supplies 426, one or more wired or wireless network interfaces 450, one or more input and output interfaces 458, and / or one or more operating systems 441, such as Windows Server 2000. TM , Mac OS XTM , Unix TM ,Linux TM , FreeBSD TM etc.
[0312] The steps performed by the server in the above embodiment can be based on the Fig.14 The server structure shown.
[0313] In the embodiment of the present application, the CPU 422 included in the server also has the following functions:
[0314] Acquire an image set, wherein the image set includes at least a first image and a second image, and the first image is an image frame previous to the second image;
[0315] Based on the image set, a depth feature set is obtained, wherein the depth feature set includes a first depth feature and a second depth feature, the first depth feature belongs to a depth feature of a region to be detected in the first image, and the second depth feature belongs to a depth feature of a region to be detected in the second image;
[0316] Generating target time series features corresponding to the area to be detected according to the depth feature set;
[0317] Based on the target time series feature, an object detection result is obtained through a time series detection model, wherein the object detection result is a detection result of the area to be detected in the second image.
[0318] Optionally, the CPU 422 is further configured to execute the following steps:
[0319] Acquire a set of images to be trained, wherein the set of images to be trained includes at least one image to be trained, and the image to be trained carries real annotation information;
[0320] Based on the set of images to be trained, obtaining prediction annotation information corresponding to the images to be trained through the object detection model to be trained;
[0321] Calculating a first loss function according to the real annotation information of the image to be trained and the predicted annotation information of the image to be trained;
[0322] When the first loss function converges, the target detection model is trained.
[0323] Optionally, the CPU 422 is specifically configured to perform the following steps:
[0324] Determining position information of a predicted bounding box according to the predicted annotation information, wherein the position information of the predicted bounding box includes a central abscissa value, a central ordinate value, a height value, and a width value of the predicted bounding box;
[0325] Determine the position information of the real bounding box according to the real annotation information, wherein the position information of the real bounding box includes a central abscissa value, a central ordinate value, a height value, and a width value of the real bounding box;
[0326] Determining the confidence level of the bounding box based on the obtained real annotation information and the predicted annotation information;
[0327] Determining a prediction category according to the prediction annotation information;
[0328] Determine the real category according to the real annotation information;
[0329] The first loss function is calculated based on the position information of the predicted bounding box, the position information of the true bounding box, the frame confidence, the predicted category, and the true category.
[0330] Optionally, the CPU 422 is specifically configured to perform the following steps:
[0331] Acquire a video to be processed, wherein the video to be processed includes multiple frames of images to be processed;
[0332] Deduplication processing is performed on the video to be processed to obtain the image set to be trained.
[0333] Optionally, the CPU 422 is specifically configured to perform the following steps:
[0334] Acquire a video to be processed, wherein the video to be processed includes multiple frames of images to be processed;
[0335] Obtaining the object size of the object to be trained in the image to be processed;
[0336] If the object size of the object to be trained is greater than or equal to the size threshold, the image to be processed is determined to be the image to be trained.
[0337] Optionally, the CPU 422 is further configured to execute the following steps:
[0338] Acquire a set of images to be trained, wherein the set of images to be trained includes a plurality of images to be trained, and the images to be trained carry real annotation information;
[0339] Generating a set of samples to be trained according to the set of images to be trained, wherein the set of samples to be trained includes at least one sample to be trained, and the sample to be trained includes a plurality of images to be trained;
[0340] Based on the set of samples to be trained, obtaining prediction labeling information corresponding to the samples to be trained through a time series detection model to be trained;
[0341] Calculating a second loss function according to the real labeling information of the sample to be trained and the predicted labeling information of the image to be trained;
[0342] When the second loss function converges, the time series detection model is trained.
[0343] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0344] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as 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 an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0345] 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 network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0346] 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.
[0347] 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 is essentially 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, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0348] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for object detection, It is characterized in that include: Acquire an image set, wherein the image set includes at least a first image and a second image, and the first image is a previous frame image of the second image; Based on the image set, a depth feature set is obtained, wherein the depth feature set includes a first depth feature and a second depth feature, the first depth feature belongs to a depth feature of a region to be detected in the first image, and the second depth feature belongs to a depth feature of a region to be detected in the second image; Generating target time series features corresponding to the area to be detected according to the depth feature set; Based on the target time series feature, obtaining an object detection result through a time series detection model, wherein the object detection result is a detection result of the area to be detected in the second image; in, In the target time series feature generation method based on a single scale, the target time series feature corresponding to the to-be-detected area is generated according to the depth feature set, including: Performing cascade processing on the first depth feature and the second depth feature to obtain the target time series feature, wherein the target time series feature is a feature matrix, and the first depth feature and the second depth feature are both feature vectors; or, In the multi-scale deep feature set extraction method, the deep feature set is obtained based on the image set, including: Based on the first image, acquiring the first depth feature through the target detection model, wherein the first depth feature includes a first feature of the area to be detected at P scales, where P is an integer greater than or equal to 1; Based on the second image, acquiring the second depth feature through the target detection model, wherein the second depth feature includes second features of the area to be detected at P scales; generating the depth feature set according to the first depth feature and the second depth feature; In the multi-scale target time series feature generation method, the target time series feature corresponding to the to-be-detected area is generated according to the depth feature set, including: Based on a first scale, a first feature in the first depth feature and a second feature in the second depth feature are cascaded to obtain a first target time series feature, wherein the first target time series feature is a feature matrix, the first feature and the second feature are both feature vectors, and the first scale belongs to one of the P scales; Based on a second scale, a first feature in the first depth feature and a second feature in the second depth feature are cascaded to obtain a second target time series feature, wherein the second target time series feature is a feature matrix, the second scale belongs to another scale among the P scales, and the second scale and the first scale belong to different scales.
2. The method according to claim 1, It is characterized in that In the single-scale object detection result generation method, the object detection result is obtained through a time series detection model based on the target time series feature, including: Based on the target time series feature, obtaining an object detection feature through the time series detection model, wherein the object detection feature is a feature vector; The object detection result is generated according to the object detection feature, wherein the object detection result includes the occurrence probability, category information and location information of the object in the area to be detected.
3. The method according to claim 1, It is characterized in that In the multi-scale object detection result generation method, the object detection result is obtained through a time series detection model based on the target time series feature, including: Based on the first target time series feature, obtaining a first object detection feature through the time series detection model, wherein the first object detection feature is a feature vector; Based on the second target time series feature, obtaining a second object detection feature through the time series detection model, wherein the second object detection feature is a feature vector; determining a first confidence level based on the first object detection feature; determining a second confidence level based on the second object detection feature; If the first confidence level is greater than the second confidence level, generating the object detection result according to the first object detection feature, wherein the object detection result includes the probability of occurrence of the object in the area to be detected, category information, and location information; If the second confidence level is greater than the first confidence level, the object detection result is generated according to the second object detection feature.
4. The method according to claim 1, It is characterized in that After obtaining the object detection result through the time series detection model based on the target time series feature, the method further includes: If the object detection result is determined to include the target object, the target operation is performed to obtain an auxiliary operation result.
5. The method according to any one of claims 1 to 4, It is characterized in that The method further comprises: Acquire a set of images to be trained, wherein the set of images to be trained includes at least one image to be trained, and the image to be trained carries real annotation information; Based on the set of images to be trained, obtaining prediction annotation information corresponding to the images to be trained through the object detection model to be trained; Calculating a first loss function according to the real annotation information of the image to be trained and the predicted annotation information of the image to be trained; When the first loss function converges, the target detection model is trained.
6. The method according to claim 5, It is characterized in that The calculating a first loss function according to the real labeling information of the image to be trained and the predicted labeling information of the image to be trained includes: Determining position information of a predicted bounding box according to the predicted annotation information, wherein the position information of the predicted bounding box includes a central abscissa value, a central ordinate value, a height value, and a width value of the predicted bounding box; Determine the position information of the real bounding box according to the real annotation information, wherein the position information of the real bounding box includes a central abscissa value, a central ordinate value, a height value, and a width value of the real bounding box; Determining the confidence level of the bounding box based on the obtained real annotation information and the predicted annotation information; Determining a prediction category according to the prediction annotation information; Determine the real category according to the real annotation information; The first loss function is calculated based on the position information of the predicted bounding box, the position information of the true bounding box, the frame confidence, the predicted category, and the true category.
7. The method according to claim 5, It is characterized in that The step of obtaining a set of images to be trained comprises: Acquire a video to be processed, wherein the video to be processed includes multiple frames of images to be processed; Deduplication processing is performed on the video to be processed to obtain the image set to be trained.
8. The method according to claim 5, It is characterized in that The step of obtaining a set of images to be trained comprises: Acquire a video to be processed, wherein the video to be processed includes multiple frames of images to be processed; Obtaining the object size of the object to be trained in the image to be processed; If the object size of the object to be trained is greater than or equal to the size threshold, the image to be processed is determined to be the image to be trained.
9. The method according to any one of claims 1 to 4, It is characterized in that The method further comprises: Acquire a set of images to be trained, wherein the set of images to be trained includes a plurality of images to be trained, and the images to be trained carry real annotation information; Generating a set of samples to be trained according to the set of images to be trained, wherein the set of samples to be trained includes at least one sample to be trained, and the sample to be trained includes a plurality of images to be trained; Based on the set of samples to be trained, obtaining prediction labeling information corresponding to the samples to be trained through a time series detection model to be trained; Calculating a second loss function according to the real labeling information of the sample to be trained and the predicted labeling information of the image to be trained; When the second loss function converges, the time series detection model is trained.
10. An object detection device, It is characterized in that include: An acquisition module, configured to acquire an image set, wherein the image set includes at least a first image and a second image, and the first image is an image frame preceding the second image; The acquisition module is further used to acquire a depth feature set based on the image set, wherein the depth feature set includes a first depth feature and a second depth feature, the first depth feature belongs to a depth feature of a region to be detected in the first image, and the second depth feature belongs to a depth feature of a region to be detected in the second image; A generating module, used for generating target time series features corresponding to the area to be detected according to the depth feature set acquired by the acquiring module; The acquisition module is further used to acquire an object detection result through a time series detection model based on the target time series feature generated by the generation module, wherein the object detection result is a detection result of the area to be detected in the second image; in, In the single-scale target time series feature generation method, the generation module is specifically used to: Performing cascade processing on the first depth feature and the second depth feature to obtain the target time series feature, wherein the target time series feature is a feature matrix, and the first depth feature and the second depth feature are both feature vectors; or, In the multi-scale deep feature set extraction method, the acquisition module is specifically used to: Based on the first image, acquiring the first depth feature through the target detection model, wherein the first depth feature includes a first feature of the area to be detected at P scales, where P is an integer greater than or equal to 1; Based on the second image, acquiring the second depth feature through the target detection model, wherein the second depth feature includes second features of the area to be detected at P scales; generating the depth feature set according to the first depth feature and the second depth feature; In the multi-scale target time series feature generation method, the generation module is specifically used to: Based on a first scale, a first feature in the first depth feature and a second feature in the second depth feature are cascaded to obtain a first target time series feature, wherein the first target time series feature is a feature matrix, the first feature and the second feature are both feature vectors, and the first scale belongs to one of the P scales; Based on a second scale, a first feature in the first depth feature and a second feature in the second depth feature are cascaded to obtain a second target time series feature, wherein the second target time series feature is a feature matrix, the second scale belongs to another scale among the P scales, and the second scale and the first scale belong to different scales.
11. The device according to claim 10, It is characterized in that In the single-scale object detection result generation method, the acquisition module is specifically used to: Based on the target time series feature, obtaining an object detection feature through the time series detection model, wherein the object detection feature is a feature vector; The object detection result is generated according to the object detection feature, wherein the object detection result includes the occurrence probability, category information and location information of the object in the area to be detected.
12. The device according to claim 10, It is characterized in that In the multi-scale object detection result generation method, the acquisition module is specifically used to: Based on the first target time series feature, obtaining a first object detection feature through the time series detection model, wherein the first object detection feature is a feature vector; Based on the second target time series feature, obtaining a second object detection feature through the time series detection model, wherein the second object detection feature is a feature vector; determining a first confidence level based on the first object detection feature; determining a second confidence level based on the second object detection feature; If the first confidence level is greater than the second confidence level, generating the object detection result according to the first object detection feature, wherein the object detection result includes the probability of occurrence of the object in the area to be detected, category information, and location information; If the second confidence level is greater than the first confidence level, the object detection result is generated according to the second object detection feature.
13. The device according to claim 10, It is characterized in that The acquisition module is also used to, after acquiring the object detection result through the time series detection model based on the target time series feature, if the object detection result is determined to include the target object, acquire the auxiliary operation result according to executing the target operation.
14. The device according to any one of claims 10 to 13, It is characterized in that The device also includes: a training module; The acquisition module is used to acquire a set of images to be trained, wherein the set of images to be trained includes at least one image to be trained, and the image to be trained carries real annotation information; The acquisition module is used to acquire the prediction annotation information corresponding to the to-be-trained image through the to-be-trained object detection model based on the to-be-trained image set; The acquisition module is used to calculate a first loss function according to the real annotation information of the image to be trained and the predicted annotation information of the image to be trained; The training module is used to train and obtain a target detection model when the first loss function converges.
15. The device according to claim 14, It is characterized in that The acquisition module is specifically used for: Determining position information of a predicted bounding box according to the predicted annotation information, wherein the position information of the predicted bounding box includes a central abscissa value, a central ordinate value, a height value, and a width value of the predicted bounding box; Determine the position information of the real bounding box according to the real annotation information, wherein the position information of the real bounding box includes a central abscissa value, a central ordinate value, a height value, and a width value of the real bounding box; Determining the confidence level of the bounding box based on the obtained real annotation information and the predicted annotation information; Determining a prediction category according to the prediction annotation information; Determine the real category according to the real annotation information; The first loss function is calculated based on the position information of the predicted bounding box, the position information of the true bounding box, the frame confidence, the predicted category, and the true category.
16. The device according to claim 14, It is characterized in that The acquisition module is specifically used for: Acquire a video to be processed, wherein the video to be processed includes multiple frames of images to be processed; Deduplication processing is performed on the video to be processed to obtain the image set to be trained.
17. The device according to claim 14, It is characterized in that The acquisition module is specifically used for: Acquire a video to be processed, wherein the video to be processed includes multiple frames of images to be processed; Obtaining the object size of the object to be trained in the image to be processed; If the object size of the object to be trained is greater than or equal to the size threshold, the image to be processed is determined to be the image to be trained.
18. The device according to any one of claims 10 to 13, It is characterized in that The device also includes a training module; The acquisition module is further used to acquire a set of images to be trained, wherein the set of images to be trained includes a plurality of images to be trained, and the images to be trained carry real annotation information; The generating module is further used to generate a set of samples to be trained according to the set of images to be trained, wherein the set of samples to be trained includes at least one sample to be trained, and the sample to be trained includes a plurality of images to be trained; The acquisition module is further used to acquire the prediction labeling information corresponding to the samples to be trained through the time series detection model to be trained based on the sample set to be trained; The acquisition module is further used to calculate a second loss function according to the real labeling information of the sample to be trained and the predicted labeling information of the image to be trained; The training module is also used to train a time series detection model when the second loss function converges.
19. An electronic device, It is characterized in that include: memories, transceivers, processors, and bus systems; Wherein, the memory is used to store programs; The processor is used to execute the program in the memory, including executing the method as described in any one of claims 1 to 9 above; The bus system is used to connect the memory and the processor so that the memory and the processor can communicate with each other.
20. A computer-readable storage medium, It is characterized in that The method comprises instructions which, when executed on a computer, cause the computer to perform the method according to any one of claims 1 to 9.
