Login| Sign Up| Help| Contact|

Patent Searching and Data


Title:
RECOGNITION METHOD, APPARATUS, AND DEVICE, AND STORAGE MEDIUM
Document Type and Number:
WIPO Patent Application WO/2021/236939
Kind Code:
A1
Abstract:
An image recognition method includes: obtaining an image; extracting a target image region corresponding to a target part from the image, wherein the target image region includes a target object; determining a location of the target object in the target image region (i) according to pixel values of pixels in the target image region and a location relationship between the pixels, or (ii) inputting the target image region to a trained segmentation model to obtain the location of the target object in the target image region; and displaying a recognition result of the image, wherein the recognition result indicates the location of the target object in the target image region.

Inventors:
LIU SHUANGRUI (CN)
TANG ZHE (CN)
GUO WENCHAO (CN)
MA JIANQIANG (CN)
XU MINFENG (CN)
Application Number:
PCT/US2021/033424
Publication Date:
November 25, 2021
Filing Date:
May 20, 2021
Export Citation:
Click for automatic bibliography generation   Help
Assignee:
ALIBABA GROUP HOLDING LTD (US)
International Classes:
G06T1/40; G06T7/00; G06T7/10; G06T7/11; G06T7/12; G06T7/70
Foreign References:
US20200058126A12020-02-20
US20070100226A12007-05-03
US20110249895A12011-10-13
US20150170002A12015-06-18
US9619735B12017-04-11
US20160328630A12016-11-10
US20170277981A12017-09-28
Attorney, Agent or Firm:
CHEN, Weiguo (US)
Download PDF:
Claims:
CLAIMS

What is claimed is:

1. An image recognition method, comprising: obtaining an image; extracting a target image region corresponding to a target part from the image, wherein the target image region comprises a target object; determining a location of the target object in the target image region (i) according to pixel values of pixels in the target image region and a location relationship between the pixels, or (ii) by inputting the target image region to a trained segmentation model to obtain the location of the target object in the target image region; and displaying a recognition result of the image, wherein the recognition result indicates the location of the target object in the target image region.

2. The method according to claim 1, further comprising: determining a size of the target object; and determining a proportion of the target object in the target image region according to the size of the target object, wherein the recognition result comprises the proportion.

3. The method according to claim 1, wherein the location of the target object in the target image region is determined according to the pixel values of pixels in the target image region and the location relationship between the pixels under a first condition, wherein the first condition indicates that a quantity of historical images obtained within a preset period of time is less than a preset quantity, and the historical images are labeled with locations of the target object in the historical images.

4. The method according to claim 3, wherein the location of the target object in the target image region is obtained by inputting the target image region to the trained segmentation model under a second condition, wherein the second condition indicated that the quantity of the historical images obtained within the preset period of time is greater than or equal to the preset quantity; and the method further comprises: extracting historical image regions corresponding to the target part from the historical images, wherein the historical image regions comprise the target object; and training a segmentation model using the locations of the target object in the historical image regions to obtain the trained segmentation model.

5. The method according to claim 1, wherein the determining a location of the target object in the target image region according to pixel values of pixels in the target image region and a location relationship between the pixels comprises: determining a plurality of target pixels in the target image region that have pixel values meeting a preset range; correcting the plurality of target pixels according to a location relationship between the plurality of target pixels to generate corrected target pixels; and determining the location of the target object in the target image region according to locations of the corrected target pixels.

6. The method according to claim 1, wherein the inputting the target image region to a trained segmentation model to obtain the location of the target object in the target image region comprises: performing dilation processing on the target image region to generate a dilated target image region; determining an image region in the dilated target image region that has a preset size, wherein the preset size is greater than a size of the target image region; and providing the image region to the trained segmentation model to obtain the location of the target object in the target image region.

7. The method according to claim 6, wherein the image region comprises a plurality of target objects, the method further comprising: filtering out one or more target objects according to a size of the target objects and/or a location of the target objects in the image region; and the displaying a recognition result of the image comprises: displaying a recognition result indicating locations of remaining target objects in the target image region.

8. The method according to claim 7, wherein the filtering out one or more target objects according to a size of the target objects and/or a location of the target objects in the image region comprises: filtering out the one or more target objects if the size of the one or more target objects is less than a preset threshold; and/or filtering out the one or more target objects if the one or more target objects are not located in the target image region.

9. The method according to claim 1, wherein the trained segmentation model comprises a convolutional neural network.

10. The method according to claim 1, wherein: the determining step obtains a first location of the target object in the target image region; the providing the target image region to the trained segmentation model obtains a second location of the target object in the target image region; and the displaying the recognition result comprises displaying the first location and the second location separately.

11. An apparatus comprising: one or more processors; and a memory communicatively connected to the one or more processors, wherein the memory stores instructions executable by the one or more processors to cause the one or more processors to perform operations including: obtaining an image; extracting a target image region corresponding to a target part from the image, wherein the target image region comprises a target object; determining a location of the target object in the target image region (i) according to pixel values of pixels in the target image region and a location relationship between the pixels, or (ii) by inputting the target image region to a trained segmentation model to obtain the location of the target object in the target image region; and displaying a recognition result of the image, wherein the recognition result indicates the location of the target object in the target image region.

12. The apparatus according to claim 11, wherein the operations further comprise: determining a size of the target object; and determining a proportion of the target object in the target image region according to the size of the target object, wherein the recognition result comprises the proportion.

13. The apparatus according to claim 11, wherein the location of the target object in the target image region is determined according to the pixel values of pixels in the target image region and the location relationship between the pixels under a first condition, wherein the first condition indicates that a quantity of historical images obtained within a preset period of time is less than a preset quantity, and the historical images are labeled with locations of the target object in the historical images.

14. The apparatus according to claim 13, wherein the location of the target object in the target image region is obtained by inputting the target image region to the trained segmentation model under a second condition, wherein the second condition indicated that the quantity of the historical images obtained within the preset period of time is greater than or equal to the preset quantity; and the operations further comprise: extracting historical image regions corresponding to the target part from the historical images, wherein the historical image regions comprise the target object; and training a segmentation model using the locations of the target object in the historical image regions to obtain the trained segmentation model.

15. The apparatus according to claim 11, wherein the determining a location of the target object in the target image region according to pixel values of pixels in the target image region and a location relationship between the pixels comprises: determining a plurality of target pixels in the target image region that have pixel values meeting a preset range; correcting the plurality of target pixels according to a location relationship between the plurality of target pixels to generate corrected target pixels; and determining the location of the target object in the target image region according to locations of the corrected target pixels.

16. The apparatus according to claim 11, wherein the inputting the target image region to a trained segmentation model to obtain the location of the target object in the target image region comprises: performing dilation processing on the target image region to generate a dilated target image region; determining an image region in the dilated target image region that has a preset size, wherein the preset size is greater than a size of the target image region; and providing the image region to the trained segmentation model to obtain the location of the target object in the target image region.

17. The apparatus according to claim 16, wherein the image region comprises a plurality of target objects, and the operations further comprise: filtering out one or more target objects according to a size of the target objects and/or a location of the target objects in the image region; and the displaying a recognition result of the image comprises: displaying a recognition result indicating locations of remaining target objects in the target image region.

18. The apparatus according to claim 17, wherein the filtering out one or more target objects according to a size of the target objects and/or a location of the target objects in the image region comprises: filtering out the one or more target objects if the size of the one or more target objects is less than a preset threshold; and/or filtering out the one or more target objects if the one or more target objects are not located in the target image region.

19. The apparatus according to claim 11, wherein the trained segmentation model comprises a convolutional neural network.

20. One or more non-transitory computer-readable storage media storing instructions which, when executed by one or more processors, cause the one or more processors to perform operations including: obtaining an image; extracting a target image region corresponding to a target part from the image, wherein the target image region comprises a target object; determining a location of the target object in the target image region (i) according to pixel values of pixels in the target image region and a location relationship between the pixels, or (ii) by inputting the target image region to a trained segmentation model to obtain the location of the target object in the target image region; and displaying a recognition result of the image, wherein the recognition result indicates the location of the target object in the target image region.

Description:
RECOGNITION METHOD, APPARATUS, AND DEVICE, AND STORAGE

MEDIUM

CROSS REFERENCE TO RELATED APPLICATIONS

[0001] This application claims priority to and benefits of Chinese Patent Application No. 202010442689.9 filed on May 22, 2020, the content of which is incorporated herein by reference in its entirety.

TECHNICAL FIELD

[0002] This application relates to the field of computer technologies, and in particular, to a recognition method, apparatus, and device, and a storage medium.

BACKGROUND

[0003] With the development of computer vision, a computer can use an image processing technology to recognize whether a target object exists in an image. This method has been widely applied to a plurality of fields. For example, in the field of intelligent transportation, current vehicle density on a road may be determined by recognizing vehicles on the road in a current period of time, to understand a real-time road condition. In another example, in the medical field, whether a lesion exists in a medical image needs to be recognized.

[0004] Therefore, as shown in the foregoing scenarios, how to ensure accuracy of recognition becomes a problem to be resolved urgently.

SUMMARY

[0005] In view of this, embodiments of this application provide a recognition method, apparatus, and device, and a storage medium, to ensure accuracy of target object recognition. [0006] According to a first aspect, the embodiments of this application provide a recognition method. The method includes: obtaining an image in response to an input operation triggered by a user; extracting a target image region corresponding to a target part from the image, where the target image region includes a target object; estimating a location of the target object in the target image region according to pixel values of pixels in the target image region and a location relationship between the pixels under a first condition; inputting the target image region to a segmentation model under a second condition, for the segmentation model to output the location of the target object in the target image region; and displaying a recognition result including the location of the target object in the target image region.

[0007] According to a second aspect, the embodiments of this application provide a recognition apparatus. The apparatus includes: an obtaining module, configured to obtain an image in response to an input operation triggered by a user; an extraction module, configured to extract a target image region corresponding to a target part from the image, where the target image region includes a target object; an estimation module, configured to estimate a location of the target object in the target image region according to pixel values of pixels in the target image region and a location relationship between the pixels under a first condition; an input module, configured to input the target image region to a segmentation model under a second condition, for the segmentation model to output the location of the target object in the target image region; and a display module, configured to display a recognition result including the location of the target object in the target image region.

[0008] According to a third aspect, the embodiments of this application provide an electronic device. The electronic device includes: a processor and a memory, where the memory is configured to store one or more computer instructions, where when the one or more computer instructions are executed by the processor, the recognition method according to the first aspect is implemented. The electronic device may further include a communication interface, configured to communicate with other devices or communication networks.

[0009] According to a fourth aspect, the embodiments of this application provide a non- transitory machine-readable storage medium, and the non-transitory machine-readable storage medium stores executable code. The executable code, when executed by a processor of an electronic device, causes the processor to at least implement the recognition method in the first aspect.

[0010] According to a fifth aspect, the embodiments of this application provide a recognition method. The method includes: obtaining an image, where the image includes a target image region, and the target image region includes a target object; calculating a location of the target object in the target image region according to pixel values of at least a part of pixels in the target image region and a location relationship between the pixels under a first condition; and inputting the target image region to a segmentation model under a second condition, for the segmentation model to output the location of the target object in the target image region. [0011] According to a sixth aspect, the embodiments of this application provide a recognition apparatus. The apparatus includes: an obtaining module, configured to obtain an image, where the image includes a target image region, and the target image region includes a target object; a calculation module, configured to calculate a location of the target object in the target image region according to pixel values of at least a part of pixels in the target image region and a location relationship between the pixels under a first condition; and an input module, configured to input the target image region to a segmentation model under a second condition, for the segmentation model to output the location of the target object in the target image region. [0012] According to a seventh aspect, the embodiments of this application provide an electronic device. The electronic device includes: a processor and a memory, where the memory is configured to store one or more computer instructions, where when the one or more computer instructions are executed by the processor, the recognition method according to the fifth aspect is implemented. The electronic device may further include a communication interface, configured to communicate with other devices or communication networks.

[0013] According to an eighth aspect, the embodiments of this application provide a non- transitory machine-readable storage medium, and the non-transitory machine-readable storage medium stores executable code. The executable code, when executed by a processor of an electronic device, causes the processor to at least implement the recognition method in the fifth aspect.

[0014] According to a ninth aspect, the embodiments of this application provide a recognition method. The method includes: obtaining an image in response to an input operation triggered by a user; extracting a target image region corresponding to a target part from the image, where the target image region includes a target object; estimating a first location of the target object in the target image region according to pixel values of pixels in the target image region and a location relationship between the pixels; inputting the target image region to a segmentation model, for the segmentation model to output a second location of the target object in the target image region; and separately displaying a recognition result including the first location and a recognition result including the second location.

[0015] According to a tenth aspect, the embodiments of this application provide a recognition apparatus. The apparatus includes: an obtaining module, configured to obtain an image in response to an input operation triggered by a user; an extraction module, configured to extract a target image region corresponding to a target part from the image, where the target image region includes a target object; an estimation module, configured to estimate a first location of the target object in the target image region according to pixel values of pixels in the target image region and a location relationship between the pixels; an input module, configured to input the target image region to a segmentation model, for the segmentation model to output a second location of the target object in the target image region; and a display module, configured to separately display a recognition result including the first location and a recognition result including the second location.

[0016] According to an eleventh aspect, the embodiments of this application provide an electronic device. The electronic device includes: a processor and a memory, where the memory is configured to store one or more computer instructions, where when the one or more computer instructions are executed by the processor, the recognition method according to the ninth aspect is implemented. The electronic device may further include a communication interface, configured to communicate with other devices or communication networks.

[0017] According to a twelfth aspect, the embodiments of this application provide a non- transitory machine-readable storage medium, and the non-transitory machine-readable storage medium stores executable code. The executable code, when executed by a processor of an electronic device, causes the processor to at least implement the recognition method in the ninth aspect.

[0018] According to a thirteenth aspect, the embodiments of this application provide a recognition method. The method includes: obtaining an image in response to an input operation triggered by a user; extracting a target image region corresponding to a target part from the image, where the target image region includes a target object; estimating a first location of the target object in the target image region according to pixel values of pixels in the target image region and a location relationship between the pixels; transmitting the first location and the target image region to a segmentation model, for the segmentation model to output a second location of the target object in the target image region; determining a corrected location according to the first location and the second location; and displaying a recognition result including the corrected location.

[0019] According to a fourteenth aspect, the embodiments of this application provide a recognition apparatus. The apparatus includes: an obtaining module, configured to obtain an image in response to an input operation triggered by a user; an extraction module, configured to extract a target image region corresponding to a target part from the image, where the target image region includes a target object; an estimation module, configured to estimate a first location of the target object in the target image region according to pixel values of pixels in the target image region and a location relationship between the pixels; a transmission module, configured to transmit the target image region to a segmentation model, for the segmentation model to output a second location of the target object in the target image region; a correction module, configured to determine a corrected location according to the first location and the second location; and a display module, configured to display a recognition result including the corrected location.

[0020] According to a fifteenth aspect, the embodiments of this application provide an electronic device. The electronic device includes: a processor and a memory, where the memory is configured to store one or more computer instructions, where when the one or more computer instructions are executed by the processor, the recognition method according to the thirteenth aspect is implemented. The electronic device may further include a communication interface, configured to communicate with other devices or communication networks.

[0021] According to a sixteenth aspect, the embodiments of this application provide a non- transitory machine-readable storage medium, and the non-transitory machine-readable storage medium stores executable code. The executable code, when executed by a processor of an electronic device, causes the processor to at least implement the recognition method in the thirteenth aspect.

[0022] According to a seventeenth aspect, the embodiments of this application provide a recognition method. The method includes: obtaining an image in response to an input operation triggered by a user; extracting a target image region corresponding to a target part from the image, where the target image region includes a target object; transmitting the target image region to a first segmentation model, for the segmentation model to output a first location of the target object in the target image region; transmitting the target image region to a second segmentation model, for the segmentation model to output a second location of the target object in the target image region, where recognition precision of the first segmentation model is different from recognition precision of the second segmentation model; and separately displaying a recognition result including the first location and a recognition result including the second location.

[0023] According to an eighteenth aspect, the embodiments of this application provide a recognition apparatus. The apparatus includes: an obtaining module, configured to obtain an image in response to an input operation triggered by a user; an extraction module, configured to extract a target image region corresponding to a target part from the image, where the target image region includes a target object; an input module, configured to input the target image region to a first segmentation model, for the segmentation model to output a first location of the target object in the target image region; a transmission module, configured to transmit the target image region to a second segmentation model, for the segmentation model to output a second location of the target object in the target image region, where recognition precision of the first segmentation model is different from recognition precision of the second segmentation model; and a display module, configured to separately display a recognition result including the first location and a recognition result including the second location.

[0024] According to a nineteenth aspect, the embodiments of this application provide an electronic device. The electronic device includes: a processor and a memory, where the memory is configured to store one or more computer instructions, where when the one or more computer instructions are executed by the processor, the recognition method according to the seventeenth aspect is implemented. The electronic device may further include a communication interface, configured to communicate with other devices or communication networks.

[0025] According to a twentieth aspect, the embodiments of this application provide a non- transitory machine-readable storage medium, and the non-transitory machine-readable storage medium stores executable code. The executable code, when executed by a processor of an electronic device, causes the processor to at least implement the recognition method in the seventeenth aspect.

[0026] According to another aspect, the embodiments of this application provide an image recognition method. The image recognition method includes: obtaining an image; extracting a target image region corresponding to a target part from the image, wherein the target image region includes a target object; determining a location of the target object in the target image region according to pixel values of pixels in the target image region and a location relationship between the pixels, or inputting the target image region to a trained segmentation model to obtain the location of the target object in the target image region; and displaying a recognition result of the image, wherein the recognition result indicates the location of the target object in the target image region.

[0027] In some embodiments, the method further includes: determining a size of the target object; and determining a proportion of the target object in the target image region according to the size of the target object. The recognition result includes the proportion.

[0028] In some embodiments, the location of the target object in the target image region is determined according to the pixel values of pixels in the target image region and the location relationship between the pixels under a first condition. The first condition indicates that a quantity of historical images obtained within a preset period of time is less than a preset quantity, and the historical images are labeled with locations of the target object in the historical images.

[0029] In some embodiments, the location of the target object in the target image region is obtained by inputting the target image region to the trained segmentation model under a second condition. The second condition indicated that the quantity of the historical images obtained within the preset period of time is greater than or equal to the preset quantity. And the method further includes: extracting historical image regions corresponding to the target part from the historical images, wherein the historical image regions comprise the target object; and training a segmentation model using the locations of the target object in the historical image regions to obtain the trained segmentation model.

[0030] In some embodiments, the determining a location of the target object in the target image region according to pixel values of pixels in the target image region and a location relationship between the pixels includes: determining a plurality of target pixels in the target image region that have pixel values meeting a preset range; correcting the plurality of target pixels according to a location relationship between the plurality of target pixels to generate corrected target pixels; and determining the location of the target object in the target image region according to locations of the corrected target pixels.

[0031] In some embodiments, the inputting the target image region to a trained segmentation model to obtain the location of the target object in the target image region includes: performing dilation processing on the target image region to generate a dilated target image region; determining an image region in the dilated target image region that has a preset size, wherein the preset size is greater than a size of the target image region; and providing the image region to the trained segmentation model to obtain the location of the target object in the target image region.

[0032] In some embodiments, the image region includes a plurality of target objects, and the method further includes: filtering out one or more target objects according to a size of the target objects and/or a location of the target objects in the image region; and the displaying a recognition result of the image includes: displaying a recognition result indicating locations of remaining target objects in the target image region.

[0033] In some embodiments, the filtering out one or more target objects according to a size of the target objects and/or a location of the target objects in the image region includes: filtering out the one or more target objects if the size of the one or more target objects is less than a preset threshold; and/or filtering out the one or more target objects if the one or more target objects are not located in the target image region.

[0034] In some embodiments, the trained segmentation model includes a convolutional neural network.

[0035] In some embodiments, the step of determining a location of the target object in the target image region according to pixel values of pixels in the target image region and a location relationship between the pixels, obtains a first location of the target object in the target image region. The step of providing the target image region to the trained segmentation model obtains a second location of the target object in the target image region. The first location and the second location are displayed separately.

[0036] According to another aspect, the embodiments of this application provide an apparatus. The apparatus includes one or more processors and a memory communicatively connected to the one or more processors. The memory stores instructions executable by the one or more processors to cause the one or more processors to perform operations including: obtaining an image; extracting a target image region corresponding to a target part from the image, wherein the target image region includes a target object; determining a location of the target object in the target image region according to pixel values of pixels in the target image region and a location relationship between the pixels, or inputting the target image region to a trained segmentation model to obtain the location of the target object in the target image region; and displaying a recognition result of the image, wherein the recognition result indicates the location of the target object in the target image region.

[0037] According to another aspect, the embodiments of this application provide one or more non-transitory computer-readable storage media storing instructions which, when executed by one or more processors, cause the one or more processors to perform operations including: obtaining an image; extracting a target image region corresponding to a target part from the image, wherein the target image region includes a target object; determining a location of the target object in the target image region according to pixel values of pixels in the target image region and a location relationship between the pixels, or inputting the target image region to a trained segmentation model to obtain the location of the target object in the target image region; and displaying a recognition result of the image, wherein the recognition result indicates the location of the target object in the target image region.

[0038] In the recognition method provided in the embodiments of this application, an image is obtained in response to an input operation triggered by a user, and a target image region corresponding to a target part is extracted from the image, where the target image region may include a target object. A location of the target object is estimated according to pixel values of pixels in the target image region and a location relationship between the pixels under a first condition. Under a second condition, the location of the target object in the target image region may be recognized by using a segmentation model. It can be learned that, the foregoing method provides two different target object recognition manners. Combined use of the two recognition manners can meet recognition requirements under different conditions, and can accurately recognize the location of the target object in the image, thereby ensuring efficiency and precision of target object recognition.

BRIEF DESCRIPTION OF THE DRAWINGS [0039] To describe the technical solutions in the embodiments of this application or in existing technologies more clearly, the accompanying drawings required for describing the embodiments or existing technologies are briefly described below. Apparently, the accompanying drawings in the following description show some embodiments of this application, and a person of ordinary skill in the art may still derive other drawings from these accompanying drawings without creative efforts.

[0040] FIG. l is a flowchart of a recognition method, according to an embodiment of this application;

[0041] FIG. 2A is a schematic diagram of an image region in an image in a medical scenario, according to an embodiment of this application;

[0042] FIG. 2B is a schematic diagram of an image region in an image in a medical scenario, according to an embodiment of this application;

[0043] FIG. 3 is a flowchart of another recognition method, according to an embodiment of this application;

[0044] FIG. 4 is a flowchart of still another recognition method, according to an embodiment of this application;

[0045] FIG. 5 is a schematic diagram of an image region in an image in a medical scenario, according to an embodiment of this application;

[0046] FIG. 6 is a flowchart of still another recognition method, according to an embodiment of this application;

[0047] FIG. 7 is a flowchart of still another recognition method, according to an embodiment of this application;

[0048] FIG. 8 is a flowchart of still another recognition method, according to an embodiment of this application;

[0049] FIG. 9 is a flowchart of still another recognition method, according to an embodiment of this application;

[0050] FIG. 10 is a schematic diagram of a recognition method, according to an embodiment of this application in a medical scenario;

[0051] FIG. 11 is a flowchart of a model training method, according to an embodiment of this application;

[0052] FIG. 12 is a schematic structural diagram of a recognition apparatus, according to an embodiment of this application;

[0053] FIG. 13 is a schematic structural diagram of an electronic device corresponding to the recognition apparatus, according to the embodiment shown in FIG. 12; [0054] FIG. 14 is a schematic structural diagram of another recognition apparatus, according to an embodiment of this application;

[0055] FIG. 15 is a schematic structural diagram of an electronic device corresponding to the recognition apparatus, according to the embodiment shown in FIG. 14;

[0056] FIG. 16 is a schematic structural diagram of still another recognition apparatus, according to an embodiment of this application;

[0057] FIG. 17 is a schematic structural diagram of an electronic device corresponding to the recognition apparatus, according to the embodiment shown in FIG. 16;

[0058] FIG. 18 is a schematic structural diagram of still another recognition apparatus, according to an embodiment of this application;

[0059] FIG. 19 is a schematic structural diagram of an electronic device corresponding to the recognition apparatus, according to the embodiment shown in FIG. 18;

[0060] FIG. 20 is a schematic structural diagram of still another recognition apparatus, according to an embodiment of this application;

[0061] FIG. 21 is a schematic structural diagram of an electronic device corresponding to the recognition apparatus, according to the embodiment shown in FIG. 20;

[0062] FIG. 22 is a schematic structural diagram of a model training apparatus, according to an embodiment of this application; and

[0063] FIG. 23 is a schematic structural diagram of an electronic device corresponding to the model training apparatus, according to the embodiment shown in FIG. 22.

DETAILED DESCRIPTION OF EMBODIMENTS

[0064] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the following clearly and completely describes the technical solutions in the embodiments of this application with reference to the accompanying drawings in the embodiments of this application. Apparently, the described embodiments are merely some embodiments of this application rather than all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of this application without creative efforts shall fall within the protection scope of this application.

[0065] The terms used in the embodiments of this application are merely for the purpose of illustrating specific embodiments, and are not intended to limit this application. The terms “a,” “said,” and “the” of singular forms used in the embodiments and the appended claims of this application are also intended to include plural forms, unless otherwise specified in the context clearly. The term “a plurality of’ generally includes at least two, but not exclude a situation of including at least one. [0066] The term “and/or” used in this specification describes only an association relationship for describing associated objects and represents that three relationships may exist. For example, A and/or B may represent the following three cases: Only A exists, both A and B exist, and only B exists. In addition, the character “/” in this specification generally indicates an “or” relationship between the associated objects.

[0067] Depending on the context, for example, words “if’ or “as if’ used herein may be explained as “while .. or “when .. or “in response to determining” or “in response to recognition.” Similarly, depending on the context, phrases “if determining” or “if recognizing (a stated condition or event)” may be explained as “when determining” or “in response to determining” or “when recognizing (the stated condition or event)” or “in response to recognition (of the stated condition or event).”

[0068] It should be further noted that the terms “include,” “contain,” and any variants thereof are intended to cover a non-exclusive inclusion. Therefore, a merchandise or a system that includes a series of elements not only includes such elements, but also includes other elements not specified expressly, or but also includes inherent elements of the merchandise or the system. Unless otherwise specified, an element limited by “include a/an...” does not exclude other same elements existing in the merchandise or the system that includes the element.

[0069] In an intelligent transportation scenario, when a traveling situation of vehicles on a current road needs to be understood in time, there is a requirement for recognizing the vehicles on the road. In this case, a target object mentioned in the following embodiments may be a vehicle, and an image may be an image captured by a camera on a road.

[0070] In another instance, because the novel coronavirus pneumonia has raged globally in recent months, to better analyze the novel coronavirus to formulate a related policy for the novel coronavirus pneumonia, another relatively urgent use scenario is for recognizing and analyzing a lesion part in a medical image. In this medical scenario, an image may be a medical image of a part of a human body, and a target object may be a lesion in that part. [0071] In addition to the foregoing scenarios, a recognition method provided in this application is applicable to any scenario where recognizing a target object is required.

[0072] Some implementations of this application are described below in detail with reference to accompanying drawings. The following embodiments and features in the embodiments may be combined if no conflict occurs among the embodiments. In addition, a sequence of steps in each of the following method embodiments is merely an example, but not a strict limitation. [0073] FIG. l is a flowchart of a recognition method, according to an embodiment of this application, and the recognition method provided in this embodiment of this application may be performed by a recognition device. It may be understood that, the recognition device may be implemented as software, or a combination of software and hardware. Recognition devices in this embodiment and the following embodiments may be a terminal device used by a user. As shown in FIG. 1, the method includes steps S101-S105.

[0074] At S 101, a recognition device obtains an image in response to an input operation triggered by a user.

[0075] At SI 02, the recognition device extracts a target image region corresponding to a target part from the image, where the target image region may include a target object.

[0076] The user may trigger the input operation on an interface provided by the recognition device, for the recognition device to obtain the image inputted by the user. For example, in an intelligent transportation scenario, an image may be an image including a vehicle and a road environment. In another example, in a medical scenario, an image may be a medical image of a part of a human body, such as an X-ray image, a CT image or a magnetic resonance image of a part such as a liver or a lung of the human body.

[0077] It is easily understood that, the image usually includes both a target part and a non target part, which can be understood with reference to FIG. 2A. The non-target part usually interferes with recognition of the target object. Therefore, the location of the target part in the image may be further first determined, then the target image region corresponding to the target part is extracted, an image region corresponding to the non-target part is filtered out, and the target object exists only in the target image region.

[0078] For extraction of the target image region corresponding to the target object in a pixel- level extraction manner, locations of pixels whose pixel values are located within a preset range in the image may be preliminarily estimated as the location of the target part, and then a morphological operation is performed according to a relationship between the pixels. The preset range of the pixel values may be set according to historical experience.

[0079] In another example, the image may be further inputted to a segmentation model trained to converge, for this model to determine the location of the target part in the image. Compared with the pixel-level extraction manner, use of the segmentation model can more accurately obtain the location of the target part.

[0080] A relationship between the image, the target part, the target image region and the target object mentioned in the foregoing steps may be understood as follows: The target image region is a part of the image, and the target image region includes the target part; and the target object is a part of the target part, that is, the image region corresponding to the target object is included in the target image region.

[0081] In an intelligent transportation scenario, the image may be an image including a vehicle and a road environment, the target part is the vehicle, an image region in which the vehicle is located is the target image region, and the target object may be a license plate number of the vehicle.

[0082] In a medical scenario, the image may be a CT image of a lung, the target part is the lung, the target image region is an image region corresponding to the lung in the CT image, and the target object is a lesion in the lung, which may be understood with reference to FIG. 2B.

[0083] At S103, the recognition device estimates/calculates a location of the target object in the target image region according to pixel values of pixels in the target image region and a location relationship between the pixels under a first condition.

[0084] At SI 04, the recognition device inputs the target image region to a segmentation model under a second condition, for the segmentation model to output the location of the target object in the target image region.

[0085] Then, a condition which a current case meets is determined. In some embodiments, if a quantity of historical images obtained within a preset period of time is less than a preset quantity, that is, if a plurality of historical images have been obtained before the image is obtained, and the quantity of historical images is less than the preset quantity, it is determined that the first condition is currently met.

[0086] The historical images may include images inputted by the user within the preset period of time, and may also include images obtained by the user in another manner within the preset period of time. In this case, the quantity of historical images is insufficient to obtain an accurate segmentation model through training. The locations of the target object in the historical images have been labeled, and a labeling manner may be a manual manner or another manner.

[0087] When the first condition is met, the location of the target object in the target image region may be further estimated according to the pixel values of the pixels in the target image region and the location relationship between the pixels.

[0088] For location estimation, a plurality of target pixels in the target image region whose pixel values meet a preset range are first determined, where the preset range may be set according to historical experience. Because the target pixels are estimated according to the pixel values of the pixels, it is very easy for an isolated target pixel point or isolated pixel block to occur. The pixels used for describing the target object are usually a plurality of pixels or a plurality of pixel blocks whose pixel coordinates are close. In this case, this isolated target pixel point or pixel block may be considered as a noisy point, and may be directly filtered out. Moreover, a case that a non-target pixel point A is surrounded by the target pixels may further occur. In this case, this non-target pixel point A may be also directly assumed as a target pixel point. Correction of pixels is completed in the foregoing two manners. Finally, the location of the target object is estimated according to locations of corrected target pixels.

[0089] In some embodiments, if a quantity of historical images obtained within a preset period of time is greater than or equal to a preset quantity, that is, if the quantity of historical images obtained before the image is obtained is greater than or equal to the preset quantity, it is determined that the second condition is currently met. In this case, a segmentation model may be obtained through training according to a sufficient quantity of historical images. The target object is similarly labeled in the historical images.

[0090] When the second condition is met, the target image region corresponding to the image may be inputted to the segmentation model, for the segmentation model to determine the location of the target object.

[0091] A manner of training the segmentation model may be roughly described as follows: The historical image is obtained, the historical image region corresponding to the target part is extracted from the historical image, and because the location of the target object in the historical image has been labeled, the historical image region may be inputted to the segmentation model by using the location of the target object in the historical image region as supervision information, to train the segmentation model.

[0092] In some embodiments, how to determine the location of the target object by using the segmentation model may also be performed with reference to embodiments shown in FIG. 3 to FIG. 6.

[0093] At SI 05, the recognition device displays the location of the target object in the target image region.

[0094] Regardless of obtaining the location of the target object in the target image region in any of the foregoing manners, the location is displayed to the user through the interface provided by the recognition device.

[0095] In this embodiment, an image is obtained in response to an input operation triggered by a user, and a target image region corresponding to a target part is extracted from the image, where the target image region may include a target object. A location of the target object is estimated according to pixel values of pixels in the target image region and a location relationship between the pixels under a first condition. Under a second condition, the location of the target object in the target image region may be recognized by using a segmentation model. The foregoing method actually provides two different target object recognition manners. Combined use of the two recognition manners can meet recognition requirements under different conditions, and can accurately recognize the location of the target object in the image, thereby ensuring efficiency and precision of target object recognition.

[0096] Additionally, it should be noted that, it has been mentioned in step SI 03 and step SI 04 that the location of the target object may be estimated according to the pixel values of the pixels in the image, or the location of the target object may be determined by using the segmentation model, both of which are two completely independent location determining manners. Usually, the segmentation model can more accurately determine the location of the target object in the image.

[0097] However, at different stages of actual application, such as an early stage at which a target object recognition requirement is put forward, because there are a relatively small quantity of historical images, which is insufficient to obtain, through training, a segmentation model whose recognition result is accurate, after the image is obtained, the location of the target object is usually estimated according to pixel values of pixels in the image.

[0098] As images are continuously accumulated, at intermediate and late stages for extraction and detection requirements, when the quantity of historical images has been sufficient to obtain, through training, an accurate segmentation model, the target object may be precisely recognized by directly using the segmentation model.

[0099] It should be further noted that, both the segmentation model used in step SI 02 and the segmentation model used in step SI 04 play a role in recognizing a target object, but the recognized objects are different, one segmentation model is used for recognizing the target part in the image, and the other segmentation model is used for recognizing the target object in the target image region.

[0100] To clearly and concisely describe the foregoing embodiment and the following embodiments, the segmentation model used in step SI 02 may be referred to as a first segmentation model, and the model used in step SI 04 may be referred to as a second segmentation model. Moreover, in actual application, both of the two segmentation models may be neural network models such as convolutional neural network (CNN) models.

[0101] The second segmentation model may output whether the target object exists in the image, and the location of the target object. In some special scenarios such as a medical scenario, the size of the target object is also one important indicator of analyzing a medical image.

[0102] Based on the foregoing description, FIG. 3 is a flowchart of another recognition method, according to an embodiment of this application. As shown in FIG. 3, after step S105 of the embodiment shown in FIG. 1, the method may further include the following steps: [0103] S201, determining a size of the target object.

[0104] S202, determining a proportion of the target object in the target image region according to the size.

[0105] S203, displaying a recognition result including the proportion.

[0106] After the second segmentation model determines the location of the target object, the size of the target object may be further determined. Then, a ratio of the size of the target object to a size of the entire target image region, that is, a proportion of the target object in the target image region corresponding to the target part is calculated. This proportion may alternatively be considered as a part of the recognition result, and is displayed to the user. [0107] In this embodiment, based on the location of the target object outputted by the segmentation model, the proportion corresponding to the target object may be further outputted. With the aid of the two parts of content, the target part and the target object may be analyzed more comprehensively, to ensure the analysis effect.

[0108] As shown in FIG. 2A and FIG. 2B, a shape of the target image region is the same as that of the target part, and is usually an irregular shape. To make the shape meet an input requirement of the segmentation model (that is, the second segmentation model), FIG. 4 is a flowchart of still another recognition method, according to an embodiment of this application. As shown in FIG. 4, the method may include steps S301 -S308.

[0109] At S301, a recognition device obtains an image in response to an input operation triggered by a user.

[0110] At S302, the recognition device extracts a target image region corresponding to a target part from the image, where the target image region includes a target object.

[0111] At S303, the recognition device estimates/calculates a location of the target object in the target image region according to pixel values of pixels in the target image region and a location relationship between the pixels under a first condition.

[0112] The execution process of steps S301 to S303 is similar to that of corresponding steps in the foregoing embodiment, reference may be made to the related description in the embodiment shown in FIG. 1, and details are not described herein again. [0113] At S304, the recognition device performs dilation processing on the target image region under the second condition.

[0114] At S305, the recognition device determines an image region that has a preset size and that includes a dilation result in the image, where the preset size is greater than a size of the target image region.

[0115] At S306, the recognition device inputs the image region that includes the dilation result to the segmentation model, for the segmentation model to output the location of the target object.

[0116] Dilation processing is first performed on an irregular target image region, to obtain a dilation result. Missing of detail information in the target image region such as incomplete inside segmentation caused by blood vessels in the lung region may be offset to some extent through dilation processing, and therefore the detail information does not affect the subsequent target object detection process, thereby ensuring detection accuracy.

[0117] Then, an image region having a preset size or preset regular shape such as a rectangle or a square is extracted from the image, and the extracted image region needs to completely include the dilation result. Finally, the extracted image region that includes the complete dilation result is inputted to the second segmentation model, for the second segmentation model to output the location of the target object. In some embodiments, the recognition result outputted by the segmentation model may be directly displayed to the user.

[0118] It should be noted that, after step S306, the second segmentation model may determine that the image includes at least one target object. To meet the input requirement of the second segmentation model, as shown in FIG. 5, the image region determined in step S305 includes both the target part and a small quantity of non-target parts. Therefore, the target object determined by the segmentation model may correspond to a non-target part, and further needs to be filtered out, to further ensure the accuracy of target object recognition. [0119] In some embodiments, after step S306, the following steps may be further performed: [0120] At S307, the recognition device filters out the target object according to a size of the target object and/or a location of the target object in the image region that includes the dilation result.

[0121] At S308, the recognition device displays a recognition result including locations of remaining target objects in the target image region.

[0122] The size of the target object and the location of the target object in the image are determined. If the size of the target object is less than a preset threshold, it indicates that a pixel point or pixel block corresponding to the target object in the image may be a noisy point, and the target object is directly filtered out.

[0123] Because the second segmentation model determines the target object in the image region including the complete dilation result, it is very likely to encounter the following case that the target object is completely located beyond the target image region before being subject to dilation processing. For example, the target object may be a lesion of a lung, and the target image region may be the lung. It is easily understood that, only the target object located at the lung is a lesion. Therefore, if the second segmentation model determines that the lesion of the lung is completely located beyond the lung, the target object is directly filtered out.

[0124] A case that the target object is incompletely located within the target image region may alternatively occur. In this case, a region in which the target object is located may be compared with the target image region, to determine a part exceeding the target image region in the target object, and the exceeding part is filtered out.

[0125] Only one or both of the foregoing manners of filtering out the target object according to the size and the location may be performed. Moreover, finally, a detection result including locations of remaining target objects in the target image region is displayed to the user.

[0126] In this embodiment, the target image region corresponding to the target part is correspondingly processed, and therefore the processed target image region can meet the input requirement of the segmentation model, thereby ensuring the accuracy of target object recognition. Moreover, the target object outputted by the segmentation model may be further filtered out from different perspectives, to filter out an evidently erroneous recognition result, thereby further ensuring the accuracy of target object recognition.

[0127] In the embodiments shown in FIG. 1 to FIG. 5, the image may be inputted by the user, and the result outputted by the segmentation model may also be displayed to the user, thereby implementing a human-computer interaction process. Besides, the manner of obtaining the image may alternatively be not limited, and a recognition method is individually provided. FIG. 6 is a flowchart of a recognition method according to still another embodiment of this application. As shown in FIG. 6, the method may include steps A401-S403.

[0128] At S401, a recognition device obtains an image, where the image includes a target image region, and the target image region includes a target object.

[0129] At S402, the recognition device calculates a location of the target object in the target image region according to pixel values of at least a part of pixels in the target image region and a location relationship between the pixels under a first condition.

[0130] At S403, the recognition device inputs the target image region to a segmentation model under a second condition, for the segmentation model to output the location of the target object in the target image region.

[0131] The execution process of step S401 to step S403 is similar to that of corresponding steps in the foregoing embodiment, reference may be made to the related descriptions in the foregoing embodiments, and details are not described herein again.

[0132] In some embodiments, the segmentation model may be a convolutional neural network.

[0133] In some embodiments, the segmentation model may further determine a size of the target object, and further obtain a proportion between the size of the target object and that of a target sample image.

[0134] For content not described in detail in this embodiment, reference may be made to the foregoing related content in the embodiments shown in FIG. 1 to FIG. 5, and details are not described herein again.

[0135] For a part that is not described in this embodiment in detail, reference may be made to the related descriptions of the embodiments shown in FIG. 1 to FIG. 5. For an execution process and technical effects of the technical solution, reference may also be made to the descriptions of the embodiments shown in FIG. 1 to FIG. 5, and details are not described herein again.

[0136] The foregoing recognition methods provided in the embodiments shown in FIG. 1 to FIG. 6 are actually solutions of determining the location of the target object in different manners when different conditions are met. In some embodiments, in actual application, to meet requirements of the user, the location of the target object may be further determined separately in two manners.

[0137] FIG. 7 is a flowchart of a recognition method according to still another embodiment of this application. As shown in FIG. 7, the method may include steps S501-S505.

[0138] At S501, a recognition device obtains an image in response to an input operation triggered by a user.

[0139] At S502, the recognition device extracts a target image region corresponding to a target part from the image, where the target image region includes a target object.

[0140] At S503, the recognition device estimates a first location of the target object in the target image region according to pixel values of pixels in the target image region and a location relationship between the pixels.

[0141] At S504, the recognition device inputs the target image region to a segmentation model, for the segmentation model to output a second location of the target object in the target image region.

[0142] At S505, the recognition device separately displays a recognition result including the first location and a recognition result including the second location.

[0143] For a specific implementation process of steps in this embodiment, reference may be made to the foregoing related descriptions in the embodiments shown in FIG. 1 to FIG. 6, and details are not described herein again. The segmentation model in this embodiment is the second segmentation model in the foregoing embodiments.

[0144] In this embodiment, the two recognition results obtained in different manners are both displayed to the user, making it convenient for the user to compare the two recognition results, to understand precision of recognizing the target object in different manners.

[0145] It is easily understood that, the foregoing two manners of determining the location of the target object have respective characteristics. Although accuracy of the manner of recognizing the location of the target object according to the pixel values and the locations of the pixels is ordinary, there is no model training process. However, although the location of the target object can be recognized relatively accurately according to the segmentation model, image samples need to be collected and labeled at an early stage, and consequently costs are relatively high.

[0146] In actual application, the two manners may be combined in use to ensure the accuracy of target object recognition. Particularly, when image samples are insufficient to make it difficult to obtain an accurate segmentation model through training, this combined use manner can have a better effect.

[0147] FIG. 8 is a flowchart of a recognition method according to still another embodiment of this application. As shown in FIG. 8, the method may include steps S601-S606.

[0148] At S601, a recognition device obtains an image in response to an input operation triggered by a user.

[0149] At S602, the recognition device extracts a target image region corresponding to a target part from the image, where the target image region includes a target object.

[0150] At S603, the recognition device estimates a first location of the target object in the target image region according to pixel values of pixels in the target image region and a location relationship between the pixels.

[0151] The user may trigger the input operation in a recognition device, for the recognition device to obtain the image. This recognition device may be a terminal device used by the user. In this case, the terminal device used by the user performs step S602 to step S603, to obtain the first location of the target object. [0152] At S604, the recognition device transmits the target image region to a segmentation model, for the segmentation model to output a second location of the target object in the target image region.

[0153] At S605, the recognition device determines a corrected location according to the second location and the first location.

[0154] At S606, the recognition device displays a recognition result including the corrected location.

[0155] Then, the terminal device may further transmit the target image region to a segmentation model deployed on a remote server, for the segmentation model to output the second location of the target object. Certainly, the processing capability of the remote server is higher than that of the terminal device used by the user. The remote server may transmit the second location to the terminal device again. Further, the terminal device may perform location correction according to the foregoing two locations. In some embodiments, an intersection set of the two locations may be determined as a corrected location, and this corrected location is displayed to the user.

[0156] The segmentation model in this embodiment is the second segmentation model in the foregoing embodiments.

[0157] In some embodiments, the terminal device may further calculate a proportion corresponding to the target object, and also display the proportion to the user.

[0158] In some embodiments, location correction and proportion calculation may be performed by the remote server, and an execution result is finally transmitted to the terminal device.

[0159] In this embodiment, the first location and the second location of the target object may be first separately obtained in two manners, then location correction is performed by using the two locations, and the obtained corrected location can more accurately reflect the location of the target object in the target image region.

[0160] FIG. 9 is a flowchart of a recognition method according to still another embodiment of this application. As shown in FIG. 9, the method may include steps S701-S705.

[0161] At S701, a recognition device obtains an image in response to an input operation triggered by a user.

[0162] At S702, the recognition device extracts a target image region corresponding to a target part from the image, where the target image region includes a target object.

[0163] At S703, the recognition device inputs the target image region to a first segmentation model, for the segmentation model to output a first location of the target object in the target image region.

[0164] At S704, the recognition device transmits the target image region to a second segmentation model, for the segmentation model to output a second location of the target object in the target image region, where recognition precision of the first segmentation model is different from recognition precision of the second segmentation model.

[0165] At S705, the recognition device separately displays a recognition result including the first location and a recognition result including the second location.

[0166] The user may trigger the input operation in a recognition device, for the recognition device to obtain the image. In some embodiments, this recognition device may be a terminal device used by the user.

[0167] In some embodiments, segmentation models with different recognition precision may be obtained through pre-training according to different quantities of sample images. For example, the recognition precision of the first segmentation model may be lower than the recognition precision of the second segmentation model. In this case, the first segmentation model may be deployed on the terminal device used by the user, and the second segmentation model may be deployed on the remote server.

[0168] The first segmentation model configured in the terminal device used by the user may output the first location of the target object. Then, the terminal device may transmit the target image region to the second segmentation model, for the segmentation model to output the second location of the target object. Finally, the recognition result including the first location and the recognition result including the second location are separately displayed to the user. [0169] It should be noted that, the first segmentation model and the second segmentation model in this embodiment are different from the first segmentation model and the second segmentation model mentioned in the embodiments shown in FIG. 1 to FIG. 8.

[0170] The first segmentation model and the second segmentation model in this embodiment may be both considered as the second segmentation model in the embodiments shown in FIG. 1 to FIG. 8, or the first segmentation model and the second segmentation model in this embodiment may be considered as two segmentation models with different recognition precision.

[0171] In this embodiment, by displaying the recognition results outputted by the segmentation models with different precision, the user is enabled to determine a recognition precision difference, to use appropriate segmentation models to perform target object recognition in scenarios with different precision requirements.

[0172] For ease of understanding, a specific implementation process of the recognition method provided above is described in an example with reference to the following medical scenario. The following content may be understood with reference to FIG. 10.

[0173] A user may input a medical image, that is, an image corresponding to a lung of a human body with the aid of an operation interface provided by a recognition device. The recognition device first extracts a target image region corresponding to a target part, that is, the lung from the medical image. In this case, a shape of the target image region is similar to that of the lung, and is an irregular shape.

[0174] If sufficient historical images have been obtained in this case, and the segmentation model has been trained to converge, that is, the second condition is met, the location of the target object, that is, the lesion in the lung may be determined directly by using the segmentation model.

[0175] When the segmentation model has a capability of receiving images in irregular shapes, the target image region may be directly inputted to the segmentation model, for the segmentation model to output the location of the target object, that is, the lesion in the lung. [0176] For a segmentation model that cannot receive images in irregular shapes, dilation processing may be further performed on the lung region in the medical image, and then an image region of a preset size is extracted from the medical image after being subject to the dilation processing. This preset size meets the input requirement of the segmentation model. The image region extracted in this case is inputted to the segmentation model, for the segmentation model to output the location of the lesion.

[0177] If no segmentation model has been obtained through training in this case, that is, the first condition is met, the location of the target object, that is, the lesion in the lung may be determined directly by using a location relationship between pixels in the target image region and pixel values of the pixels. The location of the lesion is determined according to corrected target pixels.

[0178] Moreover, after the location of the lesion is obtained, a proportion of the lesion in the entire lung may be further calculated. Finally, the location of the lesion in the medical image and the proportion corresponding to the lesion may be both displayed to the user, for the user to understand a current situation of the lung.

[0179] In addition to the foregoing medical scenario, the foregoing recognition method provided in this application is further applicable to the field of remote sensing. In this scenario, an image is a remote sensing image, the remote sensing image may correspond to a city, a target part in this remote sensing image may be an industrial district in an entire city, and a target object may be a pollution device in the industrial district, such as a metallurgical device or a coal refining device.

[0180] Based on the foregoing content, the user may input the remote sensing image with the aid of an operation interface provided by a recognition device, the recognition device may extract a target image region corresponding to the industrial district from the remote sensing image, and this region is usually irregular in shape.

[0181] If no segmentation model has been obtained through training, that is, the first condition is met, the location of the target object, that is, the pollution device in the industrial district may be determined directly by using a location relationship between pixels in the target image region and pixel values of the pixels.

[0182] If sufficient historical images have been obtained in this case, and the segmentation model has been trained to converge, that is, the second condition is met, the location of the pollution device in the industrial district may be determined directly by using the segmentation model.

[0183] However, when no irregularly shaped image can be directly inputted to the segmentation model, dilation and extraction processing may be further performed on the irregularly shaped target image region, to obtain a regularly shaped image including the industrial district, and the regularly shaped image is inputted to the segmentation model, for the segmentation model to output the location of the pollution device in the industrial district. [0184] Moreover, after the location of the pollution device is obtained, a proportion of the pollution device in the entire industrial district may be further calculated. The location and the proportion of the pollution device in the industrial district may be further both displayed to the user, for the user to understand an industrial distribution situation of the current city, and the city may be planned and constructed according to this distribution situation.

[0185] Certainly, content not described in this embodiment may be further understood in contrast with the related description in the embodiment shown in FIG. 7.

[0186] Based on the recognition methods provided in the foregoing embodiments, FIG. 11 is a flowchart of a model training method, according to an embodiment of this application. The model training method is used for training the second segmentation model mentioned in the embodiments shown in FIG. 1 to FIG. 8, and may be further used for training the first segmentation model and the second segmentation model mentioned in the embodiment shown in FIG. 9.

[0187] As shown in FIG. 11, the method may include steps S801-S805.

[0188] At S801, a recognition device obtains a sample image.

[0189] At S802, the recognition device extracts a sample image region corresponding to a target part from the sample image, where the sample image region includes a target object. [0190] The sample image may be continuously collected in actual application, or may be obtained through partnership with a medical treatment institution such as a hospital. Then, in an example, the sample image region may be extracted from the sample image according to pixel values of pixels in the sample image. In another example, the sample image may be inputted to a segmentation model, that is, the foregoing first segmentation model, for the segmentation model to determine a location of the target part, and the sample image region corresponding to the target part is extracted. For content not described in detail in this step, reference may be made to the related content in the embodiment shown in FIG. 1.

[0191] At S803, the recognition device estimates a location of the target object in the sample image region according to pixel values of pixels corresponding to the target object in the sample image and a location relationship between the pixels.

[0192] At S804, the recognition device inputs, by using the location as supervision information, the sample image region to a segmentation model, to train the segmentation model.

[0193] Then, the location of the target object in the sample image region is determined according to the pixel values of the pixels in the sample image. Pixels in the sample image region whose pixel values fall within a preset range are determined as target pixels, and locations of the plurality of target pixels are the location of the target object. Further, the location of the target object obtained in this case is further manually corrected, and the sample image region is inputted to the segmentation model by using the corrected location as supervision information, to train the segmentation model.

[0194] In some embodiments, to ensure concise and clear description, the sample image obtained in step S801 may be referred to as a first sample image. In this case, the user may further manually label both a second sample image obtained in another manner, and a location of the target object in a target sample region of the second sample image, to obtain supervision information of the second sample image. Then, the segmentation model is trained by using the two sample images and respective supervision information.

[0195] That is to say, among sample images used for training the segmentation model, some sample images are completely manually labeled, and some other sample images are automatically labeled and then manually corrected. In this way, efficiency of labeling the sample images, that is, efficiency of model training may be improved.

[0196] Additionally, accuracy of the supervision information affects an effect of training the model. Therefore, for the target pixels obtained in step S803, before manual correction is performed, the target pixels may be further corrected according to locations of the plurality of target pixels in the sample image region, and finally the location target object in the sample image region is determined according to the corrected target pixels.

[0197] Because the target pixels are determined according to the pixel values of the pixels, it is very easy for an isolated target pixel point to occur. The pixels used for describing the target object are usually a plurality of pixels whose pixel coordinates are close. In this case, this isolated target pixel point may be considered as a noisy point in the sample image, and may be directly filtered out.

[0198] Moreover, a case that a non-target pixel point B is surrounded by the target pixels may further occur. In this case, this non-target pixel point B may be assumed as a target pixel point, thereby completing pixel point correction.

[0199] It should be noted that, the model training method provided in this embodiment may be performed before the recognition method provided in this application is performed, or may be individually performed independently of the recognition method provided in the embodiments of this application.

[0200] In this embodiment, after the sample image is obtained, the sample image region corresponding to the target part and related to model training may be extracted from the sample image. Then, the location of the target object is determined according to the pixel values of the pixels in the sample image region, and after the location is manually corrected, this corrected location is supervision information used in the model training process. Compared with the conventional manner of manually labeling the target object in the sample image to obtain supervision information, the foregoing manner can greatly improve efficiency, to further improve efficiency of model training.

[0201] In some embodiments, the foregoing model training manner may be deployed on a server, to provide a model training service platform. For a user having a model training requirement, the user may directly input a sample image collected by the user to the service platform, and the service platform may automatically train a segmentation model according to the foregoing manner. After step S804, the foregoing model training method may further include the following step:

[0202] At S805, the recognition device outputs a model parameter of the segmentation model.

[0203] After training, the model parameter of the segmentation model may be outputted. In some embodiments, the model parameter may be outputted each time a preset quantity of rounds of training are performed, or the model parameter of this model may be outputted to the user after the segmentation model converges, thereby meeting the model training requirement of the user. If the user is not satisfied with the model parameter, a re-training operation may be further triggered, to perform model training again.

[0204] In some embodiments, after the sample image is obtained in step S801, the user may further perform an operation such as scaling or tapping on the sample image, and a location in which the foregoing operation is triggered is a region in which the user is interested, that is, a location on which emphasis needs to be placed in a training process. Therefore, this region of interest may be further introduced into the model training process as feedback information, that is, an attention mechanism is introduced into the model training process. [0205] Recognition apparatuses of one or more embodiments of this application are described in detail below. A person skilled in the art may understand that all the recognition apparatuses can be formed by configuring market-selling hardware components through steps instructed in this solution.

[0206] FIG. 12 is a schematic structural diagram of a recognition apparatus, according to an embodiment of this application. As shown in FIG. 12, the apparatus includes:

[0207] an obtaining module 11, configured to obtain an image in response to an input operation triggered by a user;

[0208] an extraction module 12, configured to extract a target image region corresponding to a target part from the image, where the target image region includes a target object;

[0209] an estimation/determination module 13, configured to estimate/determine a location of the target object in the target image region according to pixel values of pixels in the target image region and a location relationship between the pixels under a first condition;

[0210] an input module 14, configured to input the target image region to a segmentation model under a second condition, for the segmentation model to output the location of the target object in the target image region; and

[0211] a display module 15, configured to display a recognition result including the location of the target object in the target image region.

[0212] In some embodiments, the apparatus further includes: a proportion determining module 16, configured to determine a size of the target object; and determine a proportion of the target object in the target image region according to the size.

[0213] The display module 15 is further configured to display a recognition result including the proportion.

[0214] In some embodiments, the first condition is that a quantity of historical images obtained within a preset period of time is less than a preset quantity, and the historical images are labeled with locations of the target object in the historical images.

[0215] The second condition is that a quantity of historical images obtained within a preset period of time is greater than or equal to a preset quantity, and the historical images are labeled with locations of the target object in the historical images.

[0216] The apparatus further includes a training module 17.

[0217] The extraction module 12 is configured to extract historical image regions corresponding to a target part from the historical images, where the historical image regions include a target object; and

[0218] the training module 17 is configured to input the historical image regions to a segmentation model by using locations of the target object in the historical image regions as supervision information, to train the segmentation model.

[0219] In some embodiments, the estimation module 13 includes:

[0220] a determining unit 131, configured to determine a plurality of target pixels in the target image region whose pixel values meet a preset range;

[0221] a correction unit 132, configured to correct the plurality of target pixels according to a location relationship between the plurality of target pixels; and

[0222] an estimation unit 133, configured to estimate the location of the target object in the target image region according to locations of corrected target pixels.

[0223] The image is a medical image.

[0224] In some embodiments, the input module 14 includes:

[0225] a processing unit 141, configured to perform dilation processing on the target image region;

[0226] a determining unit 142, configured to determine an image region that has a preset size and that includes a dilation result in the image, where the preset size is greater than a size of the target image region; and

[0227] an input unit 143, configured to input the image region that includes the dilation result to the segmentation model, for the segmentation model to output the location of the target object.

[0228] In some embodiments, the apparatus further includes: a filtering-out module 18, configured to filter out the target object according to a size of the target object and/or a location of the target object in the image region that includes the dilation result.

[0229] The display module 15 is further configured to display a recognition result including locations of remaining target objects in the target image region.

[0230] In some embodiments, the filtering-out module 18 is configured to: filter out the target object if the size of the target object is less than a preset threshold; and/or [0231] filter out the target object if the target object is not located in the target image region. [0232] The apparatus shown in FIG. 12 can perform the method according to the embodiments shown in FIG. 1 to FIG. 5. For a part that is not described in this embodiment in detail, reference may be made to the related descriptions of the embodiments shown in FIG. 1 to FIG. 5. For an execution process and technical effects of the technical solution, reference may be made to the descriptions of the embodiments shown in FIG. 1 to FIG. 5, and details are not described herein again.

[0233] The internal function and structure of the target detection apparatus is described above. In a possible design, the structure of the target detection apparatus may be embodied as an electronic device. As shown in FIG. 13, the electronic device may include a processor 21 and a memory 22. The memory 22 is configured to store a program for supporting the electronic device in performing the object detection method provided in the embodiments shown in FIG. 1 to FIG. 5, and the processor 21 is configured to execute the program stored in the memory 22.

[0234] The program includes one or more computer instructions, where when the one or more computer instructions are executed by the processor 21, the following steps can be implemented:

[0235] obtaining an image in response to an input operation triggered by a user;

[0236] extracting a target image region corresponding to a target part from the image, where the target image region includes a target object;

[0237] estimating a location of the target object in the target image region according to pixel values of pixels in the target image region and a location relationship between the pixels under a first condition;

[0238] inputting the target image region to a segmentation model under a second condition, for the segmentation model to output the location of the target object in the target image region; and

[0239] displaying a recognition result including the location of the target object in the target image region.

[0240] In some embodiments, the processor 21 may be further configured to perform all or some of steps of the foregoing embodiments shown in FIG. 1 to FIG. 5.

[0241] The structure of the electronic device may further include a communication interface 23, for the electronic device to communicate with another device or communication network. [0242] In addition, an embodiment of this application further provides a computer storage medium, configured to store a computer software instruction used by the foregoing electronic device, and the computer storage medium includes a related program used for performing the object detection method in the method embodiments shown in FIG. 1 to FIG. 5.

[0243] FIG. 14 is a schematic structural diagram of another recognition apparatus, according to an embodiment of this application. As shown in FIG. 14, the apparatus includes:

[0244] an obtaining module 31, configured to obtain an image, where the image includes a target image region, and the target image region includes a target object;

[0245] a calculation module 32, configured to calculate a location of the target object in the target image region according to pixel values of at least a part of pixels in the target image region and a location relationship between the pixels under a first condition; and [0246] an input module 33, configured to input the target image region to a segmentation model under a second condition, for the segmentation model to output the location of the target object in the target image region.

[0247] The apparatus shown in FIG. 14 can perform the method according to the embodiment shown in FIG. 6. For a part that is not described in this embodiment in detail, reference may be made to the related descriptions of the embodiment shown in FIG. 6. For an execution process and technical effects of the technical solution, reference may be made to the description of the embodiment shown in FIG. 6, and details are not described herein again. [0248] The internal function and structure of the recognition apparatus is described above. In a possible design, the structure of the recognition apparatus may be embodied as an electronic device. As shown in FIG. 15, the electronic device may include a processor 41 and a memory 42. The memory 42 is configured to store a program for supporting the electronic device in performing the object detection method provided in the embodiment shown in FIG. 6, and the processor 41 is configured to execute the program stored in the memory 42.

[0249] The program includes one or more computer instructions, where when the one or more computer instructions are executed by the processor 41, the following steps can be implemented:

[0250] obtaining an image, where the image includes a target image region, and the target image region includes a target object;

[0251] calculating a location of the target object in the target image region according to pixel values of at least a part of pixels in the target image region and a location relationship between the pixels under a first condition; and

[0252] inputting the target image region to a segmentation model under a second condition, for the segmentation model to output the location of the target object in the target image region.

[0253] In some embodiments, the processor 41 may be further configured to perform all or some of steps of the foregoing embodiment shown in FIG. 6.

[0254] The structure of the electronic device may further include a communication interface 43, for the electronic device to communicate with another device or communication network. [0255] In addition, an embodiment of this application further provides a computer storage medium, configured to store a computer software instruction used by the foregoing electronic device, and the computer storage medium includes a related program used for performing the recognition method in the method embodiment shown in FIG. 6.

[0256] FIG. 16 is a schematic structural diagram of still another recognition apparatus, according to an embodiment of this application. As shown in FIG. 16, the apparatus includes: [0257] an obtaining module 51, configured to obtain an image in response to an input operation triggered by a user;

[0258] an extraction module 52, configured to extract a target image region corresponding to a target part from the image, where the target image region includes a target object;

[0259] an estimation/determination module 53, configured to estimate/determine a first location of the target object in the target image region according to pixel values of pixels in the target image region and a location relationship between the pixels;

[0260] an input module 54, configured to input the target image region to a segmentation model, for the segmentation model to output a second location of the target object in the target image region; and

[0261] a display module 55, configured to separately display a recognition result including the first location and a recognition result including the second location.

[0262] The apparatus shown in FIG. 16 can perform the method according to the embodiment shown in FIG. 7. For a part that is not described in this embodiment in detail, reference may be made to the related descriptions of the embodiment shown in FIG. 7. For an execution process and technical effects of the technical solution, reference may be made to the description of the embodiment shown in FIG. 7, and details are not described herein again. [0263] The internal function and structure of the recognition apparatus is described above. In a possible design, the structure of the recognition apparatus may be embodied as an electronic device. As shown in FIG. 17, the electronic device may include a processor 61 and a memory 62 The memory 62 is configured to store a program for supporting the electronic device in performing the object detection method provided in the embodiment shown in FIG. 7, and the processor 61 is configured to execute the program stored in the memory 62 [0264] The program includes one or more computer instructions, where when the one or more computer instructions are executed by the processor 61, the following steps can be implemented:

[0265] obtaining an image in response to an input operation triggered by a user;

[0266] extracting a target image region corresponding to a target part from the image, where the target image region includes a target object;

[0267] estimating a first location of the target object in the target image region according to pixel values of pixels in the target image region and a location relationship between the pixels;

[0268] inputting the target image region to a segmentation model, for the segmentation model to output a second location of the target object in the target image region; and [0269] separately displaying a recognition result including the first location and a recognition result including the second location.

[0270] In some embodiments, the processor 61 may be further configured to perform all or some of steps of the foregoing embodiment shown in FIG. 7.

[0271] The structure of the electronic device may further include a communication interface 63, for the electronic device to communicate with another device or communication network. [0272] In addition, an embodiment of this application further provides a computer storage medium, configured to store a computer software instruction used by the foregoing electronic device, and the computer storage medium includes a related program used for performing the recognition method in the method embodiment shown in FIG. 7.

[0273] FIG. 18 is a schematic structural diagram of still another recognition apparatus, according to an embodiment of this application. As shown in FIG. 18, the apparatus includes: [0274] an obtaining module 71, configured to obtain an image in response to an input operation triggered by a user;

[0275] an extraction module 72, configured to extract a target image region corresponding to a target part from the image, where the target image region includes a target object;

[0276] an estimation/determination module 73, configured to estimate/determine a first location of the target object in the target image region according to pixel values of pixels in the target image region and a location relationship between the pixels;

[0277] a transmission module 74, configured to transmit the target image region to a segmentation model, for the segmentation model to output a second location of the target object in the target image region;

[0278] a correction module 75, configured to determine a corrected location according to the first location and the second location; and

[0279] a display module 76, configured to display a recognition result including the corrected location.

[0280] The apparatus shown in FIG. 18 can perform the method according to the embodiment shown in FIG. 8. For a part that is not described in this embodiment in detail, reference may be made to the related descriptions of the embodiment shown in FIG. 8. For an execution process and technical effects of the technical solution, reference may be made to the description of the embodiment shown in FIG. 5, and details are not described herein again. [0281] The internal function and structure of the recognition apparatus is described above. In a possible design, the structure of the recognition apparatus may be embodied as an electronic device. As shown in FIG. 19, the electronic device may include a processor 81 and a memory

82. The memory 82 is configured to store a program for supporting the electronic device in performing the object detection method provided in the embodiment shown in FIG. 8, and the processor 81 is configured to execute the program stored in the memory 82.

[0282] The program includes one or more computer instructions, where when the one or more computer instructions are executed by the processor 81, the following steps can be implemented:

[0283] obtaining an image in response to an input operation triggered by a user;

[0284] extracting a target image region corresponding to a target part from the image, where the target image region includes a target object;

[0285] estimating a first location of the target object in the target image region according to pixel values of pixels in the target image region and a location relationship between the pixels;

[0286] transmitting the first location and the target image region to a segmentation model, for the segmentation model to output a second location of the target object in the target image region;

[0287] correcting the first location according to the second location, to obtain a corrected location; and

[0288] displaying a recognition result including the corrected location.

[0289] In some embodiments, the processor 81 may be further configured to perform all or some of steps of the foregoing embodiment shown in FIG. 8.

[0290] The structure of the electronic device may further include a communication interface

83, for the electronic device to communicate with another device or communication network. [0291] In addition, an embodiment of this application further provides a computer storage medium, configured to store a computer software instruction used by the foregoing electronic device, and the computer storage medium includes a related program used for performing the recognition method in the method embodiment shown in FIG. 8.

[0292] FIG. 20 is a schematic structural diagram of still another recognition apparatus, according to an embodiment of this application. As shown in FIG. 20, the apparatus includes: [0293] an obtaining module 91, configured to obtain an image in response to an input operation triggered by a user;

[0294] an extraction module 92, configured to extract a target image region corresponding to a target part from the image, where the target image region includes a target object;

[0295] an input module 93, configured to input the target image region to a first segmentation model, for the segmentation model to output a first location of the target object in the target image region;

[0296] a transmission module 94, configured to transmit the target image region to a second segmentation model, for the segmentation model to output a second location of the target object in the target image region, where recognition precision of the first segmentation model is different from recognition precision of the second segmentation model; and [0297] a display module 95, configured to separately display a recognition result including the first location and a recognition result including the second location.

[0298] The apparatus shown in FIG. 20 can perform the method according to the embodiment shown in FIG. 9. For a part that is not described in this embodiment in detail, reference may be made to the related descriptions of the embodiment shown in FIG. 9. For an execution process and technical effects of the technical solution, reference may be made to the description of the embodiment shown in FIG. 9, and details are not described herein again. [0299] The internal function and structure of the recognition apparatus is described above. In a possible design, the structure of the recognition apparatus may be embodied as an electronic device. As shown in FIG. 21, the electronic device may include a processor 96 and a memory 97. The memory 97 is configured to store a program for supporting the electronic device in performing the object detection method provided in the embodiment shown in FIG. 9, and the processor 96 is configured to execute the program stored in the memory 97.

[0300] The program includes one or more computer instructions, where when the one or more computer instructions are executed by the processor 96, the following steps can be implemented:

[0301] obtaining an image in response to an input operation triggered by a user;

[0302] extracting a target image region corresponding to a target part from the image, where the target image region includes a target object;

[0303] transmitting the target image region to a first segmentation model, for the segmentation model to output a first location of the target object in the target image region; [0304] transmitting the target image region to a second segmentation model, for the segmentation model to output a second location of the target object in the target image region, where recognition precision of the first segmentation model is different from recognition precision of the second segmentation model; and

[0305] separately displaying a recognition result including the first location and a recognition result including the second location.

[0306] In some embodiments, the processor 96 may be further configured to perform all or some of steps of the foregoing embodiment shown in FIG. 9.

[0307] The structure of the electronic device may further include a communication interface 98, for the electronic device to communicate with another device or communication network. [0308] In addition, an embodiment of this application further provides a computer storage medium, configured to store a computer software instruction used by the foregoing electronic device, and the computer storage medium includes a related program used for performing the recognition method in the method embodiment shown in FIG. 9.

[0309] FIG. 22 is a schematic structural diagram of a model training apparatus, according to an embodiment of this application. As shown in FIG. 22, the apparatus includes:

[0310] an obtaining module 101, configured to obtain a sample image;

[0311] an extraction module 102, configured to extract a sample image region corresponding to a target part from the sample image, where the sample image region includes a target object;

[0312] a determining module 103, configured to determine a location of the target object in the sample image region according to pixel values of pixels corresponding to the target object in the sample image and a location relationship between the pixels;

[0313] an input module 104, configured to input, by using the location as supervision information, the sample image region to a segmentation model, to train the segmentation model; and

[0314] an output module 105, configured to output a model parameter of the segmentation model.

[0315] The apparatus shown in FIG. 22 can perform the method according to the embodiment shown in FIG. 11. For a part that is not described in this embodiment in detail, reference may be made to the related descriptions of the embodiment shown in FIG. 11. For an execution process and technical effects of the technical solution, reference may be made to the description of the embodiment shown in FIG. 11, and details are not described herein again. [0316] The internal function and structure of the model training apparatus is described above. In a possible design, the structure of the model training apparatus may be embodied as an electronic device. As shown in FIG. 23, the electronic device may include a processor 106 and a memory 107. The memory 107 is configured to store a program for supporting the electronic device in performing the model training method provided in the embodiment shown in FIG. 8, and the processor 106 is configured to execute the program stored in the memory 107.

[0317] The program includes one or more computer instructions, where when the one or more computer instructions are executed by the processor 106, the following steps can be implemented:

[0318] obtaining a sample image;

[0319] extracting a sample image region corresponding to a target part from the sample image, where the sample image region includes a target object;

[0320] determining a location of the target object in the sample image region according to pixel values of pixels corresponding to the target object in the sample image and a location relationship between the pixels;

[0321] inputting, by using the location as supervision information, the sample image region to a segmentation model, to train the segmentation model; and [0322] outputting a model parameter of the segmentation model.

[0323] In some embodiments, the processor 106 may be further configured to perform all or some of steps of the foregoing embodiment shown in FIG. 11.

[0324] The structure of the electronic device may further include a communication interface 108, for the electronic device to communicate with another device or communication network.

[0325] In addition, an embodiment of this application further provides a computer storage medium, configured to store a computer software instruction used by the foregoing electronic device, and the computer storage medium includes a related program used for performing the model training method in the method embodiment shown in FIG. 11.

[0326] Finally, the foregoing embodiments are merely intended for describing the technical solutions of this application but not for limiting this application. Although this application is described in detail with reference to the foregoing embodiments, a person of ordinary skill in the art shall understand that modifications may still be made to the technical solutions described in the foregoing embodiments or equivalent replacements may still be made to some technical features thereof, without departing from the spirit and scope of the technical solutions of the embodiments of this application.