WO2021169132A1 - 图像处理方法及装置、电子设备和存储介质 - Google Patents

图像处理方法及装置、电子设备和存储介质 Download PDF

Info

Publication number
WO2021169132A1
WO2021169132A1 PCT/CN2020/099964 CN2020099964W WO2021169132A1 WO 2021169132 A1 WO2021169132 A1 WO 2021169132A1 CN 2020099964 W CN2020099964 W CN 2020099964W WO 2021169132 A1 WO2021169132 A1 WO 2021169132A1
Authority
WO
WIPO (PCT)
Prior art keywords
feature map
feature
map
convolution kernel
module
Prior art date
Application number
PCT/CN2020/099964
Other languages
English (en)
French (fr)
Inventor
刘建博
任思捷
李洪升
王晓刚
Original Assignee
深圳市商汤科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市商汤科技有限公司 filed Critical 深圳市商汤科技有限公司
Publication of WO2021169132A1 publication Critical patent/WO2021169132A1/zh
Priority to US17/890,393 priority Critical patent/US20220392202A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/7715Feature extraction, e.g. by transforming the feature space, e.g. multi-dimensional scaling [MDS]; Mappings, e.g. subspace methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/25Fusion techniques
    • G06F18/253Fusion techniques of extracted features
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/42Global feature extraction by analysis of the whole pattern, e.g. using frequency domain transformations or autocorrelation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/80Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level
    • G06V10/806Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level of extracted features
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks

Definitions

  • the present disclosure relates to the field of computer technology, and in particular to an image processing method and device, electronic equipment, and storage medium.
  • the related art image processing method usually extracts the feature map of the image, analyzes the object information in the image scene according to the feature map, and then obtains the processing result of the image.
  • an image processing method including: performing feature extraction on an image to be processed to obtain a first feature map of the image to be processed; performing weight prediction on the first feature map to obtain the A weighted feature map of the first feature map, the weighted feature map including the weight values of the feature points in the first feature map; according to the weighted feature map, feature value adjustments are performed on the feature points in the first feature map , Obtain a second feature map; determine the processing result of the image to be processed according to the second feature map.
  • the performing weight prediction on the first feature map to obtain the weighted feature map of the first feature map includes: performing a convolution kernel on each channel of the first feature map Prediction, determine the first convolution kernel tensor of the first feature map, the number of channels of the first convolution kernel tensor is the same as the number of channels of the first feature map, and the number of channels of the first convolution kernel tensor The length and width correspond to the preset convolution kernel size; according to the first convolution kernel tensor, convolution processing is performed on the first feature map to obtain the weighted feature map.
  • the performing convolution processing on the first feature map according to the first convolution kernel tensor to obtain the weight feature map includes: according to the first feature map The first convolution kernel tensor of and multiple preset expansion rates, the first feature map is subjected to hole convolution to obtain multiple fourth feature maps of the first feature map; The four feature maps are activated separately to obtain multiple fifth feature maps; according to the multiple fifth feature maps, a weighted feature map of the first feature map is determined.
  • the performing convolution kernel prediction on each channel of the first feature map to determine the first convolution kernel tensor of the first feature map includes:
  • the feature maps are respectively subjected to convolution transformation to obtain the key feature map and the retrieval feature map of the first feature map.
  • the scale of the key feature map is the same as the scale of the first feature map, and the length of the retrieval feature map is The width is the same as the length and width of the first feature map, and the number of channels of the retrieval feature map corresponds to the size of the convolution kernel; the key feature map and the retrieval feature map are respectively rearranged to obtain The first feature matrix of the key feature map and the second feature matrix of the retrieval feature map; matrix multiplication is performed on the first feature matrix and the second feature matrix to obtain the first feature matrix of the first feature map Three feature matrix; according to the third feature matrix, determine the first convolution kernel tensor of the first feature map.
  • the determining the first convolution kernel tensor of the first feature map according to the third feature matrix includes: rearranging the third feature matrix to obtain the The second convolution kernel tensor of the first feature map; normalizing the second convolution kernel tensor to determine the first convolution kernel tensor of the first feature map.
  • the adjusting the feature values of the feature points in the first feature map according to the weight feature map to obtain a second feature map includes: comparing the first feature map with The weight feature map is multiplied by elements to obtain the second feature map.
  • the method further includes: global pooling of the first feature map to obtain a pooled feature map of the first feature map, and the scale of the pooled feature map The scales of the first feature map are the same;
  • the determining the processing result of the image to be processed according to the second feature map includes: fusing the second feature map with the pooling feature map to obtain a fusion feature map; and comparing the fusion feature map Perform segmentation to obtain the processing result of the image to be processed.
  • an image processing device including: a feature extraction module for performing feature extraction on an image to be processed to obtain a first feature map of the image to be processed;
  • the first feature map performs weight prediction to obtain a weighted feature map of the first feature map.
  • the weighted feature map includes the weight values of the feature points in the first feature map;
  • Figure performing feature value adjustment on the feature points in the first feature map to obtain a second feature map;
  • the result determination module is configured to determine the processing result of the image to be processed according to the second feature map.
  • the weight prediction module includes: a convolution kernel prediction sub-module, configured to perform convolution kernel prediction on each channel of the first feature map, and determine the first feature map of the first feature map.
  • a convolution kernel tensor the number of channels of the first convolution kernel tensor is the same as the number of channels of the first feature map, and the length and width of the first convolution kernel tensor are the same as the preset convolution kernel size
  • a weight determination submodule configured to perform convolution processing on the first feature map according to the first convolution kernel tensor to obtain the weight feature map.
  • the weight determination sub-module includes: a hole convolution sub-module, which is configured to perform calculations based on the first convolution kernel tensor of the first feature map and multiple preset expansion rates. Perform hole convolution on the first feature map to obtain multiple fourth feature maps of the first feature map; an activation sub-module is used to activate the multiple fourth feature maps to obtain multiple fifth feature maps. Feature map; a determining sub-module for determining the weighted feature map of the first feature map according to the multiple fifth feature maps.
  • the convolution kernel prediction sub-module includes: a transform sub-module, configured to perform convolution transformation on the first feature map to obtain the key feature map and the key feature map of the first feature map. Retrieve a feature map, the scale of the key feature map is the same as the scale of the first feature map, the length and width of the retrieval feature map are the same as the length and width of the first feature map, and the The number of channels corresponds to the size of the convolution kernel; the rearrangement sub-module is used to rearrange the key feature map and the retrieval feature map, respectively, to obtain the first feature matrix of the key feature map and the retrieve the second feature matrix of the feature map; a matrix multiplication sub-module, used to perform matrix multiplication on the first feature matrix and the second feature matrix to obtain the third feature matrix of the first feature map; The quantity determination sub-module is configured to determine the first convolution kernel tensor of the first feature map according to the third feature matrix.
  • the adjustment module includes: an adjustment sub-module configured to perform element multiplication on the first feature map and the weight feature map to obtain the second feature map.
  • the device further includes: a global pooling module, configured to perform global pooling on the first feature map to obtain a pooled feature map of the first feature map, and the pool The scale of the transformed feature map is the same as the scale of the first feature map;
  • the result determination module includes: a fusion sub-module for fusing the second feature map with the pooling feature map to obtain a fusion feature map; a first segmentation sub-module for performing a fusion on the fusion feature map Segmentation to obtain the processing result of the image to be processed.
  • the global pooling module includes: a pooling sub-module for pooling the first feature map to obtain the first vector of the first feature map; convolution The module is used to convolve the first vector to obtain a second vector; the up-sampling sub-module is used to up-sample the second vector to obtain the pooled feature map of the first feature map.
  • an electronic device including: a processor; a memory for storing executable instructions of the processor; wherein the processor is configured to call the instructions stored in the memory to execute the foregoing method.
  • a computer program including computer readable code, and when the computer readable code runs in an electronic device, a processor in the electronic device executes the above method.
  • the present disclosure it is possible to perform weight prediction on the feature map of the image to be processed to obtain the weighted feature map including the weight values of the feature points in the feature map; adjust the feature points in the feature map according to the weighted feature map;
  • the feature map determines the processing result of the image, so that the enhancement of image feature information is realized through the weight value that is not shared globally, and the accuracy of image processing is improved.
  • Fig. 2 shows a schematic diagram of a processing procedure of an image processing method according to an embodiment of the present disclosure.
  • Fig. 4 shows a block diagram of an electronic device according to an embodiment of the present disclosure.
  • Fig. 5 shows a block diagram of an electronic device according to an embodiment of the present disclosure.
  • image feature information can be enhanced through weight values that are not shared globally during image processing.
  • Fig. 1 shows a flowchart of an image processing method according to an embodiment of the present disclosure. As shown in Fig. 1, the method includes:
  • step S11 feature extraction is performed on the image to be processed to obtain a first feature map of the image to be processed
  • step S12 weight prediction is performed on the first feature map to obtain a weighted feature map of the first feature map, and the weighted feature map includes the weight values of the feature points in the first feature map;
  • step S13 according to the weighted feature map, feature value adjustment is performed on the feature points in the first feature map to obtain a second feature map;
  • step S14 the processing result of the image to be processed is determined according to the second characteristic map.
  • the image processing method can be executed by electronic equipment such as a terminal device or a server, and the terminal device can be a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, or a cordless
  • UE user equipment
  • PDAs personal digital assistants
  • the method can be implemented by a processor invoking computer-readable instructions stored in a memory.
  • the method can be executed by a server.
  • step S11 feature extraction of the image to be processed may be performed, for example, by using a convolutional neural network to obtain the first feature map X of the image to be processed.
  • the first feature map may reflect the feature information (for example, semantic information) of each pixel position in the image to be processed, so as to classify each pixel position in the image to be processed according to the feature information in subsequent processing.
  • the convolutional neural network may, for example, adopt a residual network (ResNet), and the present disclosure does not limit the specific network structure of the convolutional neural network.
  • step S12 weight prediction may be performed on the first feature map to predict the weight value of the feature point in the first feature map (also referred to as a weight factor or a weight weight factor) to obtain the first feature map.
  • a weighted feature map W of a feature map X may be performed on the first feature map to predict the weight value of the feature point in the first feature map (also referred to as a weight factor or a weight weight factor) to obtain the first feature map.
  • each point in the weighted feature map W may correspond to the weight value of each feature point in the first feature map X, for example, the scale of the weighted feature map W and the first feature map X Similarly, for example, the scale of the first feature map X is h ⁇ w ⁇ c, and the weighted feature map W is also h ⁇ w ⁇ c, where h and w represent height and width, and c represents the number of channels, for example, c is 512.
  • the feature points in the weighted feature map W may also correspond to the weight values of some feature points in the first feature map X, that is, the weights of some feature points in the first feature map X Value, the scale of the weighted feature map W is smaller than the scale of the first feature map X.
  • the scale of the weighted feature map W is (h/2) ⁇ (w/2) ⁇ c, and the weight value of a certain point in the 2 ⁇ 2 area in the first feature map X corresponds to the point in the weighted feature map W.
  • the present disclosure does not limit the scale of the weighted feature map W and the corresponding relationship between the weight value of each point in the weighted feature map W and the feature points in the first feature map X.
  • the first feature map X can be weighted according to the weighted feature map W, and the feature values of the feature points in the first feature map are adjusted to obtain the adjusted second feature map.
  • the scale of the second feature map is the same as the scale of the first feature map X.
  • the processing result of the image to be processed may be determined according to the second characteristic map.
  • the second feature map can be segmented directly to obtain the segmentation result; the second feature map can also be further processed to segment the processed feature map to obtain the segmentation result.
  • the processing result of the image to be processed can be obtained, and the processing result may be the above-mentioned segmentation result, or the result of reprocessing the above-mentioned segmentation result according to the actual image processing task.
  • the foreground area and the background area can be distinguished according to the segmentation results, and the foreground area and/or background area can be processed accordingly, such as blurring the background area to obtain the final image processing result.
  • the present disclosure does not limit the segmentation method of the feature map and the specific content included in the processing result.
  • the embodiment of the present disclosure it is possible to perform weight prediction on the feature map of the image to be processed to obtain a weighted feature map including the weight values of the feature points in the feature map; adjust the feature points in the feature map according to the weighted feature map;
  • the feature map determines the processing result of the image, so that the enhancement of image feature information is realized through the weight value that is not shared globally, and the accuracy of image processing is improved.
  • step S12 may include:
  • the first convolution kernel tensor convolution processing is performed on the first feature map to obtain the weight feature map.
  • the first feature map may embody feature information (for example, semantic information) of each pixel position in the image to be processed.
  • the feature-adaptive convolution kernel prediction can be performed to determine the first convolution kernel tensor of the first feature map.
  • the first convolution kernel tensor includes the predicted values of all channels. Convolution kernel, therefore, the number of channels of the first convolution kernel tensor is the same as the number of channels of the first feature map, and the length and width of the first convolution kernel tensor correspond to the preset convolution kernel size s ⁇ s .
  • the size of the convolution kernel may be 3 ⁇ 3, and the length and width of the first convolution kernel tensor may be 3 respectively. It should be understood that those skilled in the art can set the value of the convolution kernel size s ⁇ s according to the actual situation, which is not limited in the present disclosure.
  • Convolution transformation is performed on the first feature map to obtain a key feature map of the first feature map and a retrieval feature map
  • the scale of the key feature map is the same as the scale of the first feature map
  • the retrieval The length and width of the feature map are the same as the length and width of the first feature map, and the number of channels of the retrieval feature map corresponds to the size of the convolution kernel;
  • the first convolution kernel tensor of the first feature map is determined.
  • convolutional transformations T k and T q can be preset.
  • the convolutional transformations T k and T q are composed of one or more 1 ⁇ 1 convolution operations and are independent of each other.
  • the specific method is not limited.
  • the first feature map can be transformed by the convolution transformation T q to obtain the retrieval (Query) feature map Q.
  • Retrieving the feature map Q can extract the global spatial distribution information of the first feature map.
  • the length and width of the retrieval feature map Q are the same as the length and width of the first feature map, that is, h ⁇ w; the number of channels corresponds to the size of the convolution kernel, that is, s ⁇ s, for example, the size of the convolution kernel is 3. ⁇ 3, the number of channels for searching the feature map Q is 9.
  • the first feature matrix The scale of is 4096 ⁇ 512; the second feature matrix The scale is 4096 ⁇ 9.
  • the first feature matrix can be And the second characteristic matrix Multiply the matrices to get the third feature matrix of the first feature map
  • the convolution kernels of all the channels of the first feature map can be predicted with lower computational complexity, thereby improving processing efficiency.
  • the step of determining the first convolution kernel tensor of the first feature map according to the third feature matrix may include:
  • the step of performing convolution processing on the first feature map according to the first convolution kernel tensor to obtain the weight feature map may include:
  • a weighted feature map of the first feature map is determined.
  • a plurality of dilation rates of the hole convolution can be preset, for example, the dilation rate is 1, 2 and 3; according to the first convolution kernel tensor and the multiple dilation rates, the first feature The image is convolved with holes to obtain multiple fourth feature maps of the first feature map, and the number of the fourth feature maps is the same as the number of expansion rates.
  • the size of the convolution kernel is 3 ⁇ 3, the expansion rate is 1, 2, and 3, and the feature regions involved in the operation of each convolution are 3 ⁇ 3, 5 ⁇ 5, and 7 ⁇ 7, respectively. It should be understood that those skilled in the art can set the number of expansion rates of the hole convolution according to the actual situation, which is not limited in the present disclosure.
  • the scale of the fourth feature map is smaller than the scale of the first feature map. That is, when each point in the weighted feature map W corresponds to the weight value of multiple feature points in the first feature map X, the scale of the fourth feature map is smaller than the scale of the first feature map X, for example, (h/2) ⁇ (w/2) ⁇ c. In this way, the amount of calculation in the image processing process can be reduced.
  • the first feature map is subjected to hole convolution to obtain the first
  • the multiple fourth feature maps of the feature map include:
  • the cut-out first feature maps are respectively subjected to hollow convolution to obtain multiple fourth feature maps of the first feature map.
  • the first feature map X can be cropped first, and the weight values to be generated are retained. Part of the feature points. Then, according to the first convolution kernel tensor and the multiple expansion rates, the cut-out first feature maps are respectively subjected to hole convolution to obtain multiple fourth feature maps of the first feature map.
  • the scale of the obtained fourth feature map is smaller than the scale of the first feature map, for example, (h/2) ⁇ (w/2) ⁇ c. In this way, the weight values of some feature points in the first feature map can be obtained, and the amount of calculation in the image processing process can be reduced.
  • multiple fourth feature maps can be activated respectively through the Sigmoid activation layer to obtain multiple fifth feature maps after activation; the multiple fifth feature maps are added together and calculated. After averaging, the weighted feature map W of the first feature map can be obtained.
  • step S14 includes: fusing the second feature map and the pooling feature map to obtain a fusion feature map; segmenting the fusion feature map to obtain a processing result of the image to be processed.
  • Training the neural network according to a preset training set including a plurality of sample images and annotation information of the plurality of sample images.
  • the device further includes: a global pooling module, configured to perform global pooling on the first feature map to obtain a pooled feature map of the first feature map, and the pool The scale of the transformed feature map is the same as the scale of the first feature map;
  • the global pooling module includes: a pooling sub-module for pooling the first feature map to obtain the first vector of the first feature map; convolution The module is used to convolve the first vector to obtain a second vector; the up-sampling sub-module is used to up-sample the second vector to obtain the pooled feature map of the first feature map.
  • the functions or modules contained in the device provided in the embodiments of the present disclosure can be used to execute the methods described in the above method embodiments.
  • the functions or modules contained in the device provided in the embodiments of the present disclosure can be used to execute the methods described in the above method embodiments.
  • the embodiments of the present disclosure also provide a computer program product, which includes computer-readable code.
  • the processor in the device executes the image processing method for implementing the image processing method provided by any of the above embodiments. instruction.
  • the embodiments of the present disclosure also provide another computer program product for storing computer-readable instructions, which when executed, cause the computer to perform the operations of the image processing method provided by any of the foregoing embodiments.
  • the electronic device 800 may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, and a sensor component 814 , And communication component 816.
  • the processing component 802 generally controls the overall operations of the electronic device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations.
  • the processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the foregoing method.
  • the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components.
  • the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
  • the memory 804 is configured to store various types of data to support operations in the electronic device 800. Examples of these data include instructions for any application or method to operate on the electronic device 800, contact data, phone book data, messages, pictures, videos, etc.
  • the memory 804 can be implemented by any type of volatile or non-volatile storage device or their combination, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Magnetic Disk or Optical Disk.
  • SRAM static random access memory
  • EEPROM electrically erasable programmable read-only memory
  • EPROM erasable Programmable Read Only Memory
  • PROM Programmable Read Only Memory
  • ROM Read Only Memory
  • Magnetic Memory Flash Memory
  • Magnetic Disk Magnetic Disk or Optical Disk.
  • the I/O interface 812 provides an interface between the processing component 802 and a peripheral interface module.
  • the above-mentioned peripheral interface module may be a keyboard, a click wheel, a button, and the like. These buttons may include, but are not limited to: home button, volume button, start button, and lock button.
  • the sensor component 814 includes one or more sensors for providing the electronic device 800 with various aspects of state evaluation.
  • the sensor component 814 can detect the on/off status of the electronic device 800 and the relative positioning of the components.
  • the component is the display and the keypad of the electronic device 800.
  • the sensor component 814 can also detect the electronic device 800 or the electronic device 800.
  • the position of the component changes, the presence or absence of contact between the user and the electronic device 800, the orientation or acceleration/deceleration of the electronic device 800, and the temperature change of the electronic device 800.
  • the sensor component 814 may include a proximity sensor configured to detect the presence of nearby objects when there is no physical contact.
  • the sensor component 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications.
  • the sensor component 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
  • the communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices.
  • the electronic device 800 can access a wireless network based on a communication standard, such as WiFi, 2G, or 3G, or a combination thereof.
  • the communication component 816 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel.
  • the communication component 816 further includes a near field communication (NFC) module to facilitate short-range communication.
  • the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
  • RFID radio frequency identification
  • IrDA infrared data association
  • UWB ultra-wideband
  • Bluetooth Bluetooth
  • the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field-available A programmable gate array (FPGA), controller, microcontroller, microprocessor, or other electronic components are implemented to implement the above methods.
  • ASIC application-specific integrated circuits
  • DSP digital signal processors
  • DSPD digital signal processing devices
  • PLD programmable logic devices
  • FPGA field-available A programmable gate array
  • controller microcontroller, microprocessor, or other electronic components are implemented to implement the above methods.
  • FIG. 5 shows a block diagram of an electronic device 1900 according to an embodiment of the present disclosure.
  • the electronic device 1900 may be provided as a server. 5
  • the electronic device 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932, for storing instructions executable by the processing component 1922, such as application programs.
  • the application program stored in the memory 1932 may include one or more modules each corresponding to a set of instructions.
  • the processing component 1922 is configured to execute instructions to perform the above-described methods.
  • the electronic device 1900 may also include a power supply component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to the network, and an input output (I/O) interface 1958 .
  • the electronic device 1900 can operate based on an operating system stored in the memory 1932, such as Windows Server TM , Mac OS X TM , Unix TM , Linux TM , FreeBSD TM or the like.
  • a non-volatile computer-readable storage medium is also provided, such as the memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the electronic device 1900 to complete the foregoing method.
  • the present disclosure may be a system, method and/or computer program product.
  • the computer program product may include a computer-readable storage medium loaded with computer-readable program instructions for enabling a processor to implement various aspects of the present disclosure.
  • the computer-readable storage medium may be a tangible device that can hold and store instructions used by the instruction execution device.
  • the computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing.
  • Computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM) Or flash memory), static random access memory (SRAM), portable compact disk read-only memory (CD-ROM), digital versatile disk (DVD), memory stick, floppy disk, mechanical encoding device, such as a printer with instructions stored thereon
  • RAM random access memory
  • ROM read-only memory
  • EPROM erasable programmable read-only memory
  • flash memory flash memory
  • SRAM static random access memory
  • CD-ROM compact disk read-only memory
  • DVD digital versatile disk
  • memory stick floppy disk
  • mechanical encoding device such as a printer with instructions stored thereon
  • the computer-readable storage medium used here is not interpreted as the instantaneous signal itself, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (for example, light pulses through fiber optic cables), or through wires Transmission of electrical signals.
  • the computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to various computing/processing devices, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and/or a wireless network.
  • the network may include copper transmission cables, optical fiber transmission, wireless transmission, routers, firewalls, switches, gateway computers, and/or edge servers.
  • the network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network, and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing/processing device .
  • the remote computer can be connected to the user's computer through any kind of network-including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, using an Internet service provider to connect to the user's computer) connect).
  • LAN local area network
  • WAN wide area network
  • an electronic circuit such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), can be customized by using the status information of the computer-readable program instructions.
  • the computer-readable program instructions are executed to realize various aspects of the present disclosure.
  • each block in the flowchart or block diagram may represent a module, program segment, or part of an instruction, and the module, program segment, or part of an instruction contains one or more components for realizing the specified logical function.
  • Executable instructions may also occur in a different order from the order marked in the drawings. For example, two consecutive blocks can actually be executed substantially in parallel, or they can sometimes be executed in the reverse order, depending on the functions involved.
  • each block in the block diagram and/or flowchart, and the combination of the blocks in the block diagram and/or flowchart can be implemented by a dedicated hardware-based system that performs the specified functions or actions Or it can be realized by a combination of dedicated hardware and computer instructions.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Medical Informatics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Image Analysis (AREA)

Abstract

一种图像处理方法及装置、电子设备和存储介质,所述方法包括:对待处理图像进行特征提取,得到所述待处理图像的第一特征图(S11);对所述第一特征图进行权重预测,得到所述第一特征图的权重特征图(S12),所述权重特征图包括所述第一特征图中特征点的权重值;根据所述权重特征图,对所述第一特征图中的特征点进行特征值调整,得到第二特征图(S13);根据所述第二特征图,确定所述待处理图像的处理结果(S14)。可提高图像处理的精度。

Description

图像处理方法及装置、电子设备和存储介质
本申请要求在2020年2月28日提交中国专利局、申请号为202010129399.9、发明名称为“图像处理方法及装置、电子设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本公开涉及计算机技术领域,尤其涉及一种图像处理方法及装置、电子设备和存储介质。
背景技术
在计算机视觉等领域,通常需要对图像进行处理。相关技术的图像处理方法通常会提取图像的特征图,根据特征图分析图像场景中的物体信息,进而得到图像的处理结果。
发明内容
本公开提出了一种图像处理技术方案。
根据本公开的一方面,提供了一种图像处理方法,包括:对待处理图像进行特征提取,得到所述待处理图像的第一特征图;对所述第一特征图进行权重预测,得到所述第一特征图的权重特征图,所述权重特征图包括所述第一特征图中特征点的权重值;根据所述权重特征图,对所述第一特征图中的特征点进行特征值调整,得到第二特征图;根据所述第二特征图,确定所述待处理图像的处理结果。
在一种可能的实现方式中,所述对所述第一特征图进行权重预测,得到所述第一特征图的权重特征图,包括:对所述第一特征图的各个通道进行卷积核预测,确定所述第一特征图的第一卷积核张量,所述第一卷积核张量的通道数与第一特征图的通道数相同,所述第一卷积核张量的长度及宽度与预设的卷积核尺寸相对应;根据所述第一卷积核张量,对所述第一特征图进行卷积处理,得到所述权重特征图。
在一种可能的实现方式中,所述根据所述第一卷积核张量,对所述第一特征图进行卷积处理,得到所述权重特征图,包括:根据所述第一特征图的第一卷积核张量以及预设的多个扩张率,对所述第一特征图进行空洞卷积,得到所述第一特征图的多个第四特征图;对所述多个第四特征图分别进行激活,得到多个第五特征图;根据所述多个第五特征图,确定所述第一特征图的权重特征图。
在一种可能的实现方式中,所述对所述第一特征图的各个通道进行卷积核预测,确定所述第一特征图的第一卷积核张量,包括:对所述第一特征图分别进行卷积变换,得到所述第一特征图的关键特征图和检索特征图,所述关键特征图的尺度与所述第一特征图的尺度相同,所述检索特征图的长度及宽度与所述第一特征图的长度及宽度相同,所述检索特征图的通道数与所述卷积核尺寸相对应;对所述关键特征图和所述检索特征图分别进行重排列,得到所述关键特征图的第一特征矩阵和所述检索特征图的第二特征矩阵;对所述第一特征矩阵和所述第二特征矩阵进行矩阵相乘,得到所述第一特征图的第三特征矩阵;根据所述第三特征矩阵,确定所述第一特征图的第一卷积核张量。
在一种可能的实现方式中,所述根据所述第三特征矩阵,确定所述第一特征图的第一卷积核张量, 包括:对所述第三特征矩阵进行重排列,得到所述第一特征图的第二卷积核张量;对所述第二卷积核张量进行归一化处理,确定所述第一特征图的第一卷积核张量。
在一种可能的实现方式中,所述根据所述权重特征图,对所述第一特征图中的特征点进行特征值调整,得到第二特征图,包括:对所述第一特征图与所述权重特征图进行元素相乘,得到所述第二特征图。
在一种可能的实现方式中,所述方法还包括:对所述第一特征图进行全局池化,得到所述第一特征图的池化特征图,所述池化特征图的尺度与所述第一特征图的尺度相同;
所述根据所述第二特征图,确定所述待处理图像的处理结果,包括:将所述第二特征图与所述池化特征图进行融合,得到融合特征图;对所述融合特征图进行分割,得到所述待处理图像的处理结果。
在一种可能的实现方式中,对所述第一特征图进行全局池化,得到所述第一特征图的池化特征图,包括:对所述第一特征图进行池化,得到所述第一特征图的第一向量;对所述第一向量进行卷积,得到第二向量;对所述第二向量进行上采样,得到所述第一特征图的池化特征图。
在一种可能的实现方式中,所述根据所述第二特征图,确定所述待处理图像的处理结果,包括:对所述第二特征图进行分割,得到所述待处理图像的处理结果。
根据本公开的一方面,提供了一种图像处理装置,包括:特征提取模块,用于对待处理图像进行特征提取,得到所述待处理图像的第一特征图;权重预测模块,用于对所述第一特征图进行权重预测,得到所述第一特征图的权重特征图,所述权重特征图包括所述第一特征图中特征点的权重值;调整模块,用于根据所述权重特征图,对所述第一特征图中的特征点进行特征值调整,得到第二特征图;结果确定模块,用于根据所述第二特征图,确定所述待处理图像的处理结果。
在一种可能的实现方式中,所述权重预测模块包括:卷积核预测子模块,用于对所述第一特征图的各个通道进行卷积核预测,确定所述第一特征图的第一卷积核张量,所述第一卷积核张量的通道数与第一特征图的通道数相同,所述第一卷积核张量的长度及宽度与预设的卷积核尺寸相对应;权重确定子模块,用于根据所述第一卷积核张量,对所述第一特征图进行卷积处理,得到所述权重特征图。
在一种可能的实现方式中,所述权重确定子模块包括:空洞卷积子模块,用于根据所述第一特征图的第一卷积核张量以及预设的多个扩张率,对所述第一特征图进行空洞卷积,得到所述第一特征图的多个第四特征图;激活子模块,用于对所述多个第四特征图分别进行激活,得到多个第五特征图;确定子模块,用于根据所述多个第五特征图,确定所述第一特征图的权重特征图。
在一种可能的实现方式中,所述卷积核预测子模块包括:变换子模块,用于对所述第一特征图分别进行卷积变换,得到所述第一特征图的关键特征图和检索特征图,所述关键特征图的尺度与所述第一特征图的尺度相同,所述检索特征图的长度及宽度与所述第一特征图的长度及宽度相同,所述检索特征图的通道数与所述卷积核尺寸相对应;重排列子模块,用于对所述关键特征图和所述检索特征图分别进行重排列,得到所述关键特征图的第一特征矩阵和所述检索特征图的第二特征矩阵;矩阵相乘子模块,用于对所述第一特征矩阵和所述第二特征矩阵进行矩阵相乘,得到所述第一特征图的第三特征矩阵;张量确定子模块,用于根据所述第三特征矩阵,确定所述第一特征图的第一卷积核张量。
在一种可能的实现方式中,所述张量确定子模块用于:对所述第三特征矩阵进行重排列,得到所述第一特征图的第二卷积核张量;对所述第二卷积核张量进行归一化处理,确定所述第一特征图的第 一卷积核张量。
在一种可能的实现方式中,所述调整模块包括:调整子模块,用于对所述第一特征图与所述权重特征图进行元素相乘,得到所述第二特征图。
在一种可能的实现方式中,所述装置还包括:全局池化模块,用于对所述第一特征图进行全局池化,得到所述第一特征图的池化特征图,所述池化特征图的尺度与所述第一特征图的尺度相同;
所述结果确定模块包括:融合子模块,用于将所述第二特征图与所述池化特征图进行融合,得到融合特征图;第一分割子模块,用于对所述融合特征图进行分割,得到所述待处理图像的处理结果。
在一种可能的实现方式中,所述全局池化模块包括:池化子模块,用于对所述第一特征图进行池化,得到所述第一特征图的第一向量;卷积子模块,用于对所述第一向量进行卷积,得到第二向量;上采样子模块,用于对所述第二向量进行上采样,得到所述第一特征图的池化特征图。
在一种可能的实现方式中,所述结果确定模块包括:第二分割子模块,用于对所述第二特征图进行分割,得到所述待处理图像的处理结果。
根据本公开的一方面,提供了一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器被配置为调用所述存储器存储的指令,以执行上述方法。
根据本公开的一方面,提供了一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述方法。
根据本公开的一方面,提供了一种计算机程序,包括计算机可读代码,当所述计算机可读代码在电子设备中运行时,所述电子设备中的处理器执行上述方法。
在本公开实施例中,能够对待处理图像的特征图进行权重预测,得到包括特征图中特征点的权重值的权重特征图;根据权重特征图对特征图中的特征点进行调整;根据调整后的特征图确定图像的处理结果,从而通过全局不共享的权重值实现图像特征信息的增强,提高图像处理的精度。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,而非限制本公开。根据下面参考附图对示例性实施例的详细说明,本公开的其它特征及方面将变得清楚。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开的技术方案。
图1示出根据本公开实施例的图像处理方法的流程图。
图2示出根据本公开实施例的图像处理方法的处理过程的示意图。
图3示出根据本公开实施例的图像处理装置的框图。
图4示出根据本公开实施例的一种电子设备的框图。
图5示出根据本公开实施例的一种电子设备的框图。
具体实施方式
以下将参考附图详细说明本公开的各种示例性实施例、特征和方面。附图中相同的附图标记表示功能相同或相似的元件。尽管在附图中示出了实施例的各种方面,但是除非特别指出,不必按比例绘 制附图。
在这里专用的词“示例性”意为“用作例子、实施例或说明性”。这里作为“示例性”所说明的任何实施例不必解释为优于或好于其它实施例。
本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中术语“至少一种”表示多种中的任意一种或多种中的至少两种的任意组合,例如,包括A、B、C中的至少一种,可以表示包括从A、B和C构成的集合中选择的任意一个或多个元素。
另外,为了更好地说明本公开,在下文的具体实施方式中给出了众多的具体细节。本领域技术人员应当理解,没有某些具体细节,本公开同样可以实施。在一些实例中,对于本领域技术人员熟知的方法、手段、元件和电路未作详细描述,以便于凸显本公开的主旨。
在智能视频分析、智能医疗、自动驾驶等领域,通常需要对图像进行处理,以识别图像中的目标。例如,在自动驾驶场景中,通常需要对车况场景中的汽车、行人、车道线等目标物体进行识别分割,来实现车况的智能感知任务。为了提高图像处理的精度,可在图像处理时,通过全局不共享的权重值对图像特征信息进行增强。
图1示出根据本公开实施例的图像处理方法的流程图,如图1所示,所述方法包括:
在步骤S11中,对待处理图像进行特征提取,得到所述待处理图像的第一特征图;
在步骤S12中,对所述第一特征图进行权重预测,得到所述第一特征图的权重特征图,所述权重特征图包括所述第一特征图中特征点的权重值;
在步骤S13中,根据所述权重特征图,对所述第一特征图中的特征点进行特征值调整,得到第二特征图;
在步骤S14中,根据所述第二特征图,确定所述待处理图像的处理结果。
在一种可能的实现方式中,所述图像处理方法可以由终端设备或服务器等电子设备执行,终端设备可以为用户设备(User Equipment,UE)、移动设备、用户终端、终端、蜂窝电话、无绳电话、个人数字处理(Personal Digital Assistant,PDA)、手持设备、计算设备、车载设备、可穿戴设备等,所述方法可以通过处理器调用存储器中存储的计算机可读指令的方式来实现。或者,可通过服务器执行所述方法。
在一种可能的实现方式中,待处理图像可以是图像采集设备(例如摄像头)采集的图像,图像中包括待识别的一个或多个目标,例如人、动物、车辆、物品等。本公开对待处理图像的来源及待处理图像中目标的具体类别不作限制。
在一种可能的实现方式中,在步骤S11中,可例如通过卷积神经网络对待处理图像进行特征提取,得到待处理图像的第一特征图X。该第一特征图可体现待处理图像中各个像素位置的特征信息(例如语义信息),以便在后续处理中根据特征信息对待处理图像中的各个像素位置进行分类。该卷积神经网络可例如采用残差网络(ResNet),本公开对卷积神经网络的具体网络结构不作限制。
在一种可能的实现方式中,在步骤S12中,可对第一特征图进行权重预测,为第一特征图中特征点预测权重值(也可称为权重因子或权重加权因子),得到第一特征图X的权重特征图W。
在一种可能的实现方式中,该权重特征图W中的每个点可以对应于第一特征图X中每个特征点的 权重值,例如该权重特征图W与第一特征图X的尺度相同,例如第一特征图X的尺度为h×w×c,则权重特征图W同样为h×w×c,其中h和w表示高度和宽度,c表示通道数量,例如c为512。
在一种可能的实现方式中,该权重特征图W中的每个点也可以对应于第一特征图X中多个特征点的权重值,也即权重值部分共享,权重特征图W的尺度小于第一特征图X的尺度。例如权重特征图W的尺度为(h/2)×(w/2)×c,权重特征图W中的每个点对应第一特征图X中2×2区域的4个点的权重值。
在一种可能的实现方式中,该权重特征图W中的特征点也可以对应于第一特征图X中部分特征点的权重值,也即第一特征图X中的部分特征点具有的权重值,权重特征图W的尺度小于第一特征图X的尺度。例如权重特征图W的尺度为(h/2)×(w/2)×c,第一特征图X中2×2区域的某一个点的权重值与权重特征图W中的点对应。
本公开对权重特征图W的尺度以及权重特征图W中每个点的权重值与第一特征图X中的特征点之间的对应关系不作限制。
在一种可能的实现方式中,在步骤S13中,可根据权重特征图W对第一特征图X进行加权,调整第一特征图中特征点的特征值,得到调整后的第二特征图。该第二特征图的尺度与第一特征图X的尺度相同。
在一种可能的实现方式中,在步骤S14中,可根据第二特征图,确定待处理图像的处理结果。可直接对第二特征图进行分割,得到分割结果;也可对第二特征图进行进一步的处理,对处理后的特征图进行分割,得到分割结果。
进而,可得到待处理图像的处理结果,该处理结果可为上述的分割结果,也可以是根据实际的图像处理任务,对上述的分割结果进行再次处理得到的结果。例如,在图像编辑类任务中,可根据分割结果区分出前景区域和背景区域,并对前景区域和/或背景区域进行相应的处理,例如对背景区域进行虚化处理等,得到最终的图像处理结果。本公开对特征图的分割方式及处理结果包括的具体内容均不作限制。
根据本公开的实施例,能够对待处理图像的特征图进行权重预测,得到包括特征图中特征点的权重值的权重特征图;根据权重特征图对特征图中的特征点进行调整;根据调整后的特征图确定图像的处理结果,从而通过全局不共享的权重值实现图像特征信息的增强,提高图像处理的精度。
在一种可能的实现方式中,在步骤S11中提取到待处理图像的第一特征图后,可在步骤S12中对该第一特征图进行权重预测。其中,步骤S12可包括:
对所述第一特征图的各个通道进行卷积核预测,确定所述第一特征图的第一卷积核张量,所述第一卷积核张量的通道数与第一特征图的通道数相同,所述第一卷积核张量的长度及宽度与预设的卷积核尺寸相对应;
根据所述第一卷积核张量,对所述第一特征图进行卷积处理,得到所述权重特征图。
举例来说,第一特征图可体现待处理图像中各个像素位置的特征信息(例如语义信息)。该第一特征图具有多个通道,例如c=512个通道。可根据第一特征图的通道数量,进行特征自适应的卷积核预测,确定出第一特征图的第一卷积核张量,该第一卷积核张量包括所预测的全部通道的卷积核,因此,第一卷积核张量的通道数与第一特征图的通道数相同,第一卷积核张量的长度及宽度与预设的卷积核尺寸s×s相对应。该卷积核尺寸可例如为3×3,第一卷积核张量的长度及宽度可分别为3。应当理 解,本领域技术人员可根据实际情况设定卷积核尺寸s×s的取值,本公开对此不作限制。
在一种可能的实现方式中,对所述第一特征图的各个通道进行卷积核预测,确定所述第一特征图的第一卷积核张量的步骤,可包括:
对所述第一特征图分别进行卷积变换,得到所述第一特征图的关键特征图和检索特征图,所述关键特征图的尺度与所述第一特征图的尺度相同,所述检索特征图的长度及宽度与所述第一特征图的长度及宽度相同,所述检索特征图的通道数与所述卷积核尺寸相对应;
对所述关键特征图和所述检索特征图分别进行重排列,得到所述关键特征图的第一特征矩阵和所述检索特征图的第二特征矩阵;
对所述第一特征矩阵和所述第二特征矩阵进行矩阵相乘,得到所述第一特征图的第三特征矩阵;
根据所述第三特征矩阵,确定所述第一特征图的第一卷积核张量。
举例来说,可预先设定有卷积变换T k和T q,卷积变换T k和T q均由一个或多个1×1的卷积操作组成且互相独立,本公开对卷积变换的具体方式不作限制。
在一种可能的实现方式中,可通过卷积变换T k对第一特征图进行变换,得到关键(Key)特征图K。关键特征图K可提取到第一特征图的c个不同的关键特征信息。关键特征图K的尺度与第一特征图的尺度相同,即为h×w×c。
在一种可能的实现方式中,可通过卷积变换T q对第一特征图进行变换,得到检索(Query)特征图Q。检索特征图Q可提取到第一特征图的全局空间分布信息。检索特征图Q的长度及宽度与所述第一特征图的长度及宽度相同,即为h×w;通道数与卷积核尺寸相对应,即为s×s,例如卷积核尺寸为3×3时,检索特征图Q的通道数为9。
在一种可能的实现方式中,可将关键特征图K和检索特征图Q分别进行重排列,得到关键特征图的第一特征矩阵
Figure PCTCN2020099964-appb-000001
和检索特征图的第二特征矩阵
Figure PCTCN2020099964-appb-000002
其中,第一特征矩阵
Figure PCTCN2020099964-appb-000003
的尺度为n×c,n=h×w;第二特征矩阵
Figure PCTCN2020099964-appb-000004
的尺度为n×s 2。例如,第一特征图的尺度h×w×c为64×64×512,卷积核尺寸s×s为3×3时,第一特征矩阵
Figure PCTCN2020099964-appb-000005
的尺度为4096×512;第二特征矩阵
Figure PCTCN2020099964-appb-000006
的尺度为4096×9。
在一种可能的实现方式中,可对第一特征矩阵
Figure PCTCN2020099964-appb-000007
和第二特征矩阵
Figure PCTCN2020099964-appb-000008
进行矩阵相乘,得到第一特征图的第三特征矩阵
Figure PCTCN2020099964-appb-000009
Figure PCTCN2020099964-appb-000010
在公式(1)中,
Figure PCTCN2020099964-appb-000011
表示第二特征矩阵
Figure PCTCN2020099964-appb-000012
的转置,第三特征矩阵
Figure PCTCN2020099964-appb-000013
的尺度为s 2×c,s=3,c=512时,第三特征矩阵
Figure PCTCN2020099964-appb-000014
的尺度为9×512。
在一种可能的实现方式中,根据第三特征矩阵,可确定第一特征图的第一卷积核张量。其中,可对第三特征矩阵进行重排列,得到尺度为s×s×c的三维张量,将该张量直接作为第一卷积核张量;也可对重排列得到的三维张量进一步处理,得到第一卷积核张量。
通过这种方式,能够以较低的运算复杂度预测出第一特征图的全部通道的卷积核,从而提高处理效率。
在一种可能的实现方式中,根据所述第三特征矩阵,确定所述第一特征图的第一卷积核张量的步骤,可包括:
对所述第三特征矩阵进行重排列,得到所述第一特征图的第二卷积核张量;对所述第二卷积核张量进行归一化处理,确定所述第一特征图的第一卷积核张量。
举例来说,可对第三特征矩阵
Figure PCTCN2020099964-appb-000015
进行重排列,将尺度为s 2×c的矩阵重排列为尺度为s×s×c的三维张量,可称为第二卷积核张量;再对第二卷积核张量进行归一化处理,例如批归一化BN(Batch Normalization),将归一化后的三维张量作为第一卷积核张量。通过这种方式,可以规范得到的卷积核张量。
在一种可能的实现方式中,根据所述第一卷积核张量,对所述第一特征图进行卷积处理,得到所述权重特征图的步骤,可包括:
根据所述第一特征图的第一卷积核张量以及预设的多个扩张率,对所述第一特征图进行空洞卷积,得到所述第一特征图的多个第四特征图;
对所述多个第四特征图分别进行激活,得到多个第五特征图;
根据所述多个第五特征图,确定所述第一特征图的权重特征图。
举例来说,可预先设定有空洞卷积的多个扩张率(dilation),例如扩张率为1、2和3;根据第一卷积核张量和多个扩张率,分别对第一特征图进行空洞卷积,得到第一特征图的多个第四特征图,第四特征图的数量与扩张率的数量相同。例如,卷积核尺寸为3×3,扩张率为1、2和3,每次卷积参与运算的特征区域分别为3×3、5×5和7×7。应当理解,本领域技术人员可根据实际情况设定空洞卷积的扩张率的数量,本公开对此不作限制。
在一种可能的实现方式中,第四特征图的尺度与第一特征图的尺度相同。也就是说,在权重特征图W中的每个点对应于第一特征图X中每个特征点的权重值的情况下,第四特征图的尺度等于第一特征图的尺度,也即为h×w×c。
在一种可能的实现方式中,第四特征图的尺度小于第一特征图的尺度。也就是说,在权重特征图W中的每个点对应于第一特征图X中多个特征点的权重值的情况下,第四特征图的尺度小于第一特征图X的尺度,例如为(h/2)×(w/2)×c。通过这种方式,能够减小图像处理过程中的计算量。
在一种可能的实现方式中,根据所述第一特征图的第一卷积核张量以及预设的多个扩张率,对所述第一特征图进行空洞卷积,得到所述第一特征图的多个第四特征图,包括:
对第一特征图进行裁剪,得到裁剪后的第一特征图;
根据第一卷积核张量和多个扩张率,分别对裁剪后的第一特征图进行空洞卷积,得到第一特征图的多个第四特征图。
也就是说,在权重特征图W中的特征点对应于第一特征图X中部分特征点的权重值的情况下,可以先对第一特征图X进行裁剪(crop),保留待生成权重值的部分特征点。再根据第一卷积核张量和多个扩张率,分别对裁剪后的第一特征图进行空洞卷积,得到第一特征图的多个第四特征图。在该情况 下,得到的第四特征图的尺度小于第一特征图的尺度,例如为(h/2)×(w/2)×c。通过这种方式,能够获取第一特征图中部分特征点的权重值,减小图像处理过程中的计算量。
在一种可能的实现方式中,可例如通过Sigmoid激活层对多个第四特征图分别进行激活,得到激活后的多个第五特征图;将多个第五特征图进行元素相加并求平均值后,可得到第一特征图的权重特征图W。
通过这种方式,能够增大特征图的特征点对应的卷积区域,使得权重特征图中各个权重值感知到更多的全局信息,从而提高各个权重值的精度。
在一种可能的实现方式中,在得到权重特征图W后,可对第一特征图X进行调整。其中,步骤S13可包括:对所述第一特征图与所述权重特征图进行元素相乘,得到所述第二特征图。也就是说,将第一特征图X与权重特征图W进行点乘(元素相乘),实现第一特征图X中全部或部分特征点的特征值的加权调整,得到加权调整后的第二特征图X*。
通过这种方式,可以实现特征图的特征增强,提高后续的图像处理效果。
在一种可能的实现方式中,所述方法还包括:
对所述第一特征图进行全局池化,得到所述第一特征图的池化特征图,所述池化特征图的尺度与所述第一特征图的尺度相同;
其中,步骤S14包括:将所述第二特征图与所述池化特征图进行融合,得到融合特征图;对所述融合特征图进行分割,得到所述待处理图像的处理结果。
举例来说,该方法还可包括全局池化分支,用于对第一特征图进行全局池化处理,得到池化特征图,与加权调整后的第二特征图共同参与后续的图像分割。该池化特征图的尺度可与第一特征图的尺度相同。
在一种可能的实现方式中,对所述第一特征图进行全局池化,得到所述第一特征图的池化特征图的步骤,包括:
对所述第一特征图进行池化,得到所述第一特征图的第一向量;
对所述第一向量进行卷积,得到第二向量;
对所述第二向量进行上采样,得到所述第一特征图的池化特征图。
也就是说,可通过设定的池化分支网络对第一特征图进行全局池化,该池化网络可包括池化层(Pool)、卷积层(Conv)、上采样层(Upsample)等。可通过池化层对第一特征图进行全局池化,得到第一向量;通过卷积层对第一向量进行卷积,调整向量的尺度,得到第二向量;通过上采样层对第二向量进行上采样,提高第二向量的尺度,从而得到与第一特征图的尺度相同的池化特征图。本公开对全局池化分支网络的具体网络结构不作限制。
在一种可能的实现方式中,在步骤S14中,可将第二特征图与池化特征图进行融合,得到融合特征图。可通过拼接或元素相加的方式进行融合,如果采用拼接的方式,则得到的融合特征图的尺度为h×w×2c,也即融合特征图的通道数为第一特征图的两倍;如果采用元素相加的方式,则得到的融合特征图的尺度为h×w×c,也即融合特征图的尺度与第一特征图相同。
在一种可能的实现方式中,可通过预设的分割网络对融合特征图进行分割,得到所述待处理图像的分割结果,也即划分出图像中属于各个类别的人或物体所对应的区域。该分割网络可包括卷积层、 池化层、全连接层等,本公开对分割网络的具体网络结构不作限制。
在一种可能的实现方式中,可将该分割结果作为图像的处理结果;也可对该分割结果进行进一步处理,得到图像的处理结果。本公开对此不作限制。
通过这种方式,可以保留原始特征图中的全局信息,提高图像的处理结果的鲁棒性。
在一种可能的实现方式中,步骤S14可包括:对所述第二特征图进行分割,得到所述待处理图像的处理结果。也就是说,可通过预设的分割网络对第二特征图进行直接分割处理,得到待处理图像的分割结果。进而,可将该分割结果作为图像的处理结果;也可对该分割结果进行进一步处理,得到图像的处理结果。通过这种方式,可提高图像处理结果的精度。该分割网络可例如为卷积神经网络,本公开对分割网络的网络结构不作限制。
在一种可能的实现方式中,第一特征图可包括待处理图像的语义信息,用于表征图像中各个位置的类别(例如人、动物、车辆等类别)。经过步骤S12-S13的处理后,可得到语义增强后的第二特征图。通过对图像场景中语义信息的理解,给每个像素判断出一个特定的物体类别,进而在步骤S14中对语义增强后的第二特征图或融合特征图进行语义分割,可得到更精确的语义分割结果。
图2示出根据本公开实施例的图像处理方法的处理过程的示意图,如图2所示,该方法可通过神经网络实现,该神经网络可包括特征提取网络21、卷积核预测网络22、权重生成网络23、池化分支网络24以及分割网络25。
在示例中,可将待处理图像26(尺度例如为H 0×W 0×C 0)输入特征提取网络21的残差子网络211中提取特征,得到特征图X0,尺度为h×w×2048,其中h=H 0/8,w=W 0/8;将特征图X0输入特征提取网络21的卷积子网络212中卷积,调整的特征图X0尺度,得到第一特征图X,尺度为h×w×512。
在示例中,将第一特征图X输入卷积核预测网络22,通过卷积变换T k和T q分别对第一特征图X进行变换,得到关键特征图K(尺度为h×w×512)和检索特征图Q(尺度为h×w×(s×s));将关键特征图K和检索特征图Q分别进行重排列,得到关键特征图的第一特征矩阵(未示出)和检索特征图的第二特征矩阵(未示出);对第一特征矩阵和第二特征矩阵进行矩阵相乘,得到第一特征图的第三特征矩阵221(尺度为(s×s)×512);对第三特征矩阵221进行重排列,得到尺度为s×s×512的三维张量222;进行对三维张量222进行批归一化BN(Batch Normalization),得到第一卷积核张量223(尺度为s×s×512)。
在示例中,将第一特征图X和第一卷积核张量223输入权重生成网络23,根据第一卷积核张量223和多个扩张率(图2中扩张率为1、2和3),分别对第一特征图X进行空洞卷积,得到第一特征图X的三个第四特征图D1、D2和D3;通过权重生成网络23的Sigmoid激活层对第四特征图D1、D2和D3分别进行激活,得到第五特征图W1、W2和W3;将第五特征图W1、W2和W3进行元素相加并求平均值后,得到权重特征图W(尺度为h×w×512)。
在示例中,将第一特征图X与所述权重特征图W进行元素相乘,得到第二特征图X*,从而实现了特征图的语义特征增强。
在示例中,如图2所示,将特征图X0输入池化分支网络24,经由池化分支网络24的池化层241、卷积层242、上采样层243依次处理,得到池化特征图244(尺度为h×w×512)。将第二特征图X*与池化特征图244进行拼接,得到融合特征图(尺度为h×w×1024)
在示例中,分割网络25为卷积神经网络,包括卷积层、池化层、全连接层等。将融合特征图输入分割网络25中进行分割,可得到各个类别的分布概率图,进而得到待处理图像26的分割结果27。如图2所示,分割结果27中包括有摩托车(类别为车辆),骑手(类别为人)以及花盆(类别为物品),实现了待处理图像26的精确分割。
在一种可能的实现方式中,在部署上述神经网络之前,可对神经网络进行训练,根据本公开实施例的图像处理方法还包括:
根据预设的训练集,训练所述神经网络,所述训练集包括多个样本图像以及所述多个样本图像的标注信息。
举例来说,可将训练集中的样本图像输入该神经网络中处理,得到样本图像的样本处理结果;根据样本图像的样本处理结果与标注信息之间的差异,确定神经网络的损失;根据该损失反向调整神经网络的网络参数;经过多次迭代,在满足训练条件(例如网络收敛)时,得到训练后的神经网络。通过这种方式,可以实现神经网络的训练过程。
根据本公开实施例的图像处理方法,能够为待处理图像的特征图的每个特征点都预测出一个全局不共享的权重因子(权重值);根据该权重因子对特征图中的每个特征点进行特征重赋权,实现特征图的语义特征增强;对语义特征增强后的特征图进行分割,得到更精准的语义分割结果。该方法能够有效提高对复杂场景中的物体、图像中不同尺寸的同一物体,以及图像中具有相似外形特征的不同物体的识别精度。
该方法通过矩阵运算的方式来预测特征图的各个通道的卷积核,降低了运算复杂度,实现了低内存消耗、低运算量的语义自适应卷积核的预测,从而能够快速实现特征图的语义增强。
根据本公开实施例的图像处理方法,能够应用于智能视频分析,智能医疗、自动驾驶等应用领域,提高图像的目标识别精度。例如,该方法可应用于自动驾驶场景中的智能感知任务,对车况场景中的汽车、行人、车道线等目标物体的识别分割,从而实现车况的智能感知任务。例如,该方法可应用于智能医疗场景中,对医学影像图进行病灶等目标的轮廓的智能提取,辅助医生的工作,提高医生的处理效率。
在示例中,该方法可应用于图像的检测识别任务,有效改善语义特征图中不合理的特征分布,得到具有全局语义信息感知能力的语义特征图,该语义特征图能够提升图像检测识别性能。
在示例中,该方法可应用于图像与视频的智能编辑任务,自动识别图像中的不同物体,然后针对不同物体采用不同的图像处理流程,例如,在智能手机的人像功能里,需要对人像后面的背景进行虚化处理,实现单反拍照效果。可通过该方法识别出图像中的人像区域,对人像区域以外的位置进行虚化处理。
可以理解,本公开提及的上述各个方法实施例,在不违背原理逻辑的情况下,均可以彼此相互结合形成结合后的实施例,限于篇幅,本公开不再赘述。本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的具体执行顺序应当以其功能和可能的内在逻辑确定。
此外,本公开还提供了图像处理装置、电子设备、计算机可读存储介质、程序,上述均可用来实现本公开提供的任一种图像处理方法,相应技术方案和描述和参见方法部分的相应记载,不再赘述。
图3示出根据本公开实施例的图像处理装置的框图,如图3所示,所述装置包括:
特征提取模块31,用于对待处理图像进行特征提取,得到所述待处理图像的第一特征图;权重预测模块32,用于对所述第一特征图进行权重预测,得到所述第一特征图的权重特征图,所述权重特征图包括所述第一特征图中特征点的权重值;调整模块33,用于根据所述权重特征图,对所述第一特征图中的特征点进行特征值调整,得到第二特征图;结果确定模块34,用于根据所述第二特征图,确定所述待处理图像的处理结果。
在一种可能的实现方式中,所述权重预测模块包括:卷积核预测子模块,用于对所述第一特征图的各个通道进行卷积核预测,确定所述第一特征图的第一卷积核张量,所述第一卷积核张量的通道数与第一特征图的通道数相同,所述第一卷积核张量的长度及宽度与预设的卷积核尺寸相对应;权重确定子模块,用于根据所述第一卷积核张量,对所述第一特征图进行卷积处理,得到所述权重特征图。
在一种可能的实现方式中,所述权重确定子模块包括:空洞卷积子模块,用于根据所述第一特征图的第一卷积核张量以及预设的多个扩张率,对所述第一特征图进行空洞卷积,得到所述第一特征图的多个第四特征图;激活子模块,用于对所述多个第四特征图分别进行激活,得到多个第五特征图;确定子模块,用于根据所述多个第五特征图,确定所述第一特征图的权重特征图。
在一种可能的实现方式中,所述卷积核预测子模块包括:变换子模块,用于对所述第一特征图分别进行卷积变换,得到所述第一特征图的关键特征图和检索特征图,所述关键特征图的尺度与所述第一特征图的尺度相同,所述检索特征图的长度及宽度与所述第一特征图的长度及宽度相同,所述检索特征图的通道数与所述卷积核尺寸相对应;重排列子模块,用于对所述关键特征图和所述检索特征图分别进行重排列,得到所述关键特征图的第一特征矩阵和所述检索特征图的第二特征矩阵;矩阵相乘子模块,用于对所述第一特征矩阵和所述第二特征矩阵进行矩阵相乘,得到所述第一特征图的第三特征矩阵;张量确定子模块,用于根据所述第三特征矩阵,确定所述第一特征图的第一卷积核张量。
在一种可能的实现方式中,所述张量确定子模块用于:对所述第三特征矩阵进行重排列,得到所述第一特征图的第二卷积核张量;对所述第二卷积核张量进行归一化处理,确定所述第一特征图的第一卷积核张量。
在一种可能的实现方式中,所述调整模块包括:调整子模块,用于对所述第一特征图与所述权重特征图进行元素相乘,得到所述第二特征图。
在一种可能的实现方式中,所述装置还包括:全局池化模块,用于对所述第一特征图进行全局池化,得到所述第一特征图的池化特征图,所述池化特征图的尺度与所述第一特征图的尺度相同;
所述结果确定模块包括:融合子模块,用于将所述第二特征图与所述池化特征图进行融合,得到融合特征图;第一分割子模块,用于对所述融合特征图进行分割,得到所述待处理图像的处理结果。
在一种可能的实现方式中,所述全局池化模块包括:池化子模块,用于对所述第一特征图进行池化,得到所述第一特征图的第一向量;卷积子模块,用于对所述第一向量进行卷积,得到第二向量;上采样子模块,用于对所述第二向量进行上采样,得到所述第一特征图的池化特征图。
在一种可能的实现方式中,所述结果确定模块包括:第二分割子模块,用于对所述第二特征图进行分割,得到所述待处理图像的处理结果。
在一些实施例中,本公开实施例提供的装置具有的功能或包含的模块可以用于执行上文方法实施例描述的方法,其具体实现可以参照上文方法实施例的描述,为了简洁,这里不再赘述。
本公开实施例还提出一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述方法。计算机可读存储介质可以是非易失性计算机可读存储介质或易失性计算机可读存储介质。
本公开实施例还提出一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器被配置为调用所述存储器存储的指令,以执行上述方法。
本公开实施例还提供了一种计算机程序产品,包括计算机可读代码,当计算机可读代码在设备上运行时,设备中的处理器执行用于实现如上任一实施例提供的图像处理方法的指令。
本公开实施例还提供了另一种计算机程序产品,用于存储计算机可读指令,指令被执行时使得计算机执行上述任一实施例提供的图像处理方法的操作。
电子设备可以被提供为终端、服务器或其它形态的设备。
图4示出根据本公开实施例的一种电子设备800的框图。例如,电子设备800可以是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等终端。
参照图4,电子设备800可以包括以下一个或多个组件:处理组件802,存储器804,电源组件806,多媒体组件808,音频组件810,输入/输出(I/O)的接口812,传感器组件814,以及通信组件816。
处理组件802通常控制电子设备800的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件802可以包括一个或多个处理器820来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件802可以包括一个或多个模块,便于处理组件802和其他组件之间的交互。例如,处理组件802可以包括多媒体模块,以方便多媒体组件808和处理组件802之间的交互。
存储器804被配置为存储各种类型的数据以支持在电子设备800的操作。这些数据的示例包括用于在电子设备800上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器804可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。
电源组件806为电子设备800的各种组件提供电力。电源组件806可以包括电源管理系统,一个或多个电源,及其他与为电子设备800生成、管理和分配电力相关联的组件。
多媒体组件808包括在所述电子设备800和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件808包括一个前置摄像头和/或后置摄像头。当电子设备800处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。
音频组件810被配置为输出和/或输入音频信号。例如,音频组件810包括一个麦克风(MIC),当电子设备800处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音 频信号。所接收的音频信号可以被进一步存储在存储器804或经由通信组件816发送。在一些实施例中,音频组件810还包括一个扬声器,用于输出音频信号。
I/O接口812为处理组件802和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。
传感器组件814包括一个或多个传感器,用于为电子设备800提供各个方面的状态评估。例如,传感器组件814可以检测到电子设备800的打开/关闭状态,组件的相对定位,例如所述组件为电子设备800的显示器和小键盘,传感器组件814还可以检测电子设备800或电子设备800一个组件的位置改变,用户与电子设备800接触的存在或不存在,电子设备800方位或加速/减速和电子设备800的温度变化。传感器组件814可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件814还可以包括光传感器,如CMOS或CCD图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件814还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。
通信组件816被配置为便于电子设备800和其他设备之间有线或无线方式的通信。电子设备800可以接入基于通信标准的无线网络,如WiFi,2G或3G,或它们的组合。在一个示例性实施例中,通信组件816经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件816还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。
在示例性实施例中,电子设备800可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述方法。
在示例性实施例中,还提供了一种非易失性计算机可读存储介质,例如包括计算机程序指令的存储器804,上述计算机程序指令可由电子设备800的处理器820执行以完成上述方法。
图5示出根据本公开实施例的一种电子设备1900的框图。例如,电子设备1900可以被提供为一服务器。参照图5,电子设备1900包括处理组件1922,其进一步包括一个或多个处理器,以及由存储器1932所代表的存储器资源,用于存储可由处理组件1922的执行的指令,例如应用程序。存储器1932中存储的应用程序可以包括一个或一个以上的每一个对应于一组指令的模块。此外,处理组件1922被配置为执行指令,以执行上述方法。
电子设备1900还可以包括一个电源组件1926被配置为执行电子设备1900的电源管理,一个有线或无线网络接口1950被配置为将电子设备1900连接到网络,和一个输入输出(I/O)接口1958。电子设备1900可以操作基于存储在存储器1932的操作系统,例如Windows Server TM,Mac OS X TM,Unix TM,Linux TM,FreeBSD TM或类似。
在示例性实施例中,还提供了一种非易失性计算机可读存储介质,例如包括计算机程序指令的存储器1932,上述计算机程序指令可由电子设备1900的处理组件1922执行以完成上述方法。
本公开可以是系统、方法和/或计算机程序产品。计算机程序产品可以包括计算机可读存储介质,其上载有用于使处理器实现本公开的各个方面的计算机可读程序指令。
计算机可读存储介质可以是可以保持和存储由指令执行设备使用的指令的有形设备。计算机可读存储介质例如可以是――但不限于――电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、静态随机存取存储器(SRAM)、便携式压缩盘只读存储器(CD-ROM)、数字多功能盘(DVD)、记忆棒、软盘、机械编码设备、例如其上存储有指令的打孔卡或凹槽内凸起结构、以及上述的任意合适的组合。这里所使用的计算机可读存储介质不被解释为瞬时信号本身,诸如无线电波或者其他自由传播的电磁波、通过波导或其他传输媒介传播的电磁波(例如,通过光纤电缆的光脉冲)、或者通过电线传输的电信号。
这里所描述的计算机可读程序指令可以从计算机可读存储介质下载到各个计算/处理设备,或者通过网络、例如因特网、局域网、广域网和/或无线网下载到外部计算机或外部存储设备。网络可以包括铜传输电缆、光纤传输、无线传输、路由器、防火墙、交换机、网关计算机和/或边缘服务器。每个计算/处理设备中的网络适配卡或者网络接口从网络接收计算机可读程序指令,并转发该计算机可读程序指令,以供存储在各个计算/处理设备中的计算机可读存储介质中。
用于执行本公开操作的计算机程序指令可以是汇编指令、指令集架构(ISA)指令、机器指令、机器相关指令、微代码、固件指令、状态设置数据、或者以一种或多种编程语言的任意组合编写的源代码或目标代码,所述编程语言包括面向对象的编程语言—诸如Smalltalk、C++等,以及常规的过程式编程语言—诸如“C”语言或类似的编程语言。计算机可读程序指令可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络—包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。在一些实施例中,通过利用计算机可读程序指令的状态信息来个性化定制电子电路,例如可编程逻辑电路、现场可编程门阵列(FPGA)或可编程逻辑阵列(PLA),该电子电路可以执行计算机可读程序指令,从而实现本公开的各个方面。
这里参照根据本公开实施例的方法、装置(系统)和计算机程序产品的流程图和/或框图描述了本公开的各个方面。应当理解,流程图和/或框图的每个方框以及流程图和/或框图中各方框的组合,都可以由计算机可读程序指令实现。
这些计算机可读程序指令可以提供给通用计算机、专用计算机或其它可编程数据处理装置的处理器,从而生产出一种机器,使得这些指令在通过计算机或其它可编程数据处理装置的处理器执行时,产生了实现流程图和/或框图中的一个或多个方框中规定的功能/动作的装置。也可以把这些计算机可读程序指令存储在计算机可读存储介质中,这些指令使得计算机、可编程数据处理装置和/或其他设备以特定方式工作,从而,存储有指令的计算机可读介质则包括一个制造品,其包括实现流程图和/或框图中的一个或多个方框中规定的功能/动作的各个方面的指令。
也可以把计算机可读程序指令加载到计算机、其它可编程数据处理装置、或其它设备上,使得在计算机、其它可编程数据处理装置或其它设备上执行一系列操作步骤,以产生计算机实现的过程,从而使得在计算机、其它可编程数据处理装置、或其它设备上执行的指令实现流程图和/或框图中的一 个或多个方框中规定的功能/动作。
附图中的流程图和框图显示了根据本公开的多个实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或指令的一部分,所述模块、程序段或指令的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
该计算机程序产品可以具体通过硬件、软件或其结合的方式实现。在一个可选实施例中,所述计算机程序产品具体体现为计算机存储介质,在另一个可选实施例中,计算机程序产品具体体现为软件产品,例如软件开发包(Software Development Kit,SDK)等等。
在不违背逻辑的情况下,本公开不同实施例之间可以相互结合,不同实施例描述有所侧重,为侧重描述的部分可以参见其他实施例的记载。
以上已经描述了本公开的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的各实施例。在不偏离所说明的各实施例的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实施例的原理、实际应用或对市场中的技术的改进,或者使本技术领域的其它普通技术人员能理解本文披露的各实施例。

Claims (21)

  1. 一种图像处理方法,包括:
    对待处理图像进行特征提取,得到所述待处理图像的第一特征图;
    对所述第一特征图进行权重预测,得到所述第一特征图的权重特征图,所述权重特征图包括所述第一特征图中特征点的权重值;
    根据所述权重特征图,对所述第一特征图中的特征点进行特征值调整,得到第二特征图;
    根据所述第二特征图,确定所述待处理图像的处理结果。
  2. 根据权利要求1所述的方法,其特征在于,所述对所述第一特征图进行权重预测,得到所述第一特征图的权重特征图,包括:
    对所述第一特征图的各个通道进行卷积核预测,确定所述第一特征图的第一卷积核张量,所述第一卷积核张量的通道数与第一特征图的通道数相同,所述第一卷积核张量的长度及宽度与预设的卷积核尺寸相对应;
    根据所述第一卷积核张量,对所述第一特征图进行卷积处理,得到所述权重特征图。
  3. 根据权利要求2所述的方法,其特征在于,所述根据所述第一卷积核张量,对所述第一特征图进行卷积处理,得到所述权重特征图,包括:
    根据所述第一特征图的第一卷积核张量以及预设的多个扩张率,对所述第一特征图进行空洞卷积,得到所述第一特征图的多个第四特征图;
    对所述多个第四特征图分别进行激活,得到多个第五特征图;
    根据所述多个第五特征图,确定所述第一特征图的权重特征图。
  4. 根据权利要求2或3所述的方法,其特征在于,所述对所述第一特征图的各个通道进行卷积核预测,确定所述第一特征图的第一卷积核张量,包括:
    对所述第一特征图分别进行卷积变换,得到所述第一特征图的关键特征图和检索特征图,所述关键特征图的尺度与所述第一特征图的尺度相同,所述检索特征图的长度及宽度与所述第一特征图的长度及宽度相同,所述检索特征图的通道数与所述卷积核尺寸相对应;
    对所述关键特征图和所述检索特征图分别进行重排列,得到所述关键特征图的第一特征矩阵和所述检索特征图的第二特征矩阵;
    对所述第一特征矩阵和所述第二特征矩阵进行矩阵相乘,得到所述第一特征图的第三特征矩阵;
    根据所述第三特征矩阵,确定所述第一特征图的第一卷积核张量。
  5. 根据权利要求4所述的方法,其特征在于,所述根据所述第三特征矩阵,确定所述第一特征图的第一卷积核张量,包括:
    对所述第三特征矩阵进行重排列,得到所述第一特征图的第二卷积核张量;
    对所述第二卷积核张量进行归一化处理,确定所述第一特征图的第一卷积核张量。
  6. 根据权利要求1-5中任意一项所述的方法,其特征在于,所述根据所述权重特征图,对所述第一特征图中的特征点进行特征值调整,得到第二特征图,包括:
    对所述第一特征图与所述权重特征图进行元素相乘,得到所述第二特征图。
  7. 根据权利要求1-6中任意一项所述的方法,其特征在于,所述方法还包括:
    对所述第一特征图进行全局池化,得到所述第一特征图的池化特征图,所述池化特征图的尺度与所述第一特征图的尺度相同;
    所述根据所述第二特征图,确定所述待处理图像的处理结果,包括:
    将所述第二特征图与所述池化特征图进行融合,得到融合特征图;
    对所述融合特征图进行分割,得到所述待处理图像的处理结果。
  8. 根据权利要求7所述的方法,其特征在于,对所述第一特征图进行全局池化,得到所述第一特征图的池化特征图,包括:
    对所述第一特征图进行池化,得到所述第一特征图的第一向量;
    对所述第一向量进行卷积,得到第二向量;
    对所述第二向量进行上采样,得到所述第一特征图的池化特征图。
  9. 根据权利要求1-6中任意一项所述的方法,其特征在于,所述根据所述第二特征图,确定所述待处理图像的处理结果,包括:
    对所述第二特征图进行分割,得到所述待处理图像的处理结果。
  10. 一种图像处理装置,包括:
    特征提取模块,用于对待处理图像进行特征提取,得到所述待处理图像的第一特征图;
    权重预测模块,用于对所述第一特征图进行权重预测,得到所述第一特征图的权重特征图,所述权重特征图包括所述第一特征图中特征点的权重值;
    调整模块,用于根据所述权重特征图,对所述第一特征图中的特征点进行特征值调整,得到第二特征图;
    结果确定模块,用于根据所述第二特征图,确定所述待处理图像的处理结果。
  11. 根据权利要求10所述的装置,其特征在于,所述权重预测模块包括:
    卷积核预测子模块,用于对所述第一特征图的各个通道进行卷积核预测,确定所述第一特征图的第一卷积核张量,所述第一卷积核张量的通道数与第一特征图的通道数相同,所述第一卷积核张量的长度及宽度与预设的卷积核尺寸相对应;
    权重确定子模块,用于根据所述第一卷积核张量,对所述第一特征图进行卷积处理,得到所述权重特征图。
  12. 根据权利要求11所述的装置,其特征在于,所述权重确定子模块包括:
    空洞卷积子模块,用于根据所述第一特征图的第一卷积核张量以及预设的多个扩张率,对所述第一特征图进行空洞卷积,得到所述第一特征图的多个第四特征图;
    激活子模块,用于对所述多个第四特征图分别进行激活,得到多个第五特征图;
    确定子模块,用于根据所述多个第五特征图,确定所述第一特征图的权重特征图。
  13. 根据权利要求11或12所述的装置,其特征在于,所述卷积核预测子模块包括:
    变换子模块,用于对所述第一特征图分别进行卷积变换,得到所述第一特征图的关键特征图和检索特征图,所述关键特征图的尺度与所述第一特征图的尺度相同,所述检索特征图的长度及宽度与所述第一特征图的长度及宽度相同,所述检索特征图的通道数与所述卷积核尺寸相对应;
    重排列子模块,用于对所述关键特征图和所述检索特征图分别进行重排列,得到所述关键特征图的第一特征矩阵和所述检索特征图的第二特征矩阵;
    矩阵相乘子模块,用于对所述第一特征矩阵和所述第二特征矩阵进行矩阵相乘,得到所述第一特征图的第三特征矩阵;
    张量确定子模块,用于根据所述第三特征矩阵,确定所述第一特征图的第一卷积核张量。
  14. 根据权利要求13所述的装置,其特征在于,所述张量确定子模块用于:
    对所述第三特征矩阵进行重排列,得到所述第一特征图的第二卷积核张量;
    对所述第二卷积核张量进行归一化处理,确定所述第一特征图的第一卷积核张量。
  15. 根据权利要求10-14中任意一项所述的装置,其特征在于,所述调整模块包括:
    调整子模块,用于对所述第一特征图与所述权重特征图进行元素相乘,得到所述第二特征图。
  16. 根据权利要求10-15中任意一项所述的装置,其特征在于,所述装置还包括:
    全局池化模块,用于对所述第一特征图进行全局池化,得到所述第一特征图的池化特征图,所述池化特征图的尺度与所述第一特征图的尺度相同;
    所述结果确定模块包括:
    融合子模块,用于将所述第二特征图与所述池化特征图进行融合,得到融合特征图;
    第一分割子模块,用于对所述融合特征图进行分割,得到所述待处理图像的处理结果。
  17. 根据权利要求16所述的装置,其特征在于,所述全局池化模块包括:
    池化子模块,用于对所述第一特征图进行池化,得到所述第一特征图的第一向量;
    卷积子模块,用于对所述第一向量进行卷积,得到第二向量;
    上采样子模块,用于对所述第二向量进行上采样,得到所述第一特征图的池化特征图。
  18. 根据权利要求10-15中任意一项所述的装置,其特征在于,所述结果确定模块包括:
    第二分割子模块,用于对所述第二特征图进行分割,得到所述待处理图像的处理结果。
  19. 一种电子设备,包括:
    处理器;
    用于存储处理器可执行指令的存储器;
    其中,所述处理器被配置为调用所述存储器存储的指令,以执行权利要求1至9中任意一项所述的方法。
  20. 一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现权利要求1至9中任意一项所述的方法。
  21. 一种计算机程序,包括计算机可读代码,当所述计算机可读代码在电子设备中运行时,所述电子设备中的处理器执行用于实现权利要求1至9中任意一项所述的方法。
PCT/CN2020/099964 2020-02-28 2020-07-02 图像处理方法及装置、电子设备和存储介质 WO2021169132A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US17/890,393 US20220392202A1 (en) 2020-02-28 2022-08-18 Imaging processing method and apparatus, electronic device, and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010129399.9A CN111340048B (zh) 2020-02-28 2020-02-28 图像处理方法及装置、电子设备和存储介质
CN202010129399.9 2020-02-28

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/890,393 Continuation US20220392202A1 (en) 2020-02-28 2022-08-18 Imaging processing method and apparatus, electronic device, and storage medium

Publications (1)

Publication Number Publication Date
WO2021169132A1 true WO2021169132A1 (zh) 2021-09-02

Family

ID=71187190

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/099964 WO2021169132A1 (zh) 2020-02-28 2020-07-02 图像处理方法及装置、电子设备和存储介质

Country Status (4)

Country Link
US (1) US20220392202A1 (zh)
CN (1) CN111340048B (zh)
TW (1) TW202133042A (zh)
WO (1) WO2021169132A1 (zh)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111340048B (zh) * 2020-02-28 2022-02-22 深圳市商汤科技有限公司 图像处理方法及装置、电子设备和存储介质
CN115552477A (zh) * 2020-05-01 2022-12-30 奇跃公司 采用施加的分层归一化的图像描述符网络
CN115239515B (zh) * 2022-07-28 2023-04-07 德玛克(长兴)精密机械有限公司 用于机械部件的精密智能化加工制造系统及其制造方法
CN115482141A (zh) * 2022-09-19 2022-12-16 北京地平线信息技术有限公司 图像处理方法、装置、电子设备和存储介质
CN116260969B (zh) * 2023-05-15 2023-08-18 鹏城实验室 一种自适应的通道渐进式编解码方法、装置、终端及介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108182384A (zh) * 2017-12-07 2018-06-19 浙江大华技术股份有限公司 一种人脸特征点定位方法及装置
CN108710847A (zh) * 2018-05-15 2018-10-26 北京旷视科技有限公司 场景识别方法、装置及电子设备
CN108846440A (zh) * 2018-06-20 2018-11-20 腾讯科技(深圳)有限公司 图像处理方法及装置、计算机可读介质和电子设备
US20190156144A1 (en) * 2017-02-23 2019-05-23 Beijing Sensetime Technology Development Co., Ltd Method and apparatus for detecting object, method and apparatus for training neural network, and electronic device
CN110136136A (zh) * 2019-05-27 2019-08-16 北京达佳互联信息技术有限公司 场景分割方法、装置、计算机设备及存储介质
CN111340048A (zh) * 2020-02-28 2020-06-26 深圳市商汤科技有限公司 图像处理方法及装置、电子设备和存储介质

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110647930B (zh) * 2019-09-20 2022-08-05 北京达佳互联信息技术有限公司 一种图像处理方法、装置及电子设备
CN110807788B (zh) * 2019-10-21 2023-07-21 腾讯科技(深圳)有限公司 医学图像处理方法、装置、电子设备及计算机存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190156144A1 (en) * 2017-02-23 2019-05-23 Beijing Sensetime Technology Development Co., Ltd Method and apparatus for detecting object, method and apparatus for training neural network, and electronic device
CN108182384A (zh) * 2017-12-07 2018-06-19 浙江大华技术股份有限公司 一种人脸特征点定位方法及装置
CN108710847A (zh) * 2018-05-15 2018-10-26 北京旷视科技有限公司 场景识别方法、装置及电子设备
CN108846440A (zh) * 2018-06-20 2018-11-20 腾讯科技(深圳)有限公司 图像处理方法及装置、计算机可读介质和电子设备
CN110136136A (zh) * 2019-05-27 2019-08-16 北京达佳互联信息技术有限公司 场景分割方法、装置、计算机设备及存储介质
CN111340048A (zh) * 2020-02-28 2020-06-26 深圳市商汤科技有限公司 图像处理方法及装置、电子设备和存储介质

Also Published As

Publication number Publication date
CN111340048B (zh) 2022-02-22
TW202133042A (zh) 2021-09-01
US20220392202A1 (en) 2022-12-08
CN111340048A (zh) 2020-06-26

Similar Documents

Publication Publication Date Title
WO2021169132A1 (zh) 图像处理方法及装置、电子设备和存储介质
TWI740309B (zh) 圖像處理方法及裝置、電子設備和電腦可讀儲存介質
CN110348537B (zh) 图像处理方法及装置、电子设备和存储介质
WO2021155632A1 (zh) 图像处理方法及装置、电子设备和存储介质
JP6916970B2 (ja) ビデオ処理方法及び装置、電子機器並びに記憶媒体
TWI782480B (zh) 圖像處理方法及電子設備和電腦可讀儲存介質
WO2021196401A1 (zh) 图像重建方法及装置、电子设备和存储介质
WO2020134866A1 (zh) 关键点检测方法及装置、电子设备和存储介质
TWI706379B (zh) 圖像處理方法及裝置、電子設備和儲存介質
WO2020155711A1 (zh) 图像生成方法及装置、电子设备和存储介质
WO2021035812A1 (zh) 一种图像处理方法及装置、电子设备和存储介质
TW202141428A (zh) 場景深度和相機運動預測方法、電子設備和電腦可讀儲存介質
JP2022522551A (ja) 画像処理方法及び装置、電子機器並びに記憶媒体
TWI778313B (zh) 圖像處理方法、電子設備和儲存介質
WO2020172979A1 (zh) 数据处理方法和装置、电子设备和存储介质
KR20200106027A (ko) 네트워크 모듈 및 분배 방법 및 장치, 전자 기기 및 저장 매체
CN111680646B (zh) 动作检测方法及装置、电子设备和存储介质
CN114332503A (zh) 对象重识别方法及装置、电子设备和存储介质
WO2022141969A1 (zh) 图像分割方法及装置、电子设备、存储介质和程序
CN111311588B (zh) 重定位方法及装置、电子设备和存储介质
CN109635926B (zh) 用于神经网络的注意力特征获取方法、装置及存储介质
CN114359808A (zh) 目标检测方法及装置、电子设备和存储介质
CN111369456B (zh) 图像去噪方法及装置、电子设备和存储介质
CN117835050A (zh) 相机预览方法、装置及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20921097

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 12.01.2023)

122 Ep: pct application non-entry in european phase

Ref document number: 20921097

Country of ref document: EP

Kind code of ref document: A1