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

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

Info

Publication number
WO2020155828A1
WO2020155828A1 PCT/CN2019/121696 CN2019121696W WO2020155828A1 WO 2020155828 A1 WO2020155828 A1 WO 2020155828A1 CN 2019121696 W CN2019121696 W CN 2019121696W WO 2020155828 A1 WO2020155828 A1 WO 2020155828A1
Authority
WO
WIPO (PCT)
Prior art keywords
feature
area
prediction
network
processing
Prior art date
Application number
PCT/CN2019/121696
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 北京市商汤科技开发有限公司
Priority to SG11202102977SA priority Critical patent/SG11202102977SA/en
Priority to JP2021516440A priority patent/JP2022500791A/ja
Publication of WO2020155828A1 publication Critical patent/WO2020155828A1/zh
Priority to US17/209,384 priority patent/US20210209392A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/217Validation; Performance evaluation; Active pattern learning techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/243Classification techniques relating to the number of classes
    • G06F18/2431Multiple classes
    • 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
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • 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/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • G06V10/443Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components by matching or filtering
    • G06V10/449Biologically inspired filters, e.g. difference of Gaussians [DoG] or Gabor filters
    • G06V10/451Biologically inspired filters, e.g. difference of Gaussians [DoG] or Gabor filters with interaction between the filter responses, e.g. cortical complex cells
    • G06V10/454Integrating the filters into a hierarchical structure, e.g. convolutional neural networks [CNN]
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V2201/00Indexing scheme relating to image or video recognition or understanding
    • G06V2201/07Target detection

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 present disclosure proposes an image processing method and device, electronic equipment and storage medium.
  • an image processing method including:
  • the detection network including the equalization sub-network and the detection sub-network;
  • the cross-combination ratio is the area ratio of the overlap region of the target object prediction region and the corresponding label region in the sample image to the combined region ;
  • feature equalization processing is performed on the target sample image, which can avoid information loss and improve the training effect.
  • the target area can be extracted according to the intersection ratio of the prediction area, which can increase the probability of extracting the prediction area that is difficult to determine, improve training efficiency and improve training effect.
  • sampling multiple prediction regions according to the intersection ratio of each prediction region to obtain the target region includes:
  • Sampling processing is performed on the prediction regions of the category respectively to obtain the target region.
  • the prediction regions can be classified by intersection and comparison, and the prediction regions of each category can be sampled, which can increase the probability of extracting the prediction regions with high intersections and improve the prediction regions that are difficult to determine in the target region.
  • performing feature equalization processing on the sample image through the equalization sub-network of the detection network to obtain a balanced feature image includes:
  • performing equalization processing on the multiple first feature maps to obtain a second feature map includes:
  • obtaining multiple balanced feature images according to the second feature map and the multiple first feature maps includes:
  • the first feature maps and the corresponding fifth feature maps are residually connected to obtain the balanced feature images.
  • the second feature map of feature balance can be obtained through equalization processing, and the balanced feature map can be obtained through residual connection, which can reduce information loss and improve training effects.
  • training the detection network according to the target area and the labeled area includes:
  • the trained detection network is obtained.
  • determining the recognition loss and location loss of the detection network according to the target area and the labeled area includes:
  • the position loss is determined according to the position error.
  • determining the recognition loss and location loss of the detection network according to the target area and the labeled area includes:
  • the position loss is determined according to the preset value.
  • the gradient of the position loss can be improved, the training efficiency can be improved, and the goodness of fit of the detection network can be improved. It can also reduce the gradient of the position loss and reduce the influence of the position loss on the training process when the prediction of the target object is wrong, so as to accelerate the convergence of the position loss and improve the training efficiency.
  • an image processing method including:
  • the image to be detected is input into the detection network trained by the image processing method for processing to obtain the position information of the target object.
  • an image processing device including:
  • An equalization module configured to perform feature equalization processing on a sample image through an equalization sub-network of a detection network to obtain an equalized feature image of the sample image, the detection network including the equalization sub-network and a detection sub-network;
  • the detection module is configured to perform target detection processing on the balanced feature image through a detection sub-network to obtain multiple prediction regions of the target object in the balanced feature image;
  • the determining module is configured to determine the intersection ratio of each prediction area in the plurality of prediction areas, where the intersection ratio is the overlap area and the corresponding label area of the target object in the sample image.
  • the sampling module is used to sample multiple prediction regions according to the intersection ratio of each prediction region to obtain the target region;
  • the training module is used to train the detection network according to the target area and the labeled area.
  • the sampling module is further configured as:
  • Sampling processing is performed on the prediction regions of each category to obtain the target region.
  • the equalization module is further configured to:
  • the equalization module is further configured to:
  • the equalization module is further configured to:
  • the first feature maps and the corresponding fifth feature maps are residually connected to obtain the balanced feature images.
  • the training module is further configured to:
  • the trained detection network is obtained.
  • the training module is further configured to:
  • the position loss is determined according to the position error.
  • the training module is further configured to:
  • the position loss is determined according to the preset value.
  • an image processing device including:
  • the obtaining module is used to input the image to be detected into the detection network trained by the image processing device for processing to obtain the position information of the target object.
  • an electronic device including:
  • a memory for storing processor executable instructions
  • the processor is configured to execute the above-mentioned image processing method.
  • a computer-readable storage medium having computer program instructions stored thereon, and when the computer program instructions are executed by a processor, the foregoing image processing method is implemented.
  • a computer program including computer-readable code, when the computer-readable code is run in an electronic device, a processor in the electronic device executes the image processing described above. method.
  • a second feature map with feature equalization can be obtained through equalization processing, and a balanced feature map can be obtained through residual connection, which can reduce information loss, improve training effects, and improve detection network detection Accuracy.
  • the prediction regions can be classified by cross-comparison, and the prediction regions of each category can be sampled, which can increase the probability of extracting the prediction regions with high cross-combination, and increase the proportion of prediction regions that are difficult to determine in the prediction region. Training efficiency, and reduce memory consumption and resource consumption.
  • the gradient of the position loss can be increased, the training efficiency can be improved, and the goodness of the detection network can be improved, and when the prediction of the target object is wrong, the position loss can be reduced.
  • the gradient of reduce the influence of position loss on the training process, in order to accelerate the convergence of position loss and improve training efficiency.
  • Fig. 1 shows a flowchart of an image processing method according to an embodiment of the present disclosure
  • FIG. 2 shows a schematic diagram of the intersection ratio of prediction regions according to an embodiment of the present disclosure
  • Fig. 3 shows an application schematic diagram of an image processing method according to an embodiment of the present disclosure
  • Fig. 4 shows a block diagram of an image processing device according to an embodiment of the present disclosure
  • Figure 5 shows a block diagram of an electronic device according to an embodiment of the present disclosure
  • FIG. 6 shows a block diagram of an electronic device according to an embodiment of the present disclosure.
  • 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 perform feature equalization processing on the sample image through the equalization sub-network of the detection network to obtain the equalized feature image of the sample image, and the detection network includes the equalization sub-network and the detection sub-network;
  • step S12 target detection processing is performed on the balanced feature image through the detection sub-network to obtain multiple prediction regions of the target object in the balanced feature image;
  • step S13 the cross-combination ratio of each prediction region in the plurality of prediction regions is determined respectively, wherein the cross-combination ratio is the overlap region and the corresponding labeled region of the target object prediction region in the sample image.
  • step S14 sampling the multiple prediction regions according to the intersection ratio of each prediction region to obtain a target region
  • step S15 a detection network is trained according to the target area and the labeled area.
  • feature equalization processing is performed on the target sample image, which can avoid information loss and improve the training effect.
  • the target area can be extracted according to the intersection ratio of the prediction area, which can increase the probability of extracting the prediction area where the determination process is difficult, improve training efficiency, and improve training effect.
  • the image processing method may be executed by terminal equipment, which may be User Equipment (UE), mobile equipment, user terminal, terminal, cellular phone, cordless phone, personal digital processing (Personal Digital Assistant, PDA), handheld devices, computing devices, vehicle-mounted devices, wearable devices, etc., the method can be implemented by a processor calling computer-readable instructions stored in a memory. Alternatively, the image processing method is executed by a server.
  • terminal equipment which may be User Equipment (UE), mobile equipment, user terminal, terminal, cellular phone, cordless phone, personal digital processing (Personal Digital Assistant, PDA), handheld devices, computing devices, vehicle-mounted devices, wearable devices, etc.
  • PDA Personal Digital Assistant
  • the detection network may be a neural network such as a convolutional neural network, and the present disclosure does not limit the type of the detection network.
  • the detection network may include an equalization sub-network and a detection sub-network.
  • the feature map of the sample image can be extracted by detecting each level of the equalization sub-network of the network, and the feature of the feature map extracted at each level can be balanced through feature equalization processing to reduce information loss and improve training effect.
  • step S11 may include: performing feature extraction processing on the sample image to obtain multiple first feature maps, wherein at least one of the multiple first feature maps is distinguished by the first feature map.
  • the resolution rate is different from that of other first feature maps; the multiple first feature maps are equalized to obtain a second feature map; according to the second feature map and the multiple first feature maps, multiple A balanced feature image.
  • an equalization sub-network can be used to perform feature equalization processing.
  • multiple convolutional layers of the equalization sub-network can be used to perform feature extraction processing on the target sample image to obtain multiple first feature maps.
  • the first feature map there is at least one resolution of the first feature map. The resolution is different from other first feature maps, for example, the resolutions of multiple first feature maps are different from each other.
  • the first convolution layer performs feature extraction processing on the target sample image to obtain the first first feature map, and then the second convolution layer performs feature extraction processing on the first first feature map , Obtain the second first feature map...
  • Multiple first feature maps can be obtained in this way, and the multiple first feature maps are obtained by different levels of convolutional layers, and the convolutional layers of each level compare the first feature map. The features in each have their own emphasis.
  • performing equalization processing on the multiple first feature maps to obtain a second feature map includes: performing scaling processing on the multiple first feature maps respectively to obtain multiple presets A third feature map of resolution; averaging the multiple third feature maps to obtain a fourth feature map; performing feature extraction processing on the fourth feature map to obtain the second feature map.
  • the resolutions of the multiple first feature maps may be different from each other, for example, 640 ⁇ 480, 800 ⁇ 600, 1024 ⁇ 768, 1600 ⁇ 1200, etc.
  • Each first feature map can be respectively scaled and reduced to obtain a third image with a preset resolution.
  • the preset resolution may be an average value of the resolutions of a plurality of first feature maps, or other set values, and the present disclosure does not limit the preset resolution.
  • the first feature map can be scaled to obtain a third feature map with a preset resolution.
  • the first feature map with a resolution lower than the preset resolution can be subjected to up-sampling processing such as interpolation to improve Resolution, the third feature map with the preset resolution is obtained, and the down-sampling process such as pooling processing can be performed on the first feature map with a higher resolution than the preset resolution to obtain the third feature map with the preset resolution.
  • up-sampling processing such as interpolation to improve Resolution
  • the third feature map with the preset resolution is obtained
  • the down-sampling process such as pooling processing can be performed on the first feature map with a higher resolution than the preset resolution to obtain the third feature map with the preset resolution.
  • multiple third feature maps may be averaged.
  • the resolutions of multiple third feature maps are the same, which are all preset resolutions.
  • the pixel values (for example, parameters such as RGB value or depth value) of the pixels of the same coordinate in the multiple third feature maps can be changed By averaging, the pixel value of the pixel point of the coordinate in the fourth feature map can be obtained. In this way, the pixel values of all pixels in the fourth feature map can be determined to obtain the fourth feature map, which is a feature map with balanced features.
  • feature extraction may be performed on the fourth feature map to obtain the second feature map.
  • the convolution layer of the equalization sub-network may be used to perform feature extraction on the fourth feature map, for example, , Using a non-local attention mechanism (Non-Local) to perform feature extraction on the fourth feature map to obtain the second feature map, and the second feature map is a feature map with balanced features.
  • Non-Local non-local attention mechanism
  • obtaining multiple balanced feature images according to the second feature map and the multiple first feature maps includes: performing scaling processing on the second feature map to obtain and The fifth feature map corresponding to each of the first feature maps, wherein the resolution of the first feature map and the corresponding fifth feature map are the same; The fifth feature map performs residual connection to obtain the balanced feature image.
  • the resolution of the second feature map and each first feature map may be different, and the second feature map can be scaled to obtain the same resolution as each first feature map.
  • the second feature map can be down-sampling processing such as pooling to obtain the fifth feature map with a resolution of 640 ⁇ 480. That is, the fifth feature map corresponding to the first feature map with a resolution of 640 ⁇ 480 can be subjected to up-sampling processing such as interpolation on the second feature map to obtain a fifth feature map with a resolution of 1024 ⁇ 768, that is, and The fifth feature map corresponding to the first feature map with a resolution of 1024 ⁇ 768...
  • the present disclosure does not limit the resolution of the second feature map and the first feature map.
  • the resolution of the first feature map and the corresponding fifth feature map are the same, and the first feature map and the corresponding fifth feature map may be subjected to residual connection processing to obtain the balanced feature image
  • the pixel value of a pixel at a certain coordinate in the first feature map can be added to the pixel value of a pixel at the same coordinate in the corresponding fifth feature map to obtain the pixel value of the pixel in the balanced feature image.
  • the pixel values of all pixels in the balanced feature image can be obtained, that is, the balanced feature image can be obtained.
  • the second feature map of feature balance can be obtained through equalization processing, and the balanced feature map can be obtained through residual connection, which can reduce information loss and improve training effects.
  • step S12 target detection can be performed on the balanced feature image through the detection sub-network to obtain the prediction area of the target object in the balanced feature image.
  • the target object can be detected by the selection box. To select the prediction area.
  • the target detection processing can also be implemented by other neural networks or other methods used for target detection to obtain multiple prediction regions of the target object. The present disclosure does not limit the implementation of target detection processing.
  • the sample image is a labeled sample image.
  • the area where the target object is located can be marked, that is, the area where the target object is located can be framed using a selection box. selected.
  • the balanced feature image is obtained based on the sample image, and the location of the target object area in the balanced feature image can be determined according to the selection box in the sample image for the area where the target object is located, and the location can be framed. Select, the area selected by the frame is the marked area.
  • the labeled area corresponds to the target object
  • the sample image or the balanced feature image of the sample image may include one or more target objects, and each target object may be labeled, that is, each The target objects all have corresponding labeled areas.
  • the intersection ratio is the area ratio of the overlap area between the prediction area of the target object and the corresponding labeled area to the combined area
  • the overlap area between the prediction area and the labeled area is the intersection of the two regions.
  • the merging area of the prediction area and the labeling area is the union of the two areas.
  • the detection network may determine the prediction area of each object separately. For example, for target object A, the detection network may determine multiple prediction areas of target object A, and for target object B, the detection network may determine target object B Multiple prediction areas.
  • the intersection ratio of the prediction area the area ratio of the overlap area between the prediction area and the corresponding labeled area to the combined area can be determined.
  • the prediction can be determined The area ratio of the overlap area between the area and the labeled area of the target object A to the combined area.
  • FIG. 2 shows a schematic diagram of the intersection ratio of prediction regions according to an embodiment of the present disclosure.
  • the area where the target object is located has been labeled, and the label may be a frame selection target
  • the selection box of the area where the object is located for example, the marked area shown by the dotted line in Figure 2.
  • the target detection method can be used to detect the target object in the balanced feature image, for example, the detection network can be used to detect, and the prediction area of the detected target object can be frame selected, for example, the prediction shown by the solid line in Figure 2 area.
  • the detection network can be used to detect
  • the prediction area of the detected target object can be frame selected, for example, the prediction shown by the solid line in Figure 2 area.
  • the label area is A+B
  • the prediction area is B+C
  • the overlap area between the prediction area and the label area is B
  • the combined area of the prediction area and the label area is A+B+C.
  • the intersection ratio of the sample image is the ratio of the area of the B area to the area of the A+B+C area.
  • the intersection ratio is positively correlated with the degree of difficulty in determining the prediction area, that is, in the prediction area with a high intersection ratio, the prediction area whose determination process is difficult takes up a larger proportion.
  • the proportion of prediction regions with low intersections is relatively large. If random sampling or uniform sampling is directly performed in all prediction regions, the probability of obtaining prediction regions with low intersections is greater, that is, The probability of obtaining a prediction region with an easy determination process is relatively high. If a large number of prediction regions with an easy determination process are used for training, the training efficiency is low. However, the use of prediction regions that are difficult to determine during training can obtain more information in each training and improve training efficiency. Therefore, the prediction regions can be screened according to the intersection ratio of the prediction regions, so that among the screened prediction regions, the prediction regions that are difficult to determine have a higher proportion, and the training efficiency is improved.
  • step S14 may include: classifying the multiple prediction regions according to the intersection ratio of each prediction region to obtain multiple categories of prediction regions; The prediction areas of the categories are respectively sampled to obtain the target area.
  • the prediction regions can be classified according to the intersection ratio.
  • the prediction regions with the intersection ratio greater than 0 and less than or equal to 0.05 can be classified into one category, and the intersection ratio
  • the prediction areas greater than 0.05 and less than or equal to 0.1 are classified into one category, and the prediction areas with an intersection ratio greater than 0.1 and less than or equal to 0.15 are classified into one category... That is, the interval length of each category in the intersection ratio is 0.05.
  • the present disclosure does not limit the number of categories and the length of each category.
  • uniform sampling or random sampling may be performed in each category to obtain the target area. That is, in the category with high intersection and the category with low intersection, the prediction area is extracted to increase the probability of extracting the prediction area with high intersection, that is, to improve the prediction area of the target area that is difficult to determine. proportion.
  • the probability of the prediction area being extracted can be expressed by the following formula (1):
  • K (K is an integer greater than 1) is the number of categories
  • p k is the probability that the prediction area is extracted in the kth category (k is a positive integer less than or equal to K)
  • N is the total number of prediction area images
  • M k is the number of prediction regions in the k-th category.
  • the present disclosure does not limit the screening method.
  • the prediction regions can be classified by intersection and comparison, and the prediction regions of each category can be sampled, which can increase the probability of extracting the prediction regions with high intersections and improve the prediction regions that are difficult to determine in the target region.
  • the detection network may be a neural network used to detect the target object in the image, for example, the detection network may be a convolutional neural network, and the present disclosure does not do anything about the type of detection network. limit.
  • the target area and the labeled area in the balanced feature image can be used to train the detection network.
  • determining the recognition loss and location loss of the detection network according to the target area and the labeled area includes: determining the detection network according to the target area and the labeled area The recognition loss and position loss of the detection network are adjusted according to the recognition loss and the position loss; the training detection network is obtained when the training conditions are met.
  • the recognition loss and location loss can be determined by any target area and the labeled area, where the recognition loss is used to indicate whether the neural network recognizes the target object correctly, for example, in the balanced feature image
  • Multiple objects may be included, of which only one or a part of the objects are target objects, and the objects may be divided into two categories, namely, the objects are target objects and the objects are not target objects.
  • the probability can be used to represent the recognition result, for example, the probability of an object being the target object, that is, if the probability of an object being the target object is greater than or equal to 50%, the object is the target object, otherwise, The stated object is not the target object.
  • the identification loss of the detection network can be determined according to the target area and the labeling area.
  • the area in the selection box for frame selection of the area where the target object is predicted by the detection network is the target area.
  • the image includes multiple objects, and the area where the target object is located can be selected.
  • Frame selection, without frame selection for other objects, the recognition loss of the detection network can be determined according to the similarity between the object framed in the target area and the target object.
  • an object in the target area has a 70% probability of being the target object (ie The detection network determines that the similarity between the object in the target area and the target object is 70%), and the object is the target object, which can be marked as 100%, and the recognition loss can be determined according to an error of 30%.
  • the location loss of the detection network is determined according to the target area and the labeled area.
  • the labeled area is a selection box for selecting the area where the target object is located. That is, the target area detects the area where the target object is predicted by the network, and uses a selection box to select the area. The positions and sizes of the two selection boxes can be compared to determine the position loss.
  • determining the recognition loss and location loss of the detection network according to the target area and the labeled area includes: determining a position error between the target area and the labeled area; In a case where the position error is less than a preset threshold, the position loss is determined according to the position error.
  • the prediction area and the labeling area are both selection boxes, and the prediction area can be compared with the labeling area.
  • the position error may include errors in the position and size of the selection box, for example, errors in the coordinates of the center point or top left corner of the selection box, and errors in the length and width of the selection box. If the prediction of the target object is correct, the position error is small.
  • the position loss determined by the position error can be beneficial to the convergence of the position loss, improve training efficiency, and improve the fitting of the detection network Goodness, if the prediction of the target object is wrong, for example, if a non-target object is mistaken for the target object, the position error is relatively large.
  • the position loss is not easy to converge, and the training process efficiency is low. It is not conducive to improving the goodness of fit of the detection network. Therefore, a preset threshold can be used to determine the location loss. In the case that the position error is less than the preset threshold, it can be considered that the prediction of the target object is correct, and the position loss can be determined according to the position error.
  • determining the recognition loss and location loss of the detection network according to the target area and the labeled area includes: determining a position error between the target area and the labeled area; In the case that the position error is greater than or equal to a preset threshold value, the position loss is determined according to the preset value. In the example, if the position error is greater than or equal to the preset threshold, it can be considered that the prediction of the target object is wrong, and the position loss can be determined according to the preset value (for example, a certain constant value) to reduce the position loss during training Therefore, the convergence of the position loss is accelerated and the training efficiency is improved.
  • the location loss can be determined by the following formula (2):
  • L pro is the position loss
  • ⁇ and b are set parameters
  • x is the position error
  • is the preset value
  • is the preset threshold.
  • is the preset threshold.
  • Integrate (2) to obtain the position loss L pro L pro can be determined according to the following formula (3):
  • C is the integral constant.
  • the logarithm is used to increase the gradient of the position loss, so that the gradient of the adjustment parameter of the position loss in the training process is larger, thus Improve training efficiency and improve the goodness of fit of the detection network.
  • the position loss is a constant ⁇ , thereby reducing the gradient of the position loss and reducing the influence of the position loss on the training process, so as to accelerate the convergence of the position loss and improve the goodness of the detection network.
  • the network parameters of the detection network can be adjusted according to the identification loss and location loss.
  • the comprehensive network loss of the detection network can be determined based on the identification loss and location loss. For example, the following formula can be used (4) Determine the comprehensive network loss of the detection network:
  • L is the integrated network loss
  • L cls is the identification loss
  • the network parameters of the detection network can be adjusted in the direction of minimizing the comprehensive network loss.
  • the gradient descent method can be used to backpropagate the comprehensive network loss to adjust the detection network. Network parameters.
  • the training conditions may include conditions such as the number of adjustments and the size or convergence and divergence of the integrated network loss.
  • the detection network can be adjusted a predetermined number of times. When the number of adjustments reaches the predetermined number of times, the training condition is satisfied. The number of training times may not be limited. When the comprehensive network loss is reduced to a certain level or converges within a certain interval, the training condition is satisfied. After the training is completed, the detection network can be used in the process of detecting the target object in the image.
  • the gradient of the position loss can be improved, the training efficiency can be improved, and the goodness of fit of the detection network can be improved. It can also reduce the gradient of the position loss and reduce the influence of the position loss on the training process when the prediction of the target object is wrong, so as to accelerate the convergence of the position loss and improve the training efficiency.
  • an image processing method includes: inputting an image to be detected into a trained detection network for processing to obtain position information of a target object.
  • the image to be detected is an image including a target object
  • feature equalization processing of the image to be detected can be performed through the equalization sub-network of the detection network to obtain a set of balanced feature maps.
  • the balanced feature map can be input into the detection sub-network of the detection network, and the detection sub-network can identify the target object, determine the location of the target object, and obtain the location information of the target object, for example, for the target object A selection box for frame selection.
  • a second feature map with feature equalization can be obtained through equalization processing, and a balanced feature map can be obtained through residual connection, which can reduce information loss, improve training effects, and improve detection network detection Accuracy.
  • the prediction regions can be classified by cross-comparison, and the prediction regions of each category can be sampled, which can increase the probability of extracting the prediction regions with high cross-combination, and increase the proportion of prediction regions that are difficult to determine in the prediction region. Training efficiency, and reduce memory consumption and resource consumption.
  • the gradient of the position loss can be increased, the training efficiency can be improved, and the goodness of the detection network can be improved, and when the prediction of the target object is wrong, the position loss can be reduced.
  • the gradient of reduce the influence of position loss on the training process, in order to accelerate the convergence of position loss and improve training efficiency.
  • Fig. 3 shows an application schematic diagram of the image processing method according to an embodiment of the present disclosure.
  • multiple levels of convolutional layers of the equalization sub-network of the detection network can be used to perform feature extraction on the sample image C1 to obtain the resolution
  • first feature maps with resolutions of 640 ⁇ 480, 800 ⁇ 600, 1024 ⁇ 768, 1600 ⁇ 1200, etc. are obtained.
  • each first feature map can be scaled to obtain multiple third feature maps with preset resolutions.
  • the resolution can be set to 640 ⁇ 480, 800 ⁇ 600, 1024
  • the first feature maps of ⁇ 768 and 1600 ⁇ 1200 are respectively scaled and reduced to obtain the third feature map with a resolution of 800 ⁇ 600.
  • multiple third feature maps may be averaged to obtain a fourth feature map with balanced features. And using a non-local attention mechanism (Non-Local) to perform feature extraction on the fourth feature map to obtain the second feature map.
  • Non-Local non-local attention mechanism
  • the second feature map can be scaled to obtain fifth feature maps (for example, C2, C3, C4, C5) with the same resolution as the first feature maps, for example,
  • the second feature map can be scaled to a fifth feature map with resolutions of 640 ⁇ 480, 800 ⁇ 600, 1024 ⁇ 768, 1600 ⁇ 1200, etc. (for example, P2, P3, P4, P5).
  • the residual connection processing can be performed on the first feature map and the corresponding fifth feature map, that is, the first feature map and the corresponding fifth feature map of the pixel points of the same coordinate Add parameters such as RGB value or gray value to obtain multiple balanced feature maps.
  • the detection sub-network of the detection network may be used to perform target detection processing on the balanced feature image to obtain multiple prediction regions of the target object in the balanced feature image. It can also determine the cross-combination ratio of multiple prediction regions, and classify the prediction regions according to the cross-combination comparison, and sample the prediction regions of each category to obtain the target region. In the target region, determine the difficult prediction region The proportion is larger.
  • the detection network can be trained using the target area and the labeled area, that is, the recognition loss is determined according to the similarity between the object framed in the target area and the target object, and the recognition loss is determined according to the target area, the labeled area, and the Equation (3) determines the location loss.
  • the comprehensive network loss can be determined by formula (4), and the network parameters of the detection network can be adjusted according to the comprehensive network loss. When the comprehensive network loss meets the training conditions, the training is completed, and the trained detection network can be used to detect the pending detection The target object in the image.
  • the equalization sub-network can be used to perform feature equalization processing on the image to be detected, and the obtained equalized feature map is input into the detection network of the detection network to obtain the location information of the target object.
  • the detection network can be used in automatic driving to perform target detection, for example, it can detect obstacles, signal lights or traffic signs, etc., which can provide a basis for controlling vehicle operation.
  • the detection network can be used for security monitoring and can detect target persons in surveillance videos.
  • the detection network can also be used to detect target objects in remote sensing images or navigation videos, etc. The present disclosure does not limit the application field of the detection network.
  • Fig. 5 shows a block diagram of an image processing device according to an embodiment of the present disclosure. As shown in Fig. 5, the device includes:
  • the equalization module 11 is configured to perform feature equalization processing on the sample image through the equalization sub-network of the detection network to obtain the equalized feature image of the sample image.
  • the detection network includes the equalization sub-network and the detection sub-network; the detection module 12, It is used to perform target detection processing on the balanced feature image through the detection sub-network to obtain multiple prediction regions of the target object in the balanced feature image; the determining module 13 is used to separately determine each prediction in the multiple prediction regions The intersection ratio of regions, where the intersection ratio is the area ratio of the overlap area of the target object's prediction area and the corresponding labeled area in the sample image to the combined area; the sampling module 14 is configured to The cross-combination ratio of the prediction regions is to sample multiple prediction regions to obtain the target region; the training module 15 is used to train the detection network according to the target region and the labeled region.
  • the sampling module is further configured to: classify the multiple prediction regions according to the intersection ratio of each prediction region to obtain prediction regions of multiple categories; The prediction areas of the category are respectively subjected to sampling processing to obtain the target area.
  • the equalization module is further configured to: perform feature extraction processing on the sample image to obtain multiple first feature maps, wherein at least one first feature map is present in the multiple first feature maps.
  • the resolution of the feature map is different from the resolution of other first feature maps; equalize the multiple first feature maps to obtain a second feature map; according to the second feature map and the multiple first features Figure to obtain multiple balanced feature images.
  • the equalization module is further configured to: respectively perform scaling processing on the multiple first feature maps to obtain multiple third feature maps with preset resolutions; Performing averaging processing on the three third feature maps to obtain a fourth feature map; performing feature extraction processing on the fourth feature map to obtain the second feature map.
  • the equalization module is further configured to: perform scaling processing on the second feature map to obtain fifth feature maps corresponding to the first feature maps respectively, wherein The resolutions of the first feature map and the corresponding fifth feature map are the same; the first feature maps and the corresponding fifth feature maps are respectively connected by residual error to obtain the balanced feature image.
  • the training module is further configured to: determine the recognition loss and location loss of the detection network according to the target area and the labeled area; according to the recognition loss and the location The loss adjusts the network parameters of the detection network; when the training conditions are met, the trained detection network is obtained.
  • the training module is further configured to: determine the position error between the target area and the labeled area; in the case where the position error is less than a preset threshold, according to the The position error determines the position loss.
  • the training module is further configured to: determine a position error between the target area and the labeled area; in the case that the position error is greater than or equal to a preset threshold, according to The preset value determines the position loss.
  • an image processing device includes: an obtaining module, configured to input the image to be detected into the detection network after the training of the image processing device. Process to obtain the location information of the target object.
  • the present disclosure also provides image processing devices, electronic equipment, computer-readable storage media, and programs, all of which can be used to implement any image processing method provided in the present disclosure.
  • image processing devices electronic equipment, computer-readable storage media, and programs, all of which can be used to implement any image processing method provided in the present disclosure.
  • the writing order of the steps does not mean a strict execution order but constitutes any limitation on the implementation process.
  • the specific execution order of each step should be based on its function and possibility.
  • the inner logic is determined.
  • the functions or modules contained in the apparatus 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 apparatus 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-readable storage medium on which computer program instructions are stored, and the computer program instructions implement the foregoing method when executed by a processor.
  • the computer-readable storage medium may be a non-volatile computer-readable storage medium.
  • An embodiment of the present disclosure also provides an electronic device, including: a processor; a memory for storing executable instructions of the processor; wherein the processor is configured as the above method.
  • the electronic device can be provided as a terminal, server or other form of device.
  • Fig. 5 is a block diagram showing an electronic device 800 according to an exemplary embodiment.
  • the electronic device 800 may be a mobile phone, a computer, a digital broadcasting terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, and other terminals.
  • 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 operating 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 and 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 and 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 power supply component 806 provides power for various components of the electronic device 800.
  • the power supply component 806 may include a power management system, one or more power supplies, and other components associated with the generation, management, and distribution of power for the electronic device 800.
  • the multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user.
  • the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user.
  • the touch panel includes one or more touch sensors to sense touch, sliding, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure related to the touch or slide operation.
  • the multimedia component 808 includes a front camera and/or a rear camera. When the electronic device 800 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera can receive external multimedia data. Each front camera and rear camera can be a fixed optical lens system or have focal length and optical zoom capabilities.
  • the audio component 810 is configured to output and/or input audio signals.
  • the audio component 810 includes a microphone (MIC).
  • the microphone is configured to receive an external audio signal.
  • the received audio signal may be further stored in the memory 804 or transmitted via the communication component 816.
  • the audio component 810 further includes a speaker for outputting audio signals.
  • the I/O interface 812 provides an interface between the processing component 802 and a peripheral interface module.
  • the 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 can 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 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 A programmable gate array
  • controller microcontroller, microprocessor, or other electronic components are implemented to implement the above methods.
  • a non-volatile computer-readable storage medium such as the memory 804 including computer program instructions, which can be executed by the processor 820 of the electronic device 800 to complete the foregoing method.
  • the embodiments of the present disclosure also provide a computer program product, which includes computer-readable code.
  • a processor in the device executes instructions for implementing the method provided in any of the above embodiments.
  • the computer program product can be specifically implemented by hardware, software or a combination thereof.
  • the computer program product is specifically embodied as a computer storage medium.
  • the computer program product is specifically embodied as a software product, such as a software development kit (SDK), etc. Wait.
  • SDK software development kit
  • Fig. 6 is a block diagram showing an electronic device 1900 according to an exemplary embodiment.
  • the electronic device 1900 may be provided as a server. 6
  • 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 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 a 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 ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM or the like.
  • a non-volatile computer-readable storage medium 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.
  • Non-exhaustive list of 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 a transient 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 computer program instructions used to perform the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or in one or more programming languages.
  • Source code or object code written in any combination, the programming language includes object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as "C" language or similar programming languages.
  • Computer-readable program instructions can be executed entirely on the user's computer, partly on the user's computer, executed as a stand-alone software package, partly on the user's computer and partly executed on a remote computer, or entirely on the remote computer or server carried out.
  • 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 access the Internet connection).
  • 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.
  • These computer-readable program instructions can be provided to the processors of general-purpose computers, special-purpose computers, or other programmable data processing devices, thereby producing a machine that makes these instructions when executed by the processors of the computer or other programmable data processing devices , A device that implements the functions/actions specified in one or more blocks in the flowcharts and/or block diagrams is produced. It is also possible to store these computer-readable program instructions in a computer-readable storage medium. These instructions make computers, programmable data processing apparatuses, and/or other devices work in a specific manner. Thus, the computer-readable medium storing the instructions includes An article of manufacture, which includes instructions for implementing various aspects of the functions/actions specified in one or more blocks in the flowchart and/or block diagram.
  • 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)
  • Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Multimedia (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Software Systems (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Biomedical Technology (AREA)
  • Molecular Biology (AREA)
  • Databases & Information Systems (AREA)
  • Medical Informatics (AREA)
  • Biodiversity & Conservation Biology (AREA)
  • Biophysics (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Image Analysis (AREA)

Abstract

本公开涉及一种图像处理方法及装置、电子设备和存储介质,所述方法包括:通过检测网络的均衡子网络对样本图像进行特征均衡处理,获得样本图像的均衡特征图像;通过检测子网络对均衡特征图像进行目标检测处理,获得均衡特征图像中目标对象的预测区域;分别确定每个预测区域的交并比;根据各预测区域的交并比,对多个预测区域进行抽样,获得目标区域;根据目标区域和标注区域,训练检测网络。根据本公开的实施例的图像处理方法,对目标样本图像进行特征均衡处理,可避免信息损失,提高训练效果。并且,可根据预测区域的交并比,抽取出目标区域,可提高抽取出确定过程困难的预测区域的概率,提升训练效率,提高训练效果。

Description

图像处理方法及装置、电子设备和存储介质
本公开要求在2019年2月1日提交中国专利局、申请号为201910103611.1、申请名称为“图像处理方法及装置、电子设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本公开中。
技术领域
本公开涉及计算机技术领域,尤其涉及一种图像处理方法及装置、电子设备和存储介质。
背景技术
在相关技术中,在神经网络训练的过程中,困难样本和简单样本对于神经网络训练的重要性不同,困难样本在训练过程可获取更多信息,使训练过程效率更高,且训练效果更好,但在大量样本中,简单样本的数量更多。并且,在训练过程中,神经网络的各层级对提取的特征各有侧重。
发明内容
本公开提出了一种图像处理方法及装置、电子设备和存储介质。
根据本公开的一方面,提供了一种图像处理方法,包括:
通过检测网络的均衡子网络对样本图像进行特征均衡处理,获得所述样本图像的均衡特征图像,所述检测网络包括所述均衡子网络和检测子网络;
通过检测子网络对所述均衡特征图像进行目标检测处理,获得所述均衡特征图像中目标对象的多个预测区域;
分别确定所述多个预测区域中每个预测区域的交并比,其中,所述交并比为所述样本图像中目标对象的预测区域与对应的标注区域的重叠区域与合并区域的面积比;
根据所述每个预测区域的交并比,对所述多个预测区域进行抽样,获得目标区域;
根据所述目标区域和所述标注区域,训练所述检测网络。
根据本公开的实施例的图像处理方法,对目标样本图像进行特征均衡处理,可避免信息损失,提高训练效果。并且,可根据预测区域的交并比,抽取出目标区域,可提高抽取出出确定过程困难的预测区域的概率,提升训练效率,提高训练效果。
在一种可能的实现方式中,根据所述每个预测区域的交并比,对多个预测区域进行抽样,获得目标区域,包括:
根据所述每个预测区域的交并比,将所述多个预测区域进行分类处理,获得多个类别的预测区域;
对所述类别的预测区域分别进行抽样处理,获得所述目标区域。
通过这种方式,可通过交并比对预测区域进行分类,并对各类别的预测区域进行抽样,可提高抽取到交并比较高的预测区域的概率,提高目标区域中确定过程困难的预测区域的比重,提高训练效率。
在一种可能的实现方式中,通过检测网络的均衡子网络对样本图像进行特征均衡处理,获得均衡特征图像,包括:
对样本图像进行特征提取处理,获得多个第一特征图,其中,所述多个第一特征图 中至少有一个第一特征图的分辨率与其他第一特征图的分辨率不同;
对所述多个第一特征图进行均衡处理,获得第二特征图;
根据所述第二特征图以及所述多个第一特征图,获得多个均衡特征图像。
在一种可能的实现方式中,对所述多个第一特征图进行均衡处理,获得第二特征图,包括:
分别对所述多个第一特征图进行放缩处理,获得多个预设分辨率的第三特征图;
对所述多个第三特征图进行平均处理,获得第四特征图;
对所述第四特征图进行特征提取处理,获得所述第二特征图。
在一种可能的实现方式中,根据所述第二特征图以及所述多个第一特征图,获得多个均衡特征图像,包括:
将所述第二特征图进行放缩处理,分别获得与所述各第一特征图对应的第五特征图,其中,所述第一特征图与所述对应的第五特征图的分辨率相同;
分别将所述各第一特征图与所述对应的第五特征图进行残差连接,获得所述均衡特征图像。
通过这种方式,可通过均衡处理获得特征均衡的第二特征图,并通过残差连接,获得均衡特征图,可减少信息损失,提高训练效果。
在一种可能的实现方式中,根据所述目标区域和所述标注区域,训练所述检测网络,包括:
根据所述目标区域和所述标注区域,确定所述检测网络的识别损失和位置损失;
根据所述识别损失与所述位置损失对所述检测网络的网络参数进行调整;
在满足训练条件的情况下,获得训练后的检测网络。
在一种可能的实现方式中,根据所述目标区域和所述标注区域,确定所述检测网络的识别损失和位置损失,包括:
确定所述目标区域与所述标注区域之间的位置误差;
在所述位置误差小于预设阈值的情况下,根据所述位置误差确定所述位置损失。
在一种可能的实现方式中,根据所述目标区域和所述标注区域,确定所述检测网络的识别损失和位置损失,包括:
确定所述目标区域与所述标注区域之间的位置误差;
在所述位置误差大于或等于预设阈值的情况下,根据预设值确定所述位置损失。
通过这种方式,可在对目标对象的预测正确的情况下,提高位置损失的梯度,提高训练效率,并提高检测网络的拟合优度。并可在对目标对象的预测错误的情况下,降低位置损失的梯度,减小位置损失对训练过程的影响,以加快位置损失收敛,提高训练效率。
根据本公开的另一方面,提供了一种图像处理方法,包括:
将待检测图像输入所述图像处理方法训练后的检测网络进行处理,获得目标对象的位置信息。
根据本公开的另一方面,提供了一种图像处理装置,包括:
均衡模块,用于通过检测网络的均衡子网络对样本图像进行特征均衡处理,获得所述样本图像的均衡特征图像,所述检测网络包括所述均衡子网络和检测子网络;
检测模块,用于通过检测子网络对所述均衡特征图像进行目标检测处理,获得所述均衡特征图像中目标对象的多个预测区域;
确定模块,用于分别确定所述多个预测区域中每个预测区域的交并比,其中,所述交并比为所述样本图像中目标对象的预测区域与对应的标注区域的重叠区域与合并区域的面积比;
抽样模块,用于根据所述每个预测区域的交并比,对多个预测区域进行抽样,获得目标区域;
训练模块,用于根据所述目标区域和所述标注区域,训练所述检测网络。
在一种可能的实现方式中,所述抽样模块被进一步配置为:
根据所述每个预测区域的交并比,将所述多个预测区域进行分类处理,获得多个类别的预测区域;
对所述各类别的预测区域分别进行抽样处理,获得所述目标区域。
在一种可能的实现方式中,所述均衡模块被进一步配置为:
对样本图像进行特征提取处理,获得多个第一特征图,其中,所述多个第一特征图中至少有一个第一特征图的分辨率与其他第一特征图的分辨率不同;
对所述多个第一特征图进行均衡处理,获得第二特征图;
根据所述第二特征图以及所述多个第一特征图,获得多个均衡特征图像。
在一种可能的实现方式中,所述均衡模块被进一步配置为:
分别对所述多个第一特征图进行放缩处理,获得多个预设分辨率的第三特征图;
对所述多个第三特征图进行平均处理,获得第四特征图;
对所述第四特征图进行特征提取处理,获得所述第二特征图。
在一种可能的实现方式中,所述均衡模块被进一步配置为:
将所述第二特征图进行放缩处理,分别获得与所述各第一特征图对应的第五特征图,其中,所述第一特征图与所述对应的第五特征图的分辨率相同;
分别将所述各第一特征图与所述对应的第五特征图进行残差连接,获得所述均衡特征图像。
在一种可能的实现方式中,所述训练模块被进一步配置为:
根据所述目标区域和所述标注区域,确定所述检测网络的识别损失和位置损失;
根据所述识别损失与所述位置损失对所述检测网络的网络参数进行调整;
在满足训练条件的情况下,获得训练后的检测网络。
在一种可能的实现方式中,所述训练模块被进一步配置为:
确定所述目标区域与所述标注区域之间的位置误差;
在所述位置误差小于预设阈值的情况下,根据所述位置误差确定所述位置损失。
在一种可能的实现方式中,所述训练模块被进一步配置为:
确定所述目标区域与所述标注区域之间的位置误差;
在所述位置误差大于或等于预设阈值的情况下,根据预设值确定所述位置损失。
根据本公开的另一方面,提供了一种图像处理装置,包括:
获得模块,用于将待检测图像输入所述图像处理装置训练后的检测网络进行处理,获得目标对象的位置信息。
根据本公开的一方面,提供了一种电子设备,包括:
处理器;
用于存储处理器可执行指令的存储器;
其中,所述处理器被配置为:执行上述图像处理方法。
根据本公开的一方面,提供了一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述图像处理方法。
根据本公开的一方面,提供了一种计算机程序,包括计算机可读代码,当所述计算机可读代码在电子设备中运行时,所述电子设备中的处理器执行用于执行上述的图像处理方法。
根据本公开的实施例的图像处理方法,可通过均衡处理获得特征均衡的第二特征图,并通过残差连接,获得均衡特征图,可减少信息损失,提高训练效果,并提高检测网络的检测精度。可通过交并比对预测区域进行分类,并对各类别的预测区域进行抽样,可提高抽取到交并比较高的预测区域的概率,提高预测区域中的确定过程困难的预测区域的比重,提高训练效率,且降低内存消耗与资源占用。进一步地,可在对目标对象的预测正确的情况下,提高位置损失的梯度,提高训练效率,并提高检测网络的拟合优度,以及在对目标对象的预测错误的情况下,降低位置损失的梯度,减小位置损失对训练过程的影响,以加快位置损失收敛,提高训练效率。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,而非限制本公开。
根据下面参考附图对示例性实施例的详细说明,本公开的其它特征及方面将变得清楚。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开的技术方案。
图1示出根据本公开实施例的图像处理方法的流程图;
图2示出根据本公开实施例的预测区域的交并比的示意图;
图3示出根据本公开实施例的图像处理方法的应用示意图;
图4示出根据本公开实施例的图像处理装置的框图;
图5示出根据本公开实施例的电子装置的框图;
图6示出根据本公开实施例的电子装置的框图。
具体实施方式
以下将参考附图详细说明本公开的各种示例性实施例、特征和方面。附图中相同的附图标记表示功能相同或相似的元件。尽管在附图中示出了实施例的各种方面,但是除 非特别指出,不必按比例绘制附图。
在这里专用的词“示例性”意为“用作例子、实施例或说明性”。这里作为“示例性”所说明的任何实施例不必解释为优于或好于其它实施例。
本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中术语“至少一种”表示多种中的任意一种或多种中的至少两种的任意组合,例如,包括A、B、C中的至少一种,可以表示包括从A、B和C构成的集合中选择的任意一个或多个元素。
另外,为了更好的说明本公开,在下文的具体实施方式中给出了众多的具体细节。本领域技术人员应当理解,没有某些具体细节,本公开同样可以实施。在一些实例中,对于本领域技术人员熟知的方法、手段、元件和电路未作详细描述,以便于凸显本公开的主旨。
图1示出根据本公开实施例的图像处理方法的流程图,如图1所示,所述方法包括:
在步骤S11中,通过检测网络的均衡子网络对样本图像进行特征均衡处理,获得所述样本图像的均衡特征图像,所述检测网络包括所述均衡子网络和检测子网络;
在步骤S12中,通过所述检测子网络对所述均衡特征图像进行目标检测处理,获得所述均衡特征图像中目标对象的多个预测区域;
在步骤S13中,分别确定所述多个预测区域中每个预测区域的交并比,其中,所述交并比为所述样本图像中目标对象的预测区域与对应的标注区域的重叠区域与合并区域的面积比;
在步骤S14中,根据所述每个预测区域的交并比,对所述多个预测区域进行抽样,获得目标区域;
在步骤S15中,根据所述目标区域和所述标注区域,训练检测网络。
根据本公开的实施例的图像处理方法,对目标样本图像进行特征均衡处理,可避免信息损失,提高训练效果。并且,可根据预测区域的交并比,抽取出目标区域,可提高抽取到确定过程困难的预测区域的概率,提升训练效率,提高训练效果。
在一种可能的实现方式中,所述图像处理方法可以由终端设备执行,终端设备可以为用户设备(User Equipment,UE)、移动设备、用户终端、终端、蜂窝电话、无绳电话、个人数字处理(Personal Digital Assistant,PDA)、手持设备、计算设备、车载设备、可穿戴设备等,所述方法可以通过处理器调用存储器中存储的计算机可读指令的方式来实现。或者,所述图像处理方法通过服务器执行。
在一种可能的实现方式中,所述检测网络可以是卷积神经网络等神经网络,本公开对检测网络的类型不作限制。所述检测网络可包括均衡子网络和检测子网络。可通过检测网络的均衡子网络的各层级提取样本图像的特征图,并可通过特征均衡处理使各层级提取的特征图的特征平衡,以减少信息损失,提高训练效果。
在一种可能的实现方式中,步骤S11可包括:对样本图像进行特征提取处理,获得多个第一特征图,其中,所述多个第一特征图中至少有一个第一特征图的分辨率与其他第 一特征图的分辨率不同;对所述多个第一特征图进行均衡处理,获得第二特征图;根据所述第二特征图以及所述多个第一特征图,获得多个均衡特征图像。
在一种可能的实现方式中,可使用均衡子网络来进行特征均衡处理。在示例中,可使用均衡子网络的多个卷积层分别对目标样本图像进行特征提取处理,获得多个第一特征图,在第一特征图中,至少有一个第一特征图的分辨率与其他第一特征图的分辨率不同,例如,多个第一特征图的分辨率互不相同。在示例中,第一个卷积层对目标样本图像进行特征提取处理,获得第一个第一特征图,再由第二个卷积层对所述第一个第一特征图进行特征提取处理,获得第二个第一特征图…可按照这种方式获得多个第一特征图,多个第一特征图分别由不同层级的卷积层获取,各层级的卷积层对第一特征图中的特征各有侧重。
在一种可能的实现方式中,对所述多个第一特征图进行均衡处理,获得第二特征图,包括:分别对所述多个第一特征图进行放缩处理,获得多个预设分辨率的第三特征图;对所述多个第三特征图进行平均处理,获得第四特征图;对所述第四特征图进行特征提取处理,获得所述第二特征图。
在一种可能的实现方式中,所述多个第一特征图的分辨率可互不相同,例如,640×480、800×600、1024×768、1600×1200等。可对各第一特征图分别进行放缩处理,获得预设分辨率的第三图像。所述预设分辨率可以是多个第一特征图的分辨率的平均值,或者其他设定值,本公开对预设分辨率不做限制。可对第一特征图进行放缩处理,获得预设分辨率的第三特征图,在示例中,可对分辨率低于预设分辨率的第一特征图进行插值等上采样处理,以提高分辨率,获得预设分辨率的第三特征图,并可对高于预设分辨率的第一特征图进行池化处理等下采样处理,获得预设分辨率的第三特征图,本公开对放缩的方法不做限制。
在一种可能的实现方式中,可对多个第三特征图进行平均处理。在示例中,多个第三特征图的分辨率相同,均为预设分辨率,可将多个第三特征图中同一坐标的像素点的像素值(例如,RGB值或深度值等参数)进行平均,可获得第四特征图中该坐标的像素点的像素值。可按照这种方式,确定第四特征图中所有像素点的像素值,即可获得第四特征图,第四特征图中为特征均衡的特征图。
在一种可能的实现方式中,可对第四特征图进行特征提取,获得第二特征图,在示例中,可使用所述均衡子网络的卷积层对第四特征图进行特征提取,例如,使用非局部注意力机制(Non-Local)对第四特征图进行特征提取,获得所述第二特征图,第二特征图中为特征均衡的特征图。
在一种可能的实现方式中,根据所述第二特征图以及所述多个第一特征图,获得多个均衡特征图像,包括:将所述第二特征图进行放缩处理,分别获得与所述各第一特征图对应的第五特征图,其中,所述第一特征图与所述对应的第五特征图的分辨率相同;分别将所述各第一特征图与所述对应的第五特征图进行残差连接,获得所述均衡特征图像。
在一种可能的实现方式中,所述第二特征图与各第一特征图的分辨率可不同,可对 第二特征图进行放缩处理,以获得分别与各第一特征图分辨率相同的第五特征图,在示例中,第二特征图的分辨率为800×600,则可对第二特征图进行池化等下采样处理,获得分辨率为640×480的第五特征图,即,与分辨率为640×480的第一特征图对应的第五特征图,可对第二特征图进行插值等上采样处理,获得分辨率为1024×768的第五特征图,即,与分辨率为1024×768的第一特征图对应的第五特征图…本公开对第二特征图和第一特征图的分辨率不做限制。
在一种可能的实现方式中,第一特征图与对应的第五特征图的分辨率相同,可将第一特征图与对应的第五特征图进行残差连接处理,获得所述均衡特征图像,例如,可将第一特征图中某一坐标的像素点的像素值与对应的第五特征图中相同坐标的像素点的像素值相加,获得均衡特征图像中该像素点的像素值,可按照这种方式获得均衡特征图像中所有像素点的像素值,即,获得均衡特征图像。
通过这种方式,可通过均衡处理获得特征均衡的第二特征图,并通过残差连接,获得均衡特征图,可减少信息损失,提高训练效果。
在一种可能的实现方式中,在步骤S12中,可通过检测子网络对均衡特征图像进行目标检测,得到均衡特征图像中目标对象的预测区域,在示例中,可通过选择框对目标对象所在的预测区域进行框选。所述目标检测处理还可通过其他用于目标检测的神经网络或其他方法来实现,以获取目标对象的多个预测区域。本公开对目标检测处理的实现方式不做限制。
在一种可能的实现方式中,在步骤S13中,所述样本图像为已标注的样本图像,例如,可对目标对象所在的区域进行标注,即,使用选择框对目标对象所在的区域进行框选。所述均衡特征图像是根据样本图像获得的,可根据样本图像中对目标对象所在区域进行框选的选择框,确定所述均衡特征图像中目标对象所在区域的位置,并可对该位置进行框选,被框选的区域即为所述标注区域。在示例中,所述标注区域与所述目标对象对应,所述样本图像或者样本图像的均衡特征图像中,可包括一个或多个目标对象,可对每个目标对象进行标注,即,每个目标对象均具有对应的标注区域。
在一种可能的实现方式中,所述交并比为目标对象的预测区域与对应标注区域的重叠区域与合并区域的面积比,所述预测区域与标注区域的重叠区域为两个区域的交集,所述预测区域与标注区域的合并区域为两个区域的并集。在示例中,所述检测网络可分别确定每个对象的预测区域,例如,针对目标对象A,检测网络可确定目标对象A的多个预测区域,针对目标对象B,检测网络可确定目标对象B的多个预测区域。在确定预测区域的交并比时,可确定预测区域与对应标注区域的重叠区域与合并区域的面积比,例如,在确定目标对象A的某个预测区域的交并比时,可确定该预测区域与目标对象A的标注区域的重叠区域与合并区域的面积比。
图2示出根据本公开实施例的预测区域的交并比的示意图,如图2所示,在某一均衡特征图像中,已对目标对象所在的区域进行标注,该标注可以是框选目标对象所在区域的选择框,例如,图2中虚线所示的标注区域。可使用目标检测方法检测均衡特征图像中的目标对象,例如,可使用检测网络等方法进行检测,并将检测到的目标对象的预测区 域进行框选,例如,图2中实线所示的预测区域。如图2所示,标注区域为A+B,预测区域为B+C,预测区域与标注区域的重叠区域为B,预测区域与标注区域的合并区域为A+B+C。样本图像的交并比为B区域面积与A+B+C区域面积之比。
在一种可能的实现方式中,交并比与确定预测区域的困难程度正相关,即,在交并比较高的预测区域中,确定过程困难的预测区域所占的比重较大。但在所有预测区域中,交并比较低的预测区域所占比重较大,如果直接在所有预测区域中进行随机抽样或均匀抽样,则获得交并比较低的预测区域的概率较大,即,获得确定过程容易的预测区域的概率较大,如果使用大量确定过程容易的预测区域进行训练,则训练效率较低。而使用确定过程困难的预测区域进行训练,可在每次训练中获得较多的信息,提高训练效率。因此,可根据各预测区域的交并比来筛选预测区域,使筛选出的预测区域中,确定过程困难的预测区域所占比重较高,提高训练效率。
在一种可能的实现方式中,在步骤S14可包括:根据所述每个预测区域的交并比,将所述多个预测区域进行分类处理,获得多个类别的预测区域;对所述各类别的预测区域分别进行抽样处理,获得所述目标区域。
在一种可能的实现方式中,可按照所述交并比,将预测区域进行分类处理,例如,可将交并比大于0且小于或等于0.05的预测区域分为一类,将交并比大于0.05且小于或等于0.1的预测区域分为一类,将交并比大于0.1且小于或等于0.15的预测区域分为一类…即,交并比中每一类的区间长度为0.05。本公开对类别数量和每一类的区间长度不做限制。
在一种可能的实现方式中,可在每个类别中,进行均匀抽样或随机抽样,获得所述目标区域。即,在交并比较高的类别和交并比较低的类别中,均抽取预测区域,来提高抽取到交并比较高的预测区域的概率,即,提高目标区域中确定过程困难的预测区域的比重。在各类别中,预测区域被抽取的概率可用以下公式(1)表示:
Figure PCTCN2019121696-appb-000001
其中,K(K为大于1的整数)为类别数量,p k为在第k(k为小于或等于K的正整数)个类别中,预测区域被抽取的概率,N为预测区域图像的总数量,M k为在第k个类别中的预测区域的数量。
在示例中,还可筛选出交并比高于预设阈值(例如,0.05、0.1等)的预测区域,或筛选出交并比属于预设区间(例如,大于0.05且小于或等于0.5等)的预测区域,作为所述目标区域,本公开对筛选方式不做限制。
通过这种方式,可通过交并比对预测区域进行分类,并对各类别的预测区域进行抽样,可提高抽取到交并比较高的预测区域的概率,提高目标区域中确定过程困难的预测区域的比重,提高训练效率。
在一种可能的实现方式中,在步骤S15中,检测网络可以是用于检测图像中的目标对象的神经网络,例如,检测网络可以是卷积神经网络,本公开对检测网络的类型不做限制。可使用均衡特征图像中的目标区域和标注区域来训练检测网络。
在一种可能的实现方式中,根据所述目标区域和所述标注区域,确定所述检测网络的识别损失和位置损失,包括:根据所述目标区域和所述标注区域,确定所述检测网络 的识别损失和位置损失;根据所述识别损失与所述位置损失对检测网络的网络参数进行调整;在满足训练条件的情况下,获得训练后的检测网络。
在一种可能的实现方式中,可通过任意一个目标区域与标注区域确定识别损失和位置损失,其中,所述识别损失用于表示神经网络对目标对象的识别是否正确,例如,均衡特征图像中可包括多个对象,其中,只有一个或一部分对象为目标对象,可将所述对象分为两类,即,所述对象为目标对象和所述对象不是目标对象。在示例中,可用概率来表示所述识别结果,例如,某对象为目标对象的概率,即,如果某对象为目标对象的概率大于或等于50%,则所述对象为目标对象,否则,所述对象不是目标对象。
在一种可能的实现方式中,可根据目标区域与标注区域,确定所述检测网络的识别损失。在示例中,对所述检测网络预测的目标对象的所在区域进行框选的选择框中的区域为所述目标区域,例如,图像中包括多个对象,其中,可将目标对象所在的区域进行框选,对其他对象不进行框选,可根据目标区域框选的对象与目标对象的相似度来确定检测网络的识别损失,例如,目标区域中的对象有70%的概率为目标对象(即,所述检测网络确定目标区域中的对象与目标对象的相似度为70%),而该对象为目标对象,可标注为100%,则可根据30%的误差确定识别损失。
在一种可能的实现方式中,根据目标区域与标注区域,确定所述检测网络的位置损失。在示例中,标注区域为对目标对象所在区域进行框选的选择框。即,目标区域检测网络预测出的目标对象所在区域,并使用选择框对该区域进行框选,可对上述两个选择框的位置和尺寸等进行比较,确定所述位置损失。
在一种可能的实现方式中,根据所述目标区域和所述标注区域,确定所述检测网络的识别损失和位置损失,包括:确定所述目标区域与所述标注区域之间的位置误差;在所述位置误差小于预设阈值的情况下,根据所述位置误差确定所述位置损失。所述预测区域和所述标注区域均为选择框,可将预测区域与标注区域进行比较。所述位置误差可包括选择框的位置和尺寸的误差,例如,选择框的中心点或左上角顶点坐标的误差,以及选择框的长度和宽度的误差等。如果对目标对象的预测是正确的,则所述位置误差较小,在训练过程中,使用该位置误差确定的位置损失可有利于位置损失收敛,提高训练效率,有利于提高检测网络的拟合优度,如果对目标对象的预测是错误的,例如,将某个非目标对象错认为目标对象,则所述位置误差较大,在训练过程中,位置损失不易收敛,训练过程效率低,也不利于提高检测网络的拟合优度,因此,可使用预设阈值来确定所述位置损失。在位置误差小于预设阈值的情况下,可认为对目标对象的预测是正确的,可根据位置误差确定所述位置损失。
在一种可能的实现方式中,根据所述目标区域和所述标注区域,确定所述检测网络的识别损失和位置损失,包括:确定所述目标区域与所述标注区域之间的位置误差;在所述位置误差大于或等于预设阈值的情况下,根据预设值确定所述位置损失。在示例中,如果位置误差大于或等于预设阈值,可认为对目标对象的预测是错误的,可根据预设值(例如,某个常数值)确定位置损失,以减小训练过程中位置损失的梯度,从而加快位置损失的收敛,提高训练效率。
在一种可能的实现方式中,所述位置损失可通过以下公式(2)来确定:
Figure PCTCN2019121696-appb-000002
其中,L pro为所述位置损失,α和b为设定的参数,x为位置误差,γ为所述预设值,ε为预设阈值,在示例中,ε=1,γ=αln(b+1)。本公开对α、b和γ的取值不做限制。
对(2)进行积分,可获得位置损失L pro,L pro可根据以下公式(3)来确定:
Figure PCTCN2019121696-appb-000003
其中,C为积分常数。在公式(3)中,如果位置误差小于预设阈值,即,对目标对象的预测正确,则通过对数来提高位置损失的梯度,使得位置损失在训练过程中调整参数的梯度较大,从而提高训练效率,提高检测网络的拟合优度。如果对目标对象的预测错误,则位置损失为常数γ,从而降低位置损失的梯度,减小位置损失对训练过程的影响,以加快位置损失收敛,提高检测网络的拟合优度。
在一种可能的实现方式中,可根据识别损失与位置损失对检测网络的网络参数进行调整,在示例中,可根据识别损失与位置损失确定检测网络的综合网络损失,例如,可通过以下公式(4)确定检测网络的综合网络损失:
L=L pro+L cls      (4)
其中,L为所述综合网络损失,L cls为所述识别损失。
在一种可能的实现方式中,可按照使综合网络损失最小化的方向来调整检测网络的网络参数,在示例中,可使用梯度下降法进行综合网络损失的反向传播,来调整检测网络的网络参数。
在一种可能的实现方式中,训练条件可包括调整次数和综合网络损失的大小或敛散性等条件。可对检测网络调整预定次数,当调整次数达到预定次数时,即为满足训练条件。也可不限定训练次数,在综合网络损失降低到一定程度或收敛于某个区间内时,即为满足训练条件。在训练完成后,可将检测网络用于检测图像中的目标对象的过程中。
通过这种方式,可在对目标对象的预测正确的情况下,提高位置损失的梯度,提高训练效率,并提高检测网络的拟合优度。并可在对目标对象的预测错误的情况下,降低位置损失的梯度,减小位置损失对训练过程的影响,以加快位置损失收敛,提高训练效率。
在一种可能的实现方式中,根据本公开实施例,还提供了一种图像处理方法,所述方法包括:将待检测图像输入训练后的检测网络进行处理,获得目标对象的位置信息。
在一种可能的实现方式中,待检测图像为包括目标对象的图像,可通过所述检测网络的均衡子网络对待检测图像进行特征均衡处理,获得一组均衡特征图。
在一种可能的实现方式中,可将均衡特征图输入检测网络的检测子网络,检测子网络可识别出目标对象,并确定目标对象的位置,获得目标对象的位置信息,例如,对目 标对象进行框选的选择框。
根据本公开的实施例的图像处理方法,可通过均衡处理获得特征均衡的第二特征图,并通过残差连接,获得均衡特征图,可减少信息损失,提高训练效果,并提高检测网络的检测精度。可通过交并比对预测区域进行分类,并对各类别的预测区域进行抽样,可提高抽取到交并比较高的预测区域的概率,提高预测区域中的确定过程困难的预测区域的比重,提高训练效率,且降低内存消耗与资源占用。进一步地,可在对目标对象的预测正确的情况下,提高位置损失的梯度,提高训练效率,并提高检测网络的拟合优度,以及在对目标对象的预测错误的情况下,降低位置损失的梯度,减小位置损失对训练过程的影响,以加快位置损失收敛,提高训练效率。
图3示出根据本公开实施例的图像处理方法的应用示意图,如图3所示,可使用检测网络的均衡子网络的多个层级的卷积层,对样本图像C1进行特征提取,获得分辨率互不相同的多个第一特征图,例如,获得分辨率为640×480、800×600、1024×768、1600×1200等的第一特征图。
在一种可能的实现方式中,可对各第一特征图进行放缩处理,获得多个预设分辨率的第三特征图,例如,可将分辨率为640×480、800×600、1024×768、1600×1200的第一特征图分别进行放缩处理,获得分辨率均为800×600的第三特征图。
在一种可能的实现方式中,可对多个第三特征图进行平均处理,获得特征均衡的第四特征图。并使用非局部注意力机制(Non-Local)对第四特征图进行特征提取,获得所述第二特征图。
在一种可能的实现方式中,可对第二特征图进行放缩处理,获得分别与各第一特征图分辨率相同的第五特征图(例如,C2、C3、C4、C5),例如,可分别将第二特征图放缩成分辨率为640×480、800×600、1024×768、1600×1200等的第五特征图(例如,P2、P3、P4、P5)。
在一种可能的实现方式中,可对第一特征图与对应的第五特征图进行残差连接处理,即,将第一特征图与对应的第五特征图中的相同坐标的像素点的RGB值或灰度值等参数相加,获得多个均衡特征图。
在一种可能的实现方式中,可使用检测网络的检测子网络对所述均衡特征图像进行目标检测处理,获得所述均衡特征图像中目标对象的多个预测区域。并可分别确定多个预测区域的交并比,并根据交并比对预测区域进行分类,并对各类别的预测区域进行抽样,可获得目标区域,在目标区域中,确定过程困难的预测区域所占的比重较大。
在一种可能的实现方式中,可使用目标区域和标注区域训练所述检测网络,即,根据目标区域框选的对象与目标对象的相似度来确定识别损失,并根据目标区域和标注区域以及公式(3)确定位置损失。进一步地,可通过公式(4)确定综合网络损失,并根据综合网络损失来调整检测网络的网络参数,在综合网络损失满足训练条件时,完成训练,并可使用训练后的检测网络检测待检测图像中的目标对象。
在一种可能的实现方式中,可使用均衡子网络对待检测图像进行特征均衡处理,并将获得均衡特征图输入检测网络的检测自网络,获得目标对象的位置信息。
在示例中,所述检测网络可用于自动驾驶中,进行目标检测,例如,可检测障碍物、信号灯或交通标识等,可为控制车辆运行提供依据。在示例中,所述检测网络可用于安防监控,可对监控视频中的目标人物进行检测。在示例中,所述检测网络还可用于检测遥感图像或导航视频中的目标对象等,本公开对检测网络的应用领域不做限制。
图5示出根据本公开实施例的图像处理装置的框图,如图5所示,所述装置包括:
均衡模块11,用于通过检测网络的均衡子网络对样本图像进行特征均衡处理,获得所述样本图像的均衡特征图像,所述检测网络包括所述均衡子网络和检测子网络;检测模块12,用于通过检测子网络对所述均衡特征图像进行目标检测处理,获得所述均衡特征图像中目标对象的多个预测区域;确定模块13,用于分别确定所述多个预测区域中每个预测区域的交并比,其中,所述交并比为所述样本图像中目标对象的预测区域与对应的标注区域的重叠区域与合并区域的面积比;抽样模块14,用于根据所述每个预测区域的交并比,对多个预测区域进行抽样,获得目标区域;训练模块15,用于根据所述目标区域和所述标注区域,训练所述检测网络。
在一种可能的实现方式中,所述抽样模块被进一步配置为:根据所述每个预测区域的交并比,将所述多个预测区域进行分类处理,获得多个类别的预测区域;对所述类别的预测区域分别进行抽样处理,获得所述目标区域。
在一种可能的实现方式中,所述均衡模块被进一步配置为:对样本图像进行特征提取处理,获得多个第一特征图,其中,所述多个第一特征图中至少有一个第一特征图的分辨率与其他第一特征图的分辨率不同;对所述多个第一特征图进行均衡处理,获得第二特征图;根据所述第二特征图以及所述多个第一特征图,获得多个均衡特征图像。
在一种可能的实现方式中,所述均衡模块被进一步配置为:分别对所述多个第一特征图进行放缩处理,获得多个预设分辨率的第三特征图;对所述多个第三特征图进行平均处理,获得第四特征图;对所述第四特征图进行特征提取处理,获得所述第二特征图。
在一种可能的实现方式中,所述均衡模块被进一步配置为:将所述第二特征图进行放缩处理,分别获得与所述各第一特征图对应的第五特征图,其中,所述第一特征图与对应的第五特征图的分辨率相同;分别将所述各第一特征图与所述对应的第五特征图进行残差连接,获得所述均衡特征图像。
在一种可能的实现方式中,所述训练模块被进一步配置为:根据所述目标区域和所述标注区域,确定所述检测网络的识别损失和位置损失;根据所述识别损失与所述位置损失对所述检测网络的网络参数进行调整;在满足训练条件的情况下,获得训练后的检测网络。
在一种可能的实现方式中,所述训练模块被进一步配置为:确定所述目标区域与所述标注区域之间的位置误差;在所述位置误差小于预设阈值的情况下,根据所述位置误差确定所述位置损失。
在一种可能的实现方式中,所述训练模块被进一步配置为:确定所述目标区域与所述标注区域之间的位置误差;在所述位置误差大于或等于预设阈值的情况下,根据预设值确定所述位置损失。
在一种可能的实现方式中,根据本公开实施例,还提供了一种图像处理装置,所述装置包括:获得模块,用于将待检测图像输入所述图像处理装置训练后的检测网络进行处理,获得目标对象的位置信息。
可以理解,本公开提及的上述各个方法实施例,在不违背原理逻辑的情况下,均可以彼此相互结合形成结合后的实施例,限于篇幅,本公开不再赘述。
此外,本公开还提供了图像处理装置、电子设备、计算机可读存储介质、程序,上述均可用来实现本公开提供的任一种图像处理方法,相应技术方案和描述和参见方法部分的相应记载,不再赘述。
本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的撰写顺序并不意味着严格的执行顺序而对实施过程构成任何限定,各步骤的具体执行顺序应当以其功能和可能的内在逻辑确定。
在一些实施例中,本公开实施例提供的装置具有的功能或包含的模块可以用于执行上文方法实施例描述的方法,其具体实现可以参照上文方法实施例的描述,为了简洁,这里不再赘述
本公开实施例还提出一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述方法。计算机可读存储介质可以是非易失性计算机可读存储介质。
本公开实施例还提出一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器被配置为上述方法。
电子设备可以被提供为终端、服务器或其它形态的设备。
图5是根据一示例性实施例示出的一种电子设备800的框图。例如,电子设备800可以是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等终端。
参照图5,电子设备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执行以完成上述方法。
本公开实施例还提供了一种计算机程序产品,包括计算机可读代码,当计算机可读代码在设备上运行时,设备中的处理器执行用于实现如上任一实施例提供的方法的指令。
该计算机程序产品可以具体通过硬件、软件或其结合的方式实现。在一个可选实施例中,所述计算机程序产品具体体现为计算机存储介质,在另一个可选实施例中,计算机程序产品具体体现为软件产品,例如软件开发包(Software Development Kit,SDK)等等。
图6是根据一示例性实施例示出的一种电子设备1900的框图。例如,电子设备1900可以被提供为一服务器。参照图6,电子设备1900包括处理组件1922,其进一步包括一个或多个处理器,以及由存储器1932所代表的存储器资源,用于存储可由处理组件1922的执行的指令,例如应用程序。存储器1932中存储的应用程序可以包括一个或一个以上的每一个对应于一组指令的模块。此外,处理组件1922被配置为执行指令,以执行上述方法。
电子设备1900还可以包括一个电源组件1926被配置为执行电子设备1900的电源管理,一个有线或无线网络接口1950被配置为将电子设备1900连接到网络,和一个输入输出(I/O)接口1958。电子设备1900可以操作基于存储在存储器1932的操作系统,例如Windows ServerTM,Mac OS XTM,UnixTM,LinuxTM,FreeBSDTM或类似。
在示例性实施例中,还提供了一种非易失性计算机可读存储介质,例如包括计算机程序指令的存储器1932,上述计算机程序指令可由电子设备1900的处理组件1922执行以完成上述方法。
本公开可以是系统、方法和/或计算机程序产品。计算机程序产品可以包括计算机可读存储介质,其上载有用于使处理器实现本公开的各个方面的计算机可读程序指令。
计算机可读存储介质可以是可以保持和存储由指令执行设备使用的指令的有形设备。计算机可读存储介质例如可以是――但不限于――电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、静态随机存取存储器(SRAM)、便携式压缩盘只读存储器(CD-ROM)、数字多功能盘(DVD)、记忆棒、软盘、机械编码设备、例如其上存储有指令的打孔卡或凹槽内凸起结构、以及上述的任意合适的组合。这里所使用的计算机可读存储介质不被解释为瞬时信号本身,诸如无线电波或者其他自由传播的电磁波、通过波导或其他传输媒介传播的电磁波(例如,通过光纤电缆的光脉冲)、或者通过电线传输的电信号。
这里所描述的计算机可读程序指令可以从计算机可读存储介质下载到各个计算/处理设备,或者通过网络、例如因特网、局域网、广域网和/或无线网下载到外部计算机或外部存储设备。网络可以包括铜传输电缆、光纤传输、无线传输、路由器、防火墙、交换机、网关计算机和/或边缘服务器。每个计算/处理设备中的网络适配卡或者网络接口从 网络接收计算机可读程序指令,并转发该计算机可读程序指令,以供存储在各个计算/处理设备中的计算机可读存储介质中。
用于执行本公开操作的计算机程序指令可以是汇编指令、指令集架构(ISA)指令、机器指令、机器相关指令、微代码、固件指令、状态设置数据、或者以一种或多种编程语言的任意组合编写的源代码或目标代码,所述编程语言包括面向对象的编程语言—诸如Smalltalk、C++等,以及常规的过程式编程语言—诸如“C”语言或类似的编程语言。计算机可读程序指令可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络—包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。在一些实施例中,通过利用计算机可读程序指令的状态信息来个性化定制电子电路,例如可编程逻辑电路、现场可编程门阵列(FPGA)或可编程逻辑阵列(PLA),该电子电路可以执行计算机可读程序指令,从而实现本公开的各个方面。
这里参照根据本公开实施例的方法、装置(系统)和计算机程序产品的流程图和/或框图描述了本公开的各个方面。应当理解,流程图和/或框图的每个方框以及流程图和/或框图中各方框的组合,都可以由计算机可读程序指令实现。
这些计算机可读程序指令可以提供给通用计算机、专用计算机或其它可编程数据处理装置的处理器,从而生产出一种机器,使得这些指令在通过计算机或其它可编程数据处理装置的处理器执行时,产生了实现流程图和/或框图中的一个或多个方框中规定的功能/动作的装置。也可以把这些计算机可读程序指令存储在计算机可读存储介质中,这些指令使得计算机、可编程数据处理装置和/或其他设备以特定方式工作,从而,存储有指令的计算机可读介质则包括一个制造品,其包括实现流程图和/或框图中的一个或多个方框中规定的功能/动作的各个方面的指令。
也可以把计算机可读程序指令加载到计算机、其它可编程数据处理装置、或其它设备上,使得在计算机、其它可编程数据处理装置或其它设备上执行一系列操作步骤,以产生计算机实现的过程,从而使得在计算机、其它可编程数据处理装置、或其它设备上执行的指令实现流程图和/或框图中的一个或多个方框中规定的功能/动作。
附图中的流程图和框图显示了根据本公开的多个实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或指令的一部分,所述模块、程序段或指令的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
以上已经描述了本公开的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的各实施例。在不偏离所说明的各实施例的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实施例的原理、实际应用或对市场中的技术的技术改进,或者使本技术领域的其它普通技术人员能理解本文披露的各实施例。

Claims (21)

  1. 一种图像处理方法,其特征在于,包括:
    通过检测网络的均衡子网络对样本图像进行特征均衡处理,获得所述样本图像的均衡特征图像,所述检测网络包括所述均衡子网络和检测子网络;
    通过所述检测子网络对所述均衡特征图像进行目标检测处理,获得所述均衡特征图像中目标对象的多个预测区域;
    分别确定所述多个预测区域中每个预测区域的交并比,其中,所述交并比为所述样本图像中目标对象的预测区域与对应的标注区域的重叠区域与合并区域的面积比;
    根据所述每个预测区域的交并比,对所述多个预测区域进行抽样,获得目标区域;
    根据所述目标区域和所述标注区域,训练所述检测网络。
  2. 根据权利要求1所述的方法,其特征在于,根据所述每个预测区域的交并比,对多个预测区域进行抽样,获得目标区域,包括:
    根据所述每个预测区域的交并比,将所述多个预测区域进行分类处理,获得多个类别的预测区域;
    对所述各类别的预测区域分别进行抽样处理,获得所述目标区域。
  3. 根据权利要求1所述的方法,其特征在于,通过检测网络的均衡子网络对样本图像进行特征均衡处理,获得均衡特征图像,包括:
    对样本图像进行特征提取处理,获得多个第一特征图,其中,所述多个第一特征图中至少有一个第一特征图的分辨率与其他第一特征图的分辨率不同;
    对所述多个第一特征图进行均衡处理,获得第二特征图;
    根据所述第二特征图以及所述多个第一特征图,获得多个均衡特征图像。
  4. 根据权利要求3所述的方法,其特征在于,对所述多个第一特征图进行均衡处理,获得第二特征图,包括:
    分别对所述多个第一特征图进行放缩处理,获得多个预设分辨率的第三特征图;
    对所述多个第三特征图进行平均处理,获得第四特征图;
    对所述第四特征图进行特征提取处理,获得所述第二特征图。
  5. 根据权利要求3或4所述的方法,其特征在于,根据所述第二特征图以及所述多个第一特征图,获得多个均衡特征图像,包括:
    将所述第二特征图进行放缩处理,分别获得与所述各第一特征图对应的第五特征图,其中,所述第一特征图与所述对应的第五特征图的分辨率相同;
    分别将所述各第一特征图与所述对应的第五特征图进行残差连接,获得所述均衡特征图像。
  6. 根据权利要求1所述的方法,其特征在于,根据所述目标区域和所述标注区域,训练所述检测网络,包括:
    根据所述目标区域和所述标注区域,确定所述检测网络的识别损失和位置损失;
    根据所述识别损失与所述位置损失对所述检测网络的网络参数进行调整;
    在满足训练条件的情况下,获得训练后的检测网络。
  7. 根据权利要求6所述的方法,其特征在于,根据所述目标区域和所述标注区域, 确定所述检测网络的识别损失和位置损失,包括:
    确定所述目标区域与所述标注区域之间的位置误差;
    在所述位置误差小于预设阈值的情况下,根据所述位置误差确定所述位置损失。
  8. 根据权利要求6或7所述的方法,其特征在于,根据所述目标区域和所述标注区域,确定所述检测网络的识别损失和位置损失,包括:
    确定所述目标区域与所述标注区域之间的位置误差;
    在所述位置误差大于或等于预设阈值的情况下,根据预设值确定所述位置损失。
  9. 一种图像处理方法,其特征在于,包括:
    将待检测图像输入根据权利要求1-8中任一项所述的方法训练后的检测网络进行处理,获得目标对象的位置信息。
  10. 一种图像处理装置,其特征在于,包括:
    均衡模块,用于通过检测网络的均衡子网络对样本图像进行特征均衡处理,获得所述样本图像的均衡特征图像,所述检测网络包括所述均衡子网络和检测子网络;
    检测模块,用于通过检测子网络对所述均衡特征图像进行目标检测处理,获得所述均衡特征图像中目标对象的多个预测区域;
    确定模块,用于分别确定所述多个预测区域中每个预测区域的交并比,其中,所述交并比为所述样本图像中目标对象的预测区域与对应的标注区域的重叠区域与合并区域的面积比;
    抽样模块,用于根据所述每个预测区域的交并比,对多个预测区域进行抽样,获得目标区域;
    训练模块,用于根据所述目标区域和所述标注区域,训练所述检测网络。
  11. 根据权利要求10所述的方法,其特征在于,所述抽样模块被进一步配置为:
    根据所述每个预测区域的交并比,将所述多个预测区域进行分类处理,获得多个类别的预测区域;
    对所述各类别的预测区域分别进行抽样处理,获得所述目标区域。
  12. 根据权利要求10所述的方法,其特征在于,所述均衡模块被进一步配置为:
    对样本图像进行特征提取处理,获得多个第一特征图,其中,所述多个第一特征图中至少有一个第一特征图的分辨率与其他第一特征图的分辨率不同;
    对所述多个第一特征图进行均衡处理,获得第二特征图;
    根据所述第二特征图以及所述多个第一特征图,获得多个均衡特征图像。
  13. 根据权利要求12所述的方法,其特征在于,所述均衡模块被进一步配置为:
    分别对所述多个第一特征图进行放缩处理,获得多个预设分辨率的第三特征图;
    对所述多个第三特征图进行平均处理,获得第四特征图;
    对所述第四特征图进行特征提取处理,获得所述第二特征图。
  14. 根据权利要求12或13所述的方法,其特征在于,所述均衡模块被进一步配置为:
    将所述第二特征图进行放缩处理,分别获得与所述各第一特征图对应的第五特征图,其中,所述第一特征图与所述对应的第五特征图的分辨率相同;
    分别将所述各第一特征图与所述对应的第五特征图进行残差连接,获得所述均衡特征图像。
  15. 根据权利要求10所述的方法,其特征在于,所述训练模块被进一步配置为:
    根据所述目标区域和所述标注区域,确定所述检测网络的识别损失和位置损失;
    根据所述识别损失与所述位置损失对所述检测网络的网络参数进行调整;
    在满足训练条件的情况下,获得训练后的检测网络。
  16. 根据权利要求15所述的方法,其特征在于,所述训练模块被进一步配置为:
    确定所述目标区域与所述标注区域之间的位置误差;
    在所述位置误差小于预设阈值的情况下,根据所述位置误差确定所述位置损失。
  17. 根据权利要求15或16所述的方法,其特征在于,所述训练模块被进一步配置为:
    确定所述目标区域与所述标注区域之间的位置误差;
    在所述位置误差大于或等于预设阈值的情况下,根据预设值确定所述位置损失。
  18. 一种图像处理装置,其特征在于,包括:
    获得模块,用于将待检测图像输入根据权利要求10-17中任一项所述的装置训练后的检测网络进行处理,获得目标对象的位置信息。
  19. 一种电子设备,其特征在于,包括:
    处理器;
    用于存储处理器可执行指令的存储器;
    其中,所述处理器被配置为:执行权利要求1至9中任意一项所述的方法。
  20. 一种计算机可读存储介质,其上存储有计算机程序指令,其特征在于,所述计算机程序指令被处理器执行时实现权利要求1至9中任意一项所述的方法。
  21. 一种计算机程序,包括计算机可读代码,当所述计算机可读代码在电子设备中运行时,所述电子设备中的处理器执行用于实现权利要求1-9中的任一权利要求所述的方法。
PCT/CN2019/121696 2019-02-01 2019-11-28 图像处理方法及装置、电子设备和存储介质 WO2020155828A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
SG11202102977SA SG11202102977SA (en) 2019-02-01 2019-11-28 Image processing method and device, electronic apparatus, and storage medium
JP2021516440A JP2022500791A (ja) 2019-02-01 2019-11-28 画像処理方法、装置、電子機器、記憶媒体及びコンピュータプログラム
US17/209,384 US20210209392A1 (en) 2019-02-01 2021-03-23 Image Processing Method and Device, and Storage Medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910103611.1A CN109829501B (zh) 2019-02-01 2019-02-01 图像处理方法及装置、电子设备和存储介质
CN201910103611.1 2019-02-01

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/209,384 Continuation US20210209392A1 (en) 2019-02-01 2021-03-23 Image Processing Method and Device, and Storage Medium

Publications (1)

Publication Number Publication Date
WO2020155828A1 true WO2020155828A1 (zh) 2020-08-06

Family

ID=66863324

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/121696 WO2020155828A1 (zh) 2019-02-01 2019-11-28 图像处理方法及装置、电子设备和存储介质

Country Status (6)

Country Link
US (1) US20210209392A1 (zh)
JP (1) JP2022500791A (zh)
CN (1) CN109829501B (zh)
SG (1) SG11202102977SA (zh)
TW (1) TWI728621B (zh)
WO (1) WO2020155828A1 (zh)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112016443A (zh) * 2020-08-26 2020-12-01 深圳市商汤科技有限公司 同行识别方法及装置、电子设备和存储介质
CN112184635A (zh) * 2020-09-10 2021-01-05 上海商汤智能科技有限公司 目标检测方法、装置、存储介质及设备
CN112308046A (zh) * 2020-12-02 2021-02-02 龙马智芯(珠海横琴)科技有限公司 图像的文本区域定位方法、装置、服务器及可读存储介质
CN112906502A (zh) * 2021-01-29 2021-06-04 北京百度网讯科技有限公司 目标检测模型的训练方法、装置、设备以及存储介质
CN113011435A (zh) * 2021-02-04 2021-06-22 精英数智科技股份有限公司 目标对象的图像处理方法、装置及电子设备
CN113486957A (zh) * 2021-07-07 2021-10-08 西安商汤智能科技有限公司 神经网络训练和图像处理方法及装置
CN113674218A (zh) * 2021-07-28 2021-11-19 中国科学院自动化研究所 焊缝特征点提取方法、装置、电子设备与存储介质
CN113762393A (zh) * 2021-09-08 2021-12-07 杭州网易智企科技有限公司 模型训练方法、注视点检测方法、介质、装置和计算设备

Families Citing this family (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109829501B (zh) * 2019-02-01 2021-02-19 北京市商汤科技开发有限公司 图像处理方法及装置、电子设备和存储介质
CN110298413B (zh) * 2019-07-08 2021-07-16 北京字节跳动网络技术有限公司 图像特征提取方法、装置、存储介质及电子设备
CN110659600B (zh) * 2019-09-19 2022-04-29 北京百度网讯科技有限公司 物体检测方法、装置及设备
CN111178346B (zh) * 2019-11-22 2023-12-08 京东科技控股股份有限公司 文字区域的定位方法、装置、设备及存储介质
JP7490359B2 (ja) * 2019-12-24 2024-05-27 キヤノン株式会社 情報処理装置、情報処理方法及びプログラム
CN111104920B (zh) * 2019-12-27 2023-12-01 深圳市商汤科技有限公司 视频处理方法及装置、电子设备和存储介质
SG10201913754XA (en) * 2019-12-30 2020-12-30 Sensetime Int Pte Ltd Image processing method and apparatus, electronic device, and storage medium
CN111310764B (zh) * 2020-01-20 2024-03-26 上海商汤智能科技有限公司 网络训练、图像处理方法及装置、电子设备和存储介质
CN113781665A (zh) * 2020-07-28 2021-12-10 北京沃东天骏信息技术有限公司 一种标注信息的审核方法和装置
CN111950570B (zh) * 2020-08-26 2023-11-21 Oppo广东移动通信有限公司 目标图像提取方法、神经网络训练方法及装置
CN111768408B (zh) * 2020-09-01 2020-11-27 安翰科技(武汉)股份有限公司 胃肠标记物自动识别方法及识别系统
TWI761948B (zh) * 2020-09-14 2022-04-21 倍利科技股份有限公司 由檢測影像取得輪廓的定位方法
CN112183627A (zh) * 2020-09-28 2021-01-05 中星技术股份有限公司 生成预测密度图网络的方法和车辆年检标数量检测方法
CN112801116B (zh) * 2021-01-27 2024-05-21 商汤集团有限公司 图像的特征提取方法及装置、电子设备和存储介质
CN112818932A (zh) * 2021-02-26 2021-05-18 北京车和家信息技术有限公司 图像处理方法、障碍物检测方法、装置、介质及车辆
CN113506325B (zh) * 2021-07-15 2024-04-12 清华大学 图像处理方法及装置、电子设备和存储介质
CN113469302A (zh) * 2021-09-06 2021-10-01 南昌工学院 一种视频图像的多圆形目标识别方法和系统
CN113902898A (zh) * 2021-09-29 2022-01-07 北京百度网讯科技有限公司 目标检测模型的训练、目标检测方法、装置、设备和介质
CN113902018A (zh) * 2021-10-12 2022-01-07 深圳壹账通智能科技有限公司 图像样本生成方法、装置、计算机可读介质及电子设备
CN113989716B (zh) * 2021-10-21 2024-05-28 西安科技大学 煤矿井下输送带异物目标检测方法、系统、设备及终端
CN114463860B (zh) * 2021-12-14 2023-05-23 浙江大华技术股份有限公司 检测模型的训练方法、活体检测方法及相关装置
CN115359308B (zh) * 2022-04-06 2024-02-13 北京百度网讯科技有限公司 模型训练、难例识别方法、装置、设备、存储介质及程序
CN115359058B (zh) * 2022-10-20 2023-04-07 江苏时代新能源科技有限公司 电池隔膜的翻折检测方法、装置、设备及介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105654067A (zh) * 2016-02-02 2016-06-08 北京格灵深瞳信息技术有限公司 一种车辆检测方法及装置
CN106874894A (zh) * 2017-03-28 2017-06-20 电子科技大学 一种基于区域全卷积神经网络的人体目标检测方法
US20170262962A1 (en) * 2016-03-11 2017-09-14 Qualcomm Incorporated Systems and methods for normalizing an image
CN107169421A (zh) * 2017-04-20 2017-09-15 华南理工大学 一种基于深度卷积神经网络的汽车驾驶场景目标检测方法
CN109829501A (zh) * 2019-02-01 2019-05-31 北京市商汤科技开发有限公司 图像处理方法及装置、电子设备和存储介质

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106462549B (zh) * 2014-04-09 2020-02-21 尹度普有限公司 使用从显微变化中进行的机器学习来鉴定实体对象
US9953243B2 (en) * 2014-04-25 2018-04-24 Google Llc Electronic device localization based on imagery
US9836839B2 (en) * 2015-05-28 2017-12-05 Tokitae Llc Image analysis systems and related methods
US9965719B2 (en) * 2015-11-04 2018-05-08 Nec Corporation Subcategory-aware convolutional neural networks for object detection
JP7110098B2 (ja) * 2015-12-18 2022-08-01 ザ リージェンツ オブ ザ ユニバーシティ オブ カリフォルニア 頭部コンピュータ断層撮影における緊急性の特徴の解釈及び定量化
US9787894B1 (en) * 2016-03-30 2017-10-10 Motorola Mobility Llc Automatic white balance using histograms from subsampled image
US10354362B2 (en) * 2016-09-08 2019-07-16 Carnegie Mellon University Methods and software for detecting objects in images using a multiscale fast region-based convolutional neural network
CN106529565B (zh) * 2016-09-23 2019-09-13 北京市商汤科技开发有限公司 目标识别模型训练和目标识别方法及装置、计算设备
CN107609525B (zh) * 2017-09-19 2020-05-22 吉林大学 基于剪枝策略构建卷积神经网络的遥感图像目标检测方法
CN108062754B (zh) * 2018-01-19 2020-08-25 深圳大学 基于密集网络图像的分割、识别方法和装置
US20190251627A1 (en) * 2018-02-11 2019-08-15 Loopring Project Ltd Methods and systems for digital asset transaction
CN108764164B (zh) * 2018-05-30 2020-12-08 华中科技大学 一种基于可变形卷积网络的人脸检测方法及系统
CN108764202B (zh) * 2018-06-06 2023-04-18 平安科技(深圳)有限公司 机场异物识别方法、装置、计算机设备及存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105654067A (zh) * 2016-02-02 2016-06-08 北京格灵深瞳信息技术有限公司 一种车辆检测方法及装置
US20170262962A1 (en) * 2016-03-11 2017-09-14 Qualcomm Incorporated Systems and methods for normalizing an image
CN106874894A (zh) * 2017-03-28 2017-06-20 电子科技大学 一种基于区域全卷积神经网络的人体目标检测方法
CN107169421A (zh) * 2017-04-20 2017-09-15 华南理工大学 一种基于深度卷积神经网络的汽车驾驶场景目标检测方法
CN109829501A (zh) * 2019-02-01 2019-05-31 北京市商汤科技开发有限公司 图像处理方法及装置、电子设备和存储介质

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112016443A (zh) * 2020-08-26 2020-12-01 深圳市商汤科技有限公司 同行识别方法及装置、电子设备和存储介质
CN112184635A (zh) * 2020-09-10 2021-01-05 上海商汤智能科技有限公司 目标检测方法、装置、存储介质及设备
CN112308046A (zh) * 2020-12-02 2021-02-02 龙马智芯(珠海横琴)科技有限公司 图像的文本区域定位方法、装置、服务器及可读存储介质
CN112906502A (zh) * 2021-01-29 2021-06-04 北京百度网讯科技有限公司 目标检测模型的训练方法、装置、设备以及存储介质
CN112906502B (zh) * 2021-01-29 2023-08-01 北京百度网讯科技有限公司 目标检测模型的训练方法、装置、设备以及存储介质
CN113011435A (zh) * 2021-02-04 2021-06-22 精英数智科技股份有限公司 目标对象的图像处理方法、装置及电子设备
CN113486957A (zh) * 2021-07-07 2021-10-08 西安商汤智能科技有限公司 神经网络训练和图像处理方法及装置
CN113674218A (zh) * 2021-07-28 2021-11-19 中国科学院自动化研究所 焊缝特征点提取方法、装置、电子设备与存储介质
CN113762393A (zh) * 2021-09-08 2021-12-07 杭州网易智企科技有限公司 模型训练方法、注视点检测方法、介质、装置和计算设备
CN113762393B (zh) * 2021-09-08 2024-04-30 杭州网易智企科技有限公司 模型训练方法、注视点检测方法、介质、装置和计算设备

Also Published As

Publication number Publication date
CN109829501B (zh) 2021-02-19
TWI728621B (zh) 2021-05-21
SG11202102977SA (en) 2021-04-29
US20210209392A1 (en) 2021-07-08
CN109829501A (zh) 2019-05-31
TW202030694A (zh) 2020-08-16
JP2022500791A (ja) 2022-01-04

Similar Documents

Publication Publication Date Title
WO2020155828A1 (zh) 图像处理方法及装置、电子设备和存储介质
WO2021155632A1 (zh) 图像处理方法及装置、电子设备和存储介质
WO2021128578A1 (zh) 图像处理方法及装置、电子设备和存储介质
WO2021159594A1 (zh) 图像识别方法及装置、电子设备和存储介质
TWI749423B (zh) 圖像處理方法及裝置、電子設備和電腦可讀儲存介質
WO2020232977A1 (zh) 神经网络训练方法及装置以及图像处理方法及装置
TWI773945B (zh) 錨點確定方法、電子設備和儲存介質
CN108629354B (zh) 目标检测方法及装置
WO2021056808A1 (zh) 图像处理方法及装置、电子设备和存储介质
KR102421820B1 (ko) 키포인트 검출 방법, 장치, 전자 기기 및 기억 매체
CN110009090B (zh) 神经网络训练与图像处理方法及装置
CN109658401B (zh) 图像处理方法及装置、电子设备和存储介质
WO2021008022A1 (zh) 图像处理方法及装置、电子设备和存储介质
US11288531B2 (en) Image processing method and apparatus, electronic device, and storage medium
WO2021208667A1 (zh) 图像处理方法及装置、电子设备和存储介质
WO2021174687A1 (zh) 去除图像中的反光的方法及装置、电子设备和存储介质
CN110443366B (zh) 神经网络的优化方法及装置、目标检测方法及装置
WO2021012564A1 (zh) 视频处理方法及装置、电子设备和存储介质
US20110255738A1 (en) Method and Apparatus for Visual Search Stability
CN110532956B (zh) 图像处理方法及装置、电子设备和存储介质
WO2020220807A1 (zh) 图像生成方法及装置、电子设备及存储介质
WO2021036013A1 (zh) 检测器的配置方法及装置、电子设备和存储介质
CN111259967A (zh) 图像分类及神经网络训练方法、装置、设备及存储介质
CN111523599B (zh) 目标检测方法及装置、电子设备和存储介质
WO2021164100A1 (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: 19912805

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2021516440

Country of ref document: JP

Kind code of ref document: A

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 (EPO FORM 1205A DATED 23.11.2021)

122 Ep: pct application non-entry in european phase

Ref document number: 19912805

Country of ref document: EP

Kind code of ref document: A1