Image processing method and device, electronic equipment and storage medium

Through the method of multi-level feature extraction and separate detection of target feature maps, the problem of large calculation amount of existing map target detection models is solved, saving resources and improving the efficiency of data collection.

CN118736338APending Publication Date: 2024-10-01TENCENT TECHNOLOGY (SHENZHEN) CO LTD

Patent Information

Application Number
CN202310376743.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-31
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

Existing map target detection models require a large amount of calculations, resulting in high equipment requirements, and cannot effectively reduce the resource consumption of terminal equipment, especially in map data collection that requires high data freshness but is under cost control.

Method used

By obtaining the target image to be detected, multi-level feature extraction is performed, the shallowest level target feature map is used to detect a specific target, and the second map target is detected through target feature maps at other levels, reducing the amount of calculation and reducing the resources of the terminal device. need.

Benefits of technology

It effectively saves the amount of calculation in the detection process, reduces the resource requirements of terminal equipment, improves the efficiency and quality of data collection, reduces cloud computing pressure, and reduces collection and transmission costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118736338A_ABST
    Figure CN118736338A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an image processing method and device, electronic equipment and a storage medium, and relates to the technical field of artificial intelligence. The image processing method comprises the following steps: acquiring a to-be-detected target image; performing an image detection operation on the target image through the image detection model to obtain an image detection result, the image detection operation comprising: performing feature extraction based on the target image to obtain a plurality of levels of target feature maps; taking the target feature map of the shallowest level in the plurality of target feature maps as a first target feature map, obtaining a first detection result of the first map target based on the first target feature map, and obtaining a second detection result of the second map target based on the target feature maps except the first target feature map; wherein the first map target comprises a specific target. The detection calculation amount can be effectively reduced, and the equipment requirement for configuring the image processing method is lowered.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence. Specifically, the present application relates to an image processing method, device, electronic device and storage medium. Background Art

[0002] When detecting map objects and producing map data, data quality and freshness are very important. Lack of freshness may lead to navigation errors in map products. For example, failure to detect road construction and diversion in time will bring a very bad experience to users. To solve the freshness problem, large-scale data collection with multiple frequencies is essential, but the higher the frequency, the higher the cost.

[0003] At present, most of the detection models of map objects are large cloud models. Even if the lightweight model is combined with the vehicle terminal device, it still requires at least multiple CPUs (Central Processing Units) and a large memory, such as 500MFLOPs and 200M memory. Therefore, it is necessary to provide a detection method with less computational effort to reduce equipment requirements. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide an image processing method, device and electronic device. The technical solutions provided by the embodiments of the present application are as follows:

[0005] On the one hand, an embodiment of the present application provides an image processing method, the method comprising:

[0006] Acquire the target image to be detected;

[0007] Perform feature extraction based on the target image to obtain target feature maps at multiple levels;

[0008] The shallowest target feature map among the multiple target feature maps is used as a first target feature map, a first detection result of a first map target is obtained based on the first target feature map, and a second detection result of a second map target is obtained based on target feature maps other than the first target feature map;

[0009] Among them, the first map target includes a specific target.

[0010] In some possible implementations, the method further includes:

[0011] If the first detection result and the second detection result meet the preset detection result, the target image, the first detection result and the second detection result are sent to the server, so that the server updates the map data based on the received multiple target images and the first detection result and the second detection result of each target image.

[0012] In some possible implementations, feature extraction is performed based on the target image to obtain target feature maps at multiple levels, including:

[0013] Perform multiple extraction operations based on the target image to obtain multiple levels of first feature maps; perform feature extraction based on the multiple levels of first feature maps to obtain multiple levels of target feature maps;

[0014] Each extraction operation includes the following steps:

[0015] Performing feature extraction based on the first image to obtain a first intermediate feature map; wherein the first image is an image of a channel of a preset proportion in the input image corresponding to the current feature extraction, and the input image corresponding to the first feature extraction is the target image;

[0016] The first intermediate feature map and the second intermediate feature map are channel-reorganized to obtain a third intermediate feature map; the second intermediate feature map is an image in the input image other than the first image;

[0017] Perform downsampling feature extraction on the third intermediate feature map to obtain an initial feature map;

[0018] Among them, the initial feature map is the input image corresponding to the next downsampling feature extraction; the first feature maps of multiple levels include the initial feature maps obtained by at least two extraction operations in the multiple extraction operations.

[0019] In some possible implementations, at least some of the channels in the first image based on two adjacent feature extractions have different relative positions in the channels in the corresponding input image.

[0020] In some possible implementations, feature extraction is performed based on the first feature maps of multiple levels to obtain target feature maps of multiple levels, including:

[0021] Perform upsampling feature extraction based on the first feature maps of multiple levels to obtain second feature maps of multiple levels; wherein the second feature map of the deepest level is the first feature map of the deepest layer; the second feature maps of other levels are obtained by performing upsampling feature extraction on the second feature maps of adjacent deep levels and fusing the first feature maps of the same level;

[0022] Downsampling feature extraction is performed based on the second feature maps of multiple levels to obtain target feature maps of multiple levels; wherein the target feature map of the shallowest level is the second feature map of the shallowest level; target feature maps of other levels are obtained by downsampling feature extraction of adjacent shallow target feature maps and fusing the second feature maps of the same level.

[0023] In some possible implementations, upsampling feature extraction is performed based on the first feature maps of multiple levels to obtain the second feature maps of multiple levels, including:

[0024] Performing upsampling feature extraction on the first input feature map to obtain an upsampling feature map; wherein the first input feature map based on the first upsampling feature extraction is the first feature map obtained by the last downsampling feature extraction;

[0025] The upsampled feature map is fused with the first feature map at the same level to obtain a second feature map;

[0026] The second feature map is used as the first input feature map corresponding to the next upsampling feature extraction.

[0027] In some possible implementations, multiple downsampling feature extractions are performed based on multiple second feature maps to obtain target feature maps of multiple levels, including:

[0028] Performing downsampling feature extraction on the second input feature map to obtain a downsampling feature map; wherein the second feature map obtained by the last upsampling feature extraction is the second input feature map of the first downsampling feature extraction;

[0029] The target feature map is obtained by fusing the downsampled feature map with the second feature map of the same level;

[0030] The target feature map is used as the second input feature map corresponding to the next downsampling feature extraction.

[0031] In some possible implementations, a target feature map is obtained by fusing the downsampled feature map with a second feature map of the same level, including:

[0032] Fusing the downsampled feature map with the second feature map at the same level to obtain a first fused feature map;

[0033] Determine the channel weights corresponding to the channels in the first fused feature map based on the first fused feature map, and fuse the channels of the second feature map based on the channel weights to obtain a second fused feature map;

[0034] A spatial weight feature map corresponding to the second fused feature is determined, and a target feature map is determined based on the spatial weight feature map and the second fused feature.

[0035] In some possible implementations, the image processing method is implemented based on an image detection model, and the image detection model is trained based on the following method:

[0036] Acquire a plurality of first sample images; the first sample images include the first sample map object and do not include the second sample map object;

[0037] Acquire a plurality of second sample images; the second sample images include the second sample map object but do not include the first sample map object;

[0038] Perform at least one training operation on the initial detection model based on the first sample image and the second sample image until the first training loss and the second training loss meet the preset training end condition, thereby obtaining an image detection model;

[0039] The training operation includes:

[0040] Inputting a plurality of first sample images and a plurality of second sample images into an initial detection model to obtain a first prediction result of each corresponding first map object and a second prediction result of each corresponding second map object;

[0041] Determining a first training loss based on each first prediction result and each corresponding first sample map target;

[0042] Determining a second training loss based on each second prediction result and each corresponding second sample map target;

[0043] The parameters of the initial detection model are updated based on the first training loss and the second training loss, and the initial detection model after the updated parameters is used as the initial detection model before the next training operation.

[0044] In some possible implementations, the specific target is a map target whose size is smaller than a preset size; acquiring a plurality of first sample images comprises:

[0045] Acquire a plurality of initial sample images; wherein the initial sample images include a first sample map object and a second sample map object;

[0046] The upper half of each initial sample image is cut out according to a preset size to obtain a plurality of corresponding first sample images.

[0047] In some possible implementations, inputting a plurality of first sample images into an initial detection model to obtain respective first prediction targets includes:

[0048] For each first sample image, performing multiple extraction operations on the first sample image through the initial detection model to obtain multiple levels of first sample feature maps;

[0049] Perform upsampling feature extraction based on the multiple first sample feature maps to obtain multiple levels of second sample feature maps;

[0050] A first prediction target is determined based on a second sample feature map with the shallowest level.

[0051] On the other hand, an embodiment of the present application provides an image processing device, the device comprising:

[0052] An acquisition module, used for acquiring a target image to be detected;

[0053] An extraction module is used to extract features based on the target image to obtain target feature maps at multiple levels;

[0054] a detection module, configured to use the shallowest target feature map among the multiple target feature maps as a first target feature map, obtain a first detection result of a first map target based on the first target feature map, and obtain a second detection result of a second map target based on target feature maps other than the first target feature map;

[0055] Among them, the first map target includes a specific target.

[0056] In some possible implementations, a sending module is further included, which is used to:

[0057] If the first detection result and the second detection result meet the preset detection result, the target image, the first detection result and the second detection result are sent to the server, so that the server updates the map data based on the received multiple target images and the first detection result and the second detection result of each target image.

[0058] In some possible implementations, when the extraction module performs feature extraction based on the target image to obtain target feature maps of multiple levels, it is specifically used to:

[0059] Perform multiple extraction operations based on the target image to obtain multiple levels of first feature maps; perform feature extraction based on the multiple levels of first feature maps to obtain multiple levels of target feature maps;

[0060] Each extraction operation includes the following steps:

[0061] Performing feature extraction based on the first image to obtain a first intermediate feature map; wherein the first image is an image of a channel of a preset proportion in the input image corresponding to the current feature extraction, and the input image corresponding to the first feature extraction is the target image;

[0062] The first intermediate feature map and the second intermediate feature map are channel-reorganized to obtain a third intermediate feature map; the second intermediate feature map is an image in the input image other than the first image;

[0063] Perform downsampling feature extraction on the third intermediate feature map to obtain an initial feature map;

[0064] Among them, the initial feature map is the input image corresponding to the next downsampling feature extraction; the first feature maps of multiple levels include the initial feature maps obtained by at least two extraction operations in the multiple extraction operations.

[0065] In some possible implementations, at least some of the channels in the first image based on two adjacent feature extractions have different relative positions in the channels in the corresponding input image.

[0066] In some possible implementations, when the extraction module performs feature extraction based on the first feature maps of multiple levels to obtain target feature maps of multiple levels, it is specifically used to:

[0067] Perform upsampling feature extraction based on the first feature maps of multiple levels to obtain second feature maps of multiple levels; wherein the second feature map of the deepest level is the first feature map of the deepest layer; the second feature maps of other levels are obtained by performing upsampling feature extraction on the second feature maps of adjacent deep levels and fusing the first feature maps of the same level;

[0068] Downsampling feature extraction is performed based on the second feature maps of multiple levels to obtain target feature maps of multiple levels; wherein the target feature map of the shallowest level is the second feature map of the shallowest level; target feature maps of other levels are obtained by downsampling feature extraction of adjacent shallow target feature maps and fusing the second feature maps of the same level.

[0069] In some possible implementations, when the extraction module performs upsampling feature extraction based on the first feature maps of multiple levels to obtain the second feature maps of multiple levels, it is specifically used to:

[0070] Performing upsampling feature extraction on the first input feature map to obtain an upsampling feature map; wherein the first input feature map based on the first upsampling feature extraction is the first feature map obtained by the last downsampling feature extraction;

[0071] The upsampled feature map is fused with the first feature map at the same level to obtain a second feature map;

[0072] The second feature map is used as the first input feature map corresponding to the next upsampling feature extraction.

[0073] In some possible implementations, when the extraction module performs multiple downsampling feature extractions based on the multiple second feature maps to obtain target feature maps of multiple levels, it is specifically used to:

[0074] Performing downsampling feature extraction on the second input feature map to obtain a downsampling feature map; wherein the second feature map obtained by the last upsampling feature extraction is the second input feature map of the first downsampling feature extraction;

[0075] The target feature map is obtained by fusing the downsampled feature map with the second feature map of the same level;

[0076] The target feature map is used as the second input feature map corresponding to the next downsampling feature extraction.

[0077] In some possible implementations, when the extraction module obtains the target feature map by fusing the downsampled feature map with the second feature map of the same level, it is specifically used to:

[0078] Fusing the downsampled feature map with the second feature map at the same level to obtain a first fused feature map;

[0079] Determine the channel weights corresponding to the channels in the first fused feature map based on the first fused feature map, and fuse the channels of the second feature map based on the channel weights to obtain a second fused feature map;

[0080] A spatial weight feature map corresponding to the second fused feature is determined, and a target feature map is determined based on the spatial weight feature map and the second fused feature.

[0081] In some possible implementations, the image processing device includes an image detection module, and the image processing device also includes a training module for:

[0082] Acquire a plurality of first sample images; the first sample images include the first sample map object and do not include the second sample map object;

[0083] Acquire a plurality of second sample images; the second sample images include the second sample map object but do not include the first sample map object;

[0084] Perform at least one training operation on the initial detection model based on the first sample image and the second sample image until the first training loss and the second training loss meet the preset training end condition, thereby obtaining an image detection model;

[0085] The training operation includes:

[0086] Inputting a plurality of first sample images and a plurality of second sample images into an initial detection model to obtain a first prediction result of each corresponding first map object and a second prediction result of each corresponding second map object;

[0087] Determining a first training loss based on each first prediction result and each corresponding first sample map target;

[0088] Determining a second training loss based on each second prediction result and each corresponding second sample map target;

[0089] The parameters of the initial detection model are updated based on the first training loss and the second training loss, and the initial detection model after the updated parameters is used as the initial detection model before the next training operation.

[0090] In some possible implementations, the specific target is a map target whose size is smaller than a preset size; when the training module acquires a plurality of first sample images, it is specifically used to:

[0091] Acquire a plurality of initial sample images; wherein the initial sample images include a first sample map object and a second sample map object;

[0092] The upper half of each initial sample image is cut out according to a preset size to obtain a plurality of corresponding first sample images.

[0093] In some possible implementations, inputting a plurality of first sample images into an initial detection model to obtain respective first prediction targets includes:

[0094] For each first sample image, performing multiple extraction operations on the first sample image through the initial detection model to obtain multiple levels of first sample feature maps;

[0095] Perform upsampling feature extraction based on the multiple first sample feature maps to obtain multiple levels of second sample feature maps;

[0096] A first prediction target is determined based on a second sample feature map with the shallowest level.

[0097] On the other hand, an embodiment of the present application further provides an electronic device, which includes a memory and a processor, wherein a computer program is stored in the memory, and the processor executes the computer program to implement the method provided in any optional embodiment of the present application.

[0098] On the other hand, an embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the method provided in any optional embodiment of the present application is implemented.

[0099] On the other hand, an embodiment of the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the method provided in any optional embodiment of the present application.

[0100] The beneficial effects of the technical solution provided by the embodiment of the present application are as follows:

[0101] Feature extraction is performed based on the target image to obtain target feature maps of multiple levels, and a specific target is detected based on the target feature map of the shallowest level, and the second map target is detected through target feature maps of other levels. Compared with using target feature maps of each level to detect the first map target and the second map target, the present application adopts a solution of separate detection with different target feature maps, which can effectively save the amount of calculation in the detection process, thereby reducing the requirements for terminal equipment. BRIEF DESCRIPTION OF THE DRAWINGS

[0102] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in describing the embodiments of the present application are briefly introduced below.

[0103] Figure 1 A schematic diagram of changes in multiple schemes for collecting map data;

[0104] Figure 2 A schematic diagram of the updated process for road collection;

[0105] Figure 3 A schematic diagram of an application environment of an image processing method provided in an example;

[0106] Figure 4 A flowchart of an image processing method provided in an embodiment of the present application;

[0107] Figure 5 A schematic diagram of a scheme for channel splitting and channel recombination in an example of the present application;

[0108] Figure 6 A schematic diagram of a channel reorganization scheme in an example of this application;

[0109] Figure 7 A schematic diagram of the relative positions of channels of a first image in an input image based on two adjacent feature extractions in an example of the present application;

[0110] Figure 8 A schematic diagram of an image processing method in an example of the present application;

[0111] Fig. 9 A schematic diagram of a scheme for introducing an attention mechanism in an example of this application;

[0112] Fig.10 A schematic diagram of a model training process provided in an embodiment of the present application;

[0113] Fig.11 A schematic diagram of a model training scheme in an example of this application;

[0114] Fig.12 A schematic diagram of a model training scheme in an example of this application;

[0115] Fig.13 A schematic diagram of the structure of an image processing device provided in an embodiment of the present application;

[0116] Fig.14 A schematic diagram of the structure of an electronic device applicable to an embodiment of the present application. DETAILED DESCRIPTION

[0117] The embodiments of the present application are described below in conjunction with the drawings in the present application. It should be understood that the implementation methods described below in conjunction with the drawings are exemplary descriptions for explaining the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions of the embodiments of the present application.

[0118] It will be understood by those skilled in the art that, unless specifically stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the terms "including" and "comprising" used in the embodiments of the present application refer to that the corresponding features can be implemented as the presented features, information, data, steps, operations, elements and / or components, but do not exclude the implementation as other features, information, data, steps, operations, elements, components and / or combinations thereof supported by the technical field. It should be understood that when we say that an element is "connected" or "coupled" to another element, the one element may be directly connected or coupled to the other element, or it may refer to that the one element and the other element establish a connection relationship through an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein indicates at least one of the items defined by the term, for example, "A and / or B" may be implemented as "A", or as "B", or as "A and B". When describing multiple (two or more) items, if the relationship between the multiple items is not clearly defined, the multiple items may refer to one, multiple or all of the multiple items. For example, the description of "parameter A includes A1, A2, A3" can be implemented as parameter A including A1 or A2 or A3, and can also be implemented as parameter A including at least two of the three items A1, A2, A3.

[0119] The quality of map lane data directly affects the application effect of digital terrain map products, among which data freshness is the most important evaluation indicator. For large equipment crowdsourcing companies, if the full amount of data is sent back, it will cost a lot of collection and transmission costs, and there will also be a lot of computing pressure in the cloud. At the same time, there will be a lot of invalid data.

[0120] Currently, for the collection of map data, Figure 1 As shown in the figure, from the earliest professional lane collection, to user crowdsourcing collection, to the current equipment crowdsourcing collection. Among them, professional vehicle collection has high cost, slow update frequency, and poor timeliness; user crowdsourcing collection is relatively low in pairs, but it is highly dependent on operational control; equipment crowdsourcing collection has lower cost, higher update frequency, and theoretically unlimited production capacity. We hope to deploy intelligent algorithms on driving recorder equipment to discover collection elements in advance, so as to achieve the goals of reducing costs, improving efficiency, increasing frequency, and improving quality.

[0121] like Figure 2As shown in the figure, the normal process of road collection and update is to collect multiple road images and then transmit the road images back. The process after the change of road collection and update is that the device detects in real time whether the map lane elements are included. If so, the image containing the map lane elements is transmitted back.

[0122] This algorithm puts cloud capabilities in front of the terminal, and perceives all elements on the terminal, such as electronic eyes, round signs, rectangular signs, triangular signs, red lights, etc. Filter out pictures without elements to reduce the pressure of backhaul and cloud computing. It makes it possible to collect data from multiple intelligent hardware. After introducing the end-to-end difference, costs can be reduced on a larger scale, truly achieving the goal of reducing costs, increasing efficiency, and improving frequency and quality. The daily DAU (Daily Active User) of vehicles where this algorithm is deployed is more than 100,000.

[0123] Optionally, the data processing involved in the embodiments of the present application can be implemented based on cloud technology. For example, the step of training the image detection model can be implemented using cloud technology. Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and network in a wide area network or a local area network to realize the calculation, storage, processing, and sharing of data. Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model application, which can form a resource pool, which is used on demand and is flexible and convenient. Cloud computing technology will become an important support. Cloud computing refers to the delivery and use mode of IT infrastructure, which refers to obtaining the required resources through the network in an on-demand and easily scalable manner; generalized cloud computing refers to the delivery and use mode of services, which refers to obtaining the required services through the network in an on-demand and easily scalable manner. This service can be IT and software, Internet-related, or other services. With the development of the Internet, real-time data streams, and the diversification of connected devices, as well as the promotion of search services, social networks, mobile commerce, and open collaboration, cloud computing has developed rapidly. Different from previous parallel distributed computing, the emergence of cloud computing will promote revolutionary changes in the entire Internet model and enterprise management model in terms of concept.

[0124] The image detection model of the present application can be implemented based on machine learning (ML) in artificial intelligence (AI).

[0125] Artificial intelligence is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that 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 machines have the functions of perception, reasoning and decision-making.

[0126] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, large image processing technology, operation / interaction systems, mechatronics and other technologies. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0127] Machine learning is a multi-disciplinary subject that involves probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning.

[0128] 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.

[0129] The following describes several optional embodiments to illustrate the technical solution provided by the present application and the technical effects produced by the technical solution of the present application. It should be noted that the following implementations can refer to, draw on or combine with each other, and the same terms, similar features and similar implementation steps in different implementations will not be described repeatedly.

[0130] The image processing method provided in the embodiment of the present application can be executed by any computer device, and optionally, can be executed by a server, wherein the server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services.

[0131] Figure 3 A schematic diagram of the application environment of the image processing method provided in the embodiment of the present application. The application environment may include a vehicle terminal 301 and a server 302. Specifically, the vehicle terminal 301 obtains a target image to be detected; the vehicle terminal 301 performs feature extraction based on the target image to obtain target feature maps of multiple levels; the vehicle terminal 301 uses the shallowest target feature map among the multiple target feature maps as the first target feature map, obtains a first detection result of the first map target based on the first target feature map, and obtains a second detection result of the second map target based on target feature maps other than the first target feature map; wherein the first map target includes a specific target. If the image detection result is that the target image includes the first map target or the second map target, and includes the category and location of the first map target or the second map target, the target image and the first detection result and the second detection result are uploaded to the service 302, and the server 302 updates the map data based on the first detection result and the second detection result.

[0132] In the above application scenarios, the vehicle-mounted terminal detects the target image. In other application scenarios, other types of terminals may also perform image detection, which is not limited in this application.

[0133] It can be understood by technicians in this technical field that the server can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server or server cluster that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and basic cloud computing services such as big data and artificial intelligence platforms. The terminal can be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a laptop computer, a digital broadcast receiver, a MID (Mobile Internet Devices), a PDA (personal digital assistant), a desktop computer, a smart home appliance, a vehicle terminal (such as a vehicle navigation terminal, a vehicle computer, etc.), a smart speaker, a smart watch, etc. The terminal and the server can be directly or indirectly connected by wired or wireless communication, but are not limited to this. The embodiments of the present invention can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, assisted driving, etc. The specific requirements can also be determined based on the actual application scenario requirements, and are not limited here.

[0134] The terminal (also referred to as a user terminal or user device) may be a smart phone, a tablet computer, a laptop computer, a desktop computer, an intelligent voice interaction device (such as an intelligent speaker), a wearable electronic device (such as a smart watch), a vehicle terminal, a smart home appliance (such as a smart TV), an AR / VR device, an aircraft, etc., but is not limited thereto. The embodiments of the present invention may be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, assisted driving, etc.

[0135] It should be noted that in the optional embodiments of the present application, the target image and other related data involved, when the embodiments of the present application are applied to specific products or technologies, need to obtain the permission or consent of the object, and the collection, use and processing of the relevant data need to comply with the relevant laws, regulations and standards of the relevant countries and regions. In other words, if the embodiments of the present application involve data related to the target image, these data need to be obtained with the authorization and consent of the object and in compliance with the relevant laws, regulations and standards of the country and region.

[0136] In some possible implementations, an image processing method is provided, which can be executed by a vehicle-mounted terminal.

[0137] Figure 4 A flow chart of an image processing method provided by an embodiment of the present application is shown. Taking the execution subject as a vehicle-mounted terminal as an example, the image processing method provided by the present application may include the following steps:

[0138] Step S401, obtaining a target image to be detected.

[0139] Among them, the vehicle-mounted terminal of the present application may include a driving recorder.

[0140] Specifically, the driving recorder can collect the target image by itself.

[0141] In other implementation scenarios, the vehicle-mounted image acquisition device may also acquire the target image, and then send the target image to a vehicle-mounted terminal for image detection for processing.

[0142] Step S402, performing feature extraction based on the target image to obtain target feature maps of multiple levels.

[0143] Among them, feature extraction may include downsampling and upsampling processes.

[0144] Specifically, the target image can be subjected to multiple upsampling feature extractions and combined with multiple downsampling feature extractions to obtain target feature maps of multiple levels, with different levels corresponding to different feature map sizes. The specific feature extraction process will be further elaborated below.

[0145] Step S403: Use the shallowest target feature map among the multiple target feature maps as the first target feature map, obtain a first detection result of the first map target based on the first target feature map, and obtain a second detection result of the second map target based on target feature maps other than the first target feature map.

[0146] The first map target includes a specific target; the size of the specific target may be smaller than a preset size, for example, the specific target may include an electronic eye.

[0147] Among them, the second map target may include traffic lights, signboards, and vehicle light signals, etc., wherein the signboards may include triangular signs, rectangular signs, circular signs, etc.

[0148] In the specific implementation process, the size of the target feature map at the shallowest level is the largest, and the detection of relatively small map targets such as electronic eyes will be more accurate.

[0149] Among them, the first detection result may include whether the first map target is included in the first target feature map, and if so, the first detection result also includes the location of the first map target; the second detection result may include whether the second map target is included in the target feature map, and if so, the second detection result also includes the location of the second map target and the category of the second map target.

[0150] In the above embodiment, feature extraction is performed based on the target image to obtain target feature maps of multiple levels, and a specific target is detected based on the target feature map of the shallowest level, and the second map target is detected through target feature maps of other levels. Compared with using target feature maps of each level to detect the first map target and the second map target, the present application adopts a solution of separate detection with different target feature maps, which can effectively save the amount of calculation in the detection process, thereby reducing the requirements for terminal equipment.

[0151] In addition, when the size of a specific target is small, using the shallowest level target feature map to detect the specific target can save computational effort while ensuring accuracy.

[0152] In some possible implementations, the method further includes:

[0153] If the first detection result and the second detection result meet the preset detection result, the target image, the first detection result and the second detection result are sent to the server, so that the server updates the map data based on the received multiple target images and the first detection result and the second detection result of each target image.

[0154] The preset detection result may be that the target image contains at least one of the first map target or the second map target.

[0155] During the specific implementation process, the vehicle-mounted terminal detects the target map. When the first detection result or the second detection result of the target map meets the preset detection result, it means that the target map can be a valid image for updating or generating map data. The vehicle-mounted terminal sends the target map to the server. The service area can update the existing map data based on the received multiple target maps, or generate new map data.

[0156] In the above embodiment, when the first detection result and the second detection result obtained by the vehicle-mounted terminal meet the preset detection result, the target image, the first detection result and the second detection result are sent to the server. The server can update the map data based on the received multiple target images and the first detection result and the second detection result of each target image, that is, the vehicle-mounted terminal can screen the target map and send the valid target map to the server to update the map data.

[0157] The process of extracting features from a target image will be further described below in conjunction with an embodiment.

[0158] In some possible implementations, feature extraction is performed based on the target image to obtain target feature maps at multiple levels, which may include:

[0159] (1) performing multiple extraction operations based on the target image to obtain first feature maps of multiple levels;

[0160] (2) performing feature extraction based on the first feature maps of multiple levels to obtain target feature maps of multiple levels;

[0161] Each extraction operation includes the following steps:

[0162] a. Perform feature extraction based on the first image to obtain a first intermediate feature map.

[0163] Among them, the first image is an image of a channel of a preset proportion in the input image corresponding to the current feature extraction, and the input image corresponding to the first feature extraction is the target image.

[0164] Specifically, an image of a channel with a preset ratio is determined from the input image as the first image.

[0165] That is to say, not all channels of the input image are subjected to feature extraction, but only some channels are subjected to feature extraction processing.

[0166] b. Reorganize the channels of the first intermediate feature map and the second intermediate feature map to obtain the third intermediate feature map.

[0167] The second intermediate feature map is an image in the input image other than the first image.

[0168] Specifically, feature extraction is performed on some channels in the input image to obtain the first intermediate feature; another part of the channels in the input image, that is, the second intermediate feature map, is not processed, and is directly recombined with the first intermediate feature map to obtain the third intermediate feature map.

[0169] Specifically, performing channel reorganization on the first intermediate feature map and the second intermediate feature map includes:

[0170] b1. Concatenate the first intermediate feature map and the second intermediate feature map to obtain a concatenated feature;

[0171] b2. Perform channel reorganization on the spliced ​​features to obtain the third intermediate feature map.

[0172] like Figure 5 As shown, Figure 5 In the method, the input image is first split into channels, then one part is convolved, and the other part is directly concatenated with the convolutional features, and then the channels are reorganized.

[0173] Specifically, channel reorganization can be understood as disrupting the original feature order and then reorganizing it: first determine the number of channels in your feature map, then determine the number of groups, and then group the channels as input.

[0174] like Figure 6 As shown, Figure 6This is the process of channel reorganization in an example. First, the groups of channel data are spliced, then the dimensions are transformed by group, transposed, split into new groups, and then spliced ​​again, so that the connection between different channel data can be established.

[0175] c. Perform downsampling feature extraction on the third intermediate feature map to obtain an initial feature map;

[0176] Among them, the initial feature map is the input image corresponding to the next downsampling feature extraction.

[0177] In the specific implementation process, first obtain the image of the channel of the preset ratio in the target image to obtain the first image; perform feature extraction on the first image, such as convolution processing, to obtain a first intermediate feature map; perform channel reorganization on the first intermediate feature map and the second intermediate feature map to obtain a third intermediate feature map; perform downsampling feature extraction on the third intermediate feature map to obtain an initial feature map; then use the initial feature map obtained this time as the input image for the next time, that is, obtain images of some channels in the initial feature map to obtain the first image, and then repeat the above process.

[0178] Among them, the first feature maps of multiple levels include initial feature maps obtained by at least two extraction operations among the multiple extraction operations.

[0179] Specifically, multiple levels of initial feature maps are obtained through multiple extraction operations; at least part of the initial feature maps can be selected from the initial feature maps of the multiple levels as the first feature map.

[0180] In the specific implementation process, some initial feature maps with deeper levels can be selected as the first feature map. For example, the initial feature map obtained after the second extraction operation can be used as the first feature map. The initial feature map obtained by the first extraction operation can not be used as the first feature map because the receptive field is too small.

[0181] In the above embodiment, each time feature extraction is performed on an image of a preset proportion of channels in the input image, the other part of the channels are not processed, which can reduce the number of channels of the image that need to be convolutionally calculated, thereby effectively reducing the amount of calculation for the extraction operation to obtain multiple first feature maps.

[0182] In some possible implementations, at least some of the channels in the first image based on two adjacent feature extractions have different relative positions in the channels in the corresponding input image.

[0183] That is, the relative positions of the channels in the first image based on two adjacent feature extractions and the channels in the corresponding input image may be at least partially staggered.

[0184] like Figure 7 As shown, Figure 7This is a schematic diagram of the relative positions of channels of the first image in the input image based on two adjacent feature extractions in an example; one time, the relative positions of the channels of the first image in the input image are at the positions on both sides, that is, the channels corresponding to the stripes shown in the figure are filled, and the second intermediate image is at the relative middle position; another time, the relative position of the channels of the first image in the input image is at the middle position, and the second intermediate image is at the relative positions on both sides. By staggering the channels in this way, feature extraction can be performed on each channel in the input image during multiple feature extraction processes.

[0185] In the above embodiment, by staggering the relative positions of at least part of the channels in the first image on which two adjacent feature extractions are based in the corresponding input image, feature extraction processing can be performed on each channel in the input image during multiple feature extraction processes, thereby enabling a more comprehensive feature expression of the target image to improve the accuracy of target image detection.

[0186] In some possible implementations, feature extraction is performed based on the first feature maps of multiple levels to obtain target feature maps of multiple levels, including:

[0187] (1) Upsampling feature extraction is performed based on the first feature maps of multiple levels to obtain second feature maps of multiple levels.

[0188] Among them, the second feature map of the deepest level is the first feature map of the deepest level; the second feature maps of other levels are obtained by upsampling feature extraction of the second feature maps of adjacent deep levels and fusing the first feature maps of the same level.

[0189] Specifically, performing upsampling feature extraction based on the first feature maps of multiple levels to obtain the second feature maps of multiple levels may include:

[0190] A. Perform upsampling feature extraction on the first input feature map to obtain an upsampling feature map;

[0191] B. Fuse the upsampled feature map with the first feature map at the same level to obtain a second feature map;

[0192] C. Use the second feature map as the first input feature map corresponding to the next upsampling feature extraction.

[0193] The first input feature map based on the first upsampling feature extraction is the first feature map obtained by the last downsampling feature extraction.

[0194] That is, the first upsampling feature extraction is started based on the first feature map obtained by the last downsampling feature extraction.

[0195] Specifically, starting from the second upsampling feature extraction, each second feature map obtained is obtained by performing upsampling feature extraction on the second feature map of the adjacent deep level and fusing the first feature map of the same level.

[0196] (2) Downsampling feature extraction is performed based on the second feature maps of multiple levels to obtain target feature maps of multiple levels.

[0197] Among them, the target feature map of the shallowest level is the second feature map of the shallowest level; the target feature maps of other levels are obtained by downsampling feature extraction of adjacent shallow target feature maps and fusing the second feature maps of the same level.

[0198] Specifically, performing multiple downsampling feature extractions based on multiple second feature maps to obtain target feature maps of multiple levels may include:

[0199] D. Perform down-sampling feature extraction on the second input feature map to obtain a down-sampled feature map.

[0200] E. Obtain the target feature map by fusing the downsampled feature map with the second feature map of the same level;

[0201] F. Use the target feature map as the second input feature map corresponding to the next downsampling feature extraction.

[0202] Among them, the second feature map obtained by the last upsampling feature extraction is the second input feature map of the first downsampling feature extraction.

[0203] That is, the first downsampling feature extraction is started based on the second feature map obtained by the last upsampling feature extraction.

[0204] Specifically, starting from the second downsampling feature extraction, each target feature map obtained is obtained by performing downsampling feature extraction on the adjacent shallow-level target feature map and fusing the second feature map of the same level.

[0205] The above-mentioned upsampling feature extraction and downsampling feature extraction processes will be further described in detail below with reference to specific examples.

[0206] like Figure 8 As shown, multiple extraction operations are performed on the target image to obtain initial feature maps of multiple levels, namely C1-C5 shown in the figure;

[0207] Some of the initial feature maps in the initial feature maps of multiple levels are used as the first feature map; namely, C2-C5 shown in the figure; the first feature map C5 shown in the figure is the second feature map P5;

[0208] The second feature map P5 is subjected to upsampling feature extraction, and is fused with the first feature map C4 to obtain the second feature map P4. Similarly, the second feature map P3 and the second feature map P2 are obtained in sequence. The second feature map P2 shown in the figure is the target feature map N2.

[0209] Down-sample the target feature map N2 for feature extraction, and fuse the second feature map P3 to obtain the target feature map N3. Similarly, the target feature maps N4 and N5 are obtained in sequence.

[0210] The first map target, that is, the specific target, is detected based on the target feature map N2; and the second map target is detected based on the target feature maps N3-N5.

[0211] In some possible implementations, obtaining a target feature map by fusing the downsampled feature map with a second feature map at the same level may include:

[0212] E1, fuse the downsampled feature map with the second feature map of the same level to obtain a first fused feature map;

[0213] E2. Determine the channel weights corresponding to the channels in the first fused feature map based on the first fused feature map, and fuse the channels of the second feature map based on the channel weights to obtain a second fused feature map;

[0214] E3. Determine a spatial weight feature map corresponding to the second fusion feature, and determine a target feature map based on the spatial weight feature map and the second fusion feature.

[0215] Specifically, after the downsampled feature map is fused with the second feature map of the same level to obtain a first fused feature map, an attention mechanism can be introduced to process the first fused feature map.

[0216] In the specific implementation process, Fig. 9 As shown, a channel attention mechanism can be introduced to determine the channel weights corresponding to each channel in the first fused feature map, and determine the second fused feature map; then a spatial attention mechanism is introduced to determine the final target feature map.

[0217] In the above implementation process, channel attention fusion is performed first, and then spatial attention fusion is performed. In other embodiments, spatial attention fusion can also be performed first and then combined with channel attention fusion.

[0218] In some possible implementations, the above-mentioned image processing process can be implemented by an image detection model, and the feature extraction in the image detection model is implemented based on FPN (Feature Pyramid Network) and PAN (Pixel Aggregation Network); wherein, FPN or PAN includes multiple layers of convolution units; the convolution kernel of at least one layer of convolution units is larger than the convolution kernel of the convolution unit of the corresponding level of FPN, and the number of convolutions of at least one layer of convolution units is smaller than the number of convolutions of the corresponding level of FPN.

[0219] Specifically, relative to the convolutional unit in the FPN or PAN network structure, the convolutional unit in the image detection model in the present application can increase the convolution kernel size of the convolutional unit and reduce the number of convolutions of the convolutional unit, for example, replacing two 3×3 convolutions in FPN or PAN with one 5×5 convolution.

[0220] In the above embodiment, by increasing the convolution kernel and reducing the number of convolution layers, the memory can be reduced while ensuring the receptive field of the feature, thereby reducing the configuration requirements of the device of the image configuration method while ensuring the accuracy of image detection.

[0221] In some possible implementations, in the image detection model, the convolution kernels of each convolution unit corresponding to at least one feature extraction are all larger than 1×1.

[0222] Specifically, we can delete the negligible 1×1 convolutional layers, reduce the number of convolution kernels, and reduce the number of feature layers.

[0223] In the above embodiment, by reducing the 1×1 convolution, there is almost no impact on the final detection result, that is, the accuracy of the detection result can be guaranteed while reducing the amount of calculation and reducing memory consumption.

[0224] The training process of the image detection model in this application will be further explained below in conjunction with specific embodiments.

[0225] In some possible implementations, such as Fig.10 As shown in the figure, the image detection model is trained based on the following method:

[0226] Step S1001, obtaining a plurality of first sample images.

[0227] The first sample image includes the first sample map object but does not include the second sample map object.

[0228] That is, only sample-specific objects are marked in the first sample image.

[0229] Step S1002: Acquire a plurality of second sample images.

[0230] The second sample image includes the second sample map object but does not include the first sample map object.

[0231] That is, there are no sample-specific objects in the second sample map, only sample annotations of other types of map objects.

[0232] Step S1003, performing at least one training operation on the initial detection model based on the first sample image and the second sample image, until the first training loss and the second training loss meet the preset training end condition, thereby obtaining an image detection model.

[0233] The training operation includes:

[0234] (1) inputting a plurality of first sample images and a plurality of second sample images into an initial detection model to obtain a first prediction result of each corresponding first map object and a second prediction result of each corresponding second map object;

[0235] (2) determining a first training loss based on each first prediction result and each corresponding first sample map target;

[0236] (3) determining a second training loss based on each second prediction result and each corresponding second sample map target;

[0237] (4) updating the parameters of the initial detection model based on the first training loss and the second training loss, and using the initial detection model after the updated parameters as the initial detection model before the next training operation.

[0238] Specifically, the total training loss may be determined based on the first training loss and the second training loss, and the total training loss only needs to meet the training end condition.

[0239] Specifically, the preset training end condition may include a first end condition and a second end condition, and the first training loss may meet the first end condition, and the second training loss may meet the second end condition, that is, the first training loss and the second training loss may meet the corresponding end conditions respectively.

[0240] In some possible implementations, step S1001 of acquiring a plurality of first sample images may include:

[0241] Acquire a plurality of initial sample images; wherein the initial sample images include a first sample map object and a second sample map object;

[0242] The upper half of each initial sample image is cut out according to a preset size to obtain a plurality of corresponding first sample images.

[0243] Specifically, Fig.11As shown, the specific target is a map target whose size is smaller than a preset size. The specific target is usually distributed in the upper half of the image, that is, the specific target is usually not detected in the lower half of the image.

[0244] In the above embodiment, the clipping according to the preset size may be direct cropping; or it may be extracted from the initial sample image, and the specific clipping method is not limited in this application.

[0245] In the above embodiment, during the training process of the image detection model, by intercepting the upper half of the initial sample image containing the first sample map target and the second sample map target, a first sample image containing only the first sample map target, that is, containing the sample-specific target, can be obtained, which can effectively reduce the amount of calculation during the training process.

[0246] In some possible implementations, inputting a plurality of first sample images into an initial detection model to obtain respective first prediction targets includes:

[0247] For each first sample image, performing multiple extraction operations on the first sample image through the initial detection model to obtain multiple levels of first sample feature maps;

[0248] Perform upsampling feature extraction based on the multiple first sample feature maps to obtain multiple levels of second sample feature maps;

[0249] A first prediction target is determined based on a second sample feature map with the shallowest level.

[0250] Specifically, for the first sample image, multiple extraction operations can be performed to obtain multiple first sample feature maps; then upsampling feature extraction is performed to obtain multiple levels of second sample feature maps; however, for multiple levels of second sample feature maps, it is only necessary to perform detection based on the second sample feature map of the shallowest level to determine the first prediction target, that is, in the training process for prediction of a specific target, there is no need to combine multiple second sample feature maps for downsampling feature extraction.

[0251] like Fig.12 As shown, multiple extraction operations can be performed based on the first sample image to obtain multiple first sample feature maps, namely c2-c5 in the figure; then upsampling feature extraction is performed to obtain multiple levels of second sample feature maps, namely p2-p5 shown in the figure. At this time, it is only necessary to use p2 as n2, and perform detection based on the second sample feature map n2 with the shallowest level to determine the sample specific target.

[0252] In the above embodiment, in the process of determining the first prediction target based on the first sample image, multiple first sample feature maps can be obtained through multiple extraction operations; then upsampling feature extraction is performed to obtain multiple levels of second sample feature maps; then, only the second sample feature map with the shallowest level needs to be detected to determine the first prediction target, and there is no need to combine multiple second sample feature maps for downsampling feature extraction, which can effectively reduce the amount of calculation in the training process.

[0253] The above-mentioned image processing method performs feature extraction based on the target image to obtain target feature maps of multiple levels, and detects the first map target based on the target feature map of the shallowest level, that is, detects the specific target, and detects the second map target through target feature maps of other levels. Compared with using target feature maps of each level to detect the first map target and the second map target, the present application adopts a solution of separate detection with different target feature maps, which can effectively save the amount of calculation in the detection process, thereby reducing the requirements for terminal equipment.

[0254] Furthermore, using the shallowest target feature map can ensure the accuracy of specific target detection, especially when the size of the specific target is small, which can save computational effort while ensuring accuracy.

[0255] Furthermore, each time feature extraction is performed on an image of a preset proportion of channels in the input image, the other channels are not processed, which can reduce the number of channels of the image that require convolution calculation, thereby effectively reducing the amount of calculation for the extraction operation to obtain multiple first feature maps.

[0256] Furthermore, by staggering the relative positions of at least some channels in the first image on which two adjacent feature extractions are based in the corresponding input image, feature extraction can be performed on each channel in the input image during multiple feature extractions, thereby enabling a more comprehensive feature expression of the target image to improve the accuracy of target image detection.

[0257] Furthermore, by increasing the convolution kernel and reducing the number of convolution layers, the memory can be reduced while ensuring the receptive field of the feature, thereby reducing the configuration requirements of the device for configuring the image method while ensuring the accuracy of image detection.

[0258] Furthermore, by reducing the 1×1 convolution, there is almost no impact on the final detection result, that is, it can reduce the amount of calculation and memory consumption while ensuring the accuracy of the detection result.

[0259] Furthermore, during the training process of the image detection model, by cutting out the upper half of the initial sample image containing the first sample map target and the second sample map target, a first sample image containing only the first sample map target, that is, containing the sample-specific target, can be obtained, which can effectively reduce the amount of computation during the training process.

[0260] Furthermore, in the process of determining the first prediction target based on the first sample image, multiple first sample feature maps can be obtained through multiple extraction operations; then upsampling feature extraction is performed to obtain multiple levels of second sample feature maps; then, only the second sample feature map with the shallowest level needs to be detected to determine the first prediction target, and there is no need to combine multiple second sample feature maps for downsampling feature extraction, which can effectively reduce the amount of computation in the training process.

[0261] like Fig.13 As shown, in some possible implementations, an image processing device is provided, including:

[0262] An acquisition module 1301 is used to acquire a target image to be detected;

[0263] An extraction module 1302 is used to extract features based on the target image to obtain target feature maps at multiple levels;

[0264] A detection module 1303 is configured to use the shallowest target feature map among the multiple target feature maps as a first target feature map, obtain a first detection result of a first map target based on the first target feature map, and obtain a second detection result of a second map target based on target feature maps other than the first target feature map;

[0265] Among them, the first map target includes a specific target.

[0266] In some possible implementations, a sending module is further included, which is used to:

[0267] If the first detection result and the second detection result meet the preset detection result, the target image, the first detection result and the second detection result are sent to the server, so that the server updates the map data based on the received multiple target images and the first detection result and the second detection result of each target image.

[0268] In some possible implementations, when the extraction module 1302 performs feature extraction based on the target image to obtain target feature maps of multiple levels, it is specifically used to:

[0269] Perform multiple extraction operations based on the target image to obtain multiple levels of first feature maps; perform feature extraction based on the multiple levels of first feature maps to obtain multiple levels of target feature maps;

[0270] Each extraction operation includes the following steps:

[0271] Performing feature extraction based on the first image to obtain a first intermediate feature map; wherein the first image is an image of a channel of a preset proportion in the input image corresponding to the current feature extraction, and the input image corresponding to the first feature extraction is the target image;

[0272] The first intermediate feature map and the second intermediate feature map are channel-reorganized to obtain a third intermediate feature map; the second intermediate feature map is an image in the input image other than the first image;

[0273] Perform downsampling feature extraction on the third intermediate feature map to obtain an initial feature map;

[0274] Among them, the initial feature map is the input image corresponding to the next downsampling feature extraction; the first feature maps of multiple levels include the initial feature maps obtained by at least two extraction operations in the multiple extraction operations.

[0275] In some possible implementations, at least some of the channels in the first image based on two adjacent feature extractions have different relative positions in the channels in the corresponding input image.

[0276] In some possible implementations, when the extraction module 1302 performs feature extraction based on the first feature maps of multiple levels to obtain target feature maps of multiple levels, it is specifically used to:

[0277] Perform upsampling feature extraction based on the first feature maps of multiple levels to obtain second feature maps of multiple levels; wherein the second feature map of the deepest level is the first feature map of the deepest layer; the second feature maps of other levels are obtained by performing upsampling feature extraction on the second feature maps of adjacent deep levels and fusing the first feature maps of the same level;

[0278] Downsampling feature extraction is performed based on the second feature maps of multiple levels to obtain target feature maps of multiple levels; wherein the target feature map of the shallowest level is the second feature map of the shallowest level; target feature maps of other levels are obtained by downsampling feature extraction of adjacent shallow target feature maps and fusing the second feature maps of the same level.

[0279] In some possible implementations, when the extraction module 1302 performs upsampling feature extraction based on the first feature maps of multiple levels to obtain the second feature maps of multiple levels, it is specifically used to:

[0280] Performing upsampling feature extraction on the first input feature map to obtain an upsampling feature map; wherein the first input feature map based on the first upsampling feature extraction is the first feature map obtained by the last downsampling feature extraction;

[0281] The upsampled feature map is fused with the first feature map at the same level to obtain a second feature map;

[0282] The second feature map is used as the first input feature map corresponding to the next upsampling feature extraction.

[0283] In some possible implementations, when the extraction module 1302 performs multiple downsampling feature extractions based on the multiple second feature maps to obtain target feature maps of multiple levels, it is specifically used to:

[0284] Performing downsampling feature extraction on the second input feature map to obtain a downsampling feature map; wherein the second feature map obtained by the last upsampling feature extraction is the second input feature map of the first downsampling feature extraction;

[0285] The target feature map is obtained by fusing the downsampled feature map with the second feature map of the same level;

[0286] The target feature map is used as the second input feature map corresponding to the next downsampling feature extraction.

[0287] In some possible implementations, when the extraction module 1302 obtains the target feature map by fusing the downsampled feature map with the second feature map of the same level, it is specifically used to:

[0288] Fusing the downsampled feature map with the second feature map at the same level to obtain a first fused feature map;

[0289] Determine the channel weights corresponding to the channels in the first fused feature map based on the first fused feature map, and fuse the channels of the second feature map based on the channel weights to obtain a second fused feature map;

[0290] A spatial weight feature map corresponding to the second fused feature is determined, and a target feature map is determined based on the spatial weight feature map and the second fused feature.

[0291] In some possible implementations, the image processing device includes an image detection model and a training module for:

[0292] Acquire a plurality of first sample images; the first sample images include the first sample map object and do not include the second sample map object;

[0293] Acquire a plurality of second sample images; the second sample images include the second sample map object but do not include the first sample map object;

[0294] Perform at least one training operation on the initial detection model based on the first sample image and the second sample image until the first training loss and the second training loss meet the preset training end condition, thereby obtaining an image detection model;

[0295] The training operation includes:

[0296] Inputting a plurality of first sample images and a plurality of second sample images into an initial detection model to obtain a first prediction result of each corresponding first map object and a second prediction result of each corresponding second map object;

[0297] Determining a first training loss based on each first prediction result and each corresponding first sample map target;

[0298] Determining a second training loss based on each second prediction result and each corresponding second sample map target;

[0299] The parameters of the initial detection model are updated based on the first training loss and the second training loss, and the initial detection model after the updated parameters is used as the initial detection model before the next training operation.

[0300] In some possible implementations, the specific target is a map target whose size is smaller than a preset size; when the training module acquires a plurality of first sample images, it is specifically used to:

[0301] Acquire a plurality of initial sample images; wherein the initial sample images include a first sample map object and a second sample map object;

[0302] The upper half of each initial sample image is cut out according to a preset size to obtain a plurality of corresponding first sample images.

[0303] In some possible implementations, inputting a plurality of first sample images into an initial detection model to obtain respective first prediction targets includes:

[0304] For each first sample image, performing multiple extraction operations on the first sample image through the initial detection model to obtain multiple levels of first sample feature maps;

[0305] Perform upsampling feature extraction based on the multiple first sample feature maps to obtain multiple levels of second sample feature maps;

[0306] A first prediction target is determined based on a second sample feature map with the shallowest level.

[0307] The above-mentioned image processing device and the above-mentioned image processing method perform feature extraction based on the target image to obtain target feature maps of multiple levels, and detect the first map target based on the target feature map of the shallowest level, that is, detect the specific target, and detect the second map target through target feature maps of other levels. Compared with using target feature maps of each level to detect the first map target and the second map target, the present application adopts a solution of separate detection with different target feature maps, which can effectively save the amount of calculation in the detection process, thereby reducing the requirements for terminal equipment.

[0308] Furthermore, using the shallowest target feature map can ensure the accuracy of specific target detection, especially when the size of the specific target is small, which can save computational effort while ensuring accuracy.

[0309] Furthermore, each time feature extraction is performed on an image of a preset proportion of channels in the input image, the other channels are not processed, which can reduce the number of channels of the image that require convolution calculation, thereby effectively reducing the amount of calculation for the extraction operation to obtain multiple first feature maps.

[0310] Furthermore, by staggering the relative positions of at least some channels in the first image on which two adjacent feature extractions are based in the corresponding input image, feature extraction can be performed on each channel in the input image during multiple feature extractions, thereby enabling a more comprehensive feature expression of the target image to improve the accuracy of target image detection.

[0311] Furthermore, by increasing the convolution kernel and reducing the number of convolution layers, the memory can be reduced while ensuring the receptive field of the feature, thereby reducing the configuration requirements of the device for configuring the image method while ensuring the accuracy of image detection.

[0312] Furthermore, by reducing the 1×1 convolution, there is almost no impact on the final detection result, that is, it can reduce the amount of calculation and memory consumption while ensuring the accuracy of the detection result.

[0313] Furthermore, during the training process of the image detection model, by cutting out the upper half of the initial sample image containing the first sample map target and the second sample map target, a first sample image containing only the first sample map target, that is, containing the sample-specific target, can be obtained, which can effectively reduce the amount of computation during the training process.

[0314] Furthermore, in the process of determining the first prediction target based on the first sample image, multiple first sample feature maps can be obtained through multiple extraction operations; then upsampling feature extraction is performed to obtain multiple levels of second sample feature maps; then, only the second sample feature map with the shallowest level needs to be detected to determine the first prediction target, and there is no need to combine multiple second sample feature maps for downsampling feature extraction, which can effectively reduce the amount of computation in the training process.

[0315] The device of the embodiments of the present application can execute the method provided by the embodiments of the present application, and the implementation principles are similar. The actions performed by each module in the device of each embodiment of the present application correspond to the steps in the method of each embodiment of the present application. For the detailed functional description of each module of the device, please refer to the description in the corresponding method shown in the previous text, which will not be repeated here.

[0316] An embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory. When the processor executes the computer program stored in the memory, the method in any optional embodiment of the present application can be implemented.

[0317] Fig.14 FIG. 1 is a schematic diagram showing a structure of an electronic device to which an embodiment of the present invention is applicable. Fig.14 As shown, the electronic device may be a server or a user terminal, and the electronic device may be used to implement the method provided in any embodiment of the present invention.

[0318] like Fig.14 As shown in FIG. 1 , the electronic device 1400 may mainly include at least one processor 1401 ( Fig.14 1402, a communication module 1403, an input / output interface 1404 and other components are shown in FIG. Optionally, each component can be connected and communicated through a bus 1405. It should be noted that Fig.14 The structure of the electronic device 1400 shown in the figure is merely illustrative and does not constitute a limitation on the electronic device to which the method provided in the embodiment of the present application is applicable.

[0319] The memory 1402 may be used to store an operating system and an application program, etc. The application program may include a computer program that implements the method shown in the embodiment of the present invention when called by the processor 1401, and may also include a program for implementing other functions or services. The memory 1402 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and computer programs, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.

[0320] The processor 1401 is connected to the memory 1402 via the bus 1405, and implements the corresponding functions by calling the application program stored in the memory 1402. Among them, the processor 1401 can be a CPU (Central Processing Unit), a general processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof, which can implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of the present invention. The processor 1401 can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0321] The electronic device 1400 can be connected to the network through the communication module 1403 (which may include but is not limited to components such as a network interface) to communicate with other devices (such as a user terminal or a server, etc.) through the network to achieve data interaction, such as sending data to other devices or receiving data from other devices. Among them, the communication module 1403 may include a wired network interface and / or a wireless network interface, etc., that is, the communication module may include at least one of a wired communication module or a wireless communication module.

[0322] The electronic device 1400 can be connected to the required input / output devices, such as a keyboard, a display device, etc., through the input / output interface 1404. The electronic device 140 itself can have a display device, and can also be connected to other display devices through the interface 1404. Optionally, a storage device, such as a hard disk, can also be connected through the interface 1404, so that data in the electronic device 1400 can be stored in the storage device, or data in the storage device can be read, and data in the storage device can also be stored in the memory 1402. It can be understood that the input / output interface 1404 can be a wired interface or a wireless interface. Depending on the actual application scenario, the device connected to the input / output interface 1404 can be a component of the electronic device 1400, or it can be an external device connected to the electronic device 1400 when needed.

[0323] The bus 1405 for connecting the components may include a path to transmit information between the above components. The bus 1405 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. According to different functions, the bus 1405 may be divided into an address bus, a data bus, a control bus, etc.

[0324] Optionally, for the solution provided by the embodiment of the present invention, the memory 1402 can be used to store a computer program for executing the solution of the present invention, and run by the processor 1401. When the processor 1401 runs the computer program, the action of the method or device provided by the embodiment of the present invention is implemented.

[0325] Based on the same principle as the method provided in the embodiment of the present application, the embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the corresponding content of the aforementioned method embodiment can be implemented.

[0326] An embodiment of the present application also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the corresponding content of the aforementioned method embodiment can be implemented.

[0327] It should be noted that the terms "first", "second", "third", "fourth", "1", "2", etc. (if any) in the specification and claims of this 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 numbers used in this way can be interchangeable where appropriate, so that the embodiments of the application described herein can be implemented in an order other than that shown or described in the drawings.

[0328] It should be understood that, although each operation step is indicated by arrows in the flowchart of the embodiment of the present application, the implementation order of these steps is not limited to the order indicated by the arrows. Unless clearly stated herein, in some implementation scenarios of the embodiment of the present application, the implementation steps in each flowchart can be performed in other orders according to demand. In addition, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages based on actual implementation scenarios. Some or all of these sub-steps or stages may be executed at the same time, and each sub-step or stage in these sub-steps or stages may also be executed at different times respectively. In different scenarios of execution time, the execution order of these sub-steps or stages may be flexibly configured according to demand, and the embodiment of the present application does not limit this.

[0329] The above is only an optional implementation method for some implementation scenarios of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the technical concept of the solution of the present application, other similar implementation methods based on the technical ideas of the present application are also within the protection scope of the embodiments of the present application.

Claims

1. An image processing method, characterized in that: The method comprises: Acquire the target image to be detected; Perform feature extraction based on the target image to obtain target feature maps at multiple levels; The shallowest target feature map among the multiple target feature maps is used as a first target feature map, a first detection result of a first map target is obtained based on the first target feature map, and a second detection result of a second map target is obtained based on target feature maps other than the first target feature map; Wherein, the first map target includes a specific target.

2. The method according to claim 1, characterized in that The method further comprises: If the first detection result and the second detection result meet the preset detection result, the target image, the first detection result and the second detection result are sent to the server, so that the server updates the map data based on the received multiple target images and the first detection result and the second detection result of each target image.

3. The method according to claim 1, characterized in that The feature extraction is performed based on the target image to obtain target feature maps at multiple levels, including: Perform multiple extraction operations based on the target image to obtain first feature maps of multiple levels; Perform feature extraction based on the first feature maps of multiple levels to obtain target feature maps of multiple levels; Each extraction operation includes the following steps: Perform feature extraction based on the first image to obtain a first intermediate feature map; wherein the first image is an image of a channel of a preset proportion in the input image corresponding to the current feature extraction; the input image corresponding to the first feature extraction is the target image; Reorganize the channels of the first intermediate feature map and the second intermediate feature map to obtain a third intermediate feature map; the second intermediate feature map is an image in the input image other than the first image; Performing downsampling feature extraction on the third intermediate feature map to obtain an initial feature map; Among them, the initial feature map is the input image corresponding to the next downsampling feature extraction; the first feature maps of the multiple levels include initial feature maps obtained by at least two extraction operations in the multiple extraction operations.

4. The method according to claim 3, characterized in that At least some of the channels in the first image based on two adjacent feature extractions have different relative positions in the channels in the corresponding input image.

5. The method according to claim 3, characterized in that: The feature extraction is performed based on the first feature maps of multiple levels to obtain target feature maps of multiple levels, including: Perform upsampling feature extraction based on the first feature maps of multiple levels to obtain second feature maps of multiple levels; wherein the second feature map of the deepest level is the first feature map of the deepest layer; the second feature maps of other levels are obtained by performing upsampling feature extraction on the second feature maps of adjacent deep levels and fusing the first feature maps of the same level; Downsampling feature extraction is performed based on the second feature maps of multiple levels to obtain the target feature maps of multiple levels; wherein the target feature map of the shallowest level is the second feature map of the shallowest level; the target feature maps of other levels are obtained by downsampling feature extraction of the target feature maps of adjacent shallow levels and fusing the second feature maps of the same level.

6. The method according to claim 5, characterized in that The upsampling feature extraction is performed based on the first feature maps of multiple levels to obtain the second feature maps of multiple levels, including: Performing upsampling feature extraction on the first input feature map to obtain an upsampling feature map; wherein the first input feature map based on the first upsampling feature extraction is the first feature map obtained by the last downsampling feature extraction; Fusion the upsampled feature map with the first feature map at the same level to obtain a second feature map; The second feature map is used as the first input feature map corresponding to the next upsampling feature extraction.

7. The method according to claim 5, characterized in that The performing multiple downsampling feature extractions based on the multiple second feature maps to obtain the target feature maps at multiple levels includes: Performing downsampling feature extraction on the second input feature map to obtain a downsampling feature map; wherein the second feature map obtained by the last upsampling feature extraction is the second input feature map of the first downsampling feature extraction; Obtaining a target feature map by fusing the downsampled feature map with a second feature map at the same level; The target feature map is used as the second input feature map corresponding to the next downsampling feature extraction.

8. The method according to claim 7, characterized in that The step of obtaining a target feature map by fusing the downsampled feature map with a second feature map at the same level includes: Fusing the downsampled feature map with a second feature map at the same level to obtain a first fused feature map; Determine, based on the first fused feature map, channel weights corresponding to the channels in the first fused feature map, and fuse the channels of the second feature map based on the channel weights to obtain a second fused feature map; Determine a spatial weight feature map corresponding to the second fused feature, and determine the target feature map based on the spatial weight feature map and the second fused feature.

9. The method according to claim 1, characterized in that: The image processing method is implemented based on an image detection model, and the image detection model is trained based on the following method: Acquire a plurality of first sample images; the first sample images include the first sample map object and do not include the second sample map object; Acquire a plurality of second sample images; the second sample images include second sample map objects but do not include the first sample map objects; Performing at least one training operation on the initial detection model based on the first sample image and the second sample image until the first training loss and the second training loss meet the preset training end condition, thereby obtaining the image detection model; The training operation includes: Inputting a plurality of the first sample images and a plurality of the second sample images into the initial detection model to obtain a first prediction result of each corresponding first map object and a second prediction result of each corresponding second map object; Determining the first training loss based on each of the first prediction results and each corresponding first sample map target; Determining the second training loss based on each of the second prediction results and each corresponding second sample map target; The parameters of the initial detection model are updated based on the first training loss and the second training loss, and the initial detection model after the updated parameters is used as the initial detection model before the next training operation.

10. The method according to claim 9, characterized in that The specific target is a map target whose size is smaller than a preset size; and the acquiring of a plurality of first sample images comprises: Acquire a plurality of initial sample images; wherein the initial sample images include a first sample map object and a second sample map object; The upper half of each initial sample image is cut out according to a preset size to obtain a plurality of corresponding first sample images.

11. The method according to claim 9, characterized in that Inputting a plurality of first sample images into the initial detection model to obtain respective first prediction targets includes: For each first sample image, performing multiple extraction operations on the first sample image by using the initial detection model to obtain first sample feature maps of multiple levels; Perform upsampling feature extraction based on the multiple first sample feature maps to obtain multiple levels of second sample feature maps; The first prediction target is determined based on a second sample feature map with the shallowest level.

12. An image processing device, characterized in that: The device comprises: An acquisition module, used for acquiring a target image to be detected; An extraction module is used to extract features based on the target image to obtain target feature maps at multiple levels; a detection module, configured to use the shallowest target feature map among the plurality of target feature maps as a first target feature map, obtain a first detection result of a first map target based on the first target feature map, and obtain a second detection result of a second map target based on target feature maps other than the first target feature map; Wherein, the first map target includes a specific target.

13. An electronic device, characterized in that: The electronic device comprises a memory and a processor, wherein a computer program is stored in the memory, and the processor executes the computer program to implement the method according to any one of claims 1 to 11.

14. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 11 is implemented.

15. A computer program product, characterized in that The computer product comprises a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 11 is implemented.

Citation Information

Patent Citations

  • Map updating method and device, electronic equipment and computer readable storage medium

    CN113704276A

  • Image target detection method, system and device and storage medium

    CN114581744A

  • Target defect detection method and device, computer equipment and storage medium

    CN114882002A

Cited By

  • System and methods for automated light rigging in virtual interactive environments

    US12477639B2

  • System and methods for automated light rigging in virtual interactive environments

    US20240334573A1